Report generation method and system supporting custom paging and process monitoring
By generating high-fidelity PDF reports with custom pagination through an online visual designer and headless browser, and embedding a source watermark, the problem of poor pagination effects and unreliable processes in long web page reports is solved, achieving efficient and secure report generation and delivery.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI BAOSIGHT SOFTWARE CO LTD
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies have poor pagination performance when generating long web page reports, cannot meet users' custom pagination needs, have unreliable generation processes, and offline report content cannot be reused and data security is difficult to trace.
The system receives user pagination rules through an online visual page designer, generates high-fidelity multi-page PDF reports using a headless browser, embeds source watermarks, and combines end-to-end monitoring and anomaly handling mechanisms to ensure the reliability and security of the generation and push process.
It enables the generation of high-fidelity reports with custom pagination, improving the readability and professionalism of reports, enhancing the reliability of processes and the security of data, reducing development and maintenance costs, and improving user experience.
Smart Images

Figure CN121958684A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer data processing technology, and more specifically, to a report generation method and system that supports custom pagination and process monitoring. Background Technology
[0002] In enterprise information management, converting dynamically generated online data visualization reports, such as long webpage reports, into offline documents (such as PDF format) that are easy to distribute, archive, and review is a common technical requirement.
[0003] To achieve this goal, several document generation solutions exist in the prior art. For example, some systems can edit content based on preset, structured document templates (such as electronic medical record templates) and render high-fidelity documents that retain the searchable and editable characteristics of the text, while also supporting the addition of watermark information to the documents.
[0004] However, the aforementioned existing technologies have several shortcomings when applied to processing long, unstructured web page reports with rich content. Firstly, in terms of pagination, existing web page conversion technologies often fail to achieve ideal pagination results. Some solutions directly render the entire long web page as a single-page document, resulting in severely scaled content that is unreadable; other solutions, while capable of pagination, typically use mechanical cutting based on a fixed page height, easily causing tables, charts, or paragraphs to be truncated in the middle of the page, severely impacting the document's readability and professionalism. Furthermore, most of these solutions rely on pre-set, fixed templates from developers, failing to meet the needs of business users who can design report layouts and flexibly adjust pagination effects based on dynamic content.
[0005] Secondly, regarding the reliability of automated report generation and push processes, existing technologies generally lack end-to-end monitoring and effective exception handling mechanisms for the entire process. These processes typically involve multiple stages, such as data querying, content rendering, file generation, and message push, resulting in a complex chain. If a problem occurs in any stage, such as a data source interface malfunction, rendering service timeout, or push failure, the system may push incorrect, corrupted, or even blank reports to the end user, or cause the task to fail unnoticed, negatively impacting normal business operations and user experience.
[0006] Furthermore, some simple methods of saving web pages, such as documents generated through browser printing or screenshot functions, are essentially image formats. The text and data within them cannot be searched or copied, limiting the secondary use value of the report content. At the same time, the generated offline report files lack effective technical means to trace their origin during distribution and circulation. In the event of a data breach, it is difficult to identify the responsible party, posing a data security risk.
[0007] Chinese patent document CN118551733A discloses a method, system, and device for generating PDFs based on a headless browser. It utilizes a preset headless browser to load the HTML template and renders the first data page using a preset CSS engine. However, for long webpages, it can only recognize one page and does not consider the need for pagination, making pagination generation impossible. Furthermore, it requires a pre-made HTML template, failing to meet the needs of users who want to design their own pages and configure pagination effects.
[0008] Chinese patent document CN104980461B discloses a page push method, apparatus, server, and centralized network management controller. It primarily utilizes a centralized network management controller architecture to implement page push, avoiding direct interaction between the page push server and network devices, thus improving page push efficiency. The pushed content is a page address; static files for online pages cannot be provided, requiring users to log in to a client to access them. The pushed content cannot be viewed under network and environmental limitations. Summary of the Invention
[0009] To address the shortcomings of existing technologies, the purpose of this invention is to provide a report generation method and system that supports custom pagination and process monitoring.
[0010] A report generation method supporting custom pagination and process monitoring according to the present invention includes: Obtain the webpage content for which a report is to be generated, and receive pagination rules input by the user to divide the webpage content into multiple pages; Based on the pagination rules, the web page rendering engine is invoked to render the web page content and generate a multi-page report file. During the generation of the report file, a watermark containing preset source information is embedded into each page of the report file. The report file is a high-fidelity file that retains the searchability and editability of the content. Submit the generated report file to the subsequent push process; Monitor the generation of the report file and the execution status of the subsequent push process. When the execution status is identified as a preset abnormal state, stop the push process and send an abnormal alarm to a preset monitoring terminal for manual intervention.
[0011] Preferably, the step of obtaining the webpage content to be generated as the report and receiving the pagination rules input by the user includes: The online visual page designer responds to user drag-and-drop operations to design the webpage content and provides a real-time preview of the pagination rules and corresponding pagination separators.
[0012] Preferably, generating a report file based on the pagination rules includes: dynamically inserting pagination separators into the webpage by calculating borders, page dimensions, and pagination dimensions based on a preset print size or a user-selected print size.
[0013] Preferably, the embedded watermark includes: Information about the recipient and sender, including name, employee ID, and sending time, is used to trace the source of the document after it goes offline.
[0014] Preferably, the webpage rendering engine is a headless browser.
[0015] Preferably, the preset abnormal state includes at least one of data query failure, file generation timeout, and push interface call failure.
[0016] Preferably, the traceability information includes at least one of the target user information and the push timestamp.
[0017] Preferably, sending an anomaly alarm to a preset monitoring terminal includes: Based on a preset role-based access control architecture, the abnormal alarm is sent to the monitoring terminal with the corresponding intervention authority.
[0018] A report generation system supporting custom pagination and process monitoring, provided by the present invention, includes: The report configuration module is used to obtain the web page content to be generated and to receive pagination rules input by the user for dividing the web page content into multiple pages; The report generation module is used to call the web page rendering engine to render the web page content and generate a multi-page report file based on the pagination rules. During the generation of the report file, a watermark containing preset traceability information is embedded into each page of the report file, and the generated report file is submitted to the subsequent push process. The report file is a high-fidelity file that retains the searchability and editability of the content. The process monitoring module is used to monitor the generation of the report file and the execution status of the subsequent push process. When the execution status is identified as a preset abnormal state, the push process is stopped and an abnormal alarm is sent to a preset monitoring terminal for manual intervention.
[0019] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention improves the flexibility and quality of report generation. By allowing users to flexibly define pagination rules according to actual needs, and generating high-fidelity multi-page reports with searchable and editable content, it solves the problems of poor pagination effect and fixed content in traditional methods, and significantly improves the professionalism and usability of the final document.
[0020] 2. This invention enhances the reliability of automated processes. By monitoring and capturing anomalies in the entire process of report generation and push in real time, it can promptly stop erroneous processes and notify relevant personnel to intervene and handle any problems that occur. This avoids pushing erroneous or invalid reports to users, thus ensuring business stability and user trust.
[0021] 3. This invention ensures the data security of offline documents. By embedding traceable watermark information into each page of the generated report file, it effectively solves the security pain point of difficulty in tracing the source of offline documents after distribution and circulation, and meets the requirements of enterprises for data security management.
[0022] 4. This invention also reduces development and maintenance costs by transferring the complex work of report formatting and pagination adjustments from developers to business users. Users can complete this independently through a visual interface, which significantly reduces the development, communication, and maintenance costs caused by changes in requirements and improves business response efficiency. Attached Figure Description
[0023] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the system architecture of one embodiment of the present invention; Figure 2 A flowchart of a report generation method provided in an embodiment of the present invention; Figure 3 This is a timing diagram showing the signaling interaction between the modules in one embodiment of the present invention; Figure 4 This is a flowchart illustrating a specific use case of the present invention.
[0024] Figure 5 The structural effect diagram of the report generation system provided by this invention; Figure 6 The flowchart of the report generation method provided by this invention is shown in the figure. Detailed Implementation
[0025] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0026] This invention provides a report generation method and system that supports custom pagination and process monitoring. This embodiment aims to address a series of problems in the prior art, such as poor pagination effects in long webpage reports, unreliable generation processes, inability to reuse content, and insecure data flow.
[0027] Please see Figure 1 This is a schematic diagram of the system architecture of one embodiment of the present invention. As an optional implementation, the system can be deployed using a browser / server architecture with a front-end and back-end separation. At the logical level, the system mainly includes a report configuration module, a report generation module, and a process monitoring module. Specifically, in a physical deployment form, the system may include a front-end module 100 and a back-end module 300. The front-end module 100 mainly carries the online visual page designer 10, which is the specific implementation of the report configuration module. The back-end module 300 integrates the report generation module and the process monitoring module. Specifically, the report generation module may consist of a task scheduling module 20 and a PDF file generation module 30, while the process monitoring module may be an independently deployed end-to-end monitoring module 50. In addition, the back-end module 300 may also include a data processing module 40 for processing data and distributing messages; in some implementations, this module is also called a message module.
[0028] Combination Figure 2 The diagram shows the overall flowchart of the report generation method provided in this embodiment of the invention. The method mainly includes the following steps: Step S10: Obtain the webpage content of the report to be generated and receive the pagination rules input by the user. Step S20: Based on the pagination rules, generate a multi-page high-fidelity report file and embed a watermark containing traceability information during the generation process. Step S30: Submit the generated report file to a subsequent push process. Step S40: Monitor the generation of the report file and the execution status of the subsequent push process. Step S50: Determine whether the execution status is a preset abnormal state. If yes, proceed to step S60; otherwise, proceed to step S70. Step S60: Stop the push process and send an abnormal alarm to a preset monitoring terminal for manual intervention. Step S70: Complete the push of the report file.
[0029] The following will combine Figure 1 , Figure 2 , Figure 3 and Figure 6 The specific execution process of the functions and methods of each module in this embodiment is described in detail.
[0030] In step S10, the system obtains the webpage content to be generated and the user-defined pagination rules. This step is mainly completed by the report configuration module, which in this embodiment is specifically implemented as an online visual page designer 10. It can be understood that the designer 10 is a web-based application built using the Backbone.js framework combined with HTML5 and CSS3 technologies. Users access the designer 10 through a browser and can design the layout and content of the report on a visual canvas through drag-and-drop operations. Specifically, users can drag and drop elements such as charts, tables, text blocks, and images from the component library onto the canvas and adjust their properties (such as size, position, data source binding, etc.) to build a content-rich long webpage report.
[0031] While designing content, users can configure pagination rules. As a preferred implementation, Designer 10 provides a dedicated configuration panel where users can select standard paper sizes such as A4 and A3, and specify the paper orientation (portrait or landscape). The system then automatically calculates the height of each page based on the selected size. Additionally, users can input custom page width and height values to meet specific layout needs. Once the pagination rules are determined, Designer 10 can draw multiple pagination separators in real-time and explicitly on the long webpage canvas based on the calculated page height. These separators can be overlaid on the report content as dotted lines or semi-transparent bands, allowing users to visually preview how the content will be segmented. If a user finds a table or chart improperly truncated, they can adjust the element's position or return to the pagination configuration panel to fine-tune the page height until a satisfactory preview is achieved. This WYSIWYG real-time preview mechanism significantly improves the efficiency and accuracy of configuring pagination rules.
[0032] In addition to pagination rules, users can also configure push strategies in Designer 10. For example, they can set whether reports are manually triggered or automatically pushed at fixed intervals (e.g., daily, weekly), and specify the target user list for receiving reports (e.g., email addresses, corporate communication tool accounts, etc.). Users can also configure watermark styles, which will be detailed in later steps. All this configuration information, including a structured description of the webpage content (e.g., a JSON object), pagination rules, push strategies, and watermark configurations, is sent to the backend server via HTTP requests (e.g., RESTful API calls) and stored in the database when the user saves the design, for later retrieval.
[0033] When a report generation task is manually triggered by the user or automatically triggered by the system according to a preset strategy, the process proceeds to steps S20 and S30. Please refer to [link to relevant documentation]. Figure 3The signaling interaction sequence diagram shown indicates that the user's trigger operation is first captured by the front-end designer (FE) and then sent to the back-end task module (TM), namely the task scheduling module 20 in this embodiment, a request to create a task, such as createTask (task details). The task details include information such as the report content identifier, pagination rules, watermark rules, and push target.
[0034] After receiving a task, the task scheduling module 20 places it into a task queue for management. To improve the system's concurrent processing capabilities and throughput, this module can internally employ a task queue (such as one based on Redis or RabbitMQ) and a concurrent thread pool or process pool mechanism. The scheduler retrieves tasks from the queue and distributes them to an available PDF file generation module 30 instance for execution.
[0035] The PDF file generation module 30 is the core of the report file generation process. In this embodiment, this module can be a backend service built on a Node.js environment, the key being the invocation of a web page rendering engine to process the web page content. As an efficient and high-fidelity implementation, this web page rendering engine is preferably a headless browser. It is understood that a headless browser (such as Puppeteer or Playwright) refers to a browser program that runs without a graphical user interface. After receiving the task, the PDF file generation module 30 starts a headless browser instance and loads the web page URL containing the report content to be generated. This URL can point to a temporary page dynamically generated by the system for displaying the report content.
[0036] When loading a page, the PDF file generation module 30 passes the pagination rules (such as page height and page width) parsed from the task information to the headless browser's printing function interface. For example, when using the Puppeteer library, the page.pdf() method can be called, and parameters such as format, width, and height can be passed in to precisely control the size of each PDF page, thereby ensuring that the pagination effect of the final multi-page report file is completely consistent with the pagination rules previewed and set by the user in the designer 10.
[0037] It's important to note that the PDF files generated by the headless browser are high-fidelity vector format files, not simple page screenshots. This means that text content in the PDF can be selected, copied, and searched, and table data can be parsed and extracted, thus greatly preserving the report's secondary use value.
[0038] During the same process of generating a PDF using a headless browser, security controls for embedding a traceable watermark are also executed. This function is also implemented internally by the PDF file generation module 30. Specifically, one or more layers for carrying the watermark can be dynamically created in the page's Document Object Model (DOM) by executing a JavaScript script before the page is rendered but before it is output as a PDF file. These layers are typically absolutely positioned. Set a high z-index value for the element to make it float above all other content, and set a certain level of transparency to avoid excessive interference with the reading of the main text.
[0039] The watermark content, namely the preset source information, is dynamically generated. Based on the user's configuration in Designer 10, this information may include, but is not limited to, the target user information for the current report (such as the recipient's name, employee ID, or email address) and the precise timestamp of the report's generation (such as "2023-10-27 15:30:00"). Embedding this unique information into the watermark gives each distributed report file its own "identity". In the event of a data breach, administrators can quickly trace the source and original recipient by viewing the watermark information on the leaked file, providing strong technical support for security audits and liability determination. The watermark style, such as font, font size, color, transparency, rotation angle, and layout (such as tiling or centering), can all be preset by the user in Designer 10 and passed as parameters to the watermark generation logic.
[0040] After the report file is generated and a watermark is embedded, the PDF file generation module 30 stores the generated file in a file server or object storage service and obtains a file path or access URL. It then returns this result, along with the task status (success), to the task scheduling module 20. Accordingly, the task scheduling module 20 submits the report file to the subsequent push process. This step corresponds to... Figure 2 In S30 of the above, the task scheduling module 20 can send a message containing the file path and push target information to the data processing module 40 (or message module). This module is responsible for interfacing with various external notification channels, such as email servers, SMS gateways, and APIs of enterprise instant messaging tools, and calling the corresponding interfaces according to the push method specified by the task to send the report file as an attachment or link to the end user.
[0041] The following describes steps S40, S50, and S60, namely the process monitoring and exception handling mechanism. This mechanism is crucial for ensuring the reliability of the entire automated process. In this embodiment, this function is mainly implemented by the end-to-end monitoring module 50. As a preferred deployment method, this module can be deployed in bypass mode, running as an independent Java service, decoupled from core business process modules (such as task scheduling module 20, PDF file generation module 30, and data processing module 40).
[0042] The end-to-end monitoring module 50 monitors the entire process of report generation and push through various methods, covering every key step from task reception to final push. Monitoring methods may include: monitoring log files generated by business modules and discovering anomalies through keyword matching (such as ERROR, Exception); listening for custom events or messages thrown by business modules; and proactively calling the health check interface of business modules.
[0043] The monitoring module 50 internally pre-sets a series of abnormal states that require attention. These states are typical problems that often lead to process failures or incorrect results, summarized from practical experience. Specifically, these pre-set abnormal states may include, but are not limited to, one or more of the following: 1. Data query failure: When generating report content, if data retrieval from an external database or API fails, such as a data source connection failure, query timeout, or the return of data in an incorrect format. 2. File generation timeout: The PDF file generation module 30 takes longer than a preset threshold (e.g., 60 seconds) to perform rendering and generation operations. This may mean that the page is too complex or the rendering engine is stuck. 3. File generation failure: The headless browser crashes during rendering, or other internal errors prevent the generation of a valid PDF file. 4. Push interface call failure: When the data processing module 40 attempts to send a report, the call fails due to network problems, unresponsive reciprocal servers, or authentication failures.
[0044] like Figure 3 As shown in the "Process Anomaly" branch of the sequence diagram, when the PDF file generation module (GM) encounters a problem during execution, the monitoring module collects error information and marks whether it is a critical error. After the current task recognizes that the received execution status matches the preset list of abnormal statuses, it will immediately take two core actions: suspend the process and send an alarm.
[0045] First, upon detecting a critical error, the monitoring module marks the current task as failed, halting subsequent push notifications. This effectively prevents the sending of blank, incomplete, or incorrectly formatted report files to the user. If the monitoring module detects an error but it is not critical, the push notification process will not be stopped.
[0046] Secondly, the monitoring module 50 will send anomaly alarms to preset monitoring terminals. This "monitoring terminal" can be the email address or mobile phone number of one or more personnel, or a dedicated monitoring and alarm platform. The alarm information will detail the task ID where the anomaly occurred, the anomaly type, the time of occurrence, and related log summaries, providing sufficient context for manual intervention.
[0047] As a more refined management approach, alert sending can be based on a pre-defined role-based access control architecture. The system can predefine a "push monitoring group" role and grant this role permissions to view details of abnormal tasks, perform retry, cancel, and other intervention operations. Accordingly, only users assigned this role can receive relevant abnormal alerts, thus ensuring that alerts are accurately delivered to capable and authorized personnel to handle the problem, avoiding information overload and interference from irrelevant personnel.
[0048] Upon receiving an alert, monitoring team members can log into the system to view detailed information about the abnormal task and perform corresponding manual intervention based on the cause of the problem. For example, if the anomaly is due to temporary network jitter causing a data query failure, the operator can choose "Retry" to re-trigger the task. If the rendering engine crashes due to a problem with the report content design itself, the operator can choose "Cancel" the task and notify the report designer to modify its design. This closed-loop mechanism of "monitoring-alerting-intervention" greatly enhances the robustness and reliability of the entire automated report generation and delivery process.
[0049] Finally, if the process is normal and no abnormalities occur (e.g.) Figure 3 As shown in the "Process Normal" branch, the report file was successfully pushed to the user, and the task scheduling module 20 updated the task status to "Completed," indicating that the entire process was successfully completed. Figure 2 Step S70 in the process.
[0050] Figure 6 This presents the entire workflow from a more macro-level user perspective. Users design and configure the front-end system, and after triggering a task, a series of modules in the back-end service (task scheduling, PDF generation, monitoring) work together to generate and distribute reports under the protection of monitoring. This process may involve anomaly detection and retry logic, and finally, the results are fed back to the user.
[0051] In summary, this embodiment provides a complete, reliable, and secure online report generation and push solution by organically combining user-defined visual configuration, high-fidelity pagination generation based on a headless browser, traceable watermark embedding, and end-to-end anomaly monitoring and manual intervention mechanisms.
[0052] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0053] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features of the present invention can be arbitrarily combined with each other.
Claims
1. A report generation method supporting custom pagination and process monitoring, characterized in that, include: Obtain the webpage content for which a report is to be generated, and receive pagination rules input by the user to divide the webpage content into multiple pages; Based on the pagination rules, the web page rendering engine is invoked to render the web page content and generate a multi-page report file. During the generation of the report file, a watermark containing preset source information is embedded into each page of the report file. The report file is a high-fidelity file that retains the searchability and editability of the content. Submit the generated report file to the subsequent push process; Monitor the generation of the report file and the execution status of the subsequent push process. When the execution status is identified as a preset abnormal state, stop the push process and send an abnormal alarm to a preset monitoring terminal for manual intervention.
2. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, The process of obtaining the webpage content to be generated as the report and receiving pagination rules input by the user includes: The online visual page designer responds to user drag-and-drop operations to design the webpage content and provides a real-time preview of the pagination rules and corresponding pagination separators.
3. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, Generating a report file based on the pagination rules includes: dynamically inserting pagination separators into the webpage by calculating borders, page dimensions, and pagination dimensions based on a preset print size or a user-selected print size.
4. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, The embedded watermark includes: Information about the recipient and sender, including name, employee ID, and sending time, is used to trace the source of the document after it goes offline.
5. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, The webpage rendering engine is a headless browser.
6. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, The preset abnormal states include at least one of the following: data query failure, file generation timeout, and push interface call failure.
7. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, The traceability information includes at least one of the following: target user information and push timestamp.
8. The report generation method supporting custom pagination and process monitoring according to claim 1, characterized in that, Sending an anomaly alarm to a preset monitoring terminal includes: Based on a preset role-based access control architecture, the abnormal alarm is sent to the monitoring terminal with the corresponding intervention authority.
9. A report generation system that supports custom pagination and process monitoring, characterized in that, include: The report configuration module is used to obtain the web page content to be generated and to receive pagination rules input by the user for dividing the web page content into multiple pages; The report generation module is used to call the web page rendering engine to render the web page content and generate a multi-page report file based on the pagination rules. During the generation of the report file, a watermark containing preset traceability information is embedded into each page of the report file, and the generated report file is submitted to the subsequent push process. The report file is a high-fidelity file that retains the searchability and editability of the content. The process monitoring module is used to monitor the generation of the report file and the execution status of the subsequent push process. When the execution status is identified as a preset abnormal state, the push process is stopped and an abnormal alarm is sent to a preset monitoring terminal for manual intervention.
Citation Information
Patent Citations
Page pushing method, device, server and centralized network management controller
CN104980461B
Method, system and equipment for generating pdf based on headless browser
CN118551733A