Document generation method and system based on template customization of GJB system
Through the template customization method and system based on the GJB system, the problems of document generation in the existing technology that does not comply with specifications, single data source format and high maintenance costs are solved, and the consistency and accuracy of multi-data source support, logical operations and document generation are achieved.
Patent Information
- Application Number
- CN202411697307.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-03-18
AI Technical Summary
It is difficult for the existing technology to generate documents that comply with the GJB system specifications, and the supported data source format is single, so it cannot support the generation of system files from multiple data sources, the maintenance cost is high, and the generation of documents is not flexible enough.
Provide a template customization method and system based on GJB system. By creating a template containing static content and template tags, the system parses the template and establishes a mapping relationship between the data source and the template tags, supports multiple data sources and logical operations, and generates documents that comply with the OOXML standard.
Improves the diversity of the data source formats supported by the document generation tool, reduces maintenance time when template changes, improves the flexibility of document generation, and ensures the consistency and accuracy of document generation.
Smart Images

Figure CN119647437A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of control software research and development, and in particular to a document generation method and system based on template customization of a GJB system. Background Art
[0002] The generation format of the National Military Standard (GJB) system documents needs to follow strict specifications and standards to ensure the consistency, accuracy and traceability of the documents. In the business systems of many military enterprises, there is a demand to output system documents according to the GJB system document template. Enterprises usually develop their own document generation tools, which often takes a lot of time, and the supported data source format is single, and it is impossible to support multiple data sources to generate system files; most of them use fixed placeholders, and once the system file template is changed, the maintenance cost is high; the data and template placeholders are simply replaced, logical operations are not supported, and the generated documents are not flexible enough; therefore, a flexible and universal system document generation solution is urgently needed. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to provide a document generation method and system based on template customization of the GJB system.
[0004] Technical solution: The document generation method based on the template customization of the GJB system described in the present invention comprises the following steps:
[0005] (1) New model version: The user creates a system file template, which consists of two parts: static content part and template tag;
[0006] (2) Design the static part: The static content part is regular word text;
[0007] (3) Insert dynamic tags: Dynamic tags are label-style texts;
[0008] (4) Upload template: The user uploads the file template to the system, and the system parses the template file to complete the storage of the document template;
[0009] (5) Configuring mapping relationships: Users construct mapping relationships between data sources and template tags in the system;
[0010] (6) Export document: The user selects a template file, clicks Export document and uploads the local data source.
[0011] Furthermore, the step (1) describes the framework, style and layout information of the system file through the static content part and template tags.
[0012] Furthermore, the static content of step (2) includes text objects, table objects, picture objects and formula objects.
[0013] Furthermore, the label format of the label text in step (3) is a symbol enclosed by double curly brackets plus an English character string.
[0014] Furthermore, the step (4) includes operations of removing, adding, deleting and modifying the templates that have been stored in the warehouse.
[0015] Furthermore, the step (5) comprises the following steps:
[0016] (5.1) Select a template file, and all template tags in the template will be displayed on the system interface;
[0017] (5.2) Select a template tag and configure the data source of the template tag;
[0018] (5.3) Configure the mapping relationship between the template tag sub-attributes and the data source fields, and save the mapping relationship;
[0019] (5.4) Repeat steps (5.1) to (5.3) until all tags are configured.
[0020] Furthermore, the data sources of step (5.2) are Http requests, databases and local files.
[0021] Furthermore, the data source formats of step (5.2) include plain document, XML, JSON and Excel.
[0022] Furthermore, the step (6) comprises the following steps:
[0023] (6.1) The system data supply template obtains data from multiple data sources and establishes a unified formatted data structure;
[0024] (6.2) The system rendering module matches and renders the template tag and data according to the mapping relationship;
[0025] (6.3) Finally, combine the dynamic content and the static part, reconstruct the OOXML standard structure, and export the generated document.
[0026] The template customized document generation system based on the GJB system described in the present invention includes a concurrent request module, a template configuration management module, a template document management module and a result document management module. The user request enters the result document management module after being processed by the template configuration management module and the template configuration management module, and finally exports the generated result document. The template configuration management module includes a data source configuration module and a data source mapping module; the template document management module includes template storage, template storage, template update, template deletion and template query; the result document management module includes a template parsing module, a document rendering module, a data supply module and a document generation module.
[0027] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: the present invention improves the diversity of data source formats supported by system document generation tools; maintains the mapping relationship between data sources and template tags through a visual interface, reducing the time for tool maintenance when the template is changed; improves the flexibility of system document generation by integrating data supply templates into formatted data structures; ensures the consistency and accuracy of document generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flow chart of a document generation method customized for a template of the present invention;
[0029] Figure 2 A structural diagram of a document generation system customized for the template of the present invention. DETAILED DESCRIPTION
[0030] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0031] like Figure 2 As shown, the document generation technology of the system of the present invention adopts a template-driven mode. The user uses a tagged text to build a template document according to the rules of the template document. The tag supports the use of SpringEL expressions and logical operators, allowing the user to implement complex logical control. Then the template file is uploaded to the system. The template parsing module in the system parses the template file into two parts: a fixed content part and a template tag part. The fixed content includes the style, layout, static content, etc. of the document. The user establishes a mapping relationship between the template tag and the data source in the system visualization interface. The supported data sources include: plain text, XML, JSON, BD, etc. The data supply module obtains data from multiple data sources and establishes a unified formatted data structure to classify each type of data, providing a data basis for document generation query to quickly obtain data. The document rendering module renders the dynamic content in the document in combination with the tags in the document, and matches and renders the template tags with the data according to the mapping relationship. Finally, the dynamic content and the static part are combined, the OOXML standard structure is reconstructed, and the generated document is exported.
[0032] like Figure 1 As shown, the document generation method based on template customization of the GJB system of the present invention comprises the following specific steps:
[0033] (1) The user creates a system file template. The system file template consists of two parts: the static content part and the template tag, which is used to describe the framework, style, layout and other information of the system file.
[0034] (1.1) The static content part is regular word text, including: text objects, table objects, picture objects and formula objects, etc.
[0035] (1.2) Template tags are tagged texts. The tag format is usually a symbol enclosed in double curly braces plus an English string, for example {{#Info.name}}, where the symbol "#" represents the type of the tag rendering, "Info" represents the name of the tag, and the "." after "name" is the sub-attribute of the tag.
[0036] (2) Design the static part: The static content part is regular word text;
[0037] (3) Insert dynamic tags: Dynamic tags are label-style texts;
[0038] (4) The user uploads the document template to the system, and the system parses the template file and completes the storage of the document template. The user can remove, add, delete, and modify the template that has been stored.
[0039] (5) The user constructs a mapping relationship between data sources and template tags in the system.
[0040] (5.1) Select a template file and all template tags in the template will be displayed on the system interface.
[0041] (5.2) Select a template tag and configure the data source of the template tag. The data source can be Http request, database, local file, etc. The data source can accept formats including: plain document, XML, JSON, Excel, etc.
[0042] (5.3) Configure the mapping relationship between template tag sub-attributes and data source fields, and save the mapping relationship
[0043] (5.4) Repeat steps (5.1) to (5.3) until all tags are configured.
[0044] (6) The user selects a template file, clicks Export Document, and uploads the local data source (if any).
[0045] (6.1) The system data supply template obtains data from multiple data sources and establishes a unified formatted data structure.
[0046] (6.2) The system rendering module matches and renders the template tags and data according to the mapping relationship.
[0047] (6.3) Finally, combine the dynamic content and the static part, reconstruct the OOXML standard structure, and export the generated document.
Claims
1. A document generation method based on template customization of GJB system, characterized in that: The steps include: (1) New model version: The user creates a system file template, which consists of two parts: static content part and template tag; (2) Design the static part: The static content part is regular word text; (3) Insert dynamic tags: Dynamic tags are label-style texts; (4) Upload template: The user uploads the file template to the system, and the system parses the template file to complete the storage of the document template; (5) Configuring mapping relationships: Users construct mapping relationships between data sources and template tags in the system; (6) Export document: The user selects a template file, clicks Export document and uploads the local data source.
2. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The step (1) describes the framework, style and layout information of the system file through the static content part and template tags.
3. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The static content of step (2) includes text objects, table objects, picture objects and formula objects.
4. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The label format of the label text in step (3) is a symbol enclosed by double curly brackets plus an English character string.
5. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The step (4) includes removing, adding, deleting and modifying the templates that have been stored in the warehouse.
6. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The step (5) comprises the following steps: (5.1) Select a template file, and all template tags in the template will be displayed on the system interface; (5.2) Select a template tag and configure the data source of the template tag; (5.3) Configure the mapping relationship between the template tag sub-attributes and the data source fields, and save the mapping relationship; (5.4) Repeat steps (5.1) to (5.3) until all tags are configured.
7. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The data sources of step (5.2) are Http requests, databases and local files.
8. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The data source formats of step (5.2) include plain document, XML, JSON and Excel.
9. The document generation method based on template customization of the GJB system according to claim 1, characterized in that: The step (6) comprises the following steps: (6.1) The system data supply template obtains data from multiple data sources and establishes a unified formatted data structure; (6.2) The system rendering module matches and renders the template tag and data according to the mapping relationship; (6.3) Finally, combine the dynamic content and the static part, reconstruct the OOXML standard structure, and export the generated document.
10. A template-customized document generation system based on the GJB system, characterized in that: It includes a concurrent request module, a template configuration management module, a template document management module and a result document management module. The user request is processed by the template configuration management module and the template configuration management module and then enters the result document management module, and finally the generated result document is exported. The template configuration management module includes a data source configuration module and a data source mapping module; The template document management module includes template storage, template retrieval, template update, template deletion and template query; the result document management module includes template parsing module, document rendering module, data supply module and document generation module.