Backend Development 8 min read

Contract Signing Platform System Design and Implementation for Cloud Music

The article details NetEase Cloud Music’s contract‑signing platform, which uses HTML‑based templates filled dynamically and itextpdf to create PDFs, an event‑driven workflow with MQ notifications, PaddleOCR for 97.9% accurate file inspection, and monitoring to cut signing time from weeks to days while lowering development costs.

NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
NetEase Cloud Music Tech Team
Contract Signing Platform System Design and Implementation for Cloud Music

This article introduces the design and implementation of a contract signing platform system for NetEase Cloud Music, providing convenient file signing capabilities for business operations.

Background: In the music copyright field, signing contracts is a frequent necessity. Cloud Music needs to obtain song authorization from artists through contracts before上架 (listing) songs. Previously, the entire signing process took 15-30 days. The existing e签宝-based system had several issues: inflexible template publishing requiring code changes for every modification, rigid signing workflows unable to dynamically add/remove processing nodes, and accuracy issues in generated contract files.

Solution - Template Configuration: Contracts consist of static legal content and dynamic data (signing dates, song info, artist info). The system uses HTML + dynamic parameter filling to generate PDF documents, implemented with itextpdf . A custom Base64ImgReplacedElementFactory handles image scaling to prevent overflow:

public class Base64ImgReplacedElementFactory implements ReplacedElementFactory { public ReplacedElement createReplacedElement(LayoutContext c, BlockBox box, UserAgentCallback uac, int cssWidth, int cssHeight) { Element e = box.getElement(); if (e == null) { return null; } String nodeName = e.getNodeName(); if (nodeName.equals("img")) { String attribute = e.getAttribute("src"); FSImage fsImage; try { fsImage = buildImage(attribute, uac); } catch (BadElementException | IOException e1) { log.warn("buildImage failed",e); fsImage = null; } if (fsImage != null) { double scale = 1.0; if (fsImage.getWidth() > 8000) { scale = fsImage.getWidth() / 8000.0; } fsImage.scale((int) (fsImage.getWidth() / scale), (int) (fsImage.getHeight() / scale)); return new ITextImageElement(fsImage); } } return null; } }

Multi-version control is also supported for rollback scenarios.

Solution - Process Configuration: The system uses an event-driven architecture based on signing states and events. Each state represents a point in the workflow, and transitions between states are triggered by specific events. The platform sends MQ messages after each state change for business follow-up.

Solution - File Inspection: Using PaddleOCR library for PDF image recognition, the system parses generated PDFs and validates content accuracy. Currently covers 18 major signing scenarios with 97.9% accuracy, having identified 30,000+ historical song file anomalies.

Solution - Process Data Monitoring: Monitors specific nodes for blocking issues. For example, human review in artist signing typically takes 1-2 days; nodes blocked beyond this threshold are marked as anomalies.

Results: Template configuration has been applied to most signing scenarios, significantly reducing development costs. The process configuration solves workflow modification issues, and file inspection prevents business losses.

system designWorkflow Automationevent-driven architecturebackend-developmentcontract-signing-platformiTextPDFpaddle-ocrPDF generation
NetEase Cloud Music Tech Team
Written by

NetEase Cloud Music Tech Team

Official account of NetEase Cloud Music Tech Team

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.