Statistical data assembly method based on data and report structure decoupling
By constructing a general data storage structure and an automatic typesetting engine, data and report styles are decoupled, solving the problem of tight coupling between data and reports in existing technologies. This enables standardized processing and efficient typesetting of multi-source data, and improves the automation of statistical data compilation and the flexibility of templates.
Patent Information
- Application Number
- CN202511363780.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-30
AI Technical Summary
Existing statistical data compilation methods suffer from high development and maintenance costs due to the tight coupling between data and report structures, making it difficult to achieve standardized management. They also lack a unified data middleware layer, resulting in excessive manual intervention, a high risk of information loss, low typesetting efficiency, and poor template flexibility, making it difficult to meet the requirements of efficiency, accuracy, and maintainability in modern statistical work.
By constructing a general data storage structure, decoupling data from report styles, importing multi-source heterogeneous reports using the SpreadJS control, defining mapping relationships, combining logical validation and manual review, employing an automatic typesetting engine to segment and populate data, generating typesetting files that meet publishing requirements, and archiving mapping relationships to support template reuse.
It enables unified management and standardized processing of multi-source data, improves the automation level of data filling and typesetting efficiency, reduces the risk of manual intervention, ensures the consistency of data quality and typesetting, and supports flexible configuration and sustainable evolution of templates.
Smart Images

Figure CN121435918A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway statistical data compilation technology, and in particular to a statistical data compilation method based on the decoupling of data and report structure. Background Technology
[0002] In the compilation of statistical data, the traditional approach typically employs a "tight coupling of data and report style," where raw data is directly embedded into a specific report template, with data content and presentation style being highly intertwined. While this approach is feasible for small-scale, single-source data processing, it reveals numerous limitations when faced with the task of integrating statistical data from multiple fields, in multiple formats, and on a large scale.
[0003] First, as statistical work becomes increasingly sophisticated, the sources of raw report data are becoming more diverse, covering multiple business areas such as transportation, infrastructure, finance, and energy. These sources exhibit significant differences in data structure, field naming, table layout, and even file formats (such as Excel, CSV, and database exported tables). If each type of report requires a customized processing flow and layout logic, development and maintenance costs become prohibitively high, and standardized management becomes difficult. Furthermore, when report templates change due to publishing standards or binding requirements, it is often necessary to readjust the underlying data structure or manually rearrange the data, leading to low efficiency, high error rates, and severely hindering the automation and intelligence of statistical data compilation.
[0004] Secondly, in existing technical solutions, data collection, review, formatting, and publishing are often fragmented operations, lacking a unified data middleware layer. Metadata in the original reports (such as header row position, starting cell, pagination rules, and print orientation) typically relies on manual identification and experience-based judgment, and cannot be automatically parsed and reused by the system. This not only increases the cognitive burden on operators but also increases the risk of information loss during data flow, affecting the consistency and traceability of the final results.
[0005] Furthermore, the publication of statistical data places high demands on typesetting quality, especially in areas such as double-sided printing, binding margins, and cross-page continuation of tables, which require adherence to strict formatting standards. Traditional manual typesetting or semi-automatic tools struggle to dynamically adapt to the matching issues between different data volumes and template specifications. For example, when data rows and columns exceed the capacity of a single page, issues such as how to reasonably perform horizontal or vertical pagination, how to maintain heading continuity, and how to handle data connections across sheets often rely on the experience of typesetting personnel, lacking systematic segmentation algorithm support, resulting in low typesetting efficiency and poor consistency.
[0006] In addition, statistical data compilation has periodicity and continuity characteristics, and the data structure of each annual data is relatively stable, but the report form may be slightly adjusted according to policy or publication needs. If the original data needs to be reorganized or the database structure needs to be modified every time the template is updated, real template reuse and flexible configuration cannot be achieved, which limits the sustainable evolution ability of the system.
[0007] In summary, the existing statistical data compilation method generally has the problems of high coupling degree of data and form, fragmented processing flow, insufficient automatic typesetting degree, poor template flexibility, and the like, and it is difficult to meet the comprehensive requirements of high efficiency, accuracy, standardization and maintainability of modern statistical work. Therefore, a new type of compilation method capable of decoupling data and report structure, supporting unified management of multi-source heterogeneous data, and having intelligent mapping and automatic typesetting capability is urgently needed to improve the overall efficiency and quality level of statistical data production. SUMMARY
[0008] In order to overcome the deficiencies in the background art, a statistical data compilation method based on decoupling of data and report structure is disclosed.
[0009] To achieve the above-mentioned object, the present application adopts the following technical solutions:
[0010] A statistical data compilation method based on decoupling of data and report structure, comprising the following steps:
[0011] S1, a general data storage structure is constructed, and the original report data is uniformly abstracted as structured data in the form of rows and columns, stored in a general database table, to realize physical separation of data and report form;
[0012] S2, the mapping relationship between the original report and the template report is defined, and the structure mapping configuration between the original report data area and the template report filling area is established, including the row and column title correspondence relationship, data range, paging rule, expansion direction and priority;
[0013] S3, data review and range confirmation: after the original report is completed, the system performs logical verification and manual review on the data, confirms the data column range to be involved in compilation, and locks the final data into the general database table;
[0014] S4, starting the automatic typesetting engine, executing data logical segmentation and filling process, reading the template report configuration, obtaining the number of rows and columns that each Sheet can accommodate, the binding center line position and the expansion strategy; according to the original report data size and the template capacity, the exceeding situation is handled by the segmentation algorithm according to the row or column;
[0015] S5, generating a final layout file, outputting the filled template report set as a printable layout document, wherein each sheet or page is arranged in page order according to the publication catalog, and meets the printing and binding requirements;
[0016] S6, publishing and archiving, submitting the layout file for printing, and archiving the original data, template configuration and mapping relationship, supporting reuse or adjustment of the template without changing the data layer during subsequent annual compilation.
[0017] Preferably, in step S4, the logical steps of the segmentation algorithm are as follows:
[0018] I. Obtain the row and column information of the data and template table, and analyze and judge;
[0019] II. If the row and column do not exceed the A / B page capacity, fill the template in the original order at one time;
[0020] III. If the number of columns of the original report is greater than the number of columns of the template report, keep the row unchanged, split the data vertically, and split into multiple sheets and fill the data in sequence;
[0021] IV. If the number of columns of the original report is less than the number of columns of the template report, resulting in that one page cannot be filled, split the data horizontally, and preferentially fill the A and B pages in sequence, and if the subsequent length is too long, continue to trigger vertical pagination;
[0022] V. If the number of rows of the original report is greater than the number of rows of the template report, split the data horizontally, copy the template page downward and fill the data in sequence;
[0023] VI. If the number of rows and columns of the original report exceeds the number of rows and columns of the template report, first split the sheet horizontally, and then split the sheet vertically to form a composite pagination structure.
[0024] Preferably, in step S1, the SpreadJS control is used to import the original report file, and the structure metadata of each report is parsed and extracted, including: the ID of the compilation catalog to which the report belongs, the sheet name and order, the title row position and field name, the title column position and field name, the data start cell and end cell, the pagination parameters of the printing direction.
[0025] By adopting the technical scheme, the application has the following beneficial effects:
[0026] (1) The present application realizes the physical separation of original report data and report style by constructing a general data storage structure, imports multi-source heterogeneous original report files using the SpreadJS control, and automatically parses the metadata information therein, including assembly directory ID, Sheet name and order, title row and column position, field name, data starting cell, and pagination rules and printing direction, etc. layout parameters, so as to unify the reports with large format differences in different fields such as transportation, infrastructure, finance, etc. into structured data in row and column form and store them into a general database table, which not only improves the compatibility and storage flexibility of multi-source data, but also provides a standardized and reusable data basis for subsequent data processing and report generation, effectively avoiding the repeated development and maintenance costs caused by the diversification of report styles.
[0027] (2) In the step of defining the mapping relationship between the original report and the template report, the present application establishes an accurate data structure mapping configuration by explicitly defining the row and column title correspondence, defining the data range, adapting the pagination rule, and setting the extension direction and priority, so that the system can intelligently identify the original data layout and accurately convert it to the target template format, significantly enhancing the automation and accuracy of data filling and reducing the risk of errors and omissions caused by manual intervention.
[0028] (3) After data review and range confirmation, the system combines logical verification and manual review dual mechanisms to complete comprehensive verification of mandatory item integrity, data format consistency and business rationality, locks the final assembly data range and writes it into the general database table under the premise of ensuring data quality, which not only guarantees the authority and reliability of statistical data, but also provides a highly reliable input basis for the subsequent automatic layout process.
[0029] (4) The automatic layout engine of the present application executes intelligent data segmentation and filling logic according to the capacity of each Sheet in the template configuration, the binding center line position and the extension strategy, combined with the size of the original data: when the data volume does not exceed the one-time filling; when the row is too long (the number of rows is too many), the row title remains unchanged for vertical pagination; when the column is too long (the number of columns is too many), the column title remains unchanged for horizontal splitting into multiple Sheets; when the column is insufficient, it is filled in the A / B sequence to improve paper utilization; when both the row and column are too long, the horizontal splitting is performed first and then the vertical pagination is performed to form a composite pagination structure. This multi-dimensional adaptive segmentation algorithm fully considers the layout utilization, reading continuity and binding requirements in the actual publishing scenario, greatly improving the layout efficiency and the beauty of the results. BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is the flowchart of the present application;
[0031] Figure 2 is the flowchart of the segmentation algorithm;
[0032] Figure 3 To express the intention of complex report with both long rows and columns;
[0033] Figure 4 To express the intention of automatically segmented and laid-out report. DETAILED DESCRIPTION
[0034] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work are within the protection scope of the present application.
[0035] In the description of the present application, it should be noted that the terms "upper", "lower" and the like indicate the orientation or positional relationship shown in the drawings, or the orientation or positional relationship commonly used when the product of the present application is used, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application.
[0036] In the present application, unless otherwise explicitly specified and limited, the terms "mounting", "connection", "connecting", "fixing" and the like should be understood in a broad sense, for example, can be fixed connection, can also be detachable connection, or integral; can be directly connected, or indirectly connected through an intermediate medium; can be the internal communication of two elements or the interaction relationship between two elements. For a person of ordinary skill in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0037] Embodiment one:
[0038] In combination with the accompanying drawings, Figures 1 to 4 A statistical material compilation method based on decoupling of data and report structure, comprising the following steps:
[0039] S1, constructing a general data storage structure:
[0040] In the context of statistical data compilation, raw report data often comes from multiple different domains such as transportation, infrastructure, finance, etc., with significant differences in format and structure. To achieve the physical separation of data and report style, a common data storage structure needs to be built first. The operator can import the original report file using the SpreadJS control, which not only supports the import of multiple file formats, but also automatically parses the metadata in the report, including but not limited to the ID of the compilation directory to which the report belongs, the name and order of each sheet, the location of the title row and column and their field names, the start and end cells of the data, and the layout parameters such as pagination rules and printing direction. In this way, the style information and data content of the report are separated, laying the foundation for subsequent automation processing.
[0041] The purpose of building a common database table is to abstract the raw report data into a structured data in the form of rows and columns. Such design not only improves the flexibility of data storage, but also makes the subsequent data processing and report generation process more efficient and unified. The design of the common database table takes into account the multi-source and diversity of data, ensuring that raw report data of different formats can be uniformly managed and utilized.
[0042] S2, define the mapping relationship between the original report and the template report:
[0043] In order to realize the accurate filling of data from the original report to the template report, it is necessary to establish the structure mapping configuration between the data area of the original report and the filling area of the template report. This step is one of the cores of the whole method, because it directly determines the presentation mode of data in the template report.
[0044] The establishment of the mapping relationship includes the following aspects:
[0045] Row and column title correspondence: Clearly define the corresponding position of row and column titles in the original report in the template report, to ensure accurate alignment of data.
[0046] Data range definition: Determine which data in the original report needs to be included in the compilation, and the filling range of these data in the template report.
[0047] Pagination rule adaptation: According to the layout requirements of the template report, set the pagination mode of data in the template to ensure the beauty and practicality of the final layout file.
[0048] Expansion direction and priority setting: When the data volume exceeds the single-page capacity of the template report, determine the direction of data expansion, such as row priority or column priority, and how to handle the overflow part of the data.
[0049] Through such a mapping configuration, the system can automatically identify the data structure in the original report and convert it into a template report format that meets the publishing requirements, greatly reducing manual intervention and improving work efficiency.
[0050] S3, Data Audit and Range Confirmation:
[0051] The accuracy and completeness of data are the foundation of statistical data compilation. After the original report is filled out, the system first performs logical verification on the data, including data integrity checks, such as whether there are missing mandatory items, consistency checks, such as whether the data format meets the specifications, etc. In addition, manual audits are also conducted to ensure the reasonableness of the data, i.e., whether the data conforms to the actual business scenario and logic.
[0052] After logical verification and manual audit, the system confirms the range of data columns that need to participate in compilation and locks the final data into the general database table. This process not only guarantees the quality of the data, but also provides a reliable data foundation for subsequent automatic layout steps. Data audit and range confirmation is a key link in the entire process, which directly affects the accuracy and authority of the final layout file.
[0053] S4, Start Automatic Layout Engine:
[0054] After the data is ready, start the automatic layout engine to perform data logical segmentation and filling process. The system obtains the number of rows and columns that each Sheet can accommodate, the binding center line position, and the expansion strategy based on the template report configuration, and analyzes and judges in combination with the original report data size.
[0055] As shown in the accompanying Figure 4 , the logical steps of the segmentation algorithm are as follows:
[0056] I. Obtain the row and column information of the data and template table, and perform analysis and judgment;
[0057] II. If neither the row nor the column exceeds the capacity of one A / B page, fill the data to the template in the original order at one time;
[0058] III. If the number of columns of the original report is greater than the number of columns of the template report (column is too long), keep the row unchanged, divide the data vertically, split into multiple Sheets and fill the data in sequence;
[0059] IV. If the number of columns of the original report is less than the number of columns of the template report (column is insufficient), resulting in one page being unable to be filled, divide the data horizontally, preferentially fill in A and B pages in sequence, and if subsequent data is too long, continue to trigger vertical pagination;
[0060] V. If the number of rows of the original report is greater than the number of rows of the template report (row is too long), divide the data horizontally, copy the template page downward and fill the data in sequence;
[0061] VI. If both the original report rows and columns exceed the template report (both rows and columns are too long), first split the Sheet horizontally, and then split each Sheet vertically to form a complex pagination structure.
[0062] The design of the segmentation algorithm fully considers the adaptation of different data sizes and template specifications. Through flexible pagination strategies, it ensures that the data can be reasonably displayed in the template report. The application of the automatic layout engine greatly improves the layout efficiency and reduces errors that may be caused by manual operations.
[0063] S5. Generate the final layout file:
[0064] After the data logic segmentation and filling process is completed, the system outputs the filled template report set as a printable format document, such as PDF or Excel. In the generated layout file, each Sheet page or page content has been arranged with page numbers according to the publication order, meeting the printing and binding requirements.
[0065] The output file at this stage is the final result of the entire assembly work. It not only needs to ensure the accuracy and integrity of the data, but also needs to meet the requirements of aesthetics and readability. Through the automated layout process, the system can generate high-quality layout files, providing convenience for subsequent printing and publishing.
[0066] S6. Release and archive:
[0067] Finally, the generated layout file is submitted for printing, and the original data, template configuration, and mapping relationship are archived together. The archived content includes the original report data file, template report configuration file, and mapping relationship record, so that the template can be reused or adjusted without changing the underlying data structure in subsequent years' statistical data assembly work.
[0068] The release and archiving step not only completes the current year's assembly work, but also provides valuable data and experience for future work. By saving the original data and configuration information, the system can quickly adapt to business changes and flexibly adjust the template, thereby achieving long-term efficient operation.
[0069] The parts of the invention not described in detail are prior art. For those skilled in the art, it is obvious that the invention is not limited to the details of the above exemplary embodiments, and the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention; therefore, from any point of view, the embodiments should be considered as exemplary and non-limiting, and are intended to encompass all changes within the meaning and scope of the equivalent elements.
Claims
1. A statistical compilation method based on decoupling of data and report structure, characterized in that, The method comprises the following steps: S1, constructing a general data storage structure, abstracting original report data into structured data in the form of rows and columns, and storing the structured data in a general database table to realize physical separation of data and report style; S2, defining a mapping relationship between original reports and template reports, establishing a structure mapping configuration between a data area of an original report and a filling area of a template report, including a row and column title correspondence relationship, a data range, a paging rule, an expansion direction, and a priority; S3, data auditing and range confirmation: after the original report is completed, the system performs logical verification and manual auditing on the data, confirms the data column range that needs to participate in compilation, and locks and writes the final data into the general database table; S4, starting an automatic layout engine, performing data logical segmentation and filling processes, reading template report configurations, obtaining the number of rows and columns that can be accommodated in each sheet, the binding center line position, and the expansion strategy; judging according to the original report data size and the template capacity, and respectively processing according to the row or column exceeding situation through a segmentation algorithm; S5, generating a final layout file, outputting the filled template report set as a printable style document, wherein each sheet or each page has been arranged with page numbers in the order of the publication catalog, meeting the printing and binding requirements; S6, publishing and archiving, submitting the layout file for printing, and archiving the original data, template configuration, and mapping relationship, supporting reuse or adjustment of the template in subsequent annual compilation without changing the data layer.
2. The statistical material compilation method based on decoupling of data and report structure according to claim 1, wherein in step S4, the logical steps of the segmentation algorithm are as follows: Ⅰ. Obtain the row and column information of the data and the template table, and perform analysis and judgment; Ⅱ. If neither the row nor the column exceeds the capacity of one A / B side, fill the data into the template in the original order at one time; Ⅲ. If the number of columns of the original report is greater than the number of columns of the template report, keep the row unchanged, divide the data vertically, split the data into multiple sheets, and sequentially fill the data; Ⅳ. If the number of columns of the original report is less than the number of columns of the template report, resulting in that one page cannot be filled, divide the data horizontally, and preferentially fill the data in the A and B sides in order, and if the subsequent length is too long, continue to trigger vertical paging; Ⅴ. If the number of rows of the original report is greater than the number of rows of the template report, divide the data horizontally, copy the template page downward, and sequentially fill the data; Ⅵ. If both the number of rows and the number of columns of the original report exceed the number of rows and the number of columns of the template report, first split the sheet horizontally, and then divide the sheet vertically to form a composite paging structure.
3. The statistical material compilation method based on decoupling of data and report structure according to claim 1, wherein in step S1, a SpreadJS control is used to import an original report file, and structural metadata of each report is parsed and extracted, including: a compilation catalog ID, a sheet name and order, a title row position and a field name, a title column position and a field name, a data starting cell and an ending cell, a paging rule, and a printing direction layout parameter.