Electronic archive management method for business document generation layout file
By using multi-dimensional feature vectors to filter templates, multi-level verification, and asynchronous processing to generate PDF/OFD format files, this technology solves the problems of insufficient template matching accuracy, uncontrollable data quality, and insufficient security in existing technologies, thus achieving efficient and secure electronic record management.
Patent Information
- Application Number
- CN202511702522.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies suffer from insufficient template matching accuracy, incomplete data verification, low file generation efficiency, and inadequate security when generating electronic archives, failing to meet the needs of complex and ever-changing business scenarios.
PDF/OFD formatted files are generated by constructing multi-dimensional feature vectors and filtering templates through similarity matching, combined with multi-level verification and asynchronous processing mechanisms, and secure storage is achieved using hash values and blockchain technology.
It achieves precise template matching, ensures data quality, improves file generation efficiency, and provides a secure and reliable archive storage and retrieval mechanism.
Smart Images

Figure CN121706752A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic records management technology, specifically to an electronic records management method for generating format files of business documents. Background Technology
[0002] With the development of information technology, various organizations generate a large number of electronic business documents in their daily operations. These documents need to be archived into formatted files that conform to national standards (such as PDF and OFD) for long-term preservation and retrieval. Existing technologies typically use fixed templates or simple rule matching to generate electronic archives. While this method achieves a certain degree of automation, it still has significant shortcomings in practical applications.
[0003] The main shortcomings of existing technologies are as follows: First, the template matching accuracy is insufficient, making it difficult to adapt to the needs of complex and ever-changing business scenarios, resulting in a low degree of consistency between the generated layout files and business data; second, the data verification mechanism is imperfect, lacking effective processing of unstructured data and consistency verification of cross-system data, which affects data quality; third, the file generation process is inefficient, failing to fully utilize system resources to achieve high-performance processing; and finally, the archive storage security is insufficient, lacking effective anti-tampering mechanisms and long-term traceability guarantees.
[0004] Based on the aforementioned technical deficiencies, there is an urgent need for an electronic archive generation method that can achieve accurate template matching, comprehensive data verification, efficient file generation, and secure storage management, in order to solve the problems of poor template adaptability, uncontrollable data quality, low processing efficiency, and insufficient security in existing technologies. Summary of the Invention
[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide an electronic archive management method for generating business document format files, which achieves accurate template matching, perfect data verification, efficient file generation and secure storage management, and solves the problems of poor template adaptability, uncontrollable data quality, low processing efficiency and insufficient security in the prior art.
[0006] A method for managing electronic archives of business document generation format files includes the following steps:
[0007] Collect scenario features of business documents to be archived to construct multi-dimensional feature vectors, filter candidate templates from the template pool through similarity matching, and dynamically adjust the structure in combination with data integrity and format requirements to determine a unique target template;
[0008] Integrate basic metadata of documents with supplementary data from related systems, verify the validity of data through rule-based validation and cross-validation, and output qualified metadata;
[0009] Based on the target template and qualified metadata, a dual-thread asynchronous processing mechanism is adopted to generate PDF / OFD format files through an adaptive algorithm;
[0010] The hash value of the layout document is calculated, and the hash, timestamp, and document number are written into the blockchain. Through a distributed architecture that separates the layout document body from the metadata, secure storage and rapid retrieval of electronic archives are achieved.
[0011] As a further embodiment, the step of determining the unique target template includes:
[0012] Collect multi-dimensional scenario features from business documents to be archived, and construct a numerical multi-dimensional feature vector based on these features;
[0013] After obtaining the multi-dimensional feature vectors, the similarity between the document to be archived and each template in the preset template library is calculated; finally, a comprehensive similarity score is obtained through weighted fusion, and all templates are sorted from high to low according to the comprehensive similarity score, and the templates at the top of the sort are selected as the candidate set.
[0014] After obtaining the candidate template, a three-level linkage adjustment mechanism is executed based on the characteristics of the document data;
[0015] The optimized candidate templates are comprehensively evaluated using a weighted scoring function, and the optimal template is selected.
[0016] As a further solution, the multi-dimensional scene features include:
[0017] Multidimensional scenario features include business type, data field composition, and industry compliance requirements. Among them, business type features are encoded through a predefined classification system, converting the textual description of business type into a discrete numerical representation. Field structure features are constructed by analyzing the actual set of fields contained in the document to accurately describe the data composition of the document. Compliance requirement features extract relevant format constraints from industry standards and convert them into quantifiable compliance vectors.
[0018] As a further solution, the method for calculating the similarity between the document to be archived and each template in the preset template library is as follows:
[0019] The similarity is achieved using a multi-level similarity matching algorithm, which includes basic feature similarity calculation and field structure similarity calculation. Basic feature similarity mainly measures the closeness between the document and the template in the overall feature space, while field structure similarity focuses on the matching of the two in terms of field composition.
[0020] Among them, basic feature similarity The formula is expressed as:
[0021] ;
[0022] This represents a multi-dimensional feature vector of a business document to be archived. Indicates the first in the template pool Multi-dimensional feature vectors of templates; basic feature similarity The value represents the similarity between the document and the template in terms of overall business scenario features. The closer the value is to 1, the better the overall features match.
[0023] Field structure similarity :
[0024] ;
[0025] A field existence vector representing a document to be archived; Indicates the first The existence vector of fields defined or required by the template; This indicates the size of the intersection between the document and the template field vector, i.e., the number of fields that both have in common; This represents the size of the union of the document and template field vectors, i.e., the total number of all fields that appear in both; field structure similarity. Pay special attention to the degree of matching between the document and the template in terms of field composition structure. The closer the value is to 1, the more the field composition of the document matches the expected structure of the template.
[0026] Overall similarity :
[0027] ;
[0028] These are the weighting coefficients.
[0029] As a further solution, the three-level linkage adjustment mechanism includes:
[0030] First, optimize the field-level structure by scanning the metadata population status, automatically hiding empty value fields and dynamically collapsing low-frequency fields, while adaptively adjusting the text box size according to the text length.
[0031] Then, the table is dynamically restructured, automatically calculating the number of rows and optimizing column width allocation based on the number of data records to ensure that the table content is presented completely and the layout is reasonable.
[0032] Finally, global layout adaptation is performed, page space is redistributed based on element importance weights, a responsive grid system is used to maintain overall alignment, and a smart pagination algorithm is used to prevent key content from being fragmented, thereby achieving precise personalized adaptation while maintaining the core framework of the template.
[0033] As a further solution, the method of comprehensively evaluating the optimized candidate templates using a weighted scoring function and selecting the optimal template is as follows:
[0034] First, a comprehensive evaluation function is constructed that includes template similarity, data matching degree, and format support degree. Template similarity is calculated based on feature vectors to ensure structural compatibility, data matching degree evaluates the degree of fit between template fields and metadata, and format support degree verifies the template's ability to accommodate special elements.
[0035] Next, appropriate weight coefficients are assigned to each dimension, and the comprehensive score of each candidate template is obtained through weighted calculation;
[0036] Then, a threshold screening mechanism is used to exclude templates whose scores in any dimension are below the minimum requirement.
[0037] Finally, the remaining candidate templates are sorted by their overall scores, the template with the highest score is selected as the target template, and its business rules are finally verified to ensure that it fully meets the archiving requirements.
[0038] As a further embodiment, the step of outputting qualified metadata includes:
[0039] Integrate the basic metadata of documents to be archived with supplementary data provided by related business systems to build a unified data view; perform natural language processing and information extraction on unstructured data such as text descriptions and attachment content, and convert them into structured fields; use preset format standards to unify the processing of all data to ensure data consistency and processability;
[0040] Establish a multi-level validation rule base, then load the data facts into the rule engine, perform pattern matching with the rule base conditions, and trigger the corresponding validation logic;
[0041] For abnormal data detected during verification, an automatic correction strategy is executed;
[0042] After completing all verifications and corrections, a qualified metadata dataset is output and packaged into a standardized data package for use by the subsequent file generation module. At the same time, a verification report is generated, recording the data source, processing procedure and verification results for easy auditing and traceability.
[0043] As a further solution, the multi-level validation rule base includes a syntax layer, a semantic layer, and a cross-validation layer;
[0044] Syntax layer rules include basic format constraints such as field non-empty validation, data type validation, and value range validation; semantic layer rules include business consistency constraints such as logical relationship validation; and the cross-validation layer sets consistency requirements with authoritative data sources for key fields.
[0045] As a further solution, the verification logic includes:
[0046] For missing fields, attempt to complete them from the association system;
[0047] For formatting errors, perform format conversion;
[0048] For logical anomalies, a manual review process will be triggered.
[0049] All corrected data must undergo secondary verification to ensure that it meets the archiving standards;
[0050] If the verification still fails, mark the document as abnormal and record the reason for the abnormality and the processing path.
[0051] As a further solution, the step of generating PDF / OFD format files using a dual-thread asynchronous processing mechanism and an adaptive algorithm includes:
[0052] Based on the target template and qualified metadata, two independent execution threads are created: a data population thread and a resource preprocessing thread. The producer-consumer pattern is used for task coordination, and inter-thread communication and load balancing are achieved through shared memory areas and message queues. This builds an efficient asynchronous processing pipeline and maximizes the use of system resources to improve processing throughput.
[0053] Thread 1 is responsible for filling qualified metadata according to the template field mapping relationship and performing intelligent dynamic typesetting calculation based on content features to generate an intermediate document containing complete content and layout information; Thread 2 preloads the rendering engine, font library, image resources, etc. required for format conversion in parallel to ensure the real-time availability of resources during conversion; content features include text features, table features, image features, layout features, and structural features;
[0054] After the dual-threaded tasks are completed, an adaptive format conversion algorithm is called to generate a layout file that conforms to both PDF and OFD standards. During the generation process, content optimization is automatically performed, including font embedding, image compression, and metadata cleaning. Subsequently, the file is losslessly compressed to reduce storage size.
[0055] Perform comprehensive quality checks on the generated layout files, including format verification, content integrity, and rendering consistency checks; verify file compatibility in various mainstream reading environments using automated testing tools to ensure that the files can be displayed correctly in various environments.
[0056] As a further solution, in the content-feature-based intelligent dynamic typesetting calculation method:
[0057] The text features dynamically calculate the optimal font size, line spacing, and paragraph spacing based on the available area size of the text box and the text length. It automatically adjusts the character spacing based on language features and automatically performs pagination and line break processing on long texts.
[0058] The table layout uses a flexible grid system that automatically calculates the table row height based on the number of data records and proportionally distributes column widths based on the maximum width of each column's content. It supports header repetition and content continuity when the table spans multiple pages.
[0059] Image features employ intelligent scaling technology, dynamically adjusting the display size while maintaining the original aspect ratio based on page layout constraints and image importance weights.
[0060] The layout features a responsive grid system that redistributes page space based on element importance weights and uses intelligent pagination algorithms to prevent key content from being fragmented, maintaining the overall visual balance and aesthetics of the layout.
[0061] As a further solution, the method of generating PDF and OFD dual-standard format files by calling an adaptive format conversion algorithm is as follows:
[0062] For PDF format, a PostScript-based vector graphics rendering pipeline is used to ensure the accuracy of printed output and the accurate reproduction of text and graphics, and to be compatible with PDF / A archiving standards. For OFD format, an XML-based open layout description is used to support content reorganization and interactive functions, and to comply with national layout document standards.
[0063] Automatically detects and embeds missing fonts, performs font subset processing to include only the characters actually used in the document, and supports both TrueType and OpenType formats;
[0064] The optimal compression algorithm is automatically selected based on the output requirements. JPEG2000 lossy compression is used for color images, and CCITT Group4 lossless compression is used for black and white images.
[0065] Automatically generate standard-compliant document metadata, clean up redundant and temporary metadata, and retain necessary business information and archiving identifiers;
[0066] By employing a streaming compression algorithm to optimize the document structure and using dictionary encoding to compress repetitive content, the final file size can be optimized to 30%-60% of the original size, maintaining a balance between file structure integrity and rendering performance.
[0067] As a further solution, the method for calculating the hash value of the format file and writing the hash, timestamp, and document number into the blockchain includes:
[0068] The generated layout file is hashed using SHA-256 to generate a unique digital fingerprint. The file hash, generation timestamp, document number, archiving personnel and other information are combined into a data package for evidence storage. This data package is written into the distributed ledger through the blockchain interface to complete the tamper-proof evidence storage. After successful evidence storage, the system returns the evidence storage number and the blockchain transaction ID.
[0069] The formula for calculating the SHA-256 hash of the generated layout file is as follows:
[0070] ;
[0071] It is the first A vector consisting of eight 32-bit hash values before each message block is processed; It is the first A 512-bit message block; It is the core compression function of SHA-256, which uses bitwise operations, modulo addition, and predefined constants to compress message blocks. Information is mixed into the intermediate hash value middle; This is the total number of message blocks;
[0072] The final number in the formula The result of the second iteration That is, the calculated 256-bit (32-byte) hash value, which serves as the unique digital fingerprint of the layout file;
[0073] The formula summarizes the main process of the SHA-256 algorithm. Its one-wayness and collision resistance ensure the integrity of electronic records, providing a reliable data foundation for blockchain-based tamper-proof evidence storage.
[0074] As a further solution, the method for achieving secure storage and rapid retrieval of electronic archives through a distributed architecture that separates the main body of the layout document from the metadata includes:
[0075] A distributed file storage architecture is adopted to separate the layout file body from the metadata index. The layout file body is stored in a highly available object storage system, while the index file is stored in a high-performance database, which includes retrieval fields such as file path, evidence information, keywords, and archiving time.
[0076] Implement role-based access control for stored electronic files to ensure that only authorized users can access or download files. All access behaviors are recorded in the audit log, including access time, user identity, operation type, etc., supporting security auditing and behavior tracing.
[0077] It provides a multi-dimensional search interface, supporting combined queries based on document number, time range, business type, keywords, and other conditions; it also supports document version management and lifecycle control, automatically executing document archiving, migration, or destruction operations according to archiving policies.
[0078] In summary, due to the adoption of the above technical solution, the beneficial technical effects of the invention are as follows:
[0079] Firstly, regarding template matching, this invention achieves accurate matching between business documents and template formats through multi-dimensional feature vector construction and a similarity matching mechanism. Specifically, a complete feature representation system is established through business type feature encoding, field existence vector construction, and compliance requirement quantification. Furthermore, a multi-level matching algorithm based on basic feature similarity and field structure similarity, combined with a dynamic structure adjustment mechanism, ensures the accuracy and adaptability of template selection, thus solving the problem of insufficient template matching accuracy in existing technologies.
[0080] Secondly, regarding data quality control, this invention establishes a comprehensive data verification system. Through data integration and standardization, the format specifications of multi-source data are unified; through multi-level rule verification at the syntax, semantic, and cross-validation layers, comprehensive verification of data integrity and consistency is achieved; and combined with automatic correction of abnormal data and a secondary verification mechanism, the quality and reliability of output metadata are ensured, effectively improving the data accuracy of electronic archives.
[0081] Third, regarding file generation efficiency, this invention employs a dual-thread asynchronous processing mechanism. By parallel execution of the data filling thread and the resource preprocessing thread, combined with producer-consumer task coordination, it significantly improves processing throughput. The intelligent dynamic typesetting calculation and adaptive format conversion algorithm based on content features achieve high-performance file generation while ensuring file quality, overcoming the problem of low processing efficiency in existing technologies.
[0082] Finally, regarding archival security, this invention utilizes SHA-256 hash calculation and blockchain notarization technology to generate a unique digital fingerprint for each document format and achieve tamper-proof notarization. Combined with a distributed storage architecture that separates the document format from its metadata index, along with role-based access control and full lifecycle management, a complete security system is constructed to ensure the long-term traceability and security of electronic archives. Attached Figure Description
[0083] Figure 1 A flowchart illustrating an electronic document management method for generating formatted files from business documents.
[0084] Figure 2 A flowchart of an electronic document management method S100 for generating formatted files of business documents;
[0085] Figure 3 A flowchart of S200, a method for managing electronic archives by generating formatted files for business documents;
[0086] Figure 4 A flowchart of S300, a method for managing electronic archives by generating formatted files for business documents;
[0087] Figure 5 This is a flowchart of S400, a method for managing electronic archives by generating formatted business documents. Detailed Implementation
[0088] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.
[0089] To make the objectives, technical solutions, and advantages of the invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0090] Please see Figure 1 This illustrates an electronic document management method for generating formatted business documents according to an embodiment of the present invention, comprising the following steps:
[0091] S100. Collect scenario features of business documents to be archived to construct a multi-dimensional feature vector, filter candidate templates from the template pool through similarity matching, and dynamically adjust the structure in combination with data integrity and format requirements to determine a unique target template;
[0092] S200. Integrate basic metadata of documents with supplementary data from related systems, verify the validity of data through rule validation and cross-validation, and output qualified metadata;
[0093] S300. Based on the target template and qualified metadata, it adopts a dual-thread asynchronous processing mechanism to perform data filling and typesetting and format resource preprocessing respectively, and generates PDF / OFD format files through an adaptive algorithm;
[0094] S400 calculates the hash value of the generated format file, writes the hash, timestamp, and document number into the blockchain to achieve tamper-proof evidence preservation; and achieves secure storage and fast retrieval of electronic archives through a distributed architecture that separates the main file and index file.
[0095] Please refer to Figure 2 The diagram illustrates a flowchart of an exemplary method S100 for generating formatted files of electronic documents, which aims to accurately match the most suitable formatted template for different types of business documents through intelligent feature matching and template optimization technology, ensuring that the generated files meet both business requirements and format specifications.
[0096] S101. Scene feature collection and vectorization construction: Collect multi-dimensional scene features of business documents to be archived, and construct a numerical multi-dimensional feature vector based on the multi-dimensional scene features;
[0097] Multidimensional scenario features include business type, data field composition, and industry compliance requirements. Among them, business type features are encoded through a predefined classification system, converting the textual description of business type into a discrete numerical representation; field structure features are constructed by analyzing the actual set of fields contained in the document to accurately describe the data composition of the document; and compliance requirement features extract relevant format constraints from industry standards and convert them into quantifiable compliance vectors.
[0098] S102. Similarity Matching and Candidate Template Selection: After obtaining multi-dimensional feature vectors, the similarity between the document to be archived and each template in the preset template library is calculated; finally, a comprehensive similarity score is obtained through weighted fusion, and all templates are sorted from high to low according to the comprehensive similarity score, selecting the top-ranked templates. 1 template as a candidate set, among which The preset number of candidate templates;
[0099] The similarity is achieved using a multi-level similarity matching algorithm, which includes basic feature similarity calculation and field structure similarity calculation. Basic feature similarity mainly measures the closeness between the document and the template in the overall feature space, while field structure similarity focuses on the matching of the two in terms of field composition.
[0100] Among them, basic feature similarity The formula is expressed as:
[0101] ;
[0102] This represents a multi-dimensional feature vector of a business document to be archived. Indicates the first in the template pool Multi-dimensional feature vectors of templates; basic feature similarity The value represents the similarity between the document and the template in terms of overall business scenario features. The closer the value is to 1, the better the overall features match.
[0103] Field structure similarity :
[0104] ;
[0105] A field existence vector representing a document to be archived; Indicates the first The existence vector of fields defined or required by the template; This indicates the size of the intersection between the document and the template field vector, i.e., the number of fields that both have in common; This represents the size of the union of the document and template field vectors, i.e., the total number of all fields that appear in both; field structure similarity. Pay special attention to the degree of matching between the document and the template in terms of field composition structure. The closer the value is to 1, the more the field composition of the document matches the expected structure of the template.
[0106] Overall similarity :
[0107] ;
[0108] These are the weighting coefficients;
[0109] S103. Dynamic Structure Adjustment and Template Optimization: After obtaining candidate templates, a three-level linkage adjustment mechanism is executed based on document data characteristics. The three-level linkage adjustment mechanism includes:
[0110] First, optimize the field-level structure by scanning the metadata population status, automatically hiding empty value fields and dynamically collapsing low-frequency fields, while adaptively adjusting the text box size according to the text length.
[0111] Then, the table is dynamically restructured, automatically calculating the number of rows and optimizing column width allocation based on the number of data records to ensure that the table content is presented completely and the layout is reasonable.
[0112] Finally, global layout adaptation is performed, page space is redistributed based on element importance weight, a responsive grid system is used to maintain overall alignment, and a smart pagination algorithm is used to avoid key content being fragmented, thereby achieving precise personalized adaptation while maintaining the core framework of the template.
[0113] S140. Determination and verification of the optimal template: The optimized candidate templates are comprehensively evaluated using a weighted scoring function to select the optimal template.
[0114] First, a comprehensive evaluation function is constructed that includes template similarity, data matching degree, and format support degree. Template similarity is calculated based on feature vectors to ensure structural compatibility, data matching degree evaluates the degree of fit between template fields and metadata, and format support degree verifies the template's ability to accommodate special elements.
[0115] Next, appropriate weight coefficients are assigned to each dimension, and the comprehensive score of each candidate template is obtained through weighted calculation;
[0116] Then, a threshold screening mechanism is used to exclude templates whose scores in any dimension are below the minimum requirement.
[0117] Finally, the remaining candidate templates are sorted by their overall scores, the template with the highest score is selected as the target template, and its business rules are finally verified to ensure that it fully meets the archiving requirements.
[0118] Please refer to Figure 3 The diagram illustrates a flowchart of an exemplary method S200 for generating formatted documents from electronic archives, which aims to establish a sound data quality assurance system. Through multi-level data verification and anomaly handling mechanisms, it ensures the accuracy, integrity, and consistency of input data, providing a reliable metadata foundation for formatted document generation.
[0119] S210. Data integration and standardization: Integrate the basic metadata of documents to be archived with supplementary data provided by related business systems to build a unified data view; perform natural language processing and information extraction on unstructured data such as text descriptions and attachment content, and convert them into structured fields; use preset format standards to unify the processing of all data to ensure data consistency and processability.
[0120] S220. Rule validation and anomaly identification: Establish a multi-level validation rule base, then load the data facts into the rule engine, perform pattern matching with the rule base conditions, and trigger the corresponding validation logic;
[0121] The multi-level validation rule base includes a syntax layer, a semantic layer, and a cross-validation layer.
[0122] Syntax layer rules include basic format constraints such as field not null validation, data type validation, and value range validation; semantic layer rules include business consistency constraints such as logical relationship validation; and the cross-validation layer sets consistency requirements with authoritative data sources for key fields.
[0123] S230. Abnormal Data Handling and Correction: For abnormal data detected during verification, an automatic correction strategy is executed.
[0124] For missing fields, attempt to complete them from the association system;
[0125] For formatting errors, perform format conversion;
[0126] For logical anomalies, a manual review process will be triggered.
[0127] All corrected data must undergo secondary verification to ensure that it meets the archiving standards;
[0128] If the verification still fails, mark the document as abnormal and record the reason for the abnormality and the processing path.
[0129] S240. Output qualified metadata: After completing all verifications and corrections, output qualified metadata datasets and encapsulate them into standardized data packages for subsequent file generation modules to call; at the same time, generate a verification report to record the data source, processing process and verification results for easy auditing and traceability.
[0130] Please refer to Figure 4 The diagram illustrates a flowchart of an exemplary method S300 for generating formatted files from electronic archives, which aims to achieve efficient generation of formatted files through parallel processing and adaptive rendering techniques, improve processing performance while ensuring file quality, and ensure that the generated PDF / OFD files meet archiving standards.
[0131] S310. Parallel processing task decomposition: Based on the target template and qualified metadata, two independent execution threads are created: a data filling thread and a resource preprocessing thread. The producer-consumer pattern is used for task coordination. Inter-thread communication and load balancing are achieved through shared memory area and message queue. An efficient asynchronous processing pipeline is built to maximize the use of system resources and improve processing throughput.
[0132] S320. Data population and resource preprocessing: Thread 1 is responsible for populating qualified metadata according to the template field mapping relationship and performing intelligent dynamic typesetting calculation based on content features to generate an intermediate document containing complete content and layout information; Thread 2 preloads the rendering engine, font library, image resources, etc. required for format conversion in parallel to ensure the real-time availability of resources during conversion;
[0133] Content features include: text features, table features, image features, layout features, and structural features;
[0134] In the intelligent dynamic typesetting calculation method based on content features:
[0135] The text features dynamically calculate the optimal font size, line spacing, and paragraph spacing based on the available area size of the text box and the text length. It automatically adjusts the character spacing based on language features and automatically performs pagination and line break processing on long texts.
[0136] The table layout uses a flexible grid system that automatically calculates the table row height based on the number of data records and proportionally distributes column widths based on the maximum width of each column's content. It supports header repetition and content continuity when the table spans multiple pages.
[0137] Image features employ intelligent scaling technology, dynamically adjusting the display size while maintaining the original aspect ratio based on page layout constraints and image importance weights.
[0138] The layout features a responsive grid system that redistributes page space based on element importance weights and uses intelligent pagination algorithms to prevent key content from being fragmented, maintaining the overall visual balance and aesthetics of the layout.
[0139] S330. Layout file generation and post-processing: After the dual-threaded tasks are completed, an adaptive format conversion algorithm is called to generate layout files that conform to both PDF and OFD standards. During the generation process, content optimization is automatically performed, including font embedding, image compression, metadata cleaning, and other operations. Subsequently, the file is losslessly compressed to reduce storage size.
[0140] A method for generating PDF and OFD dual-standard format files using an adaptive format conversion algorithm:
[0141] It adopts a dual-path parallel rendering mechanism. For PDF format, it uses a PostScript-based vector graphics rendering pipeline to ensure the accuracy of print output and the accurate reproduction of text and graphics, and is compatible with PDF / A archiving standards. For OFD format, it uses an XML-based open layout description to support content reorganization and interactive functions, and complies with national layout document standards.
[0142] Font processing automatically detects and embeds missing fonts, performs font subset processing to include only the characters actually used in the document, and supports both TrueType and OpenType formats.
[0143] Image optimization: The system automatically selects the best compression algorithm based on output requirements. It uses JPEG2000 lossy compression for color images and CCITT Group4 lossless compression for black and white images.
[0144] Metadata management automatically generates standard-compliant document metadata, cleans up redundant and temporary metadata, and retains necessary business information and archiving identifiers;
[0145] Compression optimization employs a streaming compression algorithm to optimize the document structure and uses dictionary encoding to compress repetitive content. The final file size can be optimized to 30%-60% of the original size, maintaining a balance between file structure integrity and rendering performance.
[0146] S340. Quality Verification and Compatibility Testing: Performs comprehensive quality testing on the generated layout files, including format verification, content integrity, and rendering consistency checks; verifies file compatibility in various mainstream reading environments using automated testing tools to ensure that the files can be displayed correctly in various environments.
[0147] Please refer to Figure 5The diagram illustrates a flowchart of an exemplary method S400 for generating formatted electronic archives, which aims to utilize blockchain and distributed storage technologies to establish a secure and reliable electronic archive evidence preservation and storage system, ensuring the immutability, traceability, and long-term availability of the archives.
[0148] S410. File Hash Calculation and Evidence Preservation: Perform SHA-256 hash calculation on the generated format file to generate a unique digital fingerprint. Combine the file hash, generation timestamp, document number, archiving personnel and other information into an evidence preservation data package, and write it into the distributed ledger through the blockchain interface to complete tamper-proof evidence preservation. After successful evidence preservation, the system returns the evidence preservation number and blockchain transaction ID.
[0149] The formula for calculating the SHA-256 hash of the generated layout file is as follows:
[0150] ;
[0151] It is the first A vector consisting of eight 32-bit hash values before each message block is processed; It is the first A 512-bit message block; It is the core compression function of SHA-256, which uses bitwise operations, modulo addition, and predefined constants to compress message blocks. Information is mixed into the intermediate hash value middle; This is the total number of message blocks;
[0152] The final number in the formula The result of the second iteration That is, the calculated 256-bit (32-byte) hash value, which serves as the unique digital fingerprint of the layout file;
[0153] The formula summarizes the main process of the SHA-256 algorithm. Its one-wayness and collision resistance ensure the integrity of electronic records and provide a reliable data foundation for blockchain-based tamper-proof evidence storage.
[0154] S420. The layout file body and metadata index are separated. A distributed file storage architecture is adopted to store the layout file body and metadata index separately. The layout file body is stored in a highly available object storage system, while the index file is stored in a high-performance database, which includes retrieval fields such as file path, evidence information, keywords, and archiving time.
[0155] S430. Security access control and access logs implement role-based access control (RBAC) on stored electronic files to ensure that only authorized users can access or download files. All access behaviors are recorded in the audit log, including access time, user identity, operation type, etc., supporting security auditing and behavior tracing.
[0156] S440 offers fast retrieval and lifecycle management, providing multi-dimensional retrieval interfaces and supporting combined queries based on document number, time range, business type, keywords, and other conditions; it also supports file version management and lifecycle control, automatically executing file archiving, migration, or destruction operations according to archiving strategies.
[0157] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for managing electronic archives of business document generation format files, characterized in that, Includes the following steps: Collect scenario features of business documents to be archived to construct multi-dimensional feature vectors, filter candidate templates from the template pool through similarity matching, and dynamically adjust the structure in combination with data integrity and format requirements to determine a unique target template; Integrate basic metadata of documents with supplementary data from related systems, verify the validity of data through rule-based validation and cross-validation, and output qualified metadata; Based on the target template and qualified metadata, a dual-thread asynchronous processing mechanism is adopted to generate PDF / OFD format files through an adaptive algorithm; The hash value of the layout document is calculated, and the hash, timestamp, and document number are written into the blockchain. Through a distributed architecture that separates the layout document body from the metadata, secure storage and rapid retrieval of electronic archives are achieved.
2. The electronic document management method for generating formatted business documents according to claim 1, characterized in that, The steps for determining the unique target template include: Collect multi-dimensional scenario features from business documents to be archived, and construct a numerical multi-dimensional feature vector based on these features; The multidimensional scene features include: Multidimensional scenario features include business type, data field composition, and industry compliance requirements. Among them, business type features are encoded through a predefined classification system, converting the textual description of business type into a discrete numerical representation; field structure features are constructed by analyzing the actual set of fields contained in the document to accurately describe the data composition of the document; and compliance requirement features extract relevant format constraints from industry standards and convert them into quantifiable compliance vectors. After obtaining the multi-dimensional feature vectors, the similarity between the document to be archived and each template in the preset template library is calculated; finally, a comprehensive similarity score is obtained through weighted fusion, and all templates are sorted from high to low according to the comprehensive similarity score, and the templates at the top of the sort are selected as the candidate set. After obtaining the candidate template, a three-level linkage adjustment mechanism is executed based on the characteristics of the document data; The three-level linkage adjustment mechanism includes: First, optimize the field-level structure by scanning the metadata population status, automatically hiding empty value fields and dynamically collapsing low-frequency fields, while adaptively adjusting the text box size according to the text length. Then, the table is dynamically restructured, automatically calculating the number of rows and optimizing column width allocation based on the number of data records to ensure that the table content is presented completely and the layout is reasonable. Finally, global layout adaptation is performed, page space is redistributed based on element importance weight, a responsive grid system is used to maintain overall alignment, and a smart pagination algorithm is used to avoid key content being fragmented, thereby achieving precise personalized adaptation while maintaining the core framework of the template. The optimized candidate templates are comprehensively evaluated using a weighted scoring function, and the optimal template is selected.
3. The electronic document management method for generating formatted business documents according to claim 2, characterized in that, The method for calculating the similarity between the document to be archived and each template in the preset template library is as follows: The similarity is achieved using a multi-level similarity matching algorithm, which includes basic feature similarity calculation and field structure similarity calculation. Basic feature similarity mainly measures the closeness between the document and the template in the overall feature space, while field structure similarity focuses on the matching of the two in terms of field composition. Among them, basic feature similarity The formula is expressed as: ; Represents the multi-dimensional feature vector of the business document to be archived; Indicates the first in the template pool Multi-dimensional feature vectors of templates; basic feature similarity The value represents the similarity between the document and the template in terms of overall business scenario characteristics; Field structure similarity : ; A field existence vector representing a document to be archived; Indicates the first The existence vector of fields defined or required by the template; Indicates the size of the intersection between the document and the template field vector; This represents the size of the union of the document's and the template's field vectors; field structure similarity. Pay special attention to the degree of matching between the documents and the template in terms of field composition structure; Overall similarity : ; These are the weighting coefficients.
4. The electronic document management method for generating formatted business documents according to claim 2, characterized in that, The method of comprehensively evaluating the optimized candidate templates using a weighted scoring function and selecting the optimal template is as follows: First, a comprehensive evaluation function is constructed that includes template similarity, data matching degree, and format support degree. Template similarity is calculated based on feature vectors to ensure structural compatibility, data matching degree evaluates the degree of fit between template fields and metadata, and format support degree verifies the template's ability to accommodate special elements. Next, appropriate weight coefficients are assigned to each dimension, and the comprehensive score of each candidate template is obtained through weighted calculation; Then, a threshold screening mechanism is used to exclude templates whose scores in any dimension are below the minimum requirement. Finally, the remaining candidate templates are sorted by their overall scores, the template with the highest score is selected as the target template, and its business rules are finally verified to ensure that it fully meets the archiving requirements.
5. The electronic document management method for generating formatted business documents according to claim 1, characterized in that, The steps for outputting qualified metadata include: Integrate the basic metadata of documents to be archived with supplementary data provided by related business systems to build a unified data view; perform natural language processing and information extraction on unstructured data to convert it into structured fields; and use preset format standards to unify the processing of all data to ensure data consistency and processability. Establish a multi-level validation rule base, then load the data facts into the rule engine, perform pattern matching with the rule base conditions, and trigger the corresponding validation logic; The multi-level validation rule base includes a syntax layer, a semantic layer, and a cross-validation layer; Syntax layer rules include basic format constraints such as field not null validation, data type validation, and value range validation; semantic layer rules include logical relationship validation and business consistency constraints; cross-validation layer sets consistency requirements with authoritative data sources for key fields; The verification logic includes: For missing fields, attempt to complete them from the association system; For formatting errors, perform a format conversion; For logical anomalies, a manual review process will be triggered. All corrected data must undergo secondary verification to ensure that it meets the archiving standards; If the verification still fails, mark the document as abnormal and record the reason for the abnormality and the processing path. For abnormal data detected during verification, an automatic correction strategy is executed; After completing all verifications and corrections, a qualified metadata dataset is output and packaged into a standardized data package for use by the subsequent file generation module. At the same time, a verification report is generated, recording the data source, processing procedure and verification results for easy auditing and traceability.
6. The electronic document management method for generating formatted business documents according to claim 1, characterized in that, The steps for generating PDF / OFD format files using a dual-thread asynchronous processing mechanism and an adaptive algorithm include: Based on the target template and qualified metadata, two independent execution threads are created: a data population thread and a resource preprocessing thread. The producer-consumer pattern is used for task coordination, and inter-thread communication and load balancing are achieved through shared memory areas and message queues. This builds an efficient asynchronous processing pipeline and maximizes the use of system resources to improve processing throughput. Thread 1 is responsible for filling qualified metadata according to the template field mapping relationship and performing intelligent dynamic typesetting calculation based on content features to generate an intermediate document containing complete content and layout information; Thread 2 preloads the rendering engine, font library and image resources required for format conversion in parallel to ensure the real-time availability of resources during conversion; content features include text features, table features, image features, layout features and structural features; After the dual-threaded tasks are completed, an adaptive format conversion algorithm is called to generate a layout file that conforms to both PDF and OFD standards. During the generation process, content optimization is automatically performed, including font embedding, image compression, and metadata cleaning. Subsequently, the file is losslessly compressed to reduce storage size. Perform comprehensive quality checks on the generated layout files, including format verification, content integrity, and rendering consistency checks; verify file compatibility in various mainstream reading environments using automated testing tools to ensure that the files can be displayed correctly in various environments.
7. The electronic document management method for generating formatted business documents according to claim 6, characterized in that, In the content-feature-based intelligent dynamic typesetting calculation method: The text features dynamically calculate the optimal font size, line spacing, and paragraph spacing based on the available area size of the text box and the text length. It automatically adjusts the character spacing based on language features and automatically performs pagination and line break processing on long texts. The table layout uses a flexible grid system that automatically calculates the table row height based on the number of data records and proportionally distributes column widths based on the maximum width of each column's content. It supports header repetition and content continuity when the table spans multiple pages. Image features employ intelligent scaling technology, dynamically adjusting the display size while maintaining the original aspect ratio based on page layout constraints and image importance weights. The layout features a responsive grid system that redistributes page space based on element importance weights and uses intelligent pagination algorithms to prevent key content from being fragmented, maintaining the overall visual balance and aesthetics of the layout.
8. The electronic document management method for generating formatted business documents according to claim 7, characterized in that, The method for generating PDF and OFD dual-standard format files by calling an adaptive format conversion algorithm: For PDF format, a PostScript-based vector graphics rendering pipeline is used to ensure the accuracy of printed output and the accurate reproduction of text and graphics, and to be compatible with PDF / A archiving standards. For OFD format, an XML-based open layout description is used to support content reorganization and interactive functions, and to comply with national layout document standards. Automatically detects and embeds missing fonts, performs font subset processing to include only the characters actually used in the document, and supports both TrueType and OpenType formats; The optimal compression algorithm is automatically selected based on the output requirements. JPEG2000 lossy compression is used for color images, and CCITT Group4 lossless compression is used for black and white images. Automatically generate standard-compliant document metadata, clean up redundant and temporary metadata, and retain necessary business information and archiving identifiers; The document structure is optimized using a streaming compression algorithm, and duplicate content is compressed using dictionary encoding to maintain a balance between file structure integrity and rendering performance.
9. The electronic document management method for generating formatted business documents according to claim 1, characterized in that, The method for calculating the hash value of the format file and writing the hash, timestamp, and document number into the blockchain includes: The generated layout file is hashed using SHA-256 to generate a unique digital fingerprint. The file hash, generation timestamp, document number, and archiving personnel information are combined into a data package for evidence storage. This data package is then written into the distributed ledger via a blockchain interface to complete tamper-proof evidence storage. After successful evidence storage, the system returns the evidence storage number and the blockchain transaction ID. The formula for calculating the SHA-256 hash of the generated layout file is as follows: ; It is the first A vector consisting of eight 32-bit hash values before each message block is processed; It is the first A 512-bit message block; It is the core compression function of SHA-256, which uses bitwise operations, modulo addition, and predefined constants to compress message blocks. Information is mixed into the intermediate hash value middle; This is the total number of message blocks; The final number in the formula The result of the second iteration This is the calculated 256-bit hash value, which serves as the unique digital fingerprint of the layout file.
10. The electronic document management method for generating formatted business documents according to claim 1, characterized in that, The method for achieving secure storage and rapid retrieval of electronic archives through a distributed architecture that separates the main body of the layout document from its metadata includes: A distributed file storage architecture is adopted to separate the layout file body from the metadata index. The layout file body is stored in a highly available object storage system, while the index file is stored in a high-performance database, which includes file path, evidence information, keywords, and archive time retrieval fields. Implement role-based access control for stored electronic files to ensure that only authorized users can access or download files. All access behaviors are recorded in the audit log, including access time, user identity, and operation type, supporting security auditing and behavior tracing. It provides a multi-dimensional search interface, supporting combined queries by document number, time range, business type, and keyword conditions; it supports document version management and lifecycle control, automatically executing document archiving, migration, or destruction operations according to archiving policies.
Citation Information
Cited By
Meteorological archive filing system and method
CN122220306A