Document generation method and device based on configurable rules and multi-agent collaboration
Patent Information
- Application Number
- CN202610841058.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2046-06-11
AI Technical Summary
当前报告生成技术以人工编制为核心、低自动化信息化工具为辅助,主流实现方式分为两类:一是基于固定模板的人工编辑方式,运检人员需对照Word、PDF静态模板,结合原始资料逐条填写调整,无法根据实际场景自适应优化,存在大量重复劳动;二是基于简单表单系统的半自动整理方式,如PMS等电网信息化系统,仅能归集结构化数据,无法完成数据到自然语言的转换,仍需人工导出数据手动撰写报告内容
[0015]本申请提供的基于可配置规则及多智能体协同的文档生成方法及设备,首先将待生成的作业方案拆分为多个独立的参数单元,并为每一参数单元建立对应的参数生成规则和参数生成说明;其次,基于参数生成规则、参数生成说明以及作业方案生成所需的业务数据构建知识库;然后接收用户输入,根据用户输入解析用户意图以确定待生成的方案类型,并根据方案类型确定需要生成的参数列表;进一步地,针对参数列表中的待生成的参数,由规划智能体从知识库中检索对应的参数生成规则和参数生成说明,并根据检索结果调用相应的子智能体,由子智能体按照预设循环流程生成相应的参数;最后,当参数列表中的所有待生成的参数生成完成后,将所有参数的内容整合形成最终的作业方案。综上,本申请通过知识库集中化管理、Prompt工程分层设计及多智能体协作机制,显著提升输电作业方案自动生成的效率与准确性,增强作业方案生成过程的可维护性,为其提供可靠技术支撑,进一步降低人力投入与时间成本,提升输电运维工作整体效能,实现方案生成过程的自动化、标准化与可持续迭代,具有显著的工程应用价值和推广前景。
Smart Images

Figure CN122389823B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent operation and maintenance technology of power systems, specifically involving a document generation method based on configurable rules and multi-agent collaboration, a document generation system based on configurable rules and multi-agent collaboration, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Currently, after the maintenance of transmission and distribution lines in the power grid operation and maintenance field is completed, maintenance personnel are required to prepare structured maintenance work reports. Current report generation technology relies primarily on manual compilation, supplemented by low-automation information tools. The main implementation methods fall into two categories: one is manual editing based on fixed templates, where maintenance personnel must refer to static Word or PDF templates and fill in and adjust each line according to the original data, which cannot adaptively optimize based on actual scenarios and involves a large amount of repetitive work; the other is a semi-automatic compilation method based on simple form systems, such as power grid information systems like PMS, which can only collect structured data and cannot complete the conversion of data to natural language, still requiring manual data export and report writing. Both methods have significant limitations and are difficult to adapt to the actual needs of power grid operation and maintenance.
[0003] These limitations have further exposed numerous prominent problems in practical applications: Parameter rules are scattered across related technologies, data retrieval efficiency is low, and the tight coupling between agent logic and business rules in traditional systems leads to frequent code modifications required for adding parameters or adjusting rules. Furthermore, the generation of related solutions relies on manual intervention, and dependencies between parameters are difficult to handle. Based on this, the overall process is highly dependent on manual intervention, resulting in low operational efficiency and high time costs. Manual operation throughout the entire process significantly consumes the core technical time of operation and maintenance personnel, making it unsuitable for large-scale, high-frequency maintenance needs. Report standardization is insufficient, quality stability is poor, and it is greatly affected by differences in personnel experience, making it difficult to meet the requirements of lean management in power grid operation and maintenance. The ability to integrate multi-source data and automate processing is weak, requiring manual cross-system data verification, which is prone to errors. Scenario adaptability is insufficient; fixed templates and simple rules cannot cover diverse maintenance scenarios. The flexibility and scalability of the solutions are insufficient, making it difficult to adapt to business iterations and the digital transformation needs of the power grid. In summary, improving the automation, intelligence, and standardization of maintenance operation report generation has become an urgent industry technical and management challenge. Summary of the Invention
[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a document generation method and device based on configurable rules and multi-agent collaboration.
[0005] In a first aspect, embodiments of this application provide a document generation method based on configurable rules and multi-agent collaboration, including: The job plan to be generated is divided into multiple independent parameter units, and corresponding parameter generation rules and parameter generation instructions are established for each parameter unit. A knowledge base is built based on parameter generation rules, parameter generation instructions, and business data required for job plan generation. Receive user input, parse the user intent based on the user input to determine the type of solution to be generated, and determine the list of parameters to be generated based on the solution type; For the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results. The sub-agents then generate the corresponding parameters according to the preset loop process. Once all parameters to be generated in the parameter list have been generated, the contents of all parameters are integrated to form the final job plan.
[0006] In some embodiments, business data includes line ledger information categorized and stored by line name or unique identifier, as well as professional business knowledge indexed by business keywords. The method also includes: When determining the route ledger information according to the parameter generation rules, the called sub-agent retrieves the corresponding route ledger information from the knowledge base by route name; When professional business knowledge is determined according to the parameter generation rules, the called sub-agent retrieves the corresponding professional business knowledge according to the business keywords.
[0007] In some embodiments, the parameter generation rules include at least one of the following: Does this parameter depend on the generation results of other parameters? Is this parameter generated based on user-uploaded file information? Does this parameter depend on route ledger information? Does this parameter need to generate corresponding image information?
[0008] In some embodiments, the preset loop process includes: Determine the generation logic of the current parameter; Generate parameter content based on the generation logic; Check whether the generated parameter content conforms to the preset rules. If it does not conform, repeat the steps of determining the generation logic of the current parameter and generating the parameter content according to the generation logic until the generated parameter content conforms to the preset rules or the maximum number of loops is reached.
[0009] In some embodiments, the sub-agent includes at least one of a parameter-dependent agent, a document analysis agent, a ledger analysis agent, and a drawing agent; The corresponding sub-agents are invoked based on the search results, including: Based on the parameter dependency type indicated by the parameter generation rules, the corresponding sub-agents are called from the parameter dependency agent, document analysis agent, ledger analysis agent, and drawing agent.
[0010] In some embodiments, the method further includes: When the called sub-agent is a ledger analysis agent, it retrieves structured ledger data related to the target line or tower from the knowledge base and generates parameter content based on the structured ledger data.
[0011] In some embodiments, the method further includes: When the called sub-agent is a drawing agent, a single-stage direct generation mechanism is adopted to generate structured graphic data based on the survey records uploaded by the user and the predefined drawing rules, and then output the structured graphic data to the drawing tool to generate the corresponding image information.
[0012] Secondly, embodiments of this application provide a document generation system based on configurable rules and multi-agent collaboration, comprising: The splitting module is configured to split the job plan to be generated into multiple independent parameter units, and to establish corresponding parameter generation rules and parameter generation instructions for each parameter unit. The building module is configured to build a knowledge base based on parameter generation rules, parameter generation instructions, and business data required for job plan generation. The input module is configured to receive user input data, parse the user intent based on the user input data to determine the type of solution to be generated, and determine the list of parameters to be generated based on the solution type; The calling module is configured to retrieve the corresponding parameter generation rules and parameter generation instructions from the knowledge base for the parameters to be generated in the parameter list, and call the corresponding sub-agents according to the retrieval results. The sub-agents then generate the corresponding parameters according to the preset loop process. The integration module is configured to integrate the contents of all parameters into the final job plan after all parameters to be generated in the parameter list have been generated.
[0013] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory, wherein the memory stores a program or instructions that can run on the processor, and when the program or instructions are executed by the processor, they implement the document generation method based on configurable rules and multi-agent collaboration as described in the first aspect.
[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program or instructions, which, when executed by a processor, implement the document generation method based on configurable rules and multi-agent collaboration as described in the first aspect.
[0015] The document generation method and device based on configurable rules and multi-agent collaboration provided in this application firstly divides the job plan to be generated into multiple independent parameter units, and establishes corresponding parameter generation rules and parameter generation instructions for each parameter unit; secondly, a knowledge base is constructed based on the parameter generation rules, parameter generation instructions, and business data required for job plan generation; then, user input is received, and the user intent is parsed according to the user input to determine the type of the plan to be generated, and the list of parameters to be generated is determined according to the plan type; further, for the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results, and the sub-agents generate the corresponding parameters according to a preset loop process; finally, when all the parameters to be generated in the parameter list have been generated, the contents of all parameters are integrated to form the final job plan. In summary, this application significantly improves the efficiency and accuracy of automatic generation of power transmission operation plans through centralized knowledge base management, layered Prompt engineering design, and multi-agent collaboration mechanism. It enhances the maintainability of the operation plan generation process, provides reliable technical support, further reduces manpower input and time costs, improves the overall efficiency of power transmission operation and maintenance, and realizes the automation, standardization, and sustainable iteration of the plan generation process. It has significant engineering application value and promotion prospects.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating a document generation method based on configurable rules and multi-agent collaboration in an embodiment of this application. Figure 2 This is a schematic diagram of a knowledge base framework and parameterized decomposition architecture in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a document generation system based on configurable rules and multi-agent collaboration in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0018] Figure reference numerals: 300, splitting module 301, building module 302, input module 303, calling module 304, integration module 305, processor 410, memory 420, input / output interface 430, communication interface 440, and bus 450, based on configurable rules and multi-agent collaboration document generation system. Detailed Implementation
[0019] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0020] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.
[0021] As described in the background section, existing power transmission operation plans and power grid maintenance report generation processes suffer from problems such as low efficiency and large workload due to manual writing, complex parameter dependencies and low automation, scattered document information and unstable content quality, difficulty in standardizing the plan generation process, and inability to intelligently understand maintenance data. This application proposes a document generation method and device based on configurable rules and multi-agent collaboration. It takes Retrieval-Augmented Generation (RAG) technology as the core, integrates the semantic understanding and text generation capabilities of Large Language Model (LLM), and deeply integrates retrieval-augmented generation technology with multi-agent execution mechanisms. The execution process of sub-agents incorporates a targeted retrieval link to ensure that every field of the generated content has a reliable source basis, eliminating content illusion from the root and providing intelligent and standardized knowledge service support for front-line power transmission workers.
[0022] From a system architecture perspective, the document generation method based on configurable rules and multi-agent collaboration mainly comprises two core components: a knowledge base module and an agent module. The knowledge base module stores and manages route log information, parameter generation rules, and related instructions. The agent module, based on this knowledge base, intelligently generates the content of each parameter and automatically constructs the solution document. Furthermore, this method employs a Prompt engineering design that separates the agent module and the knowledge base module. The agent execution logic is embedded in the agent module, while the specific parameter generation rules are stored in the knowledge base module. A complete Prompt is generated through a dynamic assembly mechanism, decoupling the agent logic from the business rules. Combined with a modular prompt word structure and multi-turn dialogue context management, incremental correction, verification closure, and dynamic information injection can be achieved. This ensures that the job solution generation process is accurate and standardized, easy to iterate and maintain, and significantly reduces development and maintenance costs.
[0023] refer to Figure 1 This is a flowchart illustrating a document generation method based on configurable rules and multi-agent collaboration in an embodiment of this application.
[0024] like Figure 1 As shown, the document generation method based on configurable rules and multi-agent collaboration includes: Step S101: The job plan to be generated is divided into multiple independent parameter units, and corresponding parameter generation rules and parameter generation instructions are established for each parameter unit.
[0025] In the specific implementation process, the job plan to be generated can be broken down in several ways. It can be broken down based on the parameter generation logic and business attributes, or according to parameter relationships, data sources, or output formats. After dividing the job plan content into multiple independently generateable parameter units, corresponding parameter generation rules and parameter generation instructions need to be established for each parameter in the plan. The parameter generation instructions describe the specific content and generation logic of the parameter generation, including at least the meaning of the parameter, the type of intelligent agent on which the parameter generation depends, the source and acquisition method of the fields required for the parameter, the replacement rules of the fields during the generation process, and the format requirements of the final output content of the parameter.
[0026] Step S102: Construct a knowledge base based on parameter generation rules, parameter generation instructions, and business data required for job plan generation.
[0027] In the specific implementation process, the work plan is first parameterized and broken down. Then, the generation rules and instructions for each parameter, as well as the business data required for the work plan, are uniformly written into a knowledge base. This business data covers line information, line ledger information related to the transmission system, and the professional business knowledge required for generating the work plan. Simultaneously, the knowledge base adopts a design that physically isolates the parameter generation rules from the intelligent agent orchestration framework. The rules and instructions corresponding to each parameter are stored and managed in key-value pairs, allowing the intelligent agent to retrieve and call them as needed during parameter generation. The intelligent agent obtains the corresponding information through a precise retrieval mechanism, effectively avoiding interference from irrelevant data. This improves both the accuracy of parameter generation and the efficiency of system data management, ultimately achieving centralized knowledge management and dynamic application.
[0028] Step S103: Receive user input, parse the user intent based on the user input to determine the type of scheme to be generated, and determine the list of parameters to be generated based on the scheme type.
[0029] In the implementation process, after the user inputs their questions and requirements and uploads relevant survey records and other documents, the large language model of the planning agent performs semantic parsing on the user's input, identifies the user's core intent, and determines the type of maintenance plan to be generated, covering power outage maintenance plans and power-on maintenance plans. Based on the identified plan type, the planning agent calls a pre-set plan template to determine the complete set of parameters required for that type of plan, and then constructs a list of parameters to be generated, providing a unified task input for subsequent parameter generation. In the work plan generation stage, for each parameter generation requirement, the planning agent dynamically retrieves the corresponding parameter generation rules and supporting data such as line information from the knowledge base.
[0030] In step S104, for the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results. The sub-agents then generate the corresponding parameters according to the preset loop process.
[0031] In the specific implementation process, to ensure the stability and controllability of the generation process, the planning agent selects a predetermined number of parameters from the parameter list for processing in each iteration (e.g., 4-6). Based on the current parameter to be generated, the planning agent retrieves the corresponding generation rules and parameter generation instructions from the knowledge base, and then analyzes the type of sub-agent to be called and related information for that parameter. The corresponding sub-agent called by the planning agent will automatically generate the parameter content based on the parameter generation rules and supporting data such as the required route information. After completing the parameter generation work for the current round, the planning agent continues to select the next batch of parameters from the remaining parameter list and repeats the above planning and execution process until all parameters in the parameter list have been generated.
[0032] Step S105: After all the parameters to be generated in the parameter list have been generated, integrate the contents of all parameters to form the final work plan.
[0033] In the actual implementation process, after all parameters are generated, the planning agent summarizes and structures the results of each parameter, automatically generates a maintenance plan document according to a preset document template, and then integrates it into a complete work plan document required by the user, outputting it as a Word format file. This achieves automatic parsing of maintenance data and automatic generation of reports, significantly reducing manpower input and time costs.
[0034] refer to Figure 2 This is a schematic diagram of a knowledge base framework and parameterized splitting architecture in an embodiment of this application.
[0035] like Figure 2 As shown in the diagram, the parameterized decomposition logic of the task plan and the hierarchical structure and data organization of the knowledge base are illustrated.
[0036] First, the work plan to be generated is broken down into multiple independent parameter units. This work plan includes complete content modules of two core work documents: maintenance plan and power supply protection measures. Specifically, it covers core text paragraphs of a standardized work plan, including the purpose of writing, maintenance unit, personnel division of labor, overall workload, power outage scope, schedule, work scope, technical measures, and organizational arrangements. Based on this, the complete work plan text block is further broken down into independent and separately generateable maintenance plan parameter sets and power supply protection plan parameter sets. Each parameter set corresponds to multiple independent parameter units, thus achieving granular and configurable generation of the work plan.
[0037] After the work plan is parameterized and broken down, the parameter generation rules and instructions for each parameter unit are stored in a knowledge base. This clearly defines the parameter generation method, dependencies, required agent type, parameter meaning, field source, replacement rules, and output format requirements. Simultaneously, basic information, technical parameters, and historical records of transmission lines are categorized and stored by line name and unique identifier. Shared professional knowledge such as transmission line operation and maintenance specifications, safety precautions, and industry standards are also stored concurrently, and an index is created based on business keywords to provide data support for subsequent parameter generation. Finally, the agent, based on parameter generation needs, accurately retrieves the corresponding rules, instructions, and business data from the knowledge base through retrieval, ensuring the orderly progress of parameter generation.
[0038] In summary, by structurally decomposing and classifying the information required for generating work plans into a database, unified management and on-demand access to parameter generation rules, instructions, line ledger information, and professional business knowledge are effectively achieved. On one hand, by parameterizing the work plans, clear generation rules and instructions are constructed for each parameter, and the generation logic, dependencies, and output formats of the parameters are standardized and written into the knowledge base in key-value pairs, making the parameter generation process configurable and scalable. On the other hand, by classifying and managing transmission line ledger information and shared professional business knowledge in separate databases, and combining line names and business keywords to achieve precise retrieval, highly relevant data support is provided to the intelligent agent during parameter generation, ensuring the accuracy and efficiency of parameter generation.
[0039] In some embodiments, the business data includes line ledger information stored in categories according to line name or unique identifier and professional business knowledge indexed by business keywords; the document generation method based on configurable rules and multi-agent collaboration further includes: when line ledger information is determined according to parameter generation rules, the called sub-agent retrieves the corresponding line ledger information from the knowledge base according to the line name; when professional business knowledge is determined according to parameter generation rules, the called sub-agent retrieves the corresponding professional business knowledge according to the business keywords.
[0040] In the specific implementation process, to achieve standardized management and efficient reuse of transmission line business data, it is necessary to classify and build databases for the line business data according to different categories of transmission lines. This type of business data mainly includes two parts: line ledger information and professional business knowledge. Among them, the line ledger information is organized and stored with the line name or unique identifier as the core to ensure the uniqueness and traceability of the data. It covers at least the basic information, technical parameters, and historical ledger data of each line, providing basic data support for subsequent parameter generation. The professional business knowledge is classified and organized according to multiple dimensions such as business type, professional field, and application scenario. At the same time, a corresponding knowledge index structure is constructed in combination with business keywords, covering core contents such as transmission line operation and maintenance specifications, safety precautions, and industry standards, providing professional basis for parameter generation.
[0041] To address different parameter generation needs, the planning agent will precisely invoke the corresponding agent to retrieve the required information from the knowledge base based on preset parameter generation rules. Specifically, when the planning agent determines that a parameter requires professional business knowledge for generation, it will invoke the parameter dependency agent. This agent will extract relevant content from the professional business knowledge base using business keywords as the search criteria, and use this as the core support for parameter generation. When the planning agent determines that a parameter requires route ledger information for generation, it will invoke the ledger analysis agent, which will precisely retrieve the corresponding route ledger information from the knowledge base based on the route name. Taking the work plan generation process as an example, if the ledger analysis agent finds that the required information is missing when generating parameters for a certain route, it can quickly obtain the complete ledger information for that route from the knowledge base simply by using the target route name as the search condition. This retrieval method effectively avoids irrelevant searches in the full dataset, reduces the interference of redundant information on the content generated by the agent, and thus significantly improves the accuracy and stability of parameter generation. Furthermore, relying on the scalable intelligent agent architecture, it can not only flexibly adapt to different regions and different types of power grid lines, but also extend its application to various document generation tasks, further expanding business application scenarios.
[0042] In some embodiments, the parameter generation rule includes at least one of the following: whether the parameter depends on the generation results of other parameters, whether the parameter is generated based on file information uploaded by the user, whether the parameter depends on route ledger information, and whether the parameter needs to generate corresponding image information.
[0043] In the specific implementation process, the generated task plan is first parameterized and decomposed into multiple independently generateable parameter units. Then, for each parameter in the plan, corresponding parameter generation rules and specifications are established. The parameter generation rules define the generation method of the parameter and its dependencies. Specifically, this may include: whether the parameter depends on the generation results of other parameters; whether the parameter is generated based on user-uploaded file information and parsed by a file analysis agent; whether the parameter depends on route ledger information stored in the knowledge base and extracted by a ledger analysis agent; and whether the parameter needs to further generate corresponding image information based on the generated content and the drawing agent completes the generation of the relevant images. This achieves standardized and normalized control over the generation of task plan parameters. Relying on clear generation rules and the collaborative cooperation of various agents, the parameter generation process becomes more logical and operable, while also possessing adaptability to multiple scenarios. It can automatically respond to data changes and adjust the generated content, laying the foundation for the efficient and accurate generation of subsequent task plans.
[0044] In some embodiments, the preset loop process includes: determining the generation logic of the current parameter; generating parameter content according to the generation logic; checking whether the generated parameter content conforms to preset rules; if not, repeating the steps of determining the generation logic of the current parameter and generating parameter content according to the generation logic until the generated parameter content conforms to preset rules or the maximum number of loops is reached.
[0045] In the specific implementation process, it is necessary to first clarify the generation logic of the current parameters, and then build the intelligent agent. The overall architecture of the intelligent agent adopts a multi-agent collaborative mode, and realizes the automatic generation of job plan documents through a cyclical mechanism of planning, execution, and verification.
[0046] Based on the overall architecture, during the sub-agent execution phase, the planning agent will precisely call the corresponding sub-agent to generate parameters for different types of parameters. Specifically, the execution process of the sub-agents differs depending on the type of parameter: for parameters with parameter dependencies or requiring parsing of user-uploaded files, the corresponding sub-agent will strictly follow a cyclical process of planning, execution, and verification until the generated result meets the rule requirements; for parameters dependent on route ledger information, the ledger analysis agent will adopt a process of planning, retrieval, execution, and verification to accurately retrieve relevant information from the knowledge base and then complete the parameter generation; for parameters requiring the generation of route diagrams or structural diagrams, the drawing agent will directly generate the corresponding route diagram description data according to preset drawing rules.
[0047] In the planning phase of the sub-agent, the planning agent first retrieves the generation instructions for the corresponding parameters from the knowledge base (generally including key information such as parameter generation content and format), and then synchronizes the relevant requirements to the called sub-agent, which generates the corresponding parameter content according to the requirements. After generating the parameter content, the sub-agent will automatically verify the format and accuracy of the content according to the requirements. If errors are found during verification, the verification process will be re-executed until the generated content is error-free or the maximum number of checks is reached, at which point the process will terminate. Simultaneously, to ensure generation quality, rules can be used to constrain the language model of the sub-agent to ensure that the generated report has a standardized structure, complete content, and consistent professional expression.
[0048] In some embodiments, the sub-agent includes at least one of parameter dependency agent, document analysis agent, ledger analysis agent, and drawing agent; calling the corresponding sub-agent according to the retrieval result includes: calling the corresponding sub-agent from the parameter dependency agent, document analysis agent, ledger analysis agent, and drawing agent according to the parameter dependency type indicated by the parameter generation rule.
[0049] In the specific implementation process, the planning agent retrieves the corresponding generation rule from the knowledge base based on the current generation parameters, and then analyzes the type of sub-agent and related information required for that parameter. To meet the generation requirements of different parameters, the planning and execution phases are divided into four different sub-agents. Each sub-agent collaborates according to the differences in task scenarios, and their specific functions are as follows.
[0050] The parameter-dependent agent is primarily used to handle scenarios where the target parameter depends on other generated parameters. Based on clearly defined parameter format rules and dependencies, it automatically extracts the necessary information from global parameters and generates the parameter content. Simultaneously, the parameter-dependent agent verifies the format integrity, placeholder filling, and data structure correctness of the generated results during the verification phase, performing a limited number of targeted corrections when verification fails. This process effectively ensures the accuracy and consistency of the parameter generation results, thereby improving the reliability and stability of the overall solution generation process.
[0051] Unlike parameter-dependent agents, document analysis agents are primarily used to handle scenarios where target parameters require extracting information from user-uploaded documents. Under the premise of clearly defined parameter acquisition principles and format constraints, it can perform targeted information parsing and extraction on different types of user-uploaded files, accurately filling the extracted results into the corresponding parameters. Simultaneously, it verifies the consistency and format compliance between the generated results and the source file content through a validation phase, avoiding the introduction of non-existent or non-compliant information from the files. This mechanism effectively ensures the accuracy and reliability of document-based data extraction parameter generation, improving the overall quality of the generated solution.
[0052] In addition to the two types of intelligent agents mentioned above, the ledger analysis agent and the drawing agent provide support for specific scenarios. The ledger analysis agent is mainly used to handle scenarios where the target parameter needs to query route ledger information or professional business knowledge bases, while the drawing agent is mainly used to handle scenarios where the target parameter is a graphical output.
[0053] The four sub-agents work together, relying on a planning, execution, verification, and retrieval loop mechanism to achieve automated parameter generation. Each agent collaborates according to task characteristics, efficiently handling parameter dependencies, extracting document information, retrieving ledger data, and generating graphical output, significantly improving solution generation efficiency and ensuring the accuracy and standardization of parameters and graphical information.
[0054] In some embodiments, the document generation method based on configurable rules and multi-agent collaboration further includes: in response to the called sub-agent being a ledger analysis agent, retrieving structured ledger data related to the target line or tower from the knowledge base, and generating parameter content based on the structured ledger data.
[0055] In practical implementation, the ledger analysis intelligent agent is mainly applied to scenarios where target parameters require querying route ledger information or professional business knowledge bases. This agent employs a multi-stage collaborative mechanism of planning, retrieval, execution, and verification. It can clearly define parameter generation rules and missing information, construct targeted retrieval conditions, retrieve structured ledger data related to the target route or tower from the knowledge base, and accurately populate the target parameters. During the verification phase, the ledger analysis intelligent agent verifies the reliability of the data source, the completeness of the populated content, and the standardization of the format. When information is missing, it triggers an iterative retrieval and correction mechanism. This mechanism effectively ensures the accuracy and consistency of the generated ledger-type parameters, improves the efficiency of information retrieval based on professional knowledge bases, and enhances the reliability of the generated work plan.
[0056] In some embodiments, the document generation method based on configurable rules and multi-agent collaboration further includes: in response to the called sub-agent being a drawing agent, adopting a single-stage direct generation mechanism to generate structured graphic data based on user-uploaded survey records and predefined drawing rules, and outputting the structured graphic data to a drawing tool to generate corresponding image information.
[0057] In practical implementation, the drawing agent is primarily used to handle scenarios where the target parameters are graphical outputs. This agent can generate structured graphical data such as route path diagrams, generating graphical parameters by calling drawing tools. The drawing agent employs a single-stage direct generation mechanism, eliminating the need for iterative loops. It receives documents such as survey records and predefined drawing rules, extracts key information such as route names, start and end pole numbers, and parallel lines, and generates corresponding structured graphical data according to the preset drawing rules. The drawing rules are fixed and highly structured, allowing the drawing agent to generate the required graphical data in one go. This data is then passed to the drawing tools to obtain the target graphic. This approach improves the efficiency of graphical data generation, ensures the accuracy and standardization of graphical parameters, and provides high-quality graphical information support for subsequent solution document output.
[0058] In summary, the document generation method based on configurable rules and multi-agent collaboration proposed in this application firstly divides the job plan to be generated into multiple independent parameter units, and establishes corresponding parameter generation rules and parameter generation instructions for each parameter unit; secondly, a knowledge base is constructed based on the parameter generation rules, parameter generation instructions, and business data required for job plan generation; then, user input is received, and the user intent is parsed according to the user input to determine the type of the plan to be generated, and the parameter list to be generated is determined according to the plan type; further, for the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results, and the sub-agents generate the corresponding parameters according to a preset loop process; finally, when all the parameters to be generated in the parameter list have been generated, the contents of all parameters are integrated to form the final job plan. In summary, this application relies on an intelligent agent framework to achieve multi-source data fusion and understanding analysis. By efficiently constructing a knowledge base, managing parameter rules and conducting centralized control, and designing a flexible and easy-to-maintain layered Prompt project, it provides reliable technical support for the generation of work plans through multi-agent collaboration. This further reduces manpower input and time costs, improves the overall efficiency of power transmission operation and maintenance, and realizes the automation, standardization and sustainable iteration of the plan generation process.
[0059] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described above.
[0060] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0061] Corresponding to the above embodiments, this application also proposes a document generation system based on configurable rules and multi-agent collaboration.
[0062] refer to Figure 3 This is a schematic diagram of the structure of a document generation system based on configurable rules and multi-agent collaboration in an embodiment of this application.
[0063] like Figure 3 As shown, this application embodiment provides a document generation system 300 based on configurable rules and multi-agent collaboration, including: The splitting module 301 is configured to split the job plan to be generated into multiple independent parameter units, and to establish corresponding parameter generation rules and parameter generation instructions for each parameter unit. Module 302 is configured to build a knowledge base based on parameter generation rules, parameter generation instructions, and business data required for job plan generation. The input module 303 is configured to receive user input data, parse the user intent based on the user input data to determine the type of scheme to be generated, and determine the list of parameters to be generated based on the scheme type; Module 304 is configured to retrieve the corresponding parameter generation rules and instructions from the knowledge base for the parameters to be generated in the parameter list, and call the corresponding sub-agents according to the retrieval results. The sub-agents then generate the corresponding parameters according to the preset loop process. The integration module 305 is configured to integrate the contents of all parameters into the final job plan after all parameters to be generated in the parameter list have been generated.
[0064] Optionally, building module 302 is also configured as follows: Business data includes line ledger information categorized and stored by line name or unique identifier, as well as professional business knowledge indexed by business keywords; The module 304 call is also configured as follows: When determining the route ledger information according to the parameter generation rules, the called sub-agent retrieves the corresponding route ledger information from the knowledge base by route name; When professional business knowledge is determined according to the parameter generation rules, the called sub-agent retrieves the corresponding professional business knowledge according to the business keywords.
[0065] Optionally, the split module 301 is also configured as follows: The parameter generation rules include at least one of the following: Does this parameter depend on the generation results of other parameters? Is this parameter generated based on user-uploaded file information? Does this parameter depend on route ledger information? Does this parameter need to generate corresponding image information?
[0066] Optionally, module 304 is also configured to: The preset loop process includes: Determine the generation logic of the current parameter; Generate parameter content based on the generation logic; Check whether the generated parameter content conforms to the preset rules. If it does not conform, repeat the steps of determining the generation logic of the current parameter and generating the parameter content according to the generation logic until the generated parameter content conforms to the preset rules or the maximum number of loops is reached.
[0067] Optionally, module 304 is also configured to: Sub-agents include at least one of parameter-dependent agents, document analysis agents, ledger analysis agents, and drawing agents; The corresponding sub-agents are invoked based on the search results, including: Based on the parameter dependency type indicated by the parameter generation rules, the corresponding sub-agents are called from the parameter dependency agent, document analysis agent, ledger analysis agent, and drawing agent.
[0068] Optionally, module 304 is also configured to: When the called sub-agent is a ledger analysis agent, it retrieves structured ledger data related to the target line or tower from the knowledge base and generates parameter content based on the structured ledger data.
[0069] Optionally, module 304 is also configured to: When the called sub-agent is a drawing agent, a single-stage direct generation mechanism is adopted to generate structured graphic data based on the survey records uploaded by the user and the predefined drawing rules, and then output the structured graphic data to the drawing tool to generate the corresponding image information.
[0070] In summary, the document generation system based on configurable rules and multi-agent collaboration proposed in this application firstly divides the job plan to be generated into multiple independent parameter units, and establishes corresponding parameter generation rules and parameter generation instructions for each parameter unit; secondly, a knowledge base is constructed based on the parameter generation rules, parameter generation instructions, and business data required for job plan generation; then, user input is received, the user intent is parsed based on the user input to determine the type of the plan to be generated, and the list of parameters to be generated is determined based on the plan type; further, for the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results, and the sub-agents generate the corresponding parameters according to a preset loop process; finally, when all the parameters to be generated in the parameter list have been generated, the contents of all parameters are integrated to form the final job plan. In summary, this application relies on an intelligent agent framework to achieve multi-source data fusion and understanding analysis. By efficiently constructing a knowledge base, managing parameter rules and conducting centralized control, and designing a flexible and easy-to-maintain layered Prompt project, it provides reliable technical support for the generation of work plans through multi-agent collaboration. This further reduces manpower input and time costs, improves the overall efficiency of power transmission operation and maintenance, and realizes the automation, standardization and sustainable iteration of the plan generation process.
[0071] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0072] The apparatus of the above embodiments is used to implement the corresponding method in any of the foregoing embodiments and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0073] Corresponding to the above embodiments, this application also proposes an electronic device. (See reference...) Figure 4 The diagram below is a block diagram of an electronic device according to some embodiments of this application. It also illustrates a more specific hardware structure of an electronic device provided by an embodiment of this application. The device may include: a processor 410, a memory 420, an input / output interface 430, a communication interface 440, and a bus 450. The processor 410, memory 420, input / output interface 430, and communication interface 440 are internally connected to each other via the bus 450.
[0074] The processor 410 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0075] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 420 and is called and executed by the processor 410.
[0076] Input / output interface 430 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.
[0077] The communication interface 440 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0078] Bus 450 includes a pathway for transmitting information between various components of the device, such as processor 410, memory 420, input / output interface 430, and communication interface 440.
[0079] It should be noted that although the above-described device only shows the processor 410, memory 420, input / output interface 430, communication interface 440, and bus 450, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0080] The electronic devices described in the above embodiments are used to implement the document generation methods based on configurable rules and multi-agent collaboration in any of the foregoing embodiments, and have corresponding beneficial effects, which will not be elaborated here.
[0081] Based on the same concept, corresponding to the document generation method based on configurable rules and multi-agent collaboration provided in any of the above embodiments, this application also provides a computer-readable storage medium storing a program or instructions, which, when executed by a processor, implements the document generation method based on configurable rules and multi-agent collaboration as described above.
[0082] The aforementioned computer-readable storage medium can be any available medium or data storage device that a computer can access, including but not limited to magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (e.g., ROMs, EPROMs, EEPROMs, non-volatile memory (NAND flash), solid-state drives (SSDs)).
[0083] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the corresponding document generation method based on configurable rules and multi-agent collaboration in any of the foregoing embodiments, and have corresponding beneficial effects, which will not be elaborated here.
[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0085] From the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of computer software products plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. The computer software product is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes several instructions to cause the terminal or network-side device to execute the methods described in the various embodiments of this application.
[0086] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other implementations under the guidance of this application without departing from the spirit and scope of the claims. All of these implementations are within the protection scope of this application.
Claims
1. A document generation method based on configurable rules and multi-agent collaboration, characterized in that, include: The job plan to be generated is divided into multiple independent parameter units, and corresponding parameter generation rules and parameter generation instructions are established for each parameter unit. A knowledge base is constructed based on the parameter generation rules, the parameter generation instructions, and the business data required for generating the work plan; the business data includes line ledger information categorized and stored by line name or unique identifier, and professional business knowledge indexed by business keywords. Receive user input, parse the user intent based on the user input to determine the type of solution to be generated, and determine the list of parameters to be generated based on the type of solution; For the parameters to be generated in the parameter list, the planning agent retrieves the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and calls the corresponding sub-agents according to the retrieval results. The sub-agents then generate the corresponding parameters according to a preset loop process. Once all the parameters to be generated in the parameter list have been generated, the contents of all parameters are integrated to form the final work plan; The sub-agents include parameter-dependent agents, document analysis agents, ledger analysis agents, and drawing agents; The step of calling the corresponding sub-agent based on the search results includes: calling the corresponding sub-agent from the parameter dependency agent, document analysis agent, ledger analysis agent and drawing agent according to the parameter dependency type indicated by the parameter generation rule; The preset loop process includes: determining the generation logic of the current parameter; generating parameter content according to the generation logic; checking whether the generated parameter content conforms to the preset rules; if it does not conform, repeating the steps of determining the generation logic of the current parameter and generating parameter content according to the generation logic until the generated parameter content conforms to the preset rules or the maximum number of loops is reached.
2. The document generation method based on configurable rules and multi-agent collaboration according to claim 1, characterized in that, The method further includes: When the route ledger information is determined according to the parameter generation rules, the called sub-agent retrieves the corresponding route ledger information from the knowledge base according to the route name; When professional business knowledge is determined according to the parameter generation rules, the called sub-agent retrieves the corresponding professional business knowledge according to the business keywords.
3. The document generation method based on configurable rules and multi-agent collaboration according to claim 2, characterized in that, The parameter generation rule includes at least one of the following: Does this parameter depend on the generation results of other parameters? Is this parameter generated based on user-uploaded file information? Does this parameter depend on the route ledger information? Does this parameter need to generate corresponding image information? 4. The document generation method based on configurable rules and multi-agent collaboration according to claim 1, characterized in that, The method further includes: When the called sub-agent is a ledger analysis agent, the system retrieves structured ledger data related to the target line or tower from the knowledge base and generates the parameter content based on the structured ledger data.
5. The document generation method based on configurable rules and multi-agent collaboration according to claim 1, characterized in that, The method further includes: When the called sub-agent is a drawing agent, a single-stage direct generation mechanism is adopted to generate structured graphic data based on the survey records uploaded by the user and predefined drawing rules, and the structured graphic data is output to the drawing tool to generate corresponding image information.
6. A document generation system based on configurable rules and multi-agent collaboration, characterized in that, include: The splitting module is configured to split the job plan to be generated into multiple independent parameter units, and to establish corresponding parameter generation rules and parameter generation instructions for each parameter unit. The construction module is configured to build a knowledge base based on the parameter generation rules, the parameter generation instructions, and the business data required for the operation plan; the business data includes line ledger information stored in categories according to line name or unique identifier, and professional business knowledge indexed by business keywords; The input module is configured to receive user input data, parse the user intent based on the user input data to determine the type of scheme to be generated, and determine the list of parameters to be generated based on the type of scheme. The calling module is configured to, for the parameters to be generated in the parameter list, have the planning agent retrieve the corresponding parameter generation rules and parameter generation instructions from the knowledge base, and call the corresponding sub-agent according to the retrieval results, and have the sub-agent generate the corresponding parameters according to the preset loop process; The integration module is configured to integrate the contents of all parameters to be generated into a final work plan after all the parameters to be generated in the parameter list have been generated. The sub-agents include parameter-dependent agents, document analysis agents, ledger analysis agents, and drawing agents; The step of calling the corresponding sub-agent based on the search results includes: calling the corresponding sub-agent from the parameter dependency agent, document analysis agent, ledger analysis agent and drawing agent according to the parameter dependency type indicated by the parameter generation rule; The preset loop process includes: determining the generation logic of the current parameter; generating parameter content according to the generation logic; checking whether the generated parameter content conforms to the preset rules; if it does not conform, repeating the steps of determining the generation logic of the current parameter and generating parameter content according to the generation logic until the generated parameter content conforms to the preset rules or the maximum number of loops is reached.
7. An electronic device, characterized in that, include: A processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the document generation method based on configurable rules and multi-agent collaboration as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the document generation method based on configurable rules and multi-agent collaboration as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Large language model driven report generation agent method, system, equipment and medium
CN121859853A
