An intelligent document generation system and its control method

By employing a dynamic template engine, intelligent content generation, and adaptive format optimization modules, the system solves the problems of dynamic adjustment and format optimization in document generation in existing technologies, thereby achieving automated and efficient output of the intelligent document generation system.

CN120781990BActive Publication Date: 2025-11-14ZHOUPU DATA TECH NANJING CO LTD

Patent Information

Application Number
CN202511272802.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-11-14
Estimated Expiration
2045-09-08

AI Technical Summary

Technical Problem

Existing document generation technologies cannot dynamically adjust document content, suffer from pain points such as monotonous format, data redundancy, and manual adjustments, cannot generate natural language descriptions or dynamic charts, and lack semantic understanding capabilities.

Method used

The system employs a dynamic template engine module to parse input data, combined with an intelligent content generation module to generate natural language text based on a pre-trained language model and embed charts, an adaptive format optimization module to dynamically adjust document content and order, and an automatic detection module to fix formatting errors.

Benefits of technology

It achieves dynamic adaptation and format optimization of document content, reduces manual intervention, generates text and charts that conform to context, and outputs standard format documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120781990B_ABST
    Figure CN120781990B_ABST
Patent Text Reader

Abstract

This invention provides an intelligent document generation system and its control method, characterized in that: the system includes: a dynamic template engine module; an intelligent content generation module; an adaptive format optimization module; and an automatic detection module; the dynamic template engine module determines logical branches through XML tags in a dynamic template language, which can overcome the limitations of traditional placeholder replacement, decouple document structure and data, and adapt different logical branches according to different data, effectively improving the adaptability of data dimensions; the intelligent content generation module can combine a pre-trained model to generate coherent natural language text descriptions, and dynamically render charts on this basis, embedding icons into the text in the form of vector graphics, realizing the collaborative generation of text and charts, and reducing the cost of manual writing, drawing and typesetting by collaboratively generating text and charts that conform to the context.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent document generation technology, and specifically to an intelligent document generation system and its control method. Background Technology

[0002] With the development of natural language and AI technologies, the original document export method based on fixed templates can no longer meet the business needs of multiple scenarios.

[0003] Existing document generation technologies mainly rely on the following two types of methods, but both have significant drawbacks:

[0004] One approach is based on static template population techniques, such as Apache POI and Docx4j, where:

[0005] Apache POI is a free, open-source, cross-platform Java application programming interface written in Java. It provides Java programs with an application programming interface to read and write Microsoft Office format documents.

[0006] Docx4j is an open-source library developed in Java for creating and manipulating Microsoft Open XML format files. It supports programmatic operations and template-based dynamic data editing, enabling document processing without the need for a Microsoft Office environment.

[0007] They use fixed placeholders (such as ${name}) to replace data, and cannot dynamically adjust the document content (such as the number of table columns and chapter order) according to the structure of the input data. When the data contains variable-length data items, the maximum number of columns must be set in the template in advance, which can easily lead to blank redundancy or data truncation. At the same time, they only support static data filling and do not solve the problems of dynamic content expansion and format self-adaptation.

[0008] Another approach is to use rule-driven automated generation technology, which relies on predefined rules to generate content. It lacks semantic understanding capabilities and cannot generate natural language descriptions or dynamic charts. This can lead to problems such as abnormal pagination after inserting images and discontinuous numbering of multi-level headings, thus requiring manual adjustments.

[0009] In addition, existing document generation technologies suffer from a lack of variety in format; they focus only on text generation and do not address dynamic table and chart rendering or layout optimization.

[0010] Therefore, a new solution is urgently needed to address the defects and shortcomings of the existing technologies. Summary of the Invention

[0011] To address the shortcomings and deficiencies in existing technologies, this invention provides an intelligent document generation system and its control method.

[0012] The specific solution provided by this invention is as follows:

[0013] An intelligent document generation system, characterized in that: the system comprises:

[0014] The dynamic template engine module parses the input data, judges and determines the dynamic variable blocks and irrelevant content blocks of the input data according to the logical branches, and performs corresponding processing on the block content according to the different blocks.

[0015] The intelligent content generation module is based on a pre-trained language model and combines the context to generate coherent natural language text from the input data. At the same time, it automatically selects the corresponding chart type according to the numerical type in the input data, generates vector graphics from the selected chart, and then embeds the generated vector graphics into the text to form a document.

[0016] An adaptive format optimization module is provided, which uses a priority weighting algorithm to calculate the document content weight and dynamically adjusts the document content and order according to the document content weight.

[0017] An automatic detection module uses computer vision to detect and determine whether there are errors in the document format. Once the document format is confirmed to be correct, the final document is output.

[0018] Furthermore, the present invention also provides a control method for an intelligent document generation system, characterized by comprising the following steps:

[0019] S100: The dynamic template engine module parses the input data, judges and determines the dynamic variable blocks and irrelevant content blocks of the input data according to the logical branches, and processes the block content accordingly based on the different blocks;

[0020] S200: The intelligent content generation module generates coherent natural language text based on a pre-trained language model and in combination with context. At the same time, it automatically selects the corresponding chart type according to the numerical type in the input data, generates vector graphics from the selected chart, and then embeds the generated vector graphics into the text to form a document.

[0021] S300: The adaptive format optimization module uses a priority weighting algorithm to calculate the document content weight and dynamically adjusts the document content and order according to the document content weight.

[0022] S400: The automatic detection module uses computer vision to detect and determine whether there are errors in the document format. After confirming that the document format is correct, it outputs the final document.

[0023] As a further preferred embodiment of the present invention, step S100 includes the following steps:

[0024] S101: Validate the input data;

[0025] S102: Parse the field parameters of the input data;

[0026] S103: Traverse the logical nodes of the dynamic language template, determine and activate the logical branch that adapts the field parameters;

[0027] S104: Determine and identify the dynamic variable blocks and irrelevant content blocks of the input data based on the logical branches;

[0028] S105: Process the block content according to the different blocks.

[0029] As a further preferred embodiment of the present invention, step S101, which validates the input data using JSON Schema, includes the following steps:

[0030] S1011: Predefined JSON Schema rule file;

[0031] S1012: Parse the input data and iterate through all fields;

[0032] S1013: The JSON Schema is used to sequentially validate the existence, integrity, data type, value range, and structure of the fields in the input data. If all validations are successful, proceed to the next step; if any validation fails, an error message is displayed and the process is terminated.

[0033] In step S103, determining and activating the logical branch for the adapted field parameters through the XML tags in the dynamic language template includes the following steps:

[0034] S1031: Parse the fixed characters contained in the XML tags, determine whether there are fixed characters in the adaptation field parameters, and if so, select the logical branch corresponding to the fixed character and proceed to the next step;

[0035] S1032: Parse the determination condition of the fixed character, determine whether the attribute value of the adapted field parameter meets the determination condition of the fixed character, and if it does, select the logical branch corresponding to the determination condition and proceed to the next step.

[0036] S1033: Parse fixed values ​​in a dynamic table to obtain the data value type beneficiary object that matches the field parameter;

[0037] S1034: Parse the fixed column and obtain the data value of the adapted field parameter.

[0038] As a further preferred embodiment of the present invention, in step S105,

[0039] Dynamically adjust the format parameters of the content of dynamically variable blocks;

[0040] Hide irrelevant content blocks.

[0041] As a further preferred embodiment of the present invention, in step S200,

[0042] When the intelligent content generation module generates coherent natural language text from input data based on a pre-trained language model and in conjunction with context, it includes the following steps:

[0043] S201: Construct input data prompts;

[0044] S202: Invoke the pre-trained language model;

[0045] S203: Parse the input data and generate coherent natural language text based on the input data and context.

[0046] The numerical data types include at least time-series data, categorical comparison data, and proportional distribution data, and the corresponding chart types include at least line charts, bar charts, and pie charts.

[0047] As a further preferred embodiment of the present invention, step S200, when embedding the generated vector graphic into text and forming a document, includes the following steps:

[0048] S204: Convert vector graphics format: Convert SVG strings in vector graphics to PNG byte arrays;

[0049] S205: Determine the vector graphic insertion position: Automatically match and determine the vector graphic insertion position and image size based on the natural language text generated by the pre-trained language model;

[0050] S206: Insert a vector graphic at a defined insertion position and at a defined image size.

[0051] In a further preferred embodiment of the present invention, in step S300, the weight W of the document content is calculated according to the following formula:

[0052] W = α × Q1 + β × Q2 + γ × Q3

[0053] in,

[0054] Q1 is the content type weight value, which is set to different values ​​depending on the document content;

[0055] Q2 is the correlation weight value, representing the strength of the correlation between elements;

[0056] Q3 is the page adaptation weight value, representing the degree of matching of the remaining space of the current page;

[0057] α represents the weighting coefficient of the content type weight value;

[0058] β represents the weighting coefficient of the correlation weight value;

[0059] γ represents the weight coefficient of the page adaptation weight value.

[0060] As a further preferred embodiment of the present invention, step S300, when dynamically adjusting the document content and order, includes the following steps:

[0061] S301: Traverse all content in the document, dynamically calculate the weight of the document content based on the formula, calculate the document content weight, and determine the document content priority based on the weight;

[0062] S302: Dynamically adjust document order and pagination according to the following principles:

[0063] A1) High-weight content should be placed on the current page with priority;

[0064] A2) Place the chart and its description text on the same page;

[0065] A3) Check the remaining space on the current page; if insufficient, automatically paginate.

[0066] S303: Optimize document formatting, including:

[0067] B1) Smart Pagination Correction: When a chart has high weight but insufficient remaining space, insert a page break and adjust the order of subsequent content;

[0068] B2) Heading hierarchy repair: Renumber headings based on document content weight.

[0069] As a further preferred embodiment of the present invention, step S400, after determining that there is an error in the document format, includes the following steps:

[0070] S401: Determine the document formatting error type;

[0071] S402: Match the identified document formatting error type with the pre-stored error patterns;

[0072] S403: Based on the matching results, automatically repair and adjust document format errors using pre-stored error style repair rules;

[0073] S404: Use computer vision again to detect and determine if there are any errors in the document format. If there are still errors, return to step S401. If the document format is determined to be correct, output the final document.

[0074] Compared with existing technologies, the technical effects that this invention can achieve include:

[0075] 1) This invention provides an intelligent document generation system and its control method, which is equipped with a dynamic template engine module. The logical branches are determined by XML tags in the dynamic template language, which can overcome the limitations of traditional placeholder replacement. While decoupling the document structure and data, it can adapt different logical branches according to different data, effectively improving the data dimension of adaptation.

[0076] 2) This invention provides an intelligent document generation system and its control method, which is equipped with an intelligent content generation module that can combine a pre-trained model to generate coherent natural language text descriptions and dynamically render charts on this basis. The charts are embedded in the text in the form of vector graphics, realizing the collaborative generation of text and charts. By collaboratively generating text and charts that conform to the context, the cost of manual writing, drawing and typesetting is reduced.

[0077] 3) This invention provides an intelligent document generation system and its control method, which is equipped with an adaptive format optimization module that can dynamically adjust the document content and order. Based on this, it can realize intelligent pagination and title style correction (such as title level repair), solving the pain point of manual adjustment in traditional technology. It achieves full-process automation from content generation to final typesetting and outputs standard format documents that can be used directly. Attached Figure Description

[0078] Figure 1 The figure shown is a comparison chart of the effects of the generation system provided by the present invention and the prior art.

[0079] Figure 2 The diagram shown is a logical structure diagram of the generation system provided by the present invention.

[0080] Figure 3 The diagram shows the steps of the control method provided by the present invention. Detailed Implementation

[0081] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0082] In the description of this invention, it should be noted that the terms "upper," "lower," "inner," "outer," "front end," "rear end," "both ends," "one end," and "the other end," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing this invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0083] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installed," "equipped with," "connected," etc., should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0084] [First Embodiment]

[0085] like Figure 2 The first embodiment of the present invention provides an intelligent document generation system, the system comprising:

[0086] The dynamic template engine module parses the input data, determines the dynamic variable blocks and irrelevant content blocks of the input data based on logical branches, and processes the content of the blocks accordingly. By setting up the dynamic template engine module, logical branches can be determined through XML tags in the dynamic template language, which can overcome the limitations of traditional placeholder replacement. While decoupling the document structure and data, it can adapt different logical branches according to different data, effectively improving the data dimensionality of adaptation.

[0087] The intelligent content generation module, based on a pre-trained language model and combined with context, generates coherent natural language text from input data. Simultaneously, it automatically selects the corresponding chart type based on the numerical data, generates vector graphics from the selected chart, and then embeds the vector graphics into the text to form a document. By incorporating this intelligent content generation module, coherent natural language text descriptions can be generated using a pre-trained model, and charts can be dynamically rendered on this basis. Charts are embedded into the text as vector graphics, achieving collaborative generation of text and charts. This collaborative generation of context-appropriate text and charts reduces the cost of manual writing, drawing, and typesetting.

[0088] The adaptive format optimization module uses a priority weighting algorithm to calculate the weight of document content and dynamically adjusts the document content and order according to the weight of the document content. With the adaptive format optimization module, the document content and order can be dynamically adjusted. On this basis, intelligent pagination and title style correction (such as title level repair) can be realized, solving the pain point of manual adjustment in traditional technology. The entire process from content generation to final typesetting is automated, and the output is a standard format document that can be used directly.

[0089] The automatic detection module uses computer vision to detect and determine whether there are any errors in the document format. Once the document format is confirmed to be correct, the final document is output. By setting up the automatic detection module, the automatic detection and automatic repair process of the generated document format can be realized, so as to further ensure that the format of the final output document meets the preset requirements.

[0090] like Figure 1 The figure shown is a comparison chart of the effects of the generation system provided by the present invention and the prior art.

[0091] [Second Embodiment]

[0092] like Figure 3 The diagram illustrates a control method for the intelligent document generation system mentioned in the first embodiment, provided by a second embodiment of the present invention, comprising the following steps:

[0093] S100: The dynamic template engine module parses the input data, judges and determines the dynamic variable blocks and irrelevant content blocks of the input data according to the logical branches, and processes the block content accordingly based on the different blocks;

[0094] Step S100 includes the following steps:

[0095] S101: Validate the input data using JSON Schema to ensure its integrity and accuracy; this includes the following steps:

[0096] S1011: Predefined JSON Schema rule files. For example, the rule file can require the data field to be an object type:object, and predefine required attributes including "required", "user", "vip_benefits", etc.

[0097] S1012: Parse the input data and iterate through all fields;

[0098] S1013: The JSON Schema is used to sequentially validate the existence, integrity, data type (e.g., string, number, array, etc.), value range (e.g., numeric range, enumeration value, etc.), and structure (e.g., nested object level, etc.) of the fields in the input data. If all validations are successful, proceed to the next step; if any validation fails, an error message (e.g., "error: field 'value' must be number") is displayed and the process is terminated.

[0099] S102: Parse the field parameters of the input data; the field parameters in this embodiment include at least the hierarchical structure and type of the fields, so as to improve the accuracy and effectiveness of the logical branches of the subsequently determined adaptive field parameters.

[0100] S103: Traverse the logical nodes of the dynamic language template, determine and activate the logical branch for the adapted field parameters; In this embodiment, the logical branch is determined by the XML tags in the dynamic language template to overcome the limitations of traditional placeholder replacement. While achieving decoupling of document structure and data, different logical branches can be adapted according to different data, effectively improving the dimension of adapted data; including the following steps:

[0101] S1031: Parse the fixed characters contained in the XML tag, determine whether the fixed character exists in the adaptation field parameter, and if so, select the logical branch corresponding to the fixed character and proceed to the next step; for example, if the fixed character contained in the XML tag is "Section", then for the adaptation field parameter... <section if=""user.type" =="‘VIP’”">If a fixed character section exists, select the logical branch corresponding to that fixed character (if="user.type =='VIP'", i.e., determine whether the user attribute is a VIP user) and proceed to the next step;

[0102] S1032: Parse the fixed character judgment condition (if="user.type =='VIP'", i.e., determine whether the user attribute is a VIP user), determine whether the attribute value of the adapted field parameter meets the fixed character judgment condition, if it does, select the logical branch corresponding to the judgment condition (e.g., return true result) and proceed to the next step;

[0103] S1033: Parse the fixed value DynamicTable of the dynamic table and obtain the data value of the data type beneficiary object vip_benefits for the adapted field parameters;

[0104] S1034: Parse the fixed column to obtain the data value of the corresponding field parameter.

[0105] The code example is as follows:

[0106] XML tags:

[0107] <section if="user.type == 'VIP'">

[0108] <title> VIP Benefits Description< / title>

[0109] <dynamictable data="vip_benefits" columns="auto">

[0110] <column name="权益名称" bind="benefit.name" / >

[0111] <column name="有效期" bind="benefit.expiry_date" format="date:yyyy-MM-dd" / >

[0112] < / dynamictable>

[0113] < / section>

[0114] Adapted field parameters:

[0115] {

[0116] "user": {

[0117] "name": "Zhang San",

[0118] "type": "VIP"

[0119] },

[0120] "total_price": 12000,

[0121] "vip_benefits": [

[0122] {"name": "Free Shipping", "expiry_date": "2024-12-31"},

[0123] {"name": "Dedicated Customer Service", "expiry_date": "2024-12-31"} ]

[0125] }

[0126] S104: Determine and identify the dynamic variable blocks and irrelevant content blocks of the input data based on the logical branches;

[0127] S105: Process the content of blocks according to their different types; the processing includes: dynamically adjusting the format parameters of dynamically variable block content, and hiding irrelevant content blocks. The dynamically adjusted parameters may include the number of table columns, the number of list items, etc., to adapt to the actual dimensions of the data as much as possible, while hiding irrelevant content blocks can avoid generating redundant information and interfering with the readability of the content.

[0128] S200: The intelligent content generation module generates coherent natural language text based on a pre-trained language model and in combination with context. At the same time, it automatically selects the corresponding chart type according to the numerical type in the input data, generates vector graphics from the selected chart, and then embeds the generated vector graphics into the text to form a document.

[0129] In this step,

[0130] The pre-trained language model can be, for example, GPT-3.5. The intelligent content generation module, based on the pre-trained language model and combined with context, generates coherent natural language text from the input data, including the following steps:

[0131] S201: Construct input data prompts; for example, "User ${user.name} purchased ${user.count} items on ${user.date}, with a total amount of ${total_price} yuan."

[0132] S202: Invoke the pre-trained language model;

[0133] S203: Parse the input data and generate coherent natural language text based on the input data and context; the final coherent natural language text can be, for example: User Zhang San purchased 8 items on 2025-08-01, with a total amount of 100 yuan.

[0134] The numerical data types mentioned in this embodiment include at least time-series data, categorical comparison data, and proportional distribution data. Correspondingly, the chart types include at least line charts, bar charts, and pie charts. That is, a line chart is selected according to the time-series data, a bar chart is selected according to the categorical comparison data, and a pie chart is selected according to the proportional distribution data.

[0135] It is worth noting that embedding the generated vector graphics into text and forming a document involves the following steps:

[0136] S204: Convert vector graphics format: Use the Apache Batik library to convert SVG strings in vector graphics to PNG byte arrays; Apache Batik is a Java-based toolkit for processing SVG format images. Its main functions include: reading SVG files and converting them into Java object models, and also generating SVG files from Java objects; it can also convert SVG strings to JPEG, PNG, PDF, and other formats; or

[0137] Provides Swing visualization components that include SVG viewing and interaction;

[0138] S205: Determine the vector graphic insertion position: Automatically match and determine the vector graphic insertion position and image size based on the natural language text generated by the pre-trained language model;

[0139] S206: Uses Apache POI's XWPFDocument API to insert vector graphics at a defined insertion position and with a defined image size. Apache POI is a widely used Java library for manipulating Microsoft Office documents, such as Word and Excel.

[0140] S300: The adaptive format optimization module uses a priority weighting algorithm to calculate the document content weight and dynamically adjusts the document content and order based on the document content weight. In this step, the document content weight W is calculated according to the following formula:

[0141] W = α × Q1 + β × Q2 + γ × Q3

[0142] in,

[0143] Q1 is the content type weight value, which is set to different values ​​according to the different document content. For example, Q1 is 1.0 for title type, 0.8 for chart type, and 0.5 for body text type.

[0144] Q2 is the relevance weight value, which represents the strength of the relationship between elements. The Q2 value for charts and descriptive text is 1.0, and the Q2 value for same-level headings is 0.7.

[0145] Q3 is the page adaptation weight value, which represents the degree of matching of the remaining space of the current page. When the page is fully adapted, Q3 is 1.0, and when the page is partially adapted, Q3 is 0.5.

[0146] α, β, and γ are the weight coefficients for the corresponding weight values, where,

[0147] α represents the weighting coefficient of the content type weight value, which is used to characterize the importance of the content type, and its value is usually 0.6;

[0148] β represents the weighting coefficient of the relevance weight value, which is used to characterize the relevance requirement, and its value is usually 0.3;

[0149] γ represents the weight coefficient of the page adaptation weight value, which is used to characterize the layout optimization requirements, and its value is usually 0.1;

[0150] When dynamically adjusting the content and order of a document, the following steps are included:

[0151] S301: Traverse all content in the document (including titles, charts, body text, etc.), dynamically calculate the weight of the document content based on the formula, calculate the document content weight, and determine the priority of the document content according to the weight; for example, the weight calculation process for the title content is 0.6×1.0+0.3×1.0+0.1×1.0=1.0 (assuming that the relevance Q2 takes the relevance weight value of the chart and description text as 1.0, and the page adaptation weight value Q3 takes the weight value of 1.0 when fully adapted).

[0152] S302: Dynamically adjust document order and pagination according to the following principles:

[0153] A1) High-weight content should be placed on the current page first to ensure that titles and charts can be placed at the top of the page and avoid pagination breaks;

[0154] A2) Grouping by Relevance: Place charts and description text (with higher relevance weighting) on ​​the same page to avoid problems such as pagination anomalies and discontinuous numbering of multi-level headings, thereby reducing manual intervention;

[0155] A3) Space adaptation: Detect the remaining space on the current page. If it is insufficient, automatically paginate. The adaptation logic is controlled by the weight coefficient γ of the page adaptation weight value.

[0156] S303: Optimize document formatting, including:

[0157] B1) Smart Pagination Correction: When a chart has high weight but insufficient remaining space, insert a page break and adjust the order of subsequent content;

[0158] B2) Heading hierarchy repair: Renumber headings based on document content weight (e.g., when the main heading has a higher weight than subheadings) to ensure the continuity of document content.

[0159] S400: The automatic detection module uses computer vision to detect and determine whether there are errors in the document format. If the document format is correct, it outputs the final document. If an error is detected in the document format, the following steps are included:

[0160] S401: Determine the document formatting error type;

[0161] S402: Match the identified document formatting error type with the pre-stored error patterns;

[0162] S403: Based on the matching results, automatically repair and adjust document format errors using pre-stored error style repair rules;

[0163] S404: Use computer vision again to detect and determine if there are any errors in the document format. If there are still errors, return to step S401. If the document format is determined to be correct, output the final document.

[0164] The automatic detection process enables automatic detection and repair of the document format, further ensuring that the final output document format meets the preset requirements.

[0165] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.< / section>

Claims

1. An intelligent document generation system, characterized in that: The system includes: The dynamic template engine module parses the input data, judges and determines the dynamic variable blocks and irrelevant content blocks of the input data according to the logical branches, and performs corresponding processing on the block content according to the different blocks. The intelligent content generation module is based on a pre-trained language model and combines the context to generate coherent natural language text from the input data. At the same time, it automatically selects the corresponding chart type according to the numerical type in the input data, generates vector graphics from the selected chart, and then embeds the generated vector graphics into the text to form a document. An adaptive format optimization module is provided, which uses a priority weighting algorithm to calculate the document content weight and dynamically adjusts the document content and order according to the document content weight. An automatic detection module uses computer vision to detect and determine whether there are errors in the document format. After confirming that the document format is correct, the final document is output. The dynamic template engine module parses the input data, determines the dynamic variable blocks and irrelevant content blocks of the input data based on logical branches, and processes the block content accordingly, including the following steps: S101: Validate the input data; S102: Parse the field parameters of the input data; S103: Traverse the logical nodes of the dynamic language template, determine and activate the logical branch that adapts the field parameters; S104: Determine and identify the dynamic variable blocks and irrelevant content blocks of the input data based on the logical branches; S105: Process the block content accordingly based on the different blocks; In step S101, the input data is validated using JSON Schema, including the following steps: S1011: Predefined JSON Schema rule file; S1012: Parse the input data and iterate through all fields; S1013: The JSON Schema is used to sequentially validate the existence, integrity, data type, value range, and structure of the fields in the input data. If all validations are successful, proceed to the next step; if any validation fails, an error message is displayed and the process is terminated. In step S103, determining and activating the logical branch for the adapted field parameters through the XML tags in the dynamic language template includes the following steps: S1031: Parse the fixed characters contained in the XML tags, determine whether there are fixed characters in the adaptation field parameters, and if so, select the logical branch corresponding to the fixed character and proceed to the next step; S1032: Parse the determination condition of the fixed character, determine whether the attribute value of the adapted field parameter meets the determination condition of the fixed character, and if it does, select the logical branch corresponding to the determination condition and proceed to the next step. S1033: Parse fixed values ​​in a dynamic table to obtain the data value type beneficiary object that matches the field parameter; S1034: Parse a fixed column and obtain the data value of the corresponding field parameter; In step S105 Dynamically adjust the format parameters of the content of dynamically variable blocks; Hide irrelevant content blocks.

2. The control method for an intelligent document generation system according to claim 1, characterized in that: Includes the following steps: S100: The dynamic template engine module parses the input data, judges and determines the dynamic variable blocks and irrelevant content blocks of the input data according to the logical branches, and processes the block content accordingly based on the different blocks; S200: The intelligent content generation module generates coherent natural language text based on a pre-trained language model and in combination with context. At the same time, it automatically selects the corresponding chart type according to the numerical type in the input data, generates vector graphics from the selected chart, and then embeds the generated vector graphics into the text to form a document. S300: The adaptive format optimization module uses a priority weighting algorithm to calculate the document content weight and dynamically adjusts the document content and order according to the document content weight. S400: The automatic detection module uses computer vision to detect and determine whether there are errors in the document format. After confirming that the document format is correct, it outputs the final document.

3. The control method for an intelligent document generation system according to claim 2, characterized in that: In step S200 When the intelligent content generation module generates coherent natural language text from input data based on a pre-trained language model and in conjunction with context, it includes the following steps: S201: Construct input data prompts; S202: Invoke the pre-trained language model; S203: Parse the input data and generate coherent natural language text based on the input data and context. The numerical data types include at least time-series data, categorical comparison data, and proportional distribution data, and the corresponding chart types include at least line charts, bar charts, and pie charts.

4. The control method for an intelligent document generation system according to claim 3, characterized in that: In step S200, when embedding the generated vector graphic into text and forming a document, the following steps are included: S204: Convert vector graphics format: Convert SVG strings in vector graphics to PNG byte arrays; S205: Determine the vector graphic insertion position: Automatically match and determine the vector graphic insertion position and image size based on the natural language text generated by the pre-trained language model; S206: Insert a vector graphic at a defined insertion position and at a defined image size.

5. The control method for an intelligent document generation system according to claim 2, characterized in that: In step S300, the weight W of the document content is calculated according to the following formula: W = α × Q1 + β × Q2 + γ × Q3 in, Q1 is the content type weight value, which is set to different values ​​depending on the document content; Q2 is the correlation weight value, representing the strength of the correlation between elements; Q3 is the page adaptation weight value, representing the degree of matching of the remaining space of the current page; α represents the weighting coefficient of the content type weight value; β represents the weighting coefficient of the correlation weight value; γ represents the weight coefficient of the page adaptation weight value.

6. The control method for an intelligent document generation system according to claim 5, characterized in that: In step S300, when dynamically adjusting the document content and order, the following steps are included: S301: Traverse all content in the document, dynamically calculate the weight of the document content based on the formula, calculate the document content weight, and determine the document content priority based on the weight; S302: Dynamically adjust document order and pagination according to the following principles: A1) High-weight content should be placed on the current page with priority; A2) Place the chart and its description text on the same page; A3) Check the remaining space on the current page; if insufficient, automatically paginate. S303: Optimize document formatting, including: B1) Smart Pagination Correction: When a chart has high weight but insufficient remaining space, insert a page break and adjust the order of subsequent content; B2) Heading hierarchy repair: Renumber headings based on document content weight.

7. The control method for an intelligent document generation system according to claim 2, characterized in that: In step S400, after determining that there is an error in the document format, the following steps are included: S401: Determine the document formatting error type; S402: Match the identified document formatting error type with the pre-stored error patterns; S403: Based on the matching results, automatically repair and adjust document format errors using pre-stored error style repair rules; S404: Use computer vision to check and determine if there are any errors in the document format. If there are still document format errors, return to step S401. If the document format is determined to be correct, output the final document.

Citation Information

Patent Citations

  • Generation method and device of presentation file

    CN118821749A

  • Method and device for automatically generating PPT (Power Point) from existing document based on multi-modal large model

    CN119807452A

Cited By

  • An intelligent document generation system and method based on multi-data fusion analysis

    CN122528849A