A method and system for automatically generating customized documents

By leveraging natural language processing and machine learning technologies, the system achieves intelligent parsing of customer needs and dynamic interface combination, solving the problems of low document generation efficiency and poor scalability in existing technologies. This enables rapid and customized document generation, improving the system's intelligence level and document quality.

CN121303059BActive Publication Date: 2026-04-03AVICIT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as low development efficiency, redundant interfaces, poor template extensibility, weak system adaptability, insufficient rich media processing capabilities, and insufficient intelligent data recommendation when facing diverse and dynamically changing document generation needs, making it difficult to achieve rapid customized document generation.

Method used

Employing natural language processing, machine learning, and dynamic interface orchestration technologies, it intelligently analyzes customer needs, recommends the optimal interface combination, enables on-demand acquisition and integration of multi-dimensional data, dynamically adapts templates, processes rich media content, and generates customized documents.

Benefits of technology

This reduces the document generation cycle from the traditional days to minutes, improving the system's intelligence and business adaptability, increasing generation efficiency and document quality, reducing resource waste, and enhancing the system's scalability and response speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121303059B_ABST
    Figure CN121303059B_ABST
Patent Text Reader

Abstract

This invention discloses a customized automatic document generation method and system, belonging to the field of automatic document generation technology. The method includes parsing user needs through natural language processing to automatically identify data dimensions and business scope; utilizing machine learning to recommend optimal data interface combinations and calling strategies; achieving parallel acquisition and intelligent integration of multi-dimensional data based on dynamic interface configuration; automatically matching and adapting document templates according to needs and data characteristics; optimizing document content and layout through AI text generation and rich media processing; and supporting multi-format output and version management. This invention can significantly improve the intelligence and customization efficiency of document generation, shortening the traditional day-long delivery cycle to minutes, and supports flexible expansion and continuous optimization, suitable for multi-level and multi-scenario enterprise document generation needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of automatic document generation technology, specifically relating to a customized automatic document generation method and system. Background Technology

[0002] As enterprises deepen their digital transformation, various business systems accumulate massive amounts of structured and unstructured data in their daily operations. Customers from different industries and of varying sizes have developed highly differentiated customization requirements for document content. For example, based on product modeling methodologies, large group clients may only require summary reports at the process domain level, business unit-level clients need detailed analysis at the process group level, while department-level users focus on operational data from the final-level processes or reports on specific business attributes. Faced with such diverse and dynamically changing needs, traditional document generation technologies have proven significantly inadequate.

[0003] Existing technologies typically employ hard-coding for document generation, requiring the redevelopment of interfaces and documentation code for each new customer requirement. This results in long development cycles, slow response times, and difficulty in meeting urgent needs. Systems often call full data interfaces, loading the entire dataset even when only a subset of fields is needed, leading to redundant interface calls, significant waste of server resources, and reduced processing efficiency. Document templates are tightly coupled with the underlying data structure, requiring source code modification and redeployment when business needs change, lacking dynamic adaptation and rapid iteration capabilities. Furthermore, the system has poor scalability; new data requirements often necessitate modifications to the core architecture, making it difficult to adapt to rapid business changes.

[0004] Furthermore, traditional methods are weak in processing rich media content, unable to automatically perform image segmentation, scaling, quality optimization, and text-image alignment, relying on manual intervention and increasing generation costs. The system lacks natural language understanding capabilities and cannot automatically identify the data dimensions (such as process domains, process groups, or final-level processes) indicated by the customer's intent, requiring manual confirmation and configuration, thus raising the barrier to entry. In terms of data selection, the lack of AI-based recommendation and combination mechanisms makes it difficult to automatically filter optimal data sources and optimize strategies, resulting in weak document data correlation and insufficient analytical depth.

[0005] Therefore, existing technologies suffer from a series of problems, such as low development efficiency, redundant interfaces, poor template extensibility, weak system adaptability, lack of rich media processing, and insufficient intelligence in demand understanding and data recommendation. There is an urgent need for an automatic document generation solution that supports intelligent understanding, dynamic configuration, on-demand acquisition, template self-adaptation, and continuous optimization. Summary of the Invention

[0006] To address the aforementioned technical challenges, this invention provides a customized document automatic generation method and system. By integrating technologies such as natural language processing, machine learning, and dynamic interface orchestration, it achieves intelligent parsing of customer needs, automatic recommendation of optimal interface combinations, on-demand acquisition and integration of multi-dimensional data, dynamic template adaptation, and intelligent processing of rich media content. Ultimately, it enables the rapid generation of customized documents for different customers and different data dimensions, shortening the document delivery cycle from the traditional days to minutes, while simultaneously improving the system's intelligence level and business adaptability.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for automatically generating customized documents, the method comprising:

[0009] Step S1, Intelligent Requirement Analysis: Based on natural language processing technology, and with the help of the SpringAI framework and large language model, the system parses customer document requirements, automatically identifies the required data dimensions, time range, organizational scope and business boundaries, and outputs executable requirement configurations.

[0010] Step S2, AI Interface Recommendation: Using machine learning models, combined with historical interface configuration data and interface call effect data, recommend the optimal combination of interfaces, interface call order and interface parallel strategy for the current needs, and output the recommendation reasons and confidence level.

[0011] Step S3, Visual Interface Configuration: The recommended solution is displayed in the visual form interface, allowing users to adjust interface parameters and form the final interface configuration;

[0012] Step S4, Dynamic Interface Call: Based on the final interface configuration, the interface instance is dynamically loaded using a dependency injection mechanism, and the interface intelligent routing and interface circuit breaking degradation are implemented through the strategy engine;

[0013] Step S5, Intelligent Data Acquisition: The AI-enhanced interface layer automatically selects the corresponding level interface based on the identified data dimensions, uses a parallel strategy to acquire data, and performs field-level filtering and field-level anonymization on the returned results.

[0014] Step S6, Intelligent Data Integration: Perform data cleaning, deduplication, alignment, and feature enhancement on the acquired multi-source data, construct a unified data model, and perform interpretable placeholders and annotations for missing data items;

[0015] Step S7, Intelligent Template Selection: Based on requirements and unified data model characteristics, automatically match document templates and perform field-placeholder self-adaptation and compatibility mapping;

[0016] Step S8, Data Population and Layout Optimization: Populate the unified data model into the selected target template and optimize the layout of tables and charts in the template;

[0017] Step S9, Intelligent Content Optimization: Using AI text generation technology, the document after data filling is analyzed, described, and polished to generate paragraphs containing key findings and improvement suggestions;

[0018] Step S10, Rich Media Processing: For image-based rich media in the document, perform image segmentation, image scaling, and image watermarking.

[0019] Step S11, Format Conversion: Based on the Aspose component, perform multi-format conversion on the optimized document to ensure consistent layout after conversion;

[0020] Step S12, Document Output and Management: Provide document preview and download functions, archive and version the generated documents, and record the configuration information and interface call history during the document generation process.

[0021] On the other hand, the present invention provides a customized document automatic generation system, comprising:

[0022] The AI ​​intelligent analysis module includes a requirement understanding submodule, a requirement classification submodule, and a requirement transformation submodule. It is used to parse customers' natural language requirements based on the SpringAI framework and a large language model, automatically identify data dimensions, time range, organizational scope, and business boundaries, and output executable requirement configurations.

[0023] The AI ​​interface management module includes a SpringAI interface layer, an intelligent routing submodule, a multi-dimensional data interface, and an interface learning submodule. The SpringAI interface layer is an AI enhancement interface layer that provides a unified AI enhancement data interface. The intelligent routing submodule automatically routes to the corresponding data interface according to the requirements. The interface learning submodule continuously optimizes the interface calling strategy based on the interface usage feedback.

[0024] The intelligent recommendation engine includes an interface recommendation submodule, a template recommendation submodule, and a configuration recommendation submodule, which are used to recommend the optimal combination of interfaces, document templates, and configuration schemes for similar historical requirements based on machine learning models.

[0025] The configuration management module provides a visual form configuration interface, integrates recommendation results output by the intelligent recommendation engine, and supports users in adjusting interface parameters and template configurations.

[0026] The interface execution module includes an interface registration submodule, an interface invocation submodule, an interface extension submodule, and a SpringAI enhancement submodule. It is used to manage all available data interfaces in the system, dynamically invoke interfaces according to configuration, and support dynamic extension of interfaces and AI capability enhancement.

[0027] The template management module includes a template storage submodule, a template parsing submodule, a template intelligent adaptation submodule, and a template version control submodule. It is used to store and manage Freemarker templates and Word templates, parse the template structure, and automatically adapt the template according to the data structure.

[0028] The data processing module includes an intelligent data acquisition submodule, a data conversion submodule, a data intelligent integration submodule, and a data caching submodule. It is used to acquire the required data based on AI analysis results, convert the raw data into a unified format, and use AI algorithms to optimize data integration.

[0029] The content generation engine, which includes the Freemarker engine, the AI ​​text generation engine, and the fill strategy management submodule, is used to process template data fill and automatically generate data analysis descriptions and supplementary explanations.

[0030] The rich media processing module includes an image processing submodule, an AI image optimization submodule, a chart generation submodule, and a watermark processing submodule. It is used to segment, scale, and crop images in a document, optimize image quality, dynamically generate charts, and add watermarks.

[0031] The format conversion module, based on the Aspose component, enables mutual conversion between various document formats, ensuring consistent document layout and font embedding.

[0032] The learning optimization module includes a data collection submodule, a model training submodule, and a strategy optimization submodule. It is used to collect system usage data and user feedback, regularly train and update AI models, and continuously optimize interface calls and data processing strategies.

[0033] The deployment management module supports independent deployment, upgrades, and rollbacks of each functional module.

[0034] Thirdly, the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method for automatically generating customized documents.

[0035] Fourthly, the present invention provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enable the processor to implement the aforementioned customized document automatic generation method.

[0036] The beneficial effects of this invention are as follows:

[0037] I. A Leap Forward in Intelligentization. By integrating natural language processing and large language models, the system achieves end-to-end intelligent parsing of customer natural language requirements. It can automatically identify data dimensions, time ranges, and business boundaries, and convert them into executable configurations, reducing the time required for traditional manual configuration from hours to minutes. Based on a machine learning-based interface recommendation model, it dynamically recommends the optimal interface combination and calling strategy according to historical data, improving recommendation accuracy by over 90% and significantly reducing manual trial and error and configuration costs.

[0038] II. Significantly Enhanced Customization Capabilities and Response Efficiency. The system supports automatic on-demand invocation of data interfaces at different levels, such as process domains, process groups, and final-level processes. It can also acquire and intelligently integrate multi-dimensional data in parallel, effectively meeting customers' mixed data needs and improving customized document generation efficiency by 200%. Adopting a dynamic interface configuration and plug-in extension mechanism, adding new data sources or requirement types requires no modification to the core code, greatly enhancing the system's adaptability and scalability.

[0039] III. Significantly optimized system performance and resource utilization. Through AI-driven predictive intelligent caching strategies and parallel calling mechanisms, redundant interface calls are effectively reduced by 50%-70%, avoiding resource waste caused by full data loading. The system supports intelligent routing and load balancing, improving response speed by 3 times and stably handling over 100 concurrent document generation requests per second.

[0040] IV. Comprehensive Upgrades to Document Quality and User Experience. The AI ​​text generation engine automatically generates structured content including situational analysis, key findings, and improvement suggestions. The rich media processing module intelligently optimizes image segmentation, scaling, chart generation, and watermark addition, significantly enhancing the professionalism and readability of documents. Multi-format conversion ensures consistent document layout across different platforms and devices, increasing user satisfaction by over 85%.

[0041] V. The system possesses continuous evolution and compliance assurance capabilities. Relying on a closed-loop user feedback system and A / B testing mechanisms, the recommendation model and processing strategies can be continuously iterated and optimized. End-to-end audit logs and sensitive data anonymization functions meet enterprise data security and compliance requirements, providing reliable support for business decision-making. Attached Figure Description

[0042] Figure 1 This is a flowchart of a customized document automatic generation method according to the present invention;

[0043] Figure 2 This is a flowchart of the Spring AI interface layer workflow;

[0044] Figure 3This is a flowchart of the AI ​​interface recommendation workflow;

[0045] Figure 4 This is a flowchart of the multi-dimensional data interface call process;

[0046] Figure 5 This is a flowchart illustrating the collaborative process of a customized document automatic generation system module according to the present invention. Detailed Implementation

[0047] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0048] like Figure 1 As shown, this invention provides a method for automatically generating customized documents. This method achieves automatic generation of customized documents through 12 core steps, with each step logically coherent and progressively building upon the previous one, as detailed below:

[0049] Step S1: Intelligent demand analysis;

[0050] Based on natural language processing technology, the SpringAI framework integrates large language models (such as GPT and LLaMA series models) to parse the natural language requirement descriptions input by customers (such as "Generate a summary report of company-wide process domain operating data for the second quarter of 2024"). This step automatically identifies the data dimensions required by the customer (process domain, process group, end-level process business domain, and process group include their own basic attribute values ​​and the basic data of all their subordinate end-level processes, and include all element data of their subordinates), time range (such as the second quarter of 2024), organizational scope (such as the entire company or a specific business unit), and business boundaries (such as operating data and operational data). The above information is then converted into a structured requirement configuration that the system can execute. The configuration parameters include data dimension identifiers, time filtering conditions, organizational codes, and sets of business indicators, ensuring the accurate conversion of requirements from "natural language descriptions" to "machine-executable instructions".

[0051] Step S2: AI Interface Recommendation;

[0052] By leveraging pre-trained machine learning recommendation models (such as hybrid models based on collaborative filtering and gradient boosting trees), combined with historical interface configuration data and call performance data (including interface call time, data hit rate, requirement coverage, user satisfaction rating, etc.), the model predicts the characteristics of current requirements. The model outputs the optimal interface combination for the current requirement (e.g., process domain data aggregation interface + domain-level KPI calculation interface), interface call order (e.g., call the aggregation interface first, then the calculation interface), and parallel strategy (e.g., parallel call scheme for multi-dimensional data interfaces), along with recommendation reasons (e.g., "The historical average call time for this interface combination is less than 10 seconds, and the satisfaction rate reaches 95%) and confidence score (e.g., 92%), providing data support for user decision-making.

[0053] Step S3: Visual configuration of the interface;

[0054] The recommended solution for step S2 is displayed in a web-based visual form interface. The interface includes an interface list, a weight adjustment slider for each interface, an enable / disable switch, and a parameter configuration area (such as timeout and retry count). Users can adjust the configuration according to their actual needs, such as increasing the call weight of specific interfaces, disabling redundant interfaces, and modifying interface timeouts. After the adjustment is completed, the system automatically verifies the legality of the configuration (such as parameter format and interface dependencies). Once the verification is successful, the final interface configuration scheme is generated and stored in the configuration database, balancing the "intelligence of AI recommendation" and the "flexibility of user configuration".

[0055] Step S4: Dynamic API call;

[0056] Based on the final interface configuration in step S3, dependency injection (such as the DI mechanism of the Spring framework) and runtime assembly technology are used to dynamically load the corresponding interface instances at system runtime, avoiding resource consumption caused by pre-loading interface instances. Simultaneously, an integrated strategy engine (such as the Drools engine) is used to implement intelligent interface routing, for example, routing requests to interface nodes with lower load based on interface load conditions; and a circuit breaker and degradation strategy is configured so that when the number of consecutive failed calls to a certain interface reaches a threshold, the circuit breaker mechanism is automatically triggered, stopping calls to that interface and switching to a backup interface to ensure system stability.

[0057] Step S5: Intelligent Data Acquisition;

[0058] The AI-enhanced interface layer automatically selects the corresponding interface level to perform data acquisition operations based on the data dimensions identified in step S1.

[0059] When the data dimension is "process domain", only the process domain-level summary interface is called;

[0060] When the data dimension is "process group", call the detailed interface at the process group level;

[0061] When the data dimension is "final-level process", the final-level process operation data interface is called;

[0062] When the requirements include multi-dimensional data (such as needing both process domain and process group data at the same time), a parallel strategy is adopted to call the corresponding interfaces simultaneously, reducing data acquisition time.

[0063] In addition, field-level filtering (only retaining fields in the requirement configuration) and sensitive data anonymization (such as encrypting customer contact information and core business indicators) are performed on the raw data returned by the interface, and supplementary calculations are performed on key fields according to requirements (such as year-on-year growth rate, month-on-month change rate, and KPI indicator aggregation).

[0064] Step S6: Intelligent data integration;

[0065] Preprocess the multi-source data (such as process domain interface and process group interface data) obtained in step S5:

[0066] Data cleaning is performed through a rules engine to remove null values ​​and outliers (such as data that exceeds a reasonable range).

[0067] Data deduplication and alignment are performed based on primary keys (such as process IDs) to ensure that data for the same business entity is unique and that fields match.

[0068] Supplement the data with feature enhancement techniques (such as missing value prediction based on historical data) to build a unified data model that includes all required fields;

[0069] For missing data items that cannot be supplemented, use an interpretable placeholder (such as "to be supplemented") to mark them and record the reason for the missing data (such as "the data source interface did not return this field") to facilitate subsequent traceability.

[0070] Step S7: Smart template selection;

[0071] Based on the requirements characteristics of step S1 (such as document type "summary report" or "detailed report") and the unified data model structure of step S6 (such as number of fields and data type), the system automatically matches the optimal document template from the template database. The system supports Freemarker templates (suitable for HTML and XML format documents) and Word templates (based on the Apose component). The matching process filters out the top 3 candidate templates by calculating the similarity between the requirements characteristics and template tags, and the matching degree between data fields and template placeholders.

[0072] When the field matching degree between the candidate template and the data model does not reach the preset threshold (e.g., 80%), field-placeholder self-adaptation is performed to map the data fields to semantically similar placeholders in the template (e.g., mapping "process domain code" to "domain code" placeholder), and compatibility processing is performed on the template paragraphs corresponding to the missing fields (e.g., hiding paragraphs without data).

[0073] Step S8: Data population and layout optimization;

[0074] Fill the corresponding positions in the target template with the unified data model from step S6, according to the field-placeholder mapping relationship determined in step S7. After filling, optimize the layout of tables, charts, lists, and other elements in the document:

[0075] When a table has too many columns, automatically adjust the column width or split the table.

[0076] Adjust the position of the chart axis labels and legend to ensure clear display;

[0077] Standardize list item indentation and line spacing to ensure consistent document formatting;

[0078] If the template variable format / style does not match the data (e.g., the template date format is "YYYY-MM-DD" and the data format is "YYYY / MM / DD"), the template variable format will be automatically adjusted without manual modification of the template.

[0079] Step S9: Intelligent content optimization;

[0080] Enhance the content of the document after data filling using an AI text generation engine (based on fine-tuning of a large language model):

[0081] Analyze and describe the core data (e.g., "In the second quarter of 2024, the operating revenue of process domain A increased by 15% year-on-year, which is 8% higher than the industry average").

[0082] Supplement key information (such as missing business background information, data source labeling);

[0083] Polish the language of the document, and optimize the fluency and professionalism of the sentences;

[0084] Generate structured key findings and improvement recommendations paragraphs (such as "Key Finding: Low approval efficiency in process domain B; Improvement Recommendation: Optimize approval nodes and reduce manual intervention") to enhance the value of document analysis.

[0085] Step S10: Rich media processing;

[0086] For rich media content such as images in documents, Graphics2D technology is used to segment images (split long images according to the document page width), scale them (adjust their size according to the template image's placeholder area), and crop them (preserving the core area and removing redundant backgrounds). AI image optimization algorithms (such as super-resolution reconstruction) are used to improve image quality and fix blur and noise issues. Images are uniformly converted to PNG format to ensure cross-platform compatibility. Watermarks (such as client name and document generation time) are added according to client requirements.

[0087] If a document requires a combination of text and images, key information from the images can be extracted using image recognition technology (such as OCR text recognition and object detection) to automatically generate image descriptions, ensuring alignment between text and images.

[0088] Step S11: Format conversion;

[0089] The document optimized in step S9 is converted to multiple formats using Aspose components (such as Aspose.Words and Aspose.PDF), supporting output formats such as DOCX, PDF, and HTML. During the conversion process:

[0090] Automatically embed font files (such as SimSun and Microsoft YaHei) to avoid layout errors caused by missing characters on the target device;

[0091] Compress and optimize image and chart resources to reduce document size while maintaining quality;

[0092] Verify the consistency of the format of the converted documents to ensure that the content and layout of each format are completely consistent with the original documents.

[0093] Step S12: Document output and management;

[0094] The system provides a web-based document preview function, allowing customers to confirm the document's appearance online and then download the corresponding format file. Simultaneously, the system archives and versiones the generated documents, assigning each document a unique version number and recording key audit information during the document generation process, including requirement configuration parameters, API call logs (API name, time, and return results), and format conversion logs, supporting subsequent document traceability and version rollback.

[0095] like Figure 2 As shown, the SpringAI interface layer is the core component for implementing AI-enhanced data interaction, specifically including:

[0096] Demand Understanding Module: Integrates Large Language Model (LLM) to perform intent recognition and entity extraction on customer natural language requirements. For example, it extracts the time entity "January 20xx", the organizational entity "Finance Department", and the data dimension entity "final process" from "Generate January 20xx Finance Department Final Process Report".

[0097] Data mapping module: Based on preset requirement-interface mapping rules and machine learning models, it automatically maps structured requirements to corresponding data source interfaces and data dimensions, such as mapping "final-level process requirements" to the final-level process operation data interface.

[0098] Interface adapter: Provides a unified calling specification (such as unified request parameter format and return data structure) for data interfaces at different levels such as process domain, process group, and last-level process, so as to achieve "one call, multi-dimensional adaptation";

[0099] Intelligent caching module: Based on AI-predicted interface access patterns (such as time series models predicting a surge in access to a certain interface at the beginning of each month), it intelligently caches high-frequency data (such as summary data of commonly used process domains) and adopts a dynamic expiration strategy to adjust the expiration time according to the data update frequency.

[0100] Data optimization module: Uses machine learning algorithms (such as decision trees and random forests) to optimize data query and combination strategies, such as adjusting query filtering conditions based on customers' historical needs, or optimizing the combination order of multi-source data.

[0101] like Figure 3 As shown, the AI ​​interface recommendation step (S2) is implemented through data-driven closed-loop logic, and the specific process is as follows:

[0102] Data collection: Historical interface configuration data (interface combination scheme, parameter settings) and call effect data (time consumption, hit rate, coverage, user satisfaction) are collected through system logs. User satisfaction is obtained through customer ratings (1-5 points) after the document is generated.

[0103] Model training: The recommendation model is trained using gradient boosting tree algorithm with the input of demand features (data dimension, time range, organizational scope) and the output of interface combination scheme and calling strategy parameters. The parameters are optimized through cross-validation.

[0104] Demand forecasting: After preprocessing (encoding, normalizing) the current demand feature vector, input it into the model and output parameters such as interface combination, parallelism, timeout, number of retries, etc., calculate the confidence level, and generate recommendation reasons (such as "this combination has a 98% hit rate in the same historical demand").

[0105] Model self-learning: Receives user feedback on recommendation schemes (whether to adopt them, adjusted configurations), uses the feedback data as new training samples to fine-tune the model online, and continuously optimizes the recommendation effect.

[0106] like Figure 4 As shown, the core implementation logic of the intelligent data acquisition step (S5) is as follows:

[0107] Dimension Determination and Interface Selection: The corresponding interface call is triggered by the data dimension identifier in the requirement configuration. For example, the dimension identifier "FLOW_DOMAIN" calls the flow domain-level summary interface (URL: / api / v1 / data / flowDomain), "FLOW_GROUP" calls the flow group-level detailed interface (URL: / api / v1 / data / flowGroup), "FLOW_END" calls the final-level flow operation data interface (URL: / api / v1 / data / flowEnd), "FLOW_ATTRIBUTES" calls the attribute operation data interface (URL: / api / v1 / data / flowAttributes), and "FLOW_ELEMENTS" calls the feature operation data interface (URL: / api / v1 / data / flowElements).

[0108] Multi-dimensional parallel acquisition: When the requirements involve multiple dimensions, parallel threads are created through a thread pool. Each thread calls one dimension interface. After the thread completes, the data is aggregated through the CountDownLatch mechanism, which reduces the time consumption by more than 50% compared with serial calls.

[0109] Data post-processing: Filter the JSON data returned by the interface, retaining only the fields specified in the requirements; use AES encryption to desensitize sensitive fields; supplement fields according to the required calculation rules (e.g., year-on-year growth rate = (current period data - same period data last year) / same period data last year × 100%).

[0110] like Figure 5 As shown, on the other hand, the present invention provides a customized document automatic generation system. According to the above method, this system achieves automatic generation of customized documents through 12 core modules. Each module has a clearly defined function and works collaboratively, as detailed below:

[0111] The AI ​​intelligent analysis module, as the core of demand understanding and transformation, comprises three sub-modules:

[0112] The requirement understanding submodule integrates a large language model based on the SpringAI framework, receives customer natural language requirements through a RESTful API, calls the model's intent recognition and entity extraction capabilities, and parses key information.

[0113] The requirement classification submodule classifies requirements based on key information, such as by data dimension into "process domain requirements", "process group requirements" and "final-level process requirements", and by document type into "summary report requirements" and "detailed report requirements", providing a basis for subsequent interface recommendations and template selection;

[0114] The requirement transformation submodule converts the categorized requirements into executable configuration parameters in JSON format, including requirement ID, data dimension identifier, time filter conditions, organization code, indicator list, etc., and stores them in the requirement configuration database.

[0115] The AI ​​interface management module is responsible for unified interface management and integration of AI enhancement capabilities, and includes four sub-modules:

[0116] SpringAI Interface Layer: This is the AI-enhanced interface layer mentioned above. It integrates sub-modules for requirement understanding, data mapping, interface adapter, intelligent caching, and data optimization, and provides a unified call entry point (such as / api / v1 / ai / interface) to achieve centralized management of interface access.

[0117] The intelligent routing submodule builds a load assessment model based on interface load (CPU utilization, memory usage, concurrent requests, response latency) and health status (call success rate in the past 5 minutes, number of exceptions and errors), calculates the load score of each interface node in real time, and routes requests to the node with the lowest load and the best health; it supports dynamic weight adjustment, increasing the weight of nodes with high success rate (≥99%) and decreasing the weight of nodes with low success rate (<80%).

[0118] Multi-dimensional data interfaces: covering process domain interfaces, process group interfaces, and final-level process interfaces, and extending support to model attribute interfaces and report-type data interfaces; each interface has preset standardized request parameters (startTime / endTime, orgCode, filter) and returned data structures (including field identifiers, data types, and descriptions) to ensure structured data output;

[0119] The Interface Learning Submodule collects interface call data (call time, parameters, time consumption, results, and satisfaction) in real time through a log collection component, builds a performance evaluation model, and calculates the comprehensive performance score of the interface periodically (e.g., every morning) (response time accounts for 30%, success rate accounts for 40%, and satisfaction accounts for 30%). It identifies interfaces with performance shortcomings and generates optimization suggestions (e.g., adding indexes, optimizing SQL queries). At the same time, it associates requirement characteristics with interface performance data, explores the mapping pattern of "requirement type - interface performance", triggers interface parameter or logic optimization, and forms a closed-loop iteration.

[0120] The intelligent recommendation engine provides end-to-end intelligent recommendation services, including interfaces, templates, and configurations, and comprises three sub-modules:

[0121] Interface Recommendation Submodule: Deploy the above AI interface recommendation model, receive the demand feature vector output by the AI ​​intelligent analysis module, output the optimal interface combination, calling strategy and confidence score, and support pushing the recommendation results to the visualization interface of the configuration management module;

[0122] Template Recommendation Submodule: Based on requirement characteristics (such as document type, data dimension) and data model structure (number of fields, data type), a template matching algorithm is constructed to calculate the matching degree between candidate templates and the current requirements (such as field matching rate, template type adaptability). The top 3 templates are output in descending order of matching degree, along with historical user satisfaction (such as "This template has a usage rate of 89% in the process domain summary requirements").

[0123] The configuration recommendation submodule retrieves historical requirement configurations from the database using similarity algorithms (such as cosine similarity), filters historical configuration schemes that are similar to the current requirement characteristics (such as similar data dimensions and organizational scope), and outputs the interface combinations, parameter settings, and user feedback of the historical configurations to provide a reference for users to adjust their configurations.

[0124] The configuration management module enables visualized operation and version control of interface configurations. Its core functions include:

[0125] It provides a web-based visual form interface that integrates the interface recommendation scheme, template recommendation scheme, and configuration recommendation scheme output by the intelligent recommendation engine. The interface supports interactive operations such as interface weight adjustment, parameter editing, and template preview.

[0126] Configure validity checks to automatically detect interface dependencies (e.g., an interface needs to call a basic data interface first), parameter formats (e.g., whether the time format is "YYYY-MM-DD"), and numerical ranges (e.g., whether the timeout is within 1-30 seconds). If the check fails, the specific error reason will be displayed.

[0127] Configuration version management automatically generates a version number for each adjusted configuration scheme, records the person who modified the configuration, the time of modification, and the content of the modification, and supports configuration version rollback (such as rolling back to the historical best configuration).

[0128] The interface execution module is responsible for the dynamic invocation and execution control of interfaces, and consists of four sub-modules:

[0129] Interface registration submodule: Provides a pluggable interface registration mechanism. When adding a new interface (such as "supply chain process data interface"), you only need to submit a metadata file containing the interface name, supported data dimensions, and request / return parameter definitions. The system will automatically complete the interface registration and instantiation without modifying the core code.

[0130] Interface call submodule: Based on the final interface configuration of the configuration management module, it dynamically loads interface instances through the dependency injection mechanism of the Spring framework, monitors the interface response status in real time during the call process, and records information such as call time and returned data volume;

[0131] Interface extension submodule: Supports dynamic inheritance and functional extension of interfaces. For example, based on the existing process domain interface, the "supply chain process domain data filtering" function can be added through the extension plugin. The extension plugin can be developed and deployed independently without affecting the original interface logic.

[0132] SpringAI Enhancement Submodule: Integrates the AI ​​capabilities of the SpringAI framework, providing intelligent enhancements for API calls, such as dynamic adjustment of API timeout based on AI prediction (e.g., automatically extending the timeout if an API is predicted to take longer during peak hours) and intelligent retries for abnormal calls (e.g., triggering a retry mechanism if a call fails due to network fluctuations).

[0133] The template management module enables full lifecycle management of document templates and includes four sub-modules:

[0134] Template storage submodule: Constructs a distributed template database, storing Freemarker templates (in .ftl format) and Word templates (in .docx format) in categories. It supports indexing by template type (such as "process domain summary template" and "final-level process detail template") and applicable data dimensions for easy and fast retrieval.

[0135] Template parsing submodule: Performs structured parsing on uploaded template files, extracts variable placeholders (such as ${domainName}) from Freemarker templates and tags (such as {{#dataList}}) from Word templates, and generates a template structure tree (containing information such as paragraphs, tables, and placeholder positions) to provide data support for template adaptation;

[0136] Template intelligent adaptation submodule: Receives the unified data model output by the data processing module, compares the data fields with the template placeholders, performs semantic mapping on mismatched fields (such as mapping "process field code" to the "field code" placeholder in the template), and performs hiding or placeholder replacement on the template paragraphs corresponding to missing fields (such as replacing {{flowDetail}} with "current requirement does not require process detail data").

[0137] Template version control submodule: Records template creation, modification, and deletion operations, assigns a unique identifier to each template version, supports template version preview (comparing placeholder differences and format differences between different versions) and rollback (such as rolling back to the template version before modification), avoiding template corruption caused by accidental operations.

[0138] The data processing module handles the entire data processing flow from acquisition to integration, and includes four sub-modules:

[0139] Intelligent data acquisition submodule: Receives interface call instructions from the AI ​​interface management module, automatically selects the corresponding interface according to the data dimension, performs multi-dimensional data acquisition in parallel, and simultaneously completes data filtering, desensitization and supplementary calculations, and outputs pre-processed structured data;

[0140] Data Conversion Submodule: Converts heterogeneous data (such as JSON and XML formats) returned by different interfaces into JSON format, and standardizes data types (such as converting string-type time to date type and text-type numeric to numeric type) to ensure data format consistency;

[0141] The data intelligence integration submodule deploys a data cleaning rule engine (such as configuring null value filtering rules and outlier removal rules), a data alignment algorithm (based on primary key association of multi-source data), and a feature enhancement model (such as predicting missing values ​​based on random forest), builds a unified data model, and labels the reasons for missing data and adds placeholders.

[0142] Data caching submodule: Based on intelligent caching strategies, it caches and stores frequently accessed data (such as process domain summary data that has been called multiple times in the past 30 days). It adopts Redis distributed caching technology and supports cache preheating (such as loading data with high demand at the beginning of the month in advance) and dynamic expiration (such as caching real-time data for 10 minutes and caching historical summary data for 24 hours) to reduce repeated interface calls.

[0143] Content generation engine, which realizes data filling and AI content enhancement, including four sub-modules:

[0144] Freemarker engine: Loads Freemarker templates and unified data models, performs data filling according to the mapping relationship between template placeholders and data fields, supports loop rendering (such as traversing process group data to generate table rows), conditional rendering (such as hiding corresponding paragraphs when a certain field is empty), and generates preliminary documents in HTML or XML format;

[0145] Apose utility class: For Word templates, fills the unified data model into the tag positions of the template through Apose technology, supports dynamic insertion of pictures and charts (such as inserting a line chart generated by the data processing module into a specified position in the template), and generates preliminary documents in DOCX format;

[0146] AI text generation engine: Based on the fine-tuned large language model, receives the unified data model and the preliminary content of the document, and automatically generates structured paragraphs such as "Overall Situation Analysis", "Key Findings", and "Suggestions for Improvement", and supports customization of language styles (such as formal business style, concise technical style);

[0147] Filling strategy management sub-module: Formulates differentiated filling strategies for different data types (such as numeric, text, date), such as retaining 2 decimal places for numeric data and unifying the date format as "YYYY-MM-DD", to ensure the format unity of the filled document.

[0148] Rich media processing module, which completes the intelligent optimization of rich media content in the document, including four sub-modules:

[0149] Image processing sub-module: Based on Graphics2D technology, performs splitting (splitting long pictures exceeding the page width of the document according to the page width), scaling (adjusting the image resolution according to the size of the template image placeholder area), and cropping (retaining the core content of the image and removing redundant edges) on the pictures in the document, and supports batch processing of multiple pictures;

[0150] AI image optimization sub-module: Deploys a super-resolution reconstruction model (such as ESRGAN) to improve the clarity of blurred pictures, removes image noise through a denoising algorithm (such as BM3D), and performs white balance adjustment on pictures with color deviation to ensure the display effect of the pictures;

[0151] Chart generation sub-module: Based on the unified data model of the data processing module, automatically generates line charts (such as the trend of process domain data), bar charts (such as the comparison of data of each process group), and pie charts (such as the proportion of process types), supports customization of chart styles (such as colors, legend positions, axis labels), and automatically adds chart titles and unit descriptions;

[0152] The watermarking submodule supports both text and image watermarking modes. Text watermarks allow configuration of content (such as customer name, document generation time), font, size, transparency, and tilt angle. Image watermarks allow users to upload customer logos and configure watermark positions (such as header, footer, and centering) and scaling ratios to ensure that the watermark does not obscure the core content of the document.

[0153] The format conversion module enables multi-dimensional conversion and optimization of document formats. Its core functionality is developed based on the Aspose component.

[0154] It supports mutual conversion between three mainstream formats: DOCX, PDF, and HTML. During the conversion process, font files (such as SimSun and Microsoft YaHei) are automatically embedded to avoid text garbled characters or layout errors caused by the target device lacking the corresponding fonts.

[0155] The converted PDF document is optimized, such as compressing image resources (reducing image resolution while maintaining clarity) and merging duplicate font resources to reduce document size;

[0156] We perform compatibility processing on HTML format documents to ensure consistent display in mainstream browsers such as Chrome, Firefox, QiAnXin, and Edge, and support adaptive page layouts (such as adapting to different device screens such as computers and tablets).

[0157] The learning optimization module enables continuous iterative optimization of the system model and strategy, and includes three sub-modules:

[0158] The data collection submodule is used to collect real-time data from the entire system chain through the log collection component, including the results of requirement analysis, interface call data, template matching data, user operation feedback (such as whether the recommended solution is adopted and the document satisfaction score), and document generation effect data (such as generation time and format conversion success rate), and to build a structured dataset.

[0159] Model training submodule: Regularly (e.g., every Sunday morning) incrementally trains the AI ​​interface recommendation model and template recommendation model, using newly collected usage data as training samples to update model parameters; supports model training effect evaluation (e.g., calculating recommendation accuracy and template matching rate), and only deploys the new model when the evaluation metric improves by more than 5%;

[0160] The strategy optimization submodule optimizes system strategies based on usage data analysis results. This includes adjusting the expiration time of smart caches (extending cache time if the update frequency of a certain type of data decreases), optimizing interface circuit breaker thresholds (increasing the threshold for the number of failed circuit breaker triggers if the stability of a certain interface improves), and adjusting the weight of template matching algorithms (increasing the weight of field matching rates if they have a greater impact on document quality). It also supports A / B testing to compare the effects of new and old strategies and select the superior strategy for formal application.

[0161] The deployment management module supports flexible deployment and operation and maintenance of various modules in the system. Its core functions include:

[0162] The system adopts a microservice architecture, which breaks down the AI ​​intelligent analysis module, AI interface management module, and intelligent recommendation engine into independent microservices. Each service can be deployed via Docker containerization, supporting independent upgrades (such as upgrading only the AI ​​text generation engine without affecting other modules) and horizontal scaling (such as adding container instances of the interface execution module to cope with high concurrency).

[0163] Provides service monitoring functions to monitor metrics such as CPU utilization, memory usage, API call volume, and error rate of each microservice in real time. When the metrics exceed preset thresholds (such as CPU utilization exceeding 80%), it automatically sends alarm notifications (such as SMS or email).

[0164] It supports service rollback and records the deployment versions of each module. When a new version fails (such as a sudden drop in the success rate of interface calls), it can be rolled back to a historical stable version with one click to ensure system availability.

[0165] Example 1: Customized document generation for different customer levels

[0166] Scene setting:

[0167] Client A: A large group company whose requirement is to "generate a summary report of the operating data of all process domains of the entire group in January 20xx". The data dimension is process domain, the organizational scope is the entire group, and the time range is January 20xx.

[0168] Client B: Business Unit, whose requirement is to "generate detailed operational reports (including upstream and downstream related indicators) for each process group of this business unit in January 20xx", with the data dimension being process group, the organizational scope being a certain business unit, and the time range being January 20xx;

[0169] Client C: Department, whose requirement is to "generate an operational data report (including execution efficiency analysis) of the department's bottom-level processes in January 2024", with the data dimension being the bottom-level processes, the organizational scope being a certain department, and the time range being January 20xx.

[0170] The implementation steps are as follows:

[0171] Step S1: Intelligent Requirement Analysis; The system receives customer natural language requirements via the web interface, and the large language model integrated into the SpringAI framework parses the requirements:

[0172] Client A's requirement: Extract data dimensions = process domain, time range = January 20xx, organizational scope = entire group, business indicators = operational data, and generate structured configuration (JSON format).

[0173] Client B's requirements: Extract data dimensions = process group, time range = January 20xx, organizational scope = a certain business unit, business indicators = operational data + upstream and downstream related indicators, and generate a structured configuration;

[0174] Client C's requirements: Extract data dimensions = final-level process, time range = January 20xx, organizational scope = a certain department, business indicators = operational data + execution efficiency indicators, and generate a structured configuration.

[0175] Step S2: AI interface recommendation; the recommendation model combines historical data to output a recommendation scheme:

[0176] Customer A: Recommends the combination of "process domain data aggregation interface + domain-level KPI calculation interface" with a parallel call strategy and a confidence level of 95%. The reason for the recommendation is that "this combination takes an average of 8 seconds in the process domain aggregation requirements of the entire group and has a satisfaction rate of 96%".

[0177] Customer B: Recommends the combination of "detailed data interface for process group + upstream and downstream related indicator interface", which can be called sequentially (first obtain detailed data and then calculate related indicators). The confidence level is 93%. The reason for the recommendation is that "this combination can ensure the consistency between upstream and downstream indicators and process group data, with a historical matching rate of 92%".

[0178] Customer C recommends the combination of "final-level process operation data interface + execution efficiency analysis interface" with a parallel call strategy, with a confidence level of 94%. The reason for the recommendation is that "this combination can simultaneously obtain operation data and efficiency analysis results, shortening the data acquisition time, with an average historical response time of 6 seconds."

[0179] Steps S3-S4: Visual configuration and dynamic invocation of the interface;

[0180] The customer confirmed the recommended solution through the visual form in the configuration management module, and no parameters were adjusted. The system then generated the final interface configuration.

[0181] The interface execution module is based on configuration and dynamically loads corresponding interface instances through dependency injection: it loads process domain data summary interface and domain-level KPI calculation interface instance for customer A, and loads process group detailed data interface and upstream and downstream related indicator interface instance for customer B. It loads terminal process operation data interface and execution efficiency analysis interface instance for customer C.

[0182] The intelligent routing submodule monitors the load of each interface node in real time, routing customer A's request to the node with 28% CPU utilization and 45ms response latency, customer B's request to the node with 32% CPU utilization and 50ms response latency, and customer C's request to the node with 25% CPU utilization and 40ms response latency, ensuring call efficiency.

[0183] Steps S5-S6: Intelligent data acquisition and integration;

[0184] Data Acquisition:

[0185] Customer A: Only call the process domain-level summary interface to obtain the operating data (such as revenue and cost) of 12 process domains across the entire group, and call the domain-level KPI calculation interface to complete year-on-year and month-on-month calculations;

[0186] Customer B: First, call the detailed data interface of the process group to obtain the operational data of the 8 process groups of the business unit (such as order volume and processing time), and then call the upstream and downstream correlation indicator interface to calculate the correlation efficiency between each process group and the upstream procurement process and the downstream delivery process.

[0187] Customer C: Parallel calls to the terminal process operation data interface to obtain the operation logs (such as operator and operation time) of 15 terminal processes in the department, and the execution efficiency analysis interface to obtain the average processing time, timeout rate and other indicators of each process.

[0188] Data integration:

[0189] The data processing module performs cleaning (removing 2 null records from the customer B process group data), deduplication (deleting 3 duplicate entries from the customer C operation log), and alignment (unifying the field association between customer A process domain data and KPI data based on the "process ID" primary key) on multi-source data to build a unified data model; for the missing "upstream associated order quantity" field in one process group of customer B, it marks it with "to be supplemented (data source interface not returned)" placeholder.

[0190] Steps S7-S9: Template selection, data population, and content optimization;

[0191] Template Selection: The template recommendation submodule matches templates based on demand characteristics. It matches "Process Domain Operation Summary Template" (Freemarker format) for customer A, "Process Group Operation Detailed Template" (Word format) for customer B, and "Final-Level Process Operation Analysis Template" (Word format) for customer C. The matching degree of the three is over 90%, and there is no need to perform field self-adaptation.

[0192] Data population: The Freemarker engine populates the process field summary data and KPI indicators for Client A template, and automatically adjusts the column width of the table (splitting the original 8-column table into two 4-column tables to adapt to the page width); the Apose engine populates the data for Client B and C templates, adds line charts to Client B's "upstream and downstream related indicators", and adds bar charts to Client C's "execution efficiency".

[0193] Content optimization: The AI ​​text generation engine generated an overall situation analysis for client A ("In January 2024, the total revenue of the entire group's 12 process domains increased by 12% year-on-year, with the supply chain process domain showing the highest growth rate at 18%"), key findings ("R&D process domain costs increased by 5% year-on-year, requiring key control"), and improvement suggestions ("Optimize R&D process approval nodes and reduce labor costs"); and generated corresponding structured analysis paragraphs for clients B and C, with the language style adopting a formal business style.

[0194] Steps S10-S12: Rich media processing, format conversion, and document output;

[0195] Rich Media Processing: The rich media processing module scales the line chart in Client B's template (adjusting it from 800×600 pixels to 600×400 pixels to fit the Word page) and enhances its quality (removing blurry chart edges). It adds a legend (labeling "Average Processing Time" and "Timeout Rate") to the bar chart in Client C's template. As requested by the client, it adds a text watermark (client name + generation time "2024-01-31") to all document images, setting the watermark transparency to 30% and the tilt angle to 45°.

[0196] Format conversion: The format conversion module is based on the Aspose component and converts Client A's Freemarker template document into PDF format (embedded with SimSun and Microsoft YaHei fonts). Clients B and C's Word documents retain the DOCX format and generate PDF copies. The document layout is correct after conversion.

[0197] Document Output: The system provides an online preview function, and the customer can download the document after confirming that it is correct. At the same time, it completes archiving and versioned storage, assigning version number V1.0.0 to customer A's document, V1.0.0 to customer B, and V1.0.0 to customer C. It records the requirement configuration, interface call trajectory (such as the time when customer A called the process domain interface "2024-01-31 09:15:23" and the amount of returned data "1.2MB") and format conversion logs for each document.

[0198] Example 2: Dynamically expanding the "Supply Chain Process Data" interface;

[0199] Scene setting

[0200] A customer has added a requirement to "generate a risk assessment report for the supply chain process domain in January 20xx". The existing interface cannot meet the requirement of obtaining "supply chain process data + risk assessment indicators", so the supply chain process data interface needs to be expanded.

[0201] The implementation steps are as follows:

[0202] Interface registration and discovery;

[0203] Developers write metadata files for the supply chain process data interface, declaring the supported data dimensions = "supply chain process domain", request parameters (startTime / endTime, supplyChainCode), and returned data structure (including supply chain process ID, purchase quantity, inventory turnover rate, and risk level fields).

[0204] Upload the metadata file through the interface registration submodule of the interface execution module, and the system will automatically complete the interface registration and instantiation without modifying the core code. The interface registration takes about 2 minutes.

[0205] API calls and data augmentation;

[0206] The AI ​​intelligent analysis module analyzes customer needs and extracts data dimensions such as supply chain process domain, time range, January 20xx, and organizational scope, generating a structured configuration.

[0207] The AI ​​interface recommendation submodule recommends the combination of "supply chain process data interface + AI risk assessment interface" based on newly registered supply chain process data interfaces and historical risk assessment demand data, with a confidence level of 91% (the reason for the recommendation is: "the supply chain process data interface can provide basic data, the AI ​​risk assessment interface can generate risk levels based on the data, and the satisfaction rate of similar historical extended interface combinations is 89%").

[0208] The interface call submodule first calls the supply chain process data interface to obtain basic data (purchase volume, inventory turnover rate) of the customer's supply chain department for 5 processes. Then, it calls the AI ​​risk assessment interface to perform risk analysis on the basic data (e.g., inventory turnover rate is judged as "medium risk" if it is lower than the industry threshold), generates risk level and concern points (e.g., "Inventory turnover rate of process 3 is 2.1, which is lower than the industry average of 2.5, and there is a risk of inventory backlog"). The risk assessment results are then used as enhanced fields (riskLevel, riskFocus) to fill back into the unified data model.

[0209] Model learning and optimization;

[0210] The interface learning submodule collects call data from the supply chain process data interface (time taken 7 seconds, success rate 100%, user satisfaction 90%) and incorporates it into the interface performance evaluation model.

[0211] In subsequent similar requests (such as "generating the supply chain process report for February 20xx"), the intelligent recommendation engine will automatically increase the recommendation weight of this interface from the initial 0.6 to 0.8, giving priority to recommending this combination of interfaces.

[0212] Example 3: Continuous Model Optimization and A / B Testing;

[0213] Scene setting

[0214] After three months of system operation, the learning optimization module detected that the accuracy of the AI ​​interface recommendation model dropped from the initial 92% to 88%, requiring model optimization and A / B testing to verify the effect.

[0215] The implementation steps are as follows:

[0216] Data collection and model retraining;

[0217] The data collection submodule was used to collect system usage data from the past three months, including 1,200 requirement analysis records, 1,500 API call data, and 900 user feedback records (of which 600 adopted recommended solutions and 300 were adopted after adjustments).

[0218] The model training submodule uses newly collected data as incremental training samples to retrain the interface recommendation model and optimize the mapping weights of "demand features - interface combination" (such as increasing the association weights between "supply chain process domain demand" and supply chain process data interfaces). After training, the model accuracy is improved to 95%.

[0219] A / B testing verification;

[0220] The deployment management module divides the system into two groups, A and B. Group A uses the old model, while Group B uses the new model. The testing period is 7 days, covering 200 new requirements.

[0221] After the test, the learning optimization module analyzed the results of the two groups: Group A had an interface recommendation adoption rate of 82% and an average document generation time of 120 seconds; Group B had an interface recommendation adoption rate of 93% and an average document generation time of 95 seconds. The new model was superior to the old model in both adoption rate and efficiency.

[0222] The strategy optimization submodule officially launched the new model and adjusted the intelligent caching strategy based on test data: the cache expiration time of the supply chain process data interface was extended from 1 hour to 2 hours (because the data update frequency of this interface was found to be low during testing), further reducing repeated calls.

[0223] Example 4: Parallel combination and comprehensive analysis of multi-dimensional data;

[0224] Scene setting

[0225] A client's requirement is to "generate a comprehensive report of the company's total process domain summary data, key process group detailed data, and core terminal process operation data for January 20xx". This requires acquiring data from three dimensions and generating cross-dimensional comparative analysis.

[0226] The implementation steps are as follows:

[0227] Requirements analysis and API recommendation;

[0228] The AI ​​intelligent analysis module analyzes the requirements and extracts data dimensions = process domain + process group + final-level process, time range = January 20xx, organizational scope = the entire company, and identifies the key process groups as "sales process group" and "R&D process group", and the core final-level processes as "sales order approval process" and "R&D project initiation process".

[0229] The AI ​​interface recommendation submodule recommends the combination of "process domain summary interface + sales / R&D process group detailed interface + sales order approval / R&D project initiation final-level process interface", with a parallel calling strategy and a confidence level of 92% (the reason for the recommendation is: "multi-dimensional parallel calling can reduce data acquisition time. The historical average time for the combination of 3 dimensions is 15 seconds, which is lower than the 35 seconds of serial calling").

[0230] Parallel acquisition and integration of multi-dimensional data;

[0231] The interface execution module creates three parallel threads: Thread 1 calls the process domain summary interface to obtain data from 12 process domains across the company; Thread 2 calls the detailed interfaces of the sales and R&D process groups to obtain detailed data from the two process groups; and Thread 3 calls the operation data interfaces of the two core end-level processes.

[0232] After the thread finishes execution, the data is aggregated through the CountDownLatch mechanism. The data processing module performs conflict resolution (unifying the naming convention of the "process name" field, such as unifying "sales order review process" to "sales order approval process"), time alignment (ensuring that the statistical period of all data is January 20xx), and indicator standardization (unifying "processing time" to "minutes"), and builds a unified data model containing three dimensions of data.

[0233] Comprehensive analysis and document generation;

[0234] The AI ​​text generation engine generates a cross-dimensional comparative analysis based on a unified data model: "In January 20xx, the total revenue of the sales process domain accounted for 35% of the company's total revenue. The average order processing time of its subordinate sales process groups was 25 minutes. The timeout rate of the core final-level process (sales order approval process) was only 2%, lower than the company's average timeout rate of 5% for final-level processes, demonstrating excellent process efficiency. The revenue of the R&D process domain accounted for 18%. The average project delivery cycle of the R&D process group was 45 days. The average number of approval nodes in the core final-level process (R&D project initiation process) was 5. Nodes need to be optimized to shorten the cycle."

[0235] The template management module matches the "Multi-Dimensional Comprehensive Report Template" (Word format), the Apose component fills in the data and generates cross-dimensional comparison charts (such as pie charts of revenue share by process domain, bar charts of processing time for key process groups, and line charts of timeout rates for core final-level processes), and finally generates a comprehensive report in DOCX and PDF formats, which customers can preview and then download for archiving.

[0236] Thirdly, the present invention provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method for automatically generating customized documents.

[0237] Fourthly, the present invention provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enable the processor to implement the aforementioned customized document automatic generation method.

[0238] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for automatically generating customized documents, characterized in that, The method includes: Step S1, Intelligent Requirement Analysis: Based on natural language processing technology, and with the help of the SpringAI framework and large language model, the system parses customer document requirements, automatically identifies the required data dimensions, time range, organizational scope and business boundaries, and outputs executable requirement configurations. Step S2, AI Interface Recommendation: Using machine learning models, combined with historical interface configuration data and interface call effect data, recommend the optimal combination of interfaces, interface call order and interface parallel strategy for the current needs, and output the recommendation reasons and confidence level. Step S3, Visual Interface Configuration: The recommended solution is displayed in the visual form interface, allowing users to adjust interface parameters and form the final interface configuration; Step S4, Dynamic Interface Call: Based on the final interface configuration, the interface instance is dynamically loaded using a dependency injection mechanism, and the interface intelligent routing and interface circuit breaking degradation are implemented through the strategy engine; Step S5, Intelligent Data Acquisition: The AI-enhanced interface layer automatically selects the corresponding level interface based on the identified data dimensions, uses a parallel strategy to acquire data, and performs field-level filtering and field-level anonymization on the returned results. Step S6, Intelligent Data Integration: Perform data cleaning, deduplication, alignment, and feature enhancement on the acquired multi-source data, construct a unified data model, and perform interpretable placeholders and annotations for missing data items; Step S7, Intelligent Template Selection: Based on requirements and unified data model characteristics, automatically match document templates and perform field-placeholder self-adaptation and compatibility mapping; Step S8, Data Population and Layout Optimization: Populate the unified data model into the selected target template and optimize the layout of tables and charts in the template; Step S9, Intelligent Content Optimization: Using AI text generation technology, the document after data filling is analyzed, described, and polished to generate paragraphs containing key findings and improvement suggestions; Step S10, Rich Media Processing: For image-based rich media in the document, perform image segmentation, image scaling, and image watermarking. Step S11, Format Conversion: Based on the Aspose component, perform multi-format conversion on the optimized document to ensure consistent layout after conversion; Step S12, Document Output and Management: Provide document preview and download functions, archive and version the generated documents, and record the configuration information and interface call history during the document generation process.

2. The method for automatically generating customized documents according to claim 1, characterized in that, In step S1, the data dimensions include process domains, process groups, and final-level processes.

3. The method for automatically generating customized documents according to claim 1, characterized in that, In step S2, the specific implementation of the AI ​​interface recommendation includes: collecting historical interface configuration and call effect data to construct a training dataset; training a recommendation model based on the training dataset, establishing a mapping relationship between demand features and interface combinations and strategy parameters; predicting current demand features, and outputting interface combinations, parallelism, timeout and retry strategies; receiving user feedback and continuously fine-tuning the recommendation model online.

4. The method for automatically generating customized documents according to claim 1, characterized in that, In step S5, the AI-enhanced interface layer includes a requirement understanding module, a data mapping module, an interface adapter, an intelligent caching module, a data optimization module, and an intelligent caching strategy. Based on the interface access patterns predicted by AI, the frequently used data is pre-warmed and stored, and the cache expiration time is dynamically adjusted.

5. The method for automatically generating customized documents according to claim 1, characterized in that, In step S6, the intelligent data integration also includes conflict resolution, primary key alignment, and standardization of indicators for multi-dimensional data; when the requirements include multi-dimensional data, the data of each dimension are acquired in parallel first, and then the integration operation is performed.

6. The method for automatically generating customized documents according to claim 1, characterized in that, In step S7, the intelligent template selection also includes scoring and sorting candidate templates based on data features and historical template matching results; when there are differences between template fields and data fields, it supports intelligent insertion of paragraphs corresponding to missing fields.

7. The method for automatically generating customized documents according to claim 1, characterized in that, In step S9, the AI ​​text generation output includes structured paragraphs of "overall situation analysis, key problem discovery, and business improvement suggestions," and the language style is strategically refined according to the customer's business scenario.

8. A customized document automatic generation system, used to implement the method described in any one of claims 1-7, characterized in that, include: The AI ​​intelligent analysis module includes a requirement understanding submodule, a requirement classification submodule, and a requirement transformation submodule. It is used to parse customers' natural language requirements based on the SpringAI framework and a large language model, automatically identify data dimensions, time range, organizational scope, and business boundaries, and output executable requirement configurations. The AI ​​interface management module includes a SpringAI interface layer, an intelligent routing submodule, a multi-dimensional data interface, and an interface learning submodule. The SpringAI interface layer is an AI enhancement interface layer that provides a unified AI enhancement data interface. The intelligent routing submodule automatically routes to the corresponding data interface according to the requirements. The interface learning submodule continuously optimizes the interface calling strategy based on the interface usage feedback. The intelligent recommendation engine includes an interface recommendation submodule, a template recommendation submodule, and a configuration recommendation submodule, which are used to recommend the optimal combination of interfaces, document templates, and configuration schemes for similar historical requirements based on machine learning models. The configuration management module provides a visual form configuration interface, integrates recommendation results output by the intelligent recommendation engine, and supports users in adjusting interface parameters and template configurations. The interface execution module includes an interface registration submodule, an interface invocation submodule, an interface extension submodule, and a SpringAI enhancement submodule. It is used to manage all available data interfaces in the system, dynamically invoke interfaces according to configuration, and support dynamic extension of interfaces and AI capability enhancement. The template management module includes a template storage submodule, a template parsing submodule, a template intelligent adaptation submodule, and a template version control submodule. It is used to store and manage Freemarker templates and Word templates, parse the template structure, and automatically adapt the template according to the data structure. The data processing module includes an intelligent data acquisition submodule, a data conversion submodule, a data intelligent integration submodule, and a data caching submodule. It is used to acquire the required data based on AI analysis results, convert the raw data into a unified format, and use AI algorithms to optimize data integration. The content generation engine, which includes the Freemarker engine, the AI ​​text generation engine, and the fill strategy management submodule, is used to process template data fill and automatically generate data analysis descriptions and supplementary explanations. The rich media processing module includes an image processing submodule, an AI image optimization submodule, a chart generation submodule, and a watermark processing submodule. It is used to segment, scale, and crop images in a document, optimize image quality, dynamically generate charts, and add watermarks. The format conversion module, based on the Aspose component, enables mutual conversion between various document formats, ensuring consistent document layout and font embedding. The learning optimization module includes a data collection submodule, a model training submodule, and a strategy optimization submodule. It is used to collect system usage data and user feedback, regularly train and update AI models, and continuously optimize interface calls and data processing strategies. The deployment management module supports independent deployment, upgrades, and rollbacks of each functional module.

9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When one or more programs are executed by the one or more processors, the one or more processors implement the customized document automatic generation method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, enable the processor to implement a customized document automatic generation method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Automatic soft text generation method and device, computer equipment and storage medium

    CN110162623A

  • Excel report automatic conversion and rendering method, system, equipment and medium

    CN120354827A