Document generation method based on agent collaboration

By establishing a unified collaboration standard and a multi-task parallel processing framework in agent collaboration document generation, the problem of inconsistent communication and data formats in agent collaboration is solved, achieving efficient task allocation and result integration, and improving the efficiency and quality of document generation.

CN121009869APending Publication Date: 2025-11-25SHANGHAI SOURCE CODE BANG DIGITAL TECHNOLOGY CO LTD +2
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511110343.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-25

AI Technical Summary

Technical Problem

The lack of a unified collaboration standard in existing intelligent agent collaborative document generation methods makes it difficult for different intelligent agents to seamlessly connect in terms of communication protocols, data formats and interaction methods, resulting in information loss or inefficiency, and making it difficult to achieve efficient task allocation and result integration.

Method used

By establishing a unified collaboration standard in advance, the content collection agent acquires initial data and performs standardized processing, which is then distributed to the content generation, structure planning, and language polishing agents. A multi-task parallel processing framework and resource management mechanism are adopted to dynamically adjust task allocation, and finally, the results are integrated through a result synchronization mechanism.

Benefits of technology

It achieves efficient coordination and seamless integration in multi-agent collaboration, significantly improving the efficiency and quality of document generation and ensuring the accuracy and consistency of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121009869A_ABST
    Figure CN121009869A_ABST
Patent Text Reader

Abstract

The invention discloses a document generation method based on agent collaboration, which comprises the following steps: acquiring initial document data through a content collection agent, and standardizing the initial document data to obtain input content; the input content is distributed to different intelligent agents; performing text generation on the standardized document data through a content generation agent and a multi-task parallel processing mechanism to obtain preliminary document content; performing structure planning coordination on the preliminary document content according to framework requirements through a structure planning agent to obtain a structured document draft; performing language retouching optimization on the structured document draft through a language retouching agent according to a retouching requirement to obtain retouched document content; and optimizing the different intelligent agents, integrating output results of the optimized intelligent agents to obtain final document content, and storing the final document content to obtain final document output.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of text generation, and particularly relates to a document generation method based on agent cooperation. BACKGROUND

[0002] The application of agent cooperation in the field of document generation is becoming a key technology direction to improve efficiency and quality. With the rapid growth of information processing demand, the document generation method based on the cooperative work of multiple agents can effectively cope with complex task demand and is widely used in report writing, knowledge sorting and content creation scenes. However, the current related method still has significant limitations in practical application. Many solutions rely too much on the functional integration of a single agent, ignoring the dynamic coordination demand in multi-agent cooperation, which makes it difficult to achieve efficient task allocation and result integration when dealing with complex document tasks. In addition, the existing method lacks a unified standard in cross-agent data interaction and task scheduling, which easily causes information loss or low efficiency in the cooperation process.

[0003] These limitations reveal the core challenges in the field of agent cooperation document generation. First, the lack of unified cooperation standards makes it difficult for agents with different functions to seamlessly integrate in terms of communication protocols, data formats and interaction methods. For example, the data transmission between content collection agents and language polishing agents may cause information distortion or repeated work due to inconsistent formats. This problem further exacerbates the complexity of task allocation and parallel processing, because in the multi-task parallel architecture, agents need to handle tasks such as content generation, structure planning and language optimization at the same time, and the lack of efficient resource management and result synchronization mechanism will lead to task conflicts or inconsistent progress. These technical factors are interrelated, and the lack of cooperation standards directly affects the coordination of parallel processing, while the inefficiency of parallel processing in turn highlights the urgent need for unified cooperation standards.

[0004] Therefore, how to design an agent document generation method based on unified cooperation standards to realize efficient coordination and seamless integration of multi-task parallel processing has become the key problem of this research. SUMMARY

[0005] To solve the above technical problems, the application provides a document generation method based on agent cooperation to solve the problems existing in the prior art.

[0006] To achieve the above purpose, the application provides a document generation method based on agent cooperation, comprising:

[0007] The initial document data is acquired by a content collection agent, and the initial document data is standardized to obtain input content; the input content is distributed to different agents; wherein the input content includes standardized document data, framework requirements and polishing requirements; different agents include a content generation agent, a structure planning agent and a language polishing agent; the standardized document data is text generated by the content generation agent through a multi-task parallel processing mechanism to obtain preliminary document content; the preliminary document content is coordinated by the structure planning agent according to the framework requirements to obtain a structured document draft; the structured document draft is polished and optimized by the language polishing agent according to the polishing requirements to obtain polished document content; the different agents are optimized, and the output results of the optimized agents are integrated to obtain final document content, and the final document content is stored to obtain final document output.

[0008] Optionally, in the content collection agent, the process of standardizing the initial document data includes:

[0009] The initial document data is collated and formatted, consistency verification is performed on the initial document data, the verified data is supplemented, the supplemented data is classified, the classified structure is sorted, the sorted data is deeply analyzed, and it is judged whether the analysis result meets the standardized input requirements, based on the judgment result, the analysis result, the framework requirements and the polishing requirements are integrated to obtain the input content.

[0010] Optionally, the process of distributing the input content to different agents includes:

[0011] The consistency of the communication protocol between the input content and the agent is judged, and based on the consistency judgment result, the input content is distributed to different agents through a task scheduling efficiency mechanism.

[0012] Optionally, the process of text generation of the standardized document data through a multi-task parallel processing mechanism includes:

[0013] A parallel processing framework is adopted to assign text construction responsibilities to different content generation agents, the standardized document data is processed by different content generation agents to obtain preliminary text data, the preliminary text data is subjected to integrity detection, content is supplemented according to the integrity detection result to obtain adjusted text data, the adjusted text data is subjected to content correction to obtain corrected text data, the corrected text data is subjected to semantic coherence analysis through a natural language processing model to obtain semantic analysis results, the corrected text data is subjected to secondary optimization according to the semantic analysis results to obtain preliminary document content.

[0014] Optionally, the process of structurally planning and coordinating the preliminary document content according to the framework requirements comprises:

[0015] preliminary parsing the preliminary document content to obtain preliminary content units, classifying and collating the preliminary content units according to structural information, obtaining logical framework elements according to the classification and collation results, sorting and hierarchically dividing according to the logical framework elements in combination with the framework requirements to obtain a logical framework structure, supplementing the logical framework results to obtain complete framework content, and integrating information according to the complete framework content to obtain a structured document draft.

[0016] Optionally, the process of polishing and optimizing the language of the structured document draft according to the polishing requirements comprises:

[0017] judging the completeness of the structured document draft, structurally analyzing the structured document draft according to the completeness judgment result to obtain a logical framework evaluation result, adjusting the paragraph order and hierarchical relationship of the structured document draft according to the logical framework evaluation result using a content reorganization method to obtain a reorganized document draft, polishing the language of the reorganized document draft according to the polishing requirements to obtain a refined document content, detecting the semantic coherence of the refined document content through a semantic analysis model to obtain a semantic coherence score, adjusting the layout of the refined document content through a format standardization module according to the semantic coherence score to obtain a format-standardized document content, and checking the use of terms and context logic of the document using a content consistency detection algorithm according to the format-standardized document content to obtain a polished document content.

[0018] Optionally, the process of optimizing the different intelligent agents comprises:

[0019] obtaining load information of different intelligent agents, judging the load information, marking high-load units, obtaining tasks to be allocated corresponding to the high-load units, and sorting the tasks to be allocated, according to the sorting result, matching the tasks to be allocated with the remaining load units in terms of capability, according to the matching result, allocating the tasks to be allocated to corresponding load units, i.e., intelligent agents, to obtain a preliminary allocation result, detecting the load change trend of each intelligent agent according to the preliminary allocation result, judging whether there is a phenomenon of uneven load by comparing the change trend with historical data, obtaining an adjustment requirement list, optimizing the task allocation of the intelligent agents using a genetic algorithm according to the adjustment requirement list to obtain an adjusted task allocation scheme, and allocating tasks to the intelligent agents according to the adjusted task allocation scheme to obtain optimized intelligent agents.

[0020] Optionally, the process of integrating the output results of the optimized intelligent agents comprises:

[0021] The document content polished by the different language polishing agents is obtained through a synchronization mechanism, the polished document contents are classified, the classified data groups are determined, the repeated and redundant data is removed, the data after the repeated and redundant data removal is grouped, merged and formatted, and the formatted data is integrated through a preset document template to obtain the final document content.

[0022] Optionally, the final document content is stored through a data interaction efficiency mechanism.

[0023] In another aspect, the application provides a document generation system based on agent cooperation, which is used to execute the method described above.

[0024] Compared with the prior art, the application has the following advantages and technical effects:

[0025] The application discloses an intelligent document generation system, which realizes the cooperative work of multiple agents by pre-establishing a unified cooperation standard. The initial data is obtained from a content collection agent, and after standardized processing, the initial data is distributed to content generation, structure planning and language polishing agents by a task scheduling mechanism. A multi-task parallel processing framework is adopted, the content generation agent executes text generation, the structure planning agent extracts a logical framework, and the language polishing agent performs optimization. The application further includes a resource management mechanism, which dynamically adjusts the task distribution scheme to improve processing efficiency. Finally, the outputs of the agents are integrated through a result synchronization mechanism, and are stored in a unified database through a data interaction efficiency mechanism to realize the automatic generation of high-quality documents. The application effectively solves the problems of multi-agent cooperation, task scheduling and resource management, and significantly improves the efficiency and quality of document generation. BRIEF DESCRIPTION OF DRAWINGS

[0026] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application and serve as an aid in explaining the present application and its implementation. The schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation on the present application. In the drawings:

[0027] Figure 1 A flowchart of the document generation method based on agent cooperation according to an embodiment of the application;

[0028] Figure 2 A structure schematic diagram of the document generation system based on agent cooperation according to an embodiment of the application. DETAILED DESCRIPTION

[0029] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0030] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0031] like Figure 1 The document generation method based on agent collaboration described in this embodiment may specifically include:

[0032] S101. By using a pre-established unified collaboration standard, initial document data is obtained from the content collection agent, the uniformity of the data format is determined, and standardized input content is obtained.

[0033] Initial document data is acquired through a content collection agent based on preset standards. This data undergoes preliminary processing to obtain pre-processed document data. Based on this pre-processed data, a format standardization rule is applied for comparison. If the data format does not conform to the preset standard, a conversion tool is used to adjust the format, ensuring consistent document data. For format-consistent document data, consistency verification rules are obtained, and these rules are used to check each item in the document data to determine if there are any format deviations, resulting in verified document data. The verified document data is then mapped using a standardized input template. For missing fields encountered during mapping, if the number of missing fields exceeds a preset threshold, supplementary data is retrieved from the content collection module to determine complete mapped document data. Based on the complete mapped document data, a decision tree algorithm is used to classify the data content. The classification results are then prioritized, resulting in sorted document data. Data processing rules are obtained from the sorted document data. High-priority data is subjected to deep analysis to determine if the analysis results meet the standardized input requirements. If not, the process returns to the format standardization step for reprocessing, obtaining the final standardized input content. The final standardized input content is stored in a structured manner using storage tools. To address potential storage conflicts during the storage process, if a conflict is detected, the input content is split and processed through an alternative storage path to obtain persistent input content.

[0034] In one possible implementation, the content collection module can obtain document data from an enterprise's internal knowledge base via a web crawler.

[0035] For example, a company's knowledge base contains employee handbooks, technical reports, etc. The web crawler filters by file type, such as PDF or Word, to obtain 1000 initial documents. During the initial processing, metadata such as title, date, and author is extracted, and duplicate files are removed, resulting in 800 valid documents. This step ensures data clarity and lays the foundation for subsequent processing.

[0036] For example, if the formatting rules require dates to be in the YYYY-MM-DD format, and some documents are found to have dates in MM / DD / YYYY format, a conversion tool is used to adjust them to the standard format, generating 800 documents with the same format. This step improves data consistency and facilitates system processing.

[0037] It should be noted that consistency verification rules may include field integrity checks and data type validation.

[0038] For example, if the verification process finds that 50 documents are missing the author field, accounting for 6.25%, which is less than the preset threshold of 10%, then the missing field is directly marked, and the verified document data is generated. This step reduces data errors and improves reliability.

[0039] In one possible implementation, the standardized input template requires documents to include four fields: title, author, date, and body text. During mapping, 20 documents were found to be missing body text, accounting for 2.5%, which is below the threshold of 5%. Therefore, without needing to re-acquire data, the missing values ​​were directly filled in, generating a complete set of 800 document data for mapping. This step ensures data integrity and supports subsequent analysis.

[0040] For example, the decision tree algorithm categorizes documents based on their subject matter, such as technical documents and administrative documents. After categorization, technical documents have a higher priority, accounting for 60%, while administrative documents account for 40%. After sorting by priority, 480 technical documents are ranked first. This step optimizes resource allocation, prioritizing critical content.

[0041] It should be noted that the data processing rules perform in-depth analysis of high-priority technical documents, such as extracting keywords and summaries.

[0042] For example, the analysis revealed that 10 technical documents had incomplete keywords, requiring a return to the format standardization process for adjustment. This step ensures the content meets standardization requirements and improves data quality.

[0043] In one possible implementation, structured storage uses a database to store the final standardized content, such as MongoDB storing 800 document data sets. If a storage conflict is detected, such as a duplicate primary key in the database, the conflicting data is saved to cloud storage via an alternative path. This step ensures data persistence, prevents data loss, and improves system robustness.

[0044] Understandably, the above process, through multi-step collaboration, ensures efficiency and accuracy from data collection to storage.

[0045] For example, standardized formatting and validation steps reduce data error rates by approximately 20%, categorization and sorting improve processing efficiency by 30%, and structured storage reduces the risk of data loss to 0.1%. These technological effects support the efficient operation of enterprise knowledge management and optimize decision support.

[0046] S102. If the format of the standardized input content is consistent with the preset communication protocol, the content is allocated to the content generation agent, the structure planning agent, and the language polishing agent through the task scheduling efficiency mechanism to obtain the preliminary task division results.

[0047] If the standardized content passes the format verification and is consistent with the preset communication protocol, the standardized content will be allocated to the content generation module, structure planning module, and language optimization module through the task scheduling mechanism to obtain the preliminary task allocation results.

[0048] For example, after processing standardized content and verifying its consistency with the preset communication protocol, the implementation of the task scheduling mechanism can be analyzed in detail from multiple perspectives. The core of the task scheduling mechanism lies in the rational allocation of resources to ensure that standardized content can be efficiently transferred to the content generation module, structure planning module, and language optimization module. Assuming a document processing system, the standardized content is an industry report that has passed format verification, containing a title, body text, and data tables, as well as framework requirements, polishing, or generation requirements. The task scheduling mechanism will, based on the functional characteristics of the modules, prioritize the assignment of the title, body text, and data tables to the content generation agent to generate more attractive expressions; the framework requirements will be assigned to the structure planning agent, which will first analyze the relevant structural content based on the original format to optimize the layout logic; finally, the language optimization agent will polish the entire text according to the polishing requirements to ensure that the language is fluent and conforms to industry standards.

[0049] For example, the specific implementation of the content generation module can be understood as matching and filling standardized content using a pre-defined template library. Suppose the main body of this industry report needs to highlight key information; the content generation module will, according to the template rules, present key data in bold or list format, while adding necessary transitional sentences to make the content more readable. This approach makes the final output document more intuitive and efficient in conveying information.

[0050] For example, in the implementation of the structure planning module, the logical hierarchy of standardized content can be analyzed to readjust the presentation order of the content according to the required framework. Taking the same industry report as an example, the structure planning module might place data tables after the main text as supplementary explanations, while adding a brief overview section before the main text to help readers quickly grasp the core content. This adjustment helps improve the overall logic and reading experience of the document.

[0051] For example, the language optimization module can focus on refining word choice and maintaining stylistic consistency. Using industry reports as an example, the module would detect redundant expressions or inconsistent wording, such as simplifying "due to..." to "because," and standardizing the expression of technical terms. This process makes the document more linguistically standardized and enhances its professionalism.

[0052] For example, the priority determination of the task scheduling mechanism when allocating tasks can also be a key point. Assuming limited system resources, the task scheduling mechanism will prioritize allocating large amounts of data to idle modules to avoid processing delays in subsequent modules due to data complexity. This dynamic adjustment of allocation strategy can effectively improve overall processing efficiency and ensure smooth collaboration among modules.

[0053] For example, during the initial task allocation process, the system may record the processing progress of each module to facilitate subsequent optimization of the scheduling strategy. Taking industry report processing as an example, if the language optimization module is found to be processing slowly, the system will adjust its allocation ratio, reducing its workload to ensure the overall task completion time. This feedback mechanism can continuously improve the rationality of task allocation and provide support for subsequent processing.

[0054] S103. Based on the preliminary task division results, a multi-task parallel processing framework is adopted to perform text generation operations on the content generation agent to obtain preliminary document content.

[0055] Based on the task division results, a parallel processing framework is used to assign specific text construction responsibilities to the content generation agent, obtaining preliminary text data. Based on the preliminary text data, a pre-established rule base is used to check the structural integrity during the text construction process. If the detection results show incomplete structure, the content is adjusted by supplementing the logical framework to determine the adjusted text data. The consistency of the agent's output is compared using the adjusted text data. If the comparison results show deviations, a preset calibration mechanism is used to correct the content, obtaining calibrated text data. Based on the calibrated text data, a natural language processing model is used to analyze the semantic coherence of the text, obtaining semantic analysis results. Based on the semantic analysis results, the clarity of expression in the text data is further optimized. If the optimized expression still does not meet the standards, a preset lexicon replacement mechanism is used for further adjustment, determining the optimized text data.

[0056] For example, in the business domain of content processing, parallel processing frameworks based on task division results can improve efficiency by rationally allocating responsibilities. The text construction responsibilities of a content generation agent can be refined into topic extraction and paragraph writing. Suppose a task is to generate an article about healthy eating; the agent might be assigned to generate an initial draft on the topic of "the importance of breakfast." The initial text data might contain a description of about 200 words, covering the impact of breakfast on energy replenishment and metabolism. This division of responsibilities allows each agent to focus on specific content, ensuring the relevance of the initial text data.

[0057] For example, for structural integrity checks on initial text data, a pre-established rule base can include checks such as paragraph logical order and the presence of topic sentences. Suppose the check finds that the text on the breakfast topic lacks a concluding sentence, resulting in an incomplete structure. The content can be adjusted by supplementing the logical framework, such as adding a concluding sentence like "Therefore, breakfast is the foundation of daily health" at the end of the paragraphs. The adjusted text data will be more complete. This approach effectively avoids missing logical content and improves the overall quality of the text.

[0058] For example, in the output consistency comparison stage, if discrepancies in tone or style are found between texts generated by different agents—such as one agent using a formal tone to describe breakfast while another uses a casual tone to describe lunch—then a pre-defined calibration mechanism is used to correct the content. This calibration mechanism might include unifying the tone to a neutral style to ensure consistent expression in the calibrated text data. This calibration helps improve the uniformity of the text and enhances the reading experience.

[0059] For example, in analyzing the semantic coherence of calibrated text data, natural language processing models can be used to detect whether the logical connections between sentences are smooth. Suppose the analysis finds an abrupt transition between "the importance of breakfast" and "nutritional balance" in a paragraph, the semantic analysis result will indicate insufficient connection. In this case, semantic coherence can be optimized by adding a transitional sentence, such as "While emphasizing breakfast, nutritional balance should not be ignored." This kind of analysis and optimization can make the text more fluent and improve the effectiveness of information delivery.

[0060] For example, in the secondary optimization of clarity, if the optimization still falls short—for instance, if certain technical terms like "metabolic rate" are not explained, making them difficult for ordinary readers to understand—a pre-defined terminology replacement mechanism is used to replace them with more colloquial expressions like "the rate at which the body consumes energy," thus determining the optimized text data. This adjustment makes the text more relevant to the target audience, improving readability and usability. Through these multifaceted processing and optimizations, the text data achieves a high level of logic, style, and expression, laying a solid foundation for subsequent applications.

[0061] S104. Through the structural planning and coordination mechanism, extract structural information from the preliminary document content, determine the logical framework of the document, and obtain a structured document draft.

[0062] Basic data is obtained from the initial document. Content parsing tools are used to initially break down the document content into preliminary content units. Based on these preliminary units, structural information is categorized and organized using pre-defined classification rules to determine the logical category of each unit and establish content groups. From these categorized content groups, key logical framework elements are extracted. Information extraction techniques are used to extract information fragments related to framework construction, resulting in a set of framework elements. For this set of framework elements, combined with structural planning requirements (pre-defined framework requirements), a coordination mechanism is used to sort and hierarchically divide the elements, determining the document's logical framework structure. If there are missing or redundant parts in the logical framework structure, content analysis techniques are used to perform a secondary scan of the initial document to obtain supplementary information, resulting in complete framework content. Based on the complete framework content and using structured processing methods, the information is integrated into a unified format to generate a structured document draft. The structured document draft is then validated using a logical consistency detection tool to determine if there are any deviations in the framework construction, resulting in the final, adjusted document draft.

[0063] For example, in the field of content generation, the process of obtaining basic data from an initial document can be understood as extracting a set of usable information from raw text. Suppose the initial document is a market analysis report containing market trends, user needs, and competitor information. Content parsing tools will break the document down into paragraph-level units, such as "market size growth trends" or "changes in user preferences." This can be achieved using text segmentation algorithms from natural language processing, which divide the document into independent content units based on semantic boundaries. This decomposition ensures the accuracy of subsequent classification. In the classification and organization stage, for the decomposed content units, pre-defined classification rules can be based on semantic tags or keyword matching.

[0064] For example, content units in a market analysis report may be categorized into categories such as "trend description," "data support," and "competitive analysis."

[0065] Specifically, pre-trained classification models can be used to automatically label data based on keywords such as "growth rate" and "user profile." For example, if a report mentions "the market size is expected to reach 50 billion yuan by 2025," this unit would be categorized as "data support," while "users prefer mobile services" would be categorized as "user preferences." This classification method facilitates subsequent framework construction. For extracting the framework's element set, information extraction techniques can focus on key information.

[0066] For example, specific values ​​such as "50 billion yuan" or "annual growth rate of 10%" can be extracted from the "data support" category, and "mobile services" can be extracted as the core element from "user preferences".

[0067] In one possible implementation, named entity recognition technology can be used to accurately locate numerical values, time points, or keywords in the document. After extraction, these elements are organized into a set of framework elements, such as "market size," "growth rate," and "user needs," providing a foundation for constructing the logical framework. When the coordination mechanism sorts and hierarchically divides the elements, priority rules can be used to determine the framework structure.

[0068] For example, the logical framework of a market analysis report may use "market background" as the top-level node, which includes "scale data", "growth trends" and "user needs".

[0069] Specifically, a weighted allocation algorithm can be used to rank elements based on their importance (such as the size of the data or the urgency of user needs). For example, if "market size of 50 billion yuan" has a high weight, it would be placed at the top of the framework. This ranking method ensures the document structure is logically clear. If any gaps in the logical framework are found, a second scan can supplement the information.

[0070] For example, if the framework is found to be missing "competitor analysis", the initial document can be rescanned to extract relevant descriptions such as "the main competitor's market share is 30%".

[0071] In one embodiment, missing information can be located using semantic search technology and supplemented to form a complete framework. This supplementation mechanism improves the comprehensiveness of the document. When integrating it into a structured document draft, a template-based method can be used to fill in the framework content into a preset format.

[0072] For example, the initial draft of the generated market analysis report includes three main sections: "Market Overview," "Data Analysis," and "User Insights," with each section containing corresponding content elements. The validation phase uses a logical consistency checker to verify the smooth transitions between sections.

[0073] For example, verify whether the descriptions in the "User Needs" section are consistent with those in the "Market Trends" section. If discrepancies are found, such as contradictions between user needs and market data, they can be corrected by adjusting the wording or providing supplementary explanations.

[0074] For example, when finalizing the draft document, if a discrepancy is found between "10% growth rate" and "market size of 50 billion yuan" in terms of timeframe, it can be adjusted by checking the original data to "10% growth rate in 2024, and an estimated 50 billion yuan in 2025." This correction ensures the logical rigor and data consistency of the document content, providing a reliable foundation for subsequent analysis.

[0075] S105. If the logical framework integrity of the structured document draft meets the preset threshold, then through the language polishing precision mechanism, the language polishing agent is called to optimize the draft and obtain the polished document content.

[0076] If the logical framework integrity of the structured document does not reach a preset threshold, the framework analysis module performs structured parsing on the document draft to obtain an evaluation result of the logical framework. Based on the evaluation result, a content reorganization algorithm is used to adjust the paragraph order and hierarchical relationships of the document draft, resulting in a reorganized document draft. If the logical framework integrity of the reorganized document draft reaches a preset threshold, a language optimization mechanism is used to refine the text of the draft using a pre-trained language optimization agent, resulting in refined document content. Based on the refined document content, a semantic analysis model is used to detect the semantic coherence of the text, resulting in a semantic coherence score. If the semantic coherence score reaches a preset standard, the formatting module adjusts the document content for layout, resulting in formatted document content. Based on the formatted document content, a content consistency detection algorithm is used to verify the terminology usage and contextual logic of the document, resulting in the final verified document content. The document storage module saves the final verified document content to a preset database and obtains a storage identifier.

[0077] For example, when assessing the logical framework completeness of a structured document, the framework analysis module can be used to conduct an in-depth analysis of the draft document. If the logical framework completeness fails to meet a preset threshold, it may be due to uneven content distribution or unclear hierarchy. Assuming the preset threshold is 80 points, and the current draft document only scores 60 points, the analysis may reveal that some key topics lack supporting content. In this case, the framework analysis module will identify the missing parts, such as a chapter lacking necessary background information, thus providing a basis for subsequent adjustments.

[0078] For example, when applying content reorganization algorithms, adjustments can be made to paragraph order and hierarchical relationships. Suppose the original draft document's discussion of a certain topic is scattered across multiple paragraphs, appearing fragmented. The reorganization algorithm will integrate related content into the same section and arrange it logically from background to detail. After adjustment, the document draft's completeness score may increase from 60 to 82 points, reaching the preset threshold. This reorganization method makes the document's structure clearer, allowing readers to quickly grasp the core content.

[0079] For example, in language optimization mechanisms, combining polishing requirements with a pre-trained language optimization agent to refine the draft text can effectively improve document readability. Suppose the original draft contains lengthy descriptions, such as a paragraph expressing a simple concept in 100 words; after optimization, this might be reduced to 50 words, retaining core information while reducing redundancy. Polishing requirements can include word count and formatting requirements. Language optimization is achieved through a large model, with polishing requirements provided as corresponding prompts. This refinement process not only improves the document's conciseness but also highlights key content.

[0080] For example, when semantic analysis models are used to detect the semantic coherence of text, a scoring mechanism can be used to determine whether the context flows naturally. Suppose a passage suddenly switches to irrelevant content while describing the main topic, resulting in a semantic coherence score of only 65 points, failing to meet the preset standard of 75 points. The model will mark the problematic area and suggest adding transition sentences or adjusting the content order. After optimization, the score may improve to 78 points, ensuring the document's logical flow.

[0081] For example, the formatting standardization module can unify visual elements such as font and paragraph spacing in a document. Suppose the original draft document had inconsistent heading levels and inconsistent paragraph indentation; after standardization, all headings will use different font sizes according to their level, and paragraph spacing will be uniformly set to 1.5 line spacing. This adjustment makes the document appear more professional, easier to read, and easier to archive.

[0082] For example, content consistency detection algorithms can identify potential problems when verifying terminology usage and contextual logic. If the same term is used differently in different sections of a document, the algorithm will suggest unifying it to the standard terminology and check for inconsistencies in the contextual logic, ensuring stronger document coherence. This verification avoids misunderstandings caused by inconsistent terminology.

[0083] For example, when the document storage module saves the final content to the preset database, it generates a unique storage identifier. Assuming the system returns the identifier code DOC20231001 after saving, it facilitates subsequent retrieval and version management. This storage method ensures document security and traceability, providing convenience for long-term maintenance.

[0084] S106. Based on the polished document content, a resource management mechanism is used to detect the processing load of each intelligent agent, determine the task scheduling efficiency, and obtain an optimized task allocation scheme.

[0085] By collecting operational data from each agent, real-time processing load information is obtained to determine the load distribution. Based on the load distribution, a preset threshold is used for comparison. If the load of an agent exceeds the threshold, it is marked as a high-load unit, resulting in a high-load unit list. For the high-load unit list, the tasks to be assigned in the current task queue are obtained, and a priority sorting method is used to determine the urgency of the tasks, identifying a set of higher-priority tasks. From the set of higher-priority tasks, specific task requirements are extracted. If the task requirements match the capabilities of low-load agents, they are assigned to the corresponding agents, resulting in a preliminary allocation result. Based on the preliminary allocation result, the load change trend of each agent is detected. By analyzing the change trend and comparing it with historical data, it is determined whether there is an uneven load, and an adjustment requirement list is determined. For the adjustment requirement list, a genetic algorithm is used to optimize the task allocation, obtaining an adjusted task allocation scheme and determining the final scheduling arrangement. By monitoring the execution of the final scheduling arrangement in real time, load fluctuation data during execution is obtained to determine whether further fine-tuning is needed, resulting in the optimized operating state.

[0086] For example, in the field of agent load management, the collection of operational data can be achieved through a real-time monitoring system to obtain the processing workload and response time of each agent. Suppose a document processing system has five agents responsible for processing tasks in different modules. The system collects data every minute and finds that agent A's processing workload reaches 1000 tasks per hour, far exceeding the preset threshold of 800 tasks per hour, and is therefore marked as a high-load unit. This data collection method can reflect the load distribution in a timely manner, providing data support for subsequent adjustments.

[0087] For example, after identifying the list of high-load units, the priority of tasks to be assigned can be sorted according to their urgency and importance. Suppose there are 10 tasks in the current task queue, of which 3 involve urgent polishing of core documents; the system would assign these 3 the highest priority and place them in the high-priority task set. This method ensures that critical tasks receive priority resource allocation, avoiding delays to important tasks due to load issues.

[0088] For example, during task allocation, the matching of task requirements with agent capabilities can be quickly filtered using capability tags. Suppose a high-priority task set includes a task requiring language optimization capabilities, and agent B currently has a low workload and possesses the relevant capabilities; the system would then allocate the task to agent B, obtaining a preliminary allocation result. This matching mechanism improves the targeting of task processing and ensures efficient resource utilization.

[0089] For example, when detecting load change trends, historical data can be compared and analyzed to determine if there is uneven load distribution. Suppose that after agent B is assigned new tasks, its load increases from 300 tasks per hour to 600, while agent C remains at 200. By comparing the average load data over the past 24 hours, the system identifies the uneven load and generates a list of adjustment needs. This analytical approach helps to identify potential problems in a timely manner and provides a basis for optimizing task allocation.

[0090] For example, in task allocation optimization calculations, genetic algorithms can be used to simulate the advantages and disadvantages of multiple rounds of allocation schemes. Assuming the system generates 10 allocation combinations, by evaluating the load balancing and task completion efficiency of each scheme, a scheme is ultimately selected that keeps the load on all agents at approximately 500 tasks per hour, forming the final scheduling arrangement. This optimization method can effectively balance resource distribution and improve overall operational stability.

[0091] For example, in real-time monitoring after the final scheduling is executed, the system can record load fluctuation data every 5 minutes. Suppose that agent D's load suddenly rises to 700 tasks per hour during execution, the system determines that fine-tuning is needed, reallocating some tasks to agent E with a lower load, ultimately stabilizing the load on each agent. This monitoring mechanism can dynamically respond to changes, ensuring the system continues to operate efficiently.

[0092] S107. Through the result synchronization mechanism, extract the output data of each agent from the optimized task allocation scheme to obtain the final integrated document content.

[0093] The system acquires task-assigned output data from multiple agents through a synchronization mechanism, integrates it to form a preliminary content set, and obtains the initial data integration result. Based on the preliminary content set, data extraction techniques are used to classify the output data of each agent, determining the classified data groups. If duplicate or redundant information exists in the classified data groups, deduplication is performed to clean the data, obtaining a cleaned data set. For the cleaned data set, content integration logic is used to merge related data groups, determining the content framework that conforms to the document structure. Based on the content framework, the merged data is formatted to obtain formatted document fragments. Based on the formatted document fragments, a preset document template is used for final integration to obtain the complete document content.

[0094] For example, in data integration scenarios following task allocation, the synchronization mechanism can be implemented by starting with the output data of multiple agents to ensure the real-time nature and consistency of data acquisition. Suppose in a collaborative document generation system, five agents are responsible for the content output of different modules. The synchronization mechanism can use timed polling to retrieve the latest data from each agent every 30 seconds, forming a preliminary content set containing all outputs. This approach ensures no data is missed and lays the foundation for subsequent processing.

[0095] Specifically, data extraction techniques can be applied to the classification and processing of output data. Assuming the output data from the five agents includes various formats such as text, tables, and charts, classification can be performed by grouping data according to its type; for example, text can be grouped into one category, and tables into another. This approach makes data grouping clearer and facilitates subsequent deduplication and integration.

[0096] It should be noted that the classification criteria can be adjusted according to actual needs, such as further subdividing by content theme to ensure the accuracy of grouping.

[0097] For example, deduplication plays a crucial role in cleaning datasets. Suppose that in a grouped dataset after classification, the text output by two agents has 80% similarity. Deduplication can compare keywords and sentence structure to remove duplicates, retaining only the core content and generating a cleaned dataset. This method effectively reduces redundant information, improves data quality, and provides more concise material for content integration.

[0098] Specifically, the implementation of content integration logic can be based on the relevance of data grouping. Suppose that in the cleaned dataset, there is a set of text data and a set of tabular data both related to a certain topic. The integration logic can merge these two sets of data into a complete document paragraph, ensuring the logical coherence of the content framework. Through this merging method, the document's content structure becomes more compact, and the information expression is more coherent.

[0099] For example, formatting and document template integration can further improve document readability. Assuming the merged data has formed multiple document fragments, formatting can standardize fonts, paragraph spacing, and other styles, such as setting the body text to 14-point font and 1.5 line spacing. Subsequently, a pre-defined document template can embed these fragments into their corresponding chapter positions, such as placing the introduction on the first page and arranging the main content sequentially, ultimately generating a well-structured document. This approach not only improves the document's visual appeal but also facilitates subsequent review and use.

[0100] It should be noted that the implementation methods of each step mentioned above are mutually supportive, forming a complete technical chain from data acquisition to final integration. The synchronization mechanism ensures data comprehensiveness, classification and deduplication improve data refinement, while integration logic and formatting ensure the document's logical consistency and standardization. The collaborative work of these steps effectively improves the overall efficiency of the document generation system, providing reliable support for intelligent agent collaboration scenarios.

[0101] S108. If the completeness of the final integrated document content meets the preset threshold, the document content is stored in a unified database through a data interaction efficiency mechanism to obtain the final document output.

[0102] The content inspection module assesses the completeness of the document content, obtains the assessment results, and determines whether a preset threshold has been reached. If the assessment results reach the preset threshold, a data interaction process is triggered, and the document content is formatted using an efficiency mechanism to obtain a processed content set. Based on the processed content set, a stored procedure is initiated to transmit the content set to a unified database, and the transmission is checked for completion. If the transmission is complete, the database management module constructs an index for the stored content set and obtains index identification information. A pre-established verification model is used to perform a consistency check on the stored content based on the index identification information, and the check result is determined. Based on the check result, if the consistency check passes, the output generation module converts the format of the stored content to obtain the final output document. If the consistency check fails, the process is backtracked to the stored procedure, and the transmission and index construction are re-executed to obtain new index identification information. This process is repeated until the consistency check passes.

[0103] For example, in the document content completeness assessment stage, a content detection module can perform multi-dimensional analysis of the document's structure, paragraph completeness, and information coverage. Assuming a document needs to include an introduction, body, and conclusion, the detection module will compare the document to each of these key parts to determine if their word count proportions are reasonable—for example, an introduction of 10%, a body of 80%, and a conclusion of 10%. If the body is found to be insufficient, the assessment result might show a completeness of 75%, falling short of the preset threshold of 85%, thus requiring additional content.

[0104] For example, when triggering data interaction processes and performing formatting, efficiency mechanisms can be used to standardize and adjust document content. Assuming the document contains multiple fonts and paragraph formats, the efficiency mechanism will unify the font to SimSun, the font size to 12, and the first-line indent of each paragraph to 2 characters, ensuring visual consistency across the content. This approach improves document readability and facilitates subsequent storage and output.

[0105] For example, when transferring a content collection to a unified database, batch transmission can ensure data integrity. Assuming the content collection is 50MB, the system will split it into five 10MB files, upload them one by one, and check for completeness by comparing checksums after each transmission. If a small file fails to transmit, only that part will be re-uploaded, reducing resource waste.

[0106] For example, when building index identification information in the database management module, a unique identifier can be generated for each document. Suppose a document's identifier is DOC20231001, the system can quickly locate its storage location based on this identifier. This indexing method improves the efficiency of subsequent retrievals and saves search time.

[0107] For example, in the consistency check phase, a pre-established verification model can perform multiple comparisons of the stored content. If the model detects differences between the stored content and the original content in certain paragraphs, such as a missing sentence, the check will be marked as failed. At this point, the system will backtrack to the stored procedure, retransmit the data, and rebuild the index until the content is consistent. This mechanism ensures the accuracy of the document.

[0108] For example, in the format conversion of the final output document, the output generation module can convert the stored content into multiple formats. Assuming the user requires a PDF format, the system will automatically adjust the content layout and embed necessary metadata to ensure the output document meets the user's expectations. This flexibility can meet the needs of different usage scenarios.

[0109] For example, in the loop checks of a backtracking stored procedure, a maximum number of retries can be set to avoid infinite loops. Assuming a maximum of 3 retries, if the consistency check still fails, the system will log the information and notify the administrator. This design ensures both process stability and provides contingency plans for exceptional situations. These various implementation methods support each other, ensuring the integrity and reliability of the document processing workflow.

[0110] On the other hand, such as Figure 2 As shown, this invention provides a document generation system based on intelligent agent collaboration, mainly comprising:

[0111] The content collection standardization module is used to obtain initial document data from the content collection agent through a pre-established unified collaboration standard, determine the uniformity of data format, and obtain standardized input content.

[0112] The task scheduling and allocation module is used to allocate the standardized input content to the content generation agent, the structure planning agent, and the language polishing agent through the task scheduling efficiency mechanism if the format of the standardized input content is consistent with the preset communication protocol, so as to obtain the preliminary task division results.

[0113] The text generation and processing module is used to perform text generation operations on the content generation agent based on the preliminary task division results, using a multi-task parallel processing framework to obtain preliminary document content.

[0114] The structure planning and coordination module is used to extract structural information from the initial document content through the structure planning and coordination mechanism, determine the logical framework of the document, and obtain a structured document draft.

[0115] The language polishing and optimization module is used to optimize the draft by calling the language polishing agent through the language polishing precision mechanism if the logical framework integrity of the structured document draft meets the preset threshold, and obtain the polished document content.

[0116] The resource management and scheduling module is used to detect the processing load of each intelligent agent based on the polished document content, using a resource management mechanism, to determine the task scheduling efficiency and obtain an optimized task allocation scheme.

[0117] The result synchronization and integration module is used to extract the output data of each agent from the optimized task allocation scheme through the result synchronization mechanism, and obtain the final integrated document content.

[0118] The data storage and output module is used to store the document content in a unified database and obtain the final document output if the completeness of the finally integrated document content meets the preset threshold.

[0119] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A document generation method based on agent collaboration, characterized in that, include: The initial document data is obtained through a content collection agent, and the initial document data is standardized to obtain the input content; The input content is assigned to different intelligent agents; the input content includes standardized document data, framework requirements, and polishing requirements; the different intelligent agents include a content generation agent, a structure planning agent, and a language polishing agent; the content generation agent generates text from the standardized document data through a multi-task parallel processing mechanism to obtain preliminary document content; The structure planning agent coordinates the structure of the initial document content according to the framework requirements to obtain a structured document draft; the language polishing agent optimizes the structured document draft according to the polishing requirements to obtain the polished document content. The different agents are optimized, and the outputs of the optimized agents are integrated to obtain the final document content. The final document content is then stored to obtain the final document output.

2. The method according to claim 1, characterized in that, In the content collection agent, the process of standardizing the initial document data includes: The initial document data is organized and formatted, and consistency checks are performed. The checked data is then supplemented and categorized. The categorized data is sorted, and the sorted data is subjected to in-depth analysis. The analysis results are then assessed to determine if they meet the standardized input requirements. Based on the assessment results, the analysis results, framework requirements, and polishing requirements are integrated to obtain the input content.

3. The method according to claim 1, characterized in that, The process of assigning the input content to different agents includes: A consistency judgment is made on the communication protocol between the input content and the agent. Based on the consistency judgment result, the input content is allocated to different agents through a task scheduling efficiency mechanism.

4. The method according to claim 1, characterized in that, The process of generating text from the standardized document data using a multi-task parallel processing mechanism includes: A parallel processing framework is adopted, assigning text construction responsibilities to different content generation agents. The standardized document data is processed by different content generation agents to obtain preliminary text data. The preliminary text data is then subjected to integrity checks, and content is supplemented based on the integrity check results to obtain adjusted text data. The adjusted text data is then subjected to content correction to obtain corrected text data. The corrected text data is then subjected to semantic coherence analysis using a natural language processing model to obtain semantic analysis results. Based on the semantic analysis results, the corrected text data is further optimized to obtain the preliminary document content.

5. The method according to claim 1, characterized in that, The process of structurally planning and coordinating the content of the preliminary document according to the framework requirements includes: The initial document content is initially analyzed to obtain initial content units. The initial content units are then classified and organized according to their structural information. Based on the classification and organization results, logical framework elements are obtained. These logical framework elements are then sorted and hierarchically divided according to the framework requirements to obtain the logical framework structure. The logical framework results are then supplemented to obtain the complete framework content. Finally, the information is integrated based on the complete framework content to obtain a structured document draft.

6. The method according to claim 1, characterized in that, The process of refining and optimizing the structured document draft according to the polishing requirements includes: The structured document draft is subjected to an integrity assessment. Based on the integrity assessment result, the structured document draft is parsed to obtain a logical framework evaluation result. Based on the logical framework evaluation result, a content reorganization method is used to adjust the paragraph order and hierarchical relationship of the structured document draft to obtain a reorganized document draft. According to the polishing requirements, the language of the reorganized document draft is optimized to obtain refined document content. The semantic coherence of the refined document content is detected by a semantic analysis model to obtain a semantic coherence score. Based on the semantic coherence score, the formatting of the refined document content is adjusted by a format standardization module to obtain formatted document content. Based on the formatted document content, a content consistency detection algorithm is used to verify the terminology usage and contextual logic of the document to obtain polished document content.

7. The method according to claim 1, characterized in that, The process of optimizing the different intelligent agents includes: The system acquires load information from different agents, assesses the load information, marks high-load units, obtains the tasks to be assigned corresponding to high-load units, sorts these tasks, matches their capabilities with other load units based on the sorting results, and assigns the tasks to the corresponding load units (agents) based on the matching results, obtaining preliminary allocation results. Based on these preliminary allocation results, the system detects the load change trends of each agent, analyzes the trends and compares them with historical data to determine if there is any uneven load distribution, and obtains an adjustment requirement list. For this list, a genetic algorithm is used to optimize the task allocation of the agents, obtaining an adjusted task allocation scheme. The system then allocates tasks to the agents according to the adjusted scheme, resulting in optimized agents.

8. The method according to claim 1, characterized in that, The process of integrating the optimized output of the agent includes: The system obtains polished document content from different language polishing agents through a synchronization mechanism, classifies the different polished document content, determines the data groups after classification, removes duplicates and redundancies from the data groups, merges and formats the grouped data after the removal of duplicates and redundancies, and integrates the formatted data through a preset document template to obtain the final document content.

9. The method according to claim 1, characterized in that, The final document content is stored through a data interaction efficiency mechanism.

10. A document generation system based on agent collaboration, characterized in that, Used to perform the method described in any one of claims 1-9.

Citation Information

Cited By

  • Government affair intelligent writing method and system based on multi-Agent collaboration and long memory technology

    CN121327156A

  • A method and system for intelligent government writing based on multi-agent collaboration and long memory technology

    CN121327156B

  • Demand document collaborative generation method and device

    CN121480455A

  • Task-driven writing file generation method and device, equipment and medium

    CN121920792A