Data sharing system and method for realizing multi-agent interaction
By training large language models and graph databases to build a knowledge relationship map, dynamically allocate tasks, and optimize the interaction of the agent, the problems of inconsistent data standards and low task execution success rate in smart grid systems are solved, and efficient data sharing and task execution are achieved.
Patent Information
- Application Number
- CN202510765532.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In existing smart grid systems, the data standards of SCADA, PMS and other systems are not unified. The agent needs to obtain data through customized interfaces. The development cost is high and the real-time performance is poor. The unstructured data processing is inefficient, and the task execution success rate is low. The load difference and task priority of the agent are not considered, resulting in a task backlog in high concurrency scenarios.
By training large language models to identify task types, generate standardized task templates, use graph databases to build knowledge relationship maps, establish a unified data interface, dynamically allocate subtasks, optimize execution order, and use message queues to realize real-time data push. The agent accesses the knowledge graph through the unified interface and calls the plug-in knowledge base to optimize decisions.
Real-time interoperability of system data such as SCADA and PMS has been achieved, which improves map update efficiency, shortens process time, improves resource utilization and task execution success rate, supports rapid adaptation of power grid business changes, and reduces system expansion costs.
Smart Images

Figure CN120277143A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of agents, and particularly to a data sharing system and method for realizing multi-agent interaction. Background Art
[0002] With the in-depth construction of the smart grid, the production command business of power transmission and distribution faces challenges such as an explosive growth in data scale and an increase in the complexity of business processes. Traditional production command systems rely on manual experience for scheduling and fragmented data processing modes, and it is difficult to meet the requirements of grid safe operation and efficient operation and maintenance.
[0003] In the prior art, the data standards of systems such as SCADA, PMS, and OMS are not unified. Agents need to obtain data through customized interfaces, with high development costs and poor real-time performance, and the processing of unstructured data is inefficient. The subtask sequence depends on fixed process orchestration, without considering the load differences and task priorities of agents, resulting in task backlogs in high-concurrency scenarios. Existing systems allocate tasks on a first-come, first-served or round-robin basis, without considering the skill differences of agents, resulting in a low success rate of task execution. General large language models lack knowledge in the power field, and the generated solutions have insufficient compliance and require manual secondary review. In addition, agents need to directly connect to multiple heterogeneous tools, and the interface protocols are not unified. Summary of the Invention
[0004] The purpose of the present invention is to provide a data sharing system and method for realizing multi-agent interaction to solve the problems raised in the prior art.
[0005] To achieve the above purpose, the present invention provides the following technical solutions: In a first aspect, a data sharing method for realizing multi-agent interaction includes the following steps: Annotate production command instructions, train a large language model to identify task types; generate a standardized task template through prompt engineering, and disassemble production command instructions into a subtask sequence in combination with task types; Collect power transmission and distribution production data, construct a knowledge relationship graph through a graph database, convert unstructured data into vectors for storage; establish a unified data interface to support agents to retrieve graph data in real time through API, and construct a data sharing center; Divide agent types according to power transmission and distribution business scenarios, determine the functional boundaries of each agent; in the data sharing center, use a multi-agent simulation environment to test the collaborative efficiency of subtasks, and optimize the execution order of subtask sequences; dynamically allocate subtasks according to agent load and skill matching degree; The agent accesses the knowledge relationship graph through a unified data interface to obtain associated data, and uses a message queue to achieve real-time push of data changes; the agent calls an external knowledge base according to task requirements, optimizes the decision-making of the large language model through prompt engineering, uses the tool library component to perform specific operations, and the agent executes operations according to the subtask sequence.
[0006] Combined with the first aspect, in the first implementation manner of the first aspect of the present application, the method of annotating the production command instruction, training the large language model, and identifying the task type includes: Collect production command instructions, perform denoising processing and standardization, and divide them into a training set, a validation set, and a test set according to a ratio; define task type labels, including data query type, process execution type, solution generation type, and risk assessment type, and use the BIO annotation method to mark the entities in the instruction, including: equipment entity, time entity, and operation action; use LabelStudio to annotate the production command instructions, use DeepSeek as the basic model of the large language model, and use the annotated production command instructions as input; the training objective is to output the task type to which the instruction belongs using the cross-entropy loss function; set training parameters, evaluate and iterate the large language model to identify the task type of newly input production command instructions.
[0007] Combined with the first aspect, in the second implementation manner of the first aspect of the present application, the method of generating a standardized task template through prompt engineering and disassembling the production command instruction into a subtask sequence according to the task type includes: Design a standardized task template structure in the template library, and each template includes: main task description, subtask sequence, parameter placeholder, and execution constraint. Among them, the main task description is specifically the business objective, the subtask sequence is the subtasks arranged in the order of business logic, the parameter placeholder is the dynamic parameter extracted based on the instruction entity, and the execution constraint is the domain rule restriction; Based on the task type, retrieve the corresponding template from the template library, combine the keywords in the instruction, and select the detailed scenario template; fill the entities in the instruction into the parameter placeholders of the template; arrange the subtasks in the business logic order preset by the template; mark the subtasks that can be processed in parallel as parallel execution nodes; call the execution constraint to verify the compliance of the subtask sequence.
[0008] Combined with the first aspect, in the third implementation manner of the first aspect of the present application, the method of collecting power transmission and distribution production data, constructing a knowledge relationship graph through a graph database, and converting unstructured data into vector storage includes: Collect power transmission and distribution production data, define event entities and spatial entities, combine equipment entities and operation actions, and construct the triggering relationship between equipment and events, the location relationship between equipment and space, and the process relationship between events and operation actions; construct an equipment layer, an event layer, a rule layer, and a space layer in the knowledge relationship graph. The equipment layer is constructed according to the hierarchical levels from high to low of substations, voltage levels, equipment, and components, and records the full life cycle information of the equipment. The event layer is used to mark the event triggering conditions and influence ranges. The rule layer implants industry rules and defines the equipment maintenance cycle and fault handling process. The space layer integrates geographical coordinates and administrative divisions. Based on the power transmission and distribution production data, convert structured data into graph nodes and convert the extracted relationships into graph edges; remove non-business-related content from unstructured data, unify terms using a domain dictionary, and split the text in unstructured data into independent blocks according to semantic relevance; use a pre-trained language model for the power industry to encode the text blocks, generate vectors, and store them in a vector database.
[0009] Combined with the first aspect, in the fourth implementation manner of the first aspect of the present application, the intelligent agent types are divided according to the power transmission and distribution business scenarios, and the functional boundaries of each intelligent agent are determined, including: The power transmission and distribution business scenarios include equipment management, operation monitoring, dispatching and command, emergency repair, and material management. For each power distribution business scenario, determine the corresponding intelligent agent type; define the functional scope of each intelligent agent, check the functions of each intelligent agent to ensure that there is no functional overlap between intelligent agents. When there is a functional overlap, readjust the functional boundaries; based on the association and dependency relationships between various links in the power transmission and distribution business process, determine the cooperation requirements between intelligent agents.
[0010] Combined with the first aspect, in the fifth implementation manner of the first aspect of the present application, in the data sharing center, use the multi-intelligent agent simulation environment to test the cooperation efficiency of subtasks and optimize the execution order of subtask sequences, including: Create a virtual scenario based on the power transmission and distribution business process, including an equipment network, business rules, and a resource pool; deploy intelligent agents consistent with the production environment, map their data interfaces and functional logics, and configure a load threshold for each intelligent agent; use discrete event simulation technology to drive intelligent agent interactions according to time slices for monitoring and debugging; locate typical problems, including serial execution caused by strong dependencies between subtasks, multiple intelligent agents simultaneously requesting the same resource, and data version conflicts in the data transmitted between intelligent agents. Identify sub-tasks with no dependencies and adjust them to be executed in parallel; assign priorities to sub-tasks, and high-priority tasks can preempt low-priority resources; encode the execution order of sub-tasks into chromosomes, calculate the fitness considering the total task execution time, resource occupancy, and compliance, iteratively generate the optimal sequence, and dynamically allocate tasks to idle agent instances; define arbitration rules during resource competition, and when an agent fails, switch to a backup agent instance or trigger a manual intervention process.
[0011] Combined with the first aspect, in the sixth implementation manner of the first aspect of this application, the dynamically allocating sub-tasks according to agent load and skill matching degree includes: Obtain the real-time load data of the agent, and use the cosine similarity algorithm to calculate the matching degree score between the sub-task requirements and the agent skills. The formula is as follows: ; where MD is the matching degree, is the demand intensity of the sub-task for skill i, is the mastery degree of the agent for skill i, is the skill weight; Obtain sub-task characteristics and agent status. The sub-task characteristics include task type, priority, skill requirements, and data requirements. The agent status includes real-time load data and skill portraits; construct a sub-task set according to the sub-task characteristics of all sub-tasks, and construct an agent set according to the agent status of all agents. With the goal of maximizing skill matching degree and load balancing, construct a mixed-integer programming model. The formula is as follows: ; where A is the agent set, T is the sub-task set, is a 0-1 variable indicating whether agent a processes sub-task t, is the skill matching degree between agent a and sub-task t, is the load of agent a, is the load threshold of agent a, MMT is the lowest matching degree threshold, and s.t. is used to introduce the constraint conditions that the objective function must satisfy; The sub-tasks enter the allocation queue for compliance verification; filter out unmatched agents according to the mandatory constraint conditions, generate a list of candidate agents, sort them in descending order of skill matching degree, when the matching degrees are the same, sort them in ascending order of load rate, and when the load rates are the same, sort them in descending order of historical task success rate; push the sub-tasks to the target agent through the API, along with the task details. After receiving the task, the agent updates the load status in real time and synchronizes it to the data sharing center.
[0012] In combination with the first aspect, in the seventh implementation manner of the first aspect of this application, the agent accesses the knowledge relationship graph through a unified data interface, obtains associated data, and uses a message queue to achieve real-time push of data changes, including: The unified data interface adopts the RESTful API specification, realizes high throughput based on the HTTP / 2 protocol, and supports JSON format requests or responses; docks with the authentication system, verifies the identity of the agent through the API Key, and follows the principle of least privilege; The agent actively initiates a query according to the task requirements, subscribes to specific types of data changes, and the interface automatically pushes updates; maps the nodes and edges returned by the knowledge relationship graph to an object model recognizable by the agent; the message queue adopts Apache Kafka.
[0013] In combination with the first aspect, in the eighth implementation manner of the first aspect of this application, the agent calls an external knowledge base according to the task requirements, optimizes the decision-making of the large language model through prompt engineering, and uses the tool library component to execute specific operations. The agent executes the operations according to the subtask sequence, including: The external knowledge base includes an industry specification library, a historical case library, and a real-time data knowledge base. The agent extracts key retrieval elements according to the task type and subtasks; designs a prompt engineering template, inserts several historical successful cases in the prompt, and guides the large language model to generate a response that conforms to historical experience; filters the tool library components according to the subtask requirements, checks the integrity of the tool input parameters, and triggers the agent to ask questions when missing; when receiving a task with a higher priority, pauses the current subtask sequence and preferentially executes the task with a higher priority; when a subtask fails, triggers a rollback mechanism and re-plans the subtask sequence.
[0014] A data sharing system for realizing multi-agent interaction includes: Task decomposition module: including: a task type recognition unit and a subtask sequence generation unit; among them, the task type recognition unit annotates the production command instructions, trains the large language model, and recognizes the task type; the subtask sequence generation unit generates a standardized task template through prompt engineering, and decomposes the production command instructions into a subtask sequence in combination with the task type; Knowledge graph construction module: including: a knowledge relationship graph construction unit, an unstructured data vectorization unit, and a data sharing center establishment unit; among them, the knowledge relationship graph construction unit collects power transmission and distribution production data, constructs a knowledge relationship graph through a graph database, and the unstructured data vectorization unit converts unstructured data into vectors for storage; the data sharing center establishment unit establishes a unified data interface to support agents to call graph data in real time through the API and constructs a data sharing center; Agent classification and collaborative optimization module: including: agent type division unit, subtask sequence execution order optimization unit and skill matching degree dynamic task allocation unit; wherein, the agent type division unit divides the agent type according to the power transmission and distribution business scenario and determines the functional boundary of each agent; the subtask sequence execution order optimization unit uses a multi-agent simulation environment in the data sharing center to test the collaborative efficiency of subtasks and optimize the execution order of subtask sequences; the skill matching degree dynamic task allocation unit dynamically allocates subtasks according to the agent load and skill matching degree; Agent interaction and task execution module: including: real-time data push unit, prompt word engineering optimization decision unit and sub-task execution unit; in the real-time data push unit, the agent accesses the knowledge relationship graph through a unified data interface, obtains related data, and uses a message queue to realize real-time push of data changes; in the prompt word engineering optimization decision unit, the agent calls the external knowledge base according to task requirements, optimizes the decision of the large language model through prompt word engineering, the sub-task execution unit uses the tool library components to perform specific operations, and the agent performs operations according to the sub-task sequence.
[0015] Compared with the prior art, the present invention has the following beneficial effects: 1. The present invention realizes real-time data communication between SCADA, PMS and other systems through standardized API interface and data sharing center, and automatically extracts entity relationships in unstructured data using retrieval enhancement generation technology, thereby improving the efficiency of graph updating.
[0016] 2. The present invention uses a simulated environment to test the collaborative path of subtasks, optimizes the execution order through algorithms, shortens the overall process time, dynamically allocates tasks according to the real-time load and skill matching of the intelligent body, avoids problems such as uneven busyness and qualification mismatch, and improves resource utilization and task execution success rate.
[0017] 3. The agent types and collaboration processes of the present invention can be dynamically adjusted according to business needs without reconstructing the underlying architecture, quickly adapting to changes in power grid business, decoupling data interfaces and agent functions, supporting rapid access to new agents, reducing system expansion costs, and improving the ability to cope with new business scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the steps of a data sharing method for realizing multi-agent interaction of the present invention; Figure 2 It is a system structure diagram of a data sharing system for realizing multi-agent interaction according to the present invention. DETAILED DESCRIPTION
[0019] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0020] Embodiment: As Figure 1 - Figure 2 shown, the present invention provides a technical solution. As Figure 1 shown in the schematic diagram of the steps of a data sharing method for realizing multi-agent interaction, the present invention provides a data sharing method for realizing multi-agent interaction, including the following steps: Step S100: Annotate the production command instructions, train a large language model to identify the task type; generate a standardized task template through prompt engineering, and disassemble the production command instructions into a sub-task sequence in combination with the task type; Specifically, collect production command instructions, perform denoising processing and standardization, and divide them into a training set, a validation set, and a test set according to a ratio; define task type labels, including data query type, process execution type, solution generation type, and risk assessment type, and use the BIO annotation method to mark the entities in the instructions, including: equipment entity, time entity, and operation action; use LabelStudio to annotate the production command instructions, use DeepSeek as the basic model of the large language model, and use the annotated production command instructions as input; the training objective is to output the task type to which the instruction belongs using the cross-entropy loss function; set training parameters, evaluate and iterate the large language model to identify the task type of newly input production command instructions.
[0021] Furthermore, design a standardized task template structure in the template library. Each template includes: main task description, sub-task sequence, parameter placeholder, and execution constraint. Among them, the main task description is specifically the business objective, the sub-task sequence is the sub-tasks arranged in the order of business logic, the parameter placeholder is the dynamic parameter extracted based on the instruction entity, and the execution constraint is the domain rule restriction; Based on the task type, retrieve the corresponding template from the template library, combine the keywords in the instruction, and select the detailed scenario template; fill the entities in the instruction into the parameter placeholders of the template; arrange the sub-tasks in the preset business logic order of the template; for the sub-tasks that can be processed in parallel, mark them as parallel execution nodes; call the execution constraint to verify the compliance of the sub-task sequence.
[0022] In a specific embodiment, 3,000 production command instructions of a regional power grid in Q2 of 2024 were collected, including dispatching instructions, maintenance work orders, fault handling notices, etc. After removing invalid instructions, 2,750 valid instructions were retained; the dataset was divided as follows: training set: 1,925 (70%), validation set: 413 (15%), test set: 412 (15%).
[0023] An example of BIO annotation is as follows: Instruction: "Conduct on-off test on the #3 switch of 10kV Guangming Line on July 10, 2024", and the following results are obtained: Time entity: July 10, 2024 → B-Time, I-Time, I-Time, I-Time; Equipment entity: #3 switch of 10kV Guangming Line → B-Device, I-Device, I-Device, I-Device, I-Device; Operation action: On-off test → B-Action, I-Action, I-Action. Using LabelStudio for annotation, the annotation consistency was verified by Fleiss' kappa coefficient to be 0.91, showing a high degree of consistency.
[0024] The base model of the large language model is DeepSeek-R1-13B, and the training configuration is as follows: Training duration: 48 hours (GPU cluster: 8 × A100); Learning rate: 1.5e-5, Batch size: 32, Number of training epochs: 12; Loss function: Cross-entropy loss, Optimizer: AdamW.
[0025] Through the validation set, it was found that the "solution generation class" had errors due to high instruction complexity. By increasing the long text segmentation process (truncated to 2048 tokens), the F1 value was increased to 91.7%.
[0026] Input instruction: "Conduct annual preventive test on the #7 switch of 10kV Zhenxing Line at 14:00 on September 12, 2024, and power outage is required 30 minutes in advance". The large language model outputs "process execution class" (confidence 98.2%), matching the "process execution class - equipment maintenance" template (similarity 95.6%). Parameter filling is performed: Equipment name: #7 switch of 10kV Zhenxing Line; Maintenance type: Annual preventive test; Scheduled time: 14:00 on September 12, 2024; The generated subtask sequence is as follows: Safety disclosure → Power outage and voltage inspection → Defect handling → Re-power acceptance. Parallel node marking: None. Equipment coordinate verification is carried out: Query through the GIS interface and it exists (time-consuming 200ms); Time conflict check is carried out: The scheduled time is 14:00, which is a non-peak period, and it passes the verification.
[0027] Step S200: Collect power transmission and distribution production data, construct a knowledge relationship graph through a graph database, and convert unstructured data into vectors for storage; establish a unified data interface to support agents to retrieve graph data in real time through the API and construct a data sharing center; Specifically, collect power transmission and distribution production data, define event entities and spatial entities, combine equipment entities and operation actions, and construct the trigger relationship between equipment and events, the location relationship between equipment and space, and the process relationship between events and operation actions; construct an equipment layer, an event layer, a rule layer, and a spatial layer in the knowledge relationship graph. The equipment layer is constructed according to the hierarchical levels from high to low of substations, voltage levels, equipment, and components, and records the full life cycle information of the equipment. The event layer is used to mark the event trigger conditions and influence ranges. The rule layer implants industry rules and defines the equipment maintenance cycle and fault handling process. The spatial layer integrates geographical coordinates and administrative divisions; Based on the power transmission and distribution production data, convert structured data into graph nodes and convert the extracted relationships into graph edges; remove non-business-related content from unstructured data, unify terms using a domain dictionary, and split the text in unstructured data into independent blocks according to semantic relevance; use a pre-trained language model for the power industry to encode the text blocks, generate vectors, and store them in a vector database.
[0028] In a specific embodiment, the collected structured data includes: Equipment ledger: Full life cycle data of 500 substations, 100,000 poles, and 200,000 distribution network equipment (including transformers, switches, etc.); Operation data: Real-time load, oil temperature, voltage, etc. monitoring data of 1,000 transmission lines (sampling frequency: 1 time / minute); Event data: 100,000 fault records (such as tripping, overload) from January 2023 to June 2024, 50,000 maintenance work orders. Unstructured data includes: Maintenance reports: 20,000 PDF / Word documents (such as main transformer maintenance records, line inspection reports); Dispatching recordings: 500 hours of voice data (including fault handling instructions, load adjustment notifications); Industry specifications: PDF clauses such as "Southern Power Grid Equipment Maintenance Regulations" and "Distribution Network Fault Handling Standards".
[0029] Entity types include: equipment entity, event entity, spatial entity, and rule entity; Relationship types include: Trigger relationship: Equipment failure → Trigger → Protection action (such as "#1 line tripping" triggers "quick break protection action"); Location relationship: Equipment → Installed in → Spatial area (such as "10kV switch station" is located in "No. 1 distribution area of Futian District"); Process relationship: Fault event → Followed by → Disposal steps (such as "fault location" followed by "resource scheduling").
[0030] In the device layer, the hierarchical structure is: substation (such as "Shenzhen Substation") → voltage level (110 kV) → device (main transformer) → components (windings, bushings); the stored information includes: device model, commissioning time, and previous maintenance records. A total of more than 500,000 nodes and more than 1 million edges are generated.
[0031] In the event layer, the marked content includes: event type (fault / maintenance), trigger condition (such as "oil temperature > 95°C"), and scope of influence (number of power outage users, affected lines); the association relationship is: each event node is associated with 1 - 5 device nodes. A total of more than 150,000 nodes and more than 300,000 edges are generated.
[0032] In the rule layer, 200 industry standard clauses (such as "the inspection cycle of 10 kV lines ≤ 7 days") are implanted, and each rule is associated with a device type or an event type; the relationship definition is: rule → constraint → device / event (such as the "main transformer maintenance cycle" constrains the "main transformer" device node), generating more than 2,000 edges.
[0033] In the space layer, data fusion: GIS coordinates (such as longitude 114.05°, latitude 22.54°) are associated with the administrative division (Nanshan District, Shenzhen); the application scenario: supports the path planning of "device → spatial location → emergency repair team", generating more than 80,000 spatial nodes and more than 120,000 edges.
[0034] In the following query scenario: "Find the 10 kV line faults that occurred in Shenzhen in 2024 and caused power outages to more than 100 households, and their associated main transformer devices", the traditional SQL query takes 1,200 ms, while the graph query takes 180 ms, with an efficiency improvement of 85%.
[0035] In the vectorized storage of unstructured data, the encoding model is the BERT - base model fine - tuned for the power domain. The input example is: "#3 main transformer oil chromatogram detection found that the acetylene content exceeded the standard, it is recommended to arrange a cover lifting inspection", and the output vector is: [-0.12, 0.34,..., 0.05] (a 768 - dimensional floating - point array). Deploy a Milvus cluster to store more than 1 million vectors, support cosine similarity retrieval, and the average response time < 50 ms.
[0036] The types of APIs used include: graph query interface: GET / graph / device / {device_id} / events, which returns a list of fault events associated with the device; vector retrieval interface: POST / vector / search, which receives a text query and returns similar document IDs; real - time data interface: GET / realtime / data / {device_id}, which returns the real - time operating parameters of the device.
[0037] The storage scale of the data sharing center is as follows: Graph database: Neo4j cluster stores more than 1 million nodes and more than 2 million edges; Vector database: Milvus stores more than 1.5 million vectors; Relational database: DM database stores structured operation data (about 500GB).
[0038] Step S300: Divide the types of agents according to the power transmission and distribution business scenarios, and determine the functional boundaries of each agent; In the data sharing center, use the multi-agent simulation environment to test the collaboration efficiency of subtasks and optimize the execution order of the subtask sequence; Dynamically allocate subtasks according to the agent load and skill matching degree; Specifically, the power transmission and distribution business scenarios include equipment management, operation monitoring, dispatching and command, emergency repair, and material management. For each power distribution business scenario, determine the corresponding agent type; Define the functional scope of each agent, check the functions of each agent to ensure that there is no functional overlap between agents. When functional overlap occurs, readjust the functional boundaries; Based on the associations and dependencies between various links in the power transmission and distribution business process, determine the collaboration requirements between agents.
[0039] Furthermore, create a virtual scenario based on the power transmission and distribution business process, including equipment network, business rules, and resource pool; Deploy agents consistent with the production environment, map their data interfaces and functional logics, and configure load thresholds for each agent; Use discrete event simulation technology to drive agent interactions by time slices for monitoring and debugging; Locate typical problems, including serial execution caused by strong dependencies between subtasks, multiple agents simultaneously requesting the same resource, and data version conflicts in the data transmitted between agents; Identify subtasks with no dependencies and adjust them to be executed in parallel; Assign priorities to subtasks, and high-priority tasks can preempt low-priority resources; Encode the execution order of subtasks as chromosomes, calculate the fitness by comprehensively considering the total task duration, resource occupancy, and compliance, iteratively generate the optimal sequence, and dynamically allocate tasks to idle agent instances; Define arbitration rules during resource competition. When an agent fails, switch to a standby agent instance or trigger a manual intervention process.
[0040] Furthermore, obtain the real-time load data of agents, and use the cosine similarity algorithm to calculate the matching degree score between subtask requirements and agent skills. The formula is as follows: ; where MD is the matching degree, is the demand intensity of subtask for skill i, is the mastery degree of agent for skill i, is the skill weight; Obtain sub-task features and agent states. The sub-task features include task type, priority, skill requirements, and data requirements. The agent states include real-time load data and skill profiles. Construct a sub-task set based on the sub-task features of all sub-tasks and an agent set based on the agent states of all agents. With the goal of maximizing skill matching degree and load balancing, construct a mixed-integer programming model, and the formula is as follows:
[0041] where A is the agent set, T is the sub-task set, is a 0-1 variable indicating whether agent a processes sub-task t, is the skill matching degree between agent a and sub-task t, is the load of agent a, is the load threshold of agent a, MMT is the minimum matching degree threshold, and s.t. is used to introduce the constraint conditions that the objective function must satisfy; The sub-tasks enter the assignment queue for compliance verification. Filter out unmatched agents according to the mandatory constraint conditions to generate a list of candidate agents, which is sorted in descending order of skill matching degree. When the matching degrees are the same, it is sorted in ascending order of load rate. When the load rates are the same, it is sorted in descending order of historical task success rate. Push the sub-tasks to the target agent through the API, along with the task details. After receiving the task, the agent updates the load status in real time and synchronizes it to the data sharing center.
[0042] In a specific embodiment, the device network: reproduce the distribution network structure of a certain area, including: substations: 5 (220kV / 110kV / 10kV); transmission lines: 20 (110kV), distribution lines: 100 (10kV); device nodes: 500 (transformers, switches, towers). Business rules: "South Grid Fault Disposal Process": fault location → impact analysis → resource scheduling → work order generation → emergency repair execution; resource constraints: each emergency repair team only has the qualification to handle a single voltage level (such as 10kV or 110kV). Resource pool: emergency repair teams: 10 (5 for 10kV, 5 for 110kV); material warehouses: 3, storing 20 types of materials such as insulators and circuit breakers.
[0043] The time slice is 100ms / step, simulating 24-hour continuous operation; the initial task sequence is: fault location, impact analysis, resource scheduling, work order generation, and emergency repair execution. The monitoring indicators are: total task duration, agent idle rate, number of resource conflicts; typical problems are: serial bottleneck: "resource scheduling" needs to wait for "impact analysis" to complete, and the time-consuming proportion is 30%; resource competition: in the case of multiple fault scenarios, the load of the "data query agent" reaches 100%, resulting in request timeouts.
[0044] The skills required for "10kV line tripping handling" are as follows: fault location (requirement intensity 0.9), 10kV equipment handling (0.8), GIS operation (0.7); the skill portraits of the agents are as follows: Agent A: 10kV handling (0.9), fault location (0.8), GIS (0.6); Agent B: 110kV handling (0.9), fault location (0.7), GIS (0.8); Perform the matching degree calculation, , due to the mismatch of 110kV skills, the matching degree is relatively low, ; In the mixed integer programming model, the input parameters include: Agent set A: 10 agents (including 2 spare instances); subtask set T: 50 subtasks (including 10 high-priority fault tasks); load threshold: CPU utilization > 80% is regarded as overloaded; the solution result (optimization goal: matching degree ≥ 0.8, load balance degree ≤ 20%) is: all high-priority tasks are processed by agents with a matching degree ≥ 0.8; the load difference of the agents is reduced from 35% to 18%, meeting the balance requirement.
[0045] Step S400: The agent accesses the knowledge relationship graph through a unified data interface, obtains associated data, and uses a message queue to achieve real-time push of data changes; the agent calls the external knowledge base according to the task requirements, optimizes the decision-making of the large language model through prompt engineering, and uses the tool library components to perform specific operations. The agent executes the operations according to the subtask sequence.
[0046] Specifically, the unified data interface adopts the RESTful API specification, realizes high throughput based on the HTTP / 2 protocol, and supports JSON format requests or responses; docks with the authentication system, verifies the identity of the agent through the API Key, and follows the principle of least privilege; The agent actively initiates queries according to the task requirements, subscribes to specific types of data changes, and the interface automatically pushes updates; maps the nodes and edges returned by the knowledge relationship graph into an object model recognizable by the agent; the message queue adopts Apache Kafka.
[0047] Furthermore, the external knowledge base includes an industry specification library, a historical case library, and a real-time data knowledge base. The agent extracts key retrieval elements according to the task type and subtasks; designs a prompt engineering template, inserts several historical successful cases in the prompt, and guides the large language model to generate responses that conform to historical experience; filters the tool library components according to the subtask requirements, checks the integrity of the tool input parameters, and triggers the agent to ask questions when missing; when receiving a higher-priority task, pauses the current subtask sequence and gives priority to executing the higher-priority task; when a subtask execution fails, triggers a rollback mechanism and re-plans the subtask sequence.
[0048] In a specific embodiment, the template example is as follows: [Task type]: Emergency repair; [Current fault]: The #8 pole of the 10kV Chaoyang line tripped and failed to reclosing successfully; [Historical cases]: Case 1: On X month X day, 2023, the disposal steps for the same type of fault: 1. Fault location → 2. Isolate the fault point → 3. Transfer the load; Case 2: On X month X day, 2024, preferentially call the local repair team (distance < 5 km); [Output requirements]: Generate a 5-step disposal process and quote the terms of the Southern Power Grid regulations.
[0049] Perform tool library component calls and task executions. When a low-priority task (equipment inspection) is in progress and receives a first-level fault task, the preemption time is < 1 second; when the suspended inspection task releases the GIS tool occupation, the release success rate is 100%. If the work order generation fails (network interruption), rollback is triggered to cancel the dispatched repair team; after 3 consecutive retry failures, the manual intervention process is automatically triggered to notify the dispatcher to handle it manually.
[0050] As Figure 2 As shown in the system structure diagram of a data sharing system for realizing multi-agent interaction, a data sharing system for realizing multi-agent interaction includes: Task decomposition module: including: task type recognition unit and subtask sequence generation unit; among them, the task type recognition unit annotates the production command instructions, trains the large language model, and recognizes the task type; the subtask sequence generation unit generates a standardized task template through prompt engineering, and decomposes the production command instructions into subtask sequences in combination with the task type; Knowledge graph construction module: including: knowledge relationship graph construction unit, unstructured data vectorization unit and data sharing center establishment unit; among them, the knowledge relationship graph construction unit collects power transmission and distribution production data, constructs a knowledge relationship graph through a graph database, and the unstructured data vectorization unit converts unstructured data into vectors for storage; the data sharing center establishment unit establishes a unified data interface to support agents to retrieve graph data in real time through the API and construct a data sharing center; Agent classification and collaborative optimization module: including: agent type division unit, subtask sequence execution order optimization unit and skill matching degree dynamic task allocation unit; among them, the agent type division unit divides the agent types according to the power transmission and distribution business scenarios and determines the functional boundaries of each agent; the subtask sequence execution order optimization unit tests the collaborative efficiency of subtasks in the data sharing center using a multi-agent simulation environment and optimizes the execution order of subtask sequences; the skill matching degree dynamic task allocation unit dynamically allocates subtasks according to the agent load and skill matching degree; Agent Interaction and Task Execution Module: It includes: a real-time data push unit, a prompt engineering optimization decision-making unit, and a subtask execution unit; among them, in the real-time data push unit, the agent accesses the knowledge relationship graph through a unified data interface, obtains associated data, and uses a message queue to achieve real-time push of data changes; in the prompt engineering optimization decision-making unit, the agent calls an external knowledge base according to task requirements, optimizes the decision-making of the large language model through prompt engineering, and the subtask execution unit uses the tool library component to perform specific operations, and the agent executes operations according to the subtask sequence.
[0051] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved.
Claims
1. A data sharing method for realizing multi-agent interaction, characterized in that The following steps are involved: Label production command instructions, train large language models, and identify task types; generate standardized task templates through prompt word engineering, and decompose production command instructions into sub-task sequences based on task types; Collect power transmission and distribution production data, build a knowledge relationship graph through a graph database, and convert unstructured data into vector storage; establish a unified data interface to support intelligent agents to retrieve graph data in real time through APIs and build a data sharing center; Classify the types of agents according to the power transmission and distribution business scenarios and determine the functional boundaries of each agent; in the data sharing center, use the multi-agent simulation environment to test the collaborative efficiency of subtasks and optimize the execution order of subtask sequences; dynamically allocate subtasks based on agent load and skill matching; The intelligent agent accesses the knowledge relationship graph through a unified data interface, obtains related data, and uses message queues to push data changes in real time; the intelligent agent calls the plug-in knowledge base according to task requirements, optimizes the decision of the large language model through prompt word engineering, and uses tool library components to perform specific operations. The intelligent agent performs operations according to the sub-task sequence.
2. The data sharing method for realizing multi-agent interaction according to claim 1, wherein The production command instructions are labeled, a large language model is trained, and the task type is identified, including: Collect production command instructions, perform denoising and standardization, and divide the training set, validation set, and test set into proportions; define task type labels, including data query class, process execution class, solution generation class, and risk assessment class, and use the BIO labeling method to mark entities in the instructions, including: equipment entity, time entity, and operation action; use LabelStudio to label the production command instructions, use DeepSeek as the basic model of the large language model, and use the labeled production command instructions as input; the training goal is to use the cross-entropy loss function to output the task type to which the instruction belongs; set training parameters, evaluate and iterate the large language model, and use it to identify the task type of the newly input production command instructions.
3. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that, The standardized task template is generated by the prompt word engineering, and the production command instruction is decomposed into sub-task sequences according to the task type, including: A standardized task template structure is designed in the template library. Each template contains: main task description, subtask sequence, parameter placeholder and execution constraints. The main task description is specifically the business goal, the subtask sequence is the subtask arranged in the order of business logic, the parameter placeholder is the dynamic parameter extracted based on the instruction entity, and the execution constraint is the domain rule restriction. Based on the task type, retrieve the corresponding template from the template library, and select the segmented scenario template based on the keywords in the instruction; fill the entities in the instruction into the parameter placeholders of the template; arrange the subtasks according to the business logic order preset by the template; mark the subtasks that can be processed in parallel as parallel execution nodes; call the execution constraints to verify the compliance of the subtask sequence.
4. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that The collection of power transmission and distribution production data, the construction of a knowledge relationship graph through a graph database, and the conversion of unstructured data into vector storage include: Collect power transmission and distribution production data, define event entities and spatial entities, combine equipment entities and operation actions, and construct the triggering relationship between equipment and events, the location relationship between equipment and space, and the process relationship between events and operation actions; construct an equipment layer, an event layer, a rule layer, and a spatial layer in the knowledge relationship graph. The equipment layer is constructed according to the hierarchical levels of substation, voltage level, equipment, and components from high to low, and records the full life cycle information of the equipment. The event layer is used to mark the event triggering conditions and influence ranges. The rule layer implants industry rules and defines the equipment maintenance cycle and fault handling process. The spatial layer integrates geographical coordinates and administrative divisions. Based on the power transmission and distribution production data, convert structured data into graph nodes and convert the extracted relationships into graph edges; remove non-business-related content from unstructured data, unify terms using a domain dictionary, and segment the text in unstructured data into independent blocks according to semantic relevance; use a pre-trained language model for the power industry to encode the text blocks, generate vectors, and store them in a vector database.
5. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that Divide the intelligent agent types according to the power transmission and distribution business scenarios, and determine the functional boundaries of each intelligent agent, including: The power transmission and distribution business scenarios include equipment management, operation monitoring, dispatching and command, emergency repair, and material management. For each power distribution business scenario, determine the corresponding intelligent agent type; define the functional scope of each intelligent agent, check the functions of each intelligent agent to ensure that there is no functional overlap between intelligent agents. When there is a functional overlap, readjust the functional boundaries; based on the association and dependency relationships between various links in the power transmission and distribution business process, determine the cooperation requirements between intelligent agents.
6. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that In the data sharing center, use a multi-intelligent agent simulation environment to test the cooperation efficiency of subtasks and optimize the execution order of subtask sequences, including: Create a virtual scenario based on the power transmission and distribution business process, including an equipment network, business rules, and a resource pool; deploy intelligent agents consistent with the production environment, map their data interfaces and functional logics, and configure a load threshold for each intelligent agent; use discrete event simulation technology to drive intelligent agent interactions according to time slices for monitoring and debugging; locate typical problems, including serial execution caused by strong dependencies between subtasks, multiple intelligent agents requesting the same resource simultaneously, and data version conflicts in the data transmitted between intelligent agents. Identify subtasks with no dependency relationships and adjust them to be executed in parallel; assign priorities to subtasks, and high-priority tasks can preempt low-priority resources; encode the execution order of subtasks into chromosomes, calculate the fitness by integrating the total task execution time, resource occupancy, and compliance, iteratively generate the optimal sequence, and dynamically allocate tasks to idle intelligent agent instances; define arbitration rules during resource competition. When an intelligent agent fails, switch to a standby intelligent agent instance or trigger an artificial intervention process.
7. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that Dynamically allocate subtasks according to the load and skill matching degree of intelligent agents, including: Obtain the real-time load data of intelligent agents, and use the cosine similarity algorithm to calculate the matching degree score between subtask requirements and intelligent agent skills. The formula is as follows: ; where MD is the matching degree, is the demand intensity of subtask for skill i, is the mastery level of the agent for skill i, is the skill weight; Obtain subtask features and agent status. The subtask features include task type, priority, skill requirements, and data requirements. The agent status includes real-time load data and skill profiles. Construct a subtask set based on the subtask features of all subtasks, and construct an agent set based on the agent status of all agents. A mixed-integer programming model is constructed with the goal of maximizing skill matching and load balancing. The formula is as follows: ; where \(A\) is the set of agents, \(T\) is the set of subtasks, is a 0-1 variable indicating whether agent \(a\) processes subtask \(t\), is the skill matching degree between agent \(a\) and subtask \(t\), is the load of agent \(a\), is the load threshold of agent \(a\), \(MMT\) is the minimum matching degree threshold, and \(s.t.\) is used to introduce the constraints that the objective function must satisfy; The subtasks enter the allocation queue for compliance verification. Filter out unmatched agents according to the mandatory constraint conditions to generate a list of candidate agents, which is sorted in descending order of skill matching degree. When the matching degrees are the same, it is sorted in ascending order of load rate. When the load rates are the same, it is sorted in descending order of historical task success rate. The subtasks are pushed to the target agent through the API, along with the task details. After receiving the task, the agent updates the load status in real time and synchronizes it to the data sharing center.
8. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that, The agent accesses the knowledge relationship graph through a unified data interface to obtain associated data, and uses a message queue to achieve real-time push of data changes, including: The unified data interface adopts the RESTful API specification, realizes high throughput based on the HTTP / 2 protocol, and supports JSON format requests or responses. It is docked with the authentication system to verify the identity of the agent through the API Key, following the principle of least privilege. The agent actively initiates queries according to task requirements. The agent subscribes to specific types of data changes, and the interface automatically pushes updates. Map the nodes and edges returned by the knowledge relationship graph to an object model recognizable by the agent. The message queue uses Apache Kafka.
9. A data sharing method for realizing multi-agent interaction according to claim 1, characterized in that The agent calls the external knowledge base according to task requirements, optimizes the decision-making of the large language model through prompt engineering, and uses the tool library components to execute specific operations. The agent executes operations according to the subtask sequence, including: The external knowledge base includes an industry specification library, a historical case library, and a real-time data knowledge base. The agent extracts key retrieval elements according to the task type and subtasks. Design a prompt engineering template, insert several historical successful cases in the prompt, and guide the large language model to generate responses that conform to historical experience. According to the subtask requirements, screen the tool library components, check the integrity of the tool input parameters, and trigger the agent to ask questions when they are missing. When receiving a task with a higher priority, pause the current subtask sequence and give priority to executing the task with a higher priority. When a subtask fails to execute, trigger a rollback mechanism and re-plan the subtask sequence.
10. A data sharing system for realizing multi-agent interaction, which uses a method for realizing multi-agent interaction data sharing according to any one of claims 1-9, characterized in that, Including: Task decomposition module: including: task type recognition unit and subtask sequence generation unit; among them, the task type recognition unit annotates the production command instructions, trains the large language model, and recognizes the task type; the subtask sequence generation unit generates a standardized task template through prompt engineering, and decomposes the production command instructions into a subtask sequence in combination with the task type; Knowledge Graph Construction Module: It includes: Knowledge Relationship Graph Construction Unit, Unstructured Data Vectorization Unit, and Data Sharing Center Establishment Unit; among them, the Knowledge Relationship Graph Construction Unit collects power transmission and distribution production data and constructs a knowledge relationship graph through a graph database. The Unstructured Data Vectorization Unit converts unstructured data into vectors for storage; the Data Sharing Center Establishment Unit establishes a unified data interface to support agents to retrieve graph data in real time through the API and constructs a data sharing center; Agent Classification and Cooperative Optimization Module: It includes: Agent Type Division Unit, Sub-task Sequence Execution Order Optimization Unit, and Skill Matching Degree Dynamic Task Allocation Unit; among them, the Agent Type Division Unit divides agent types according to the power transmission and distribution business scenarios to determine the functional boundaries of each agent; the Sub-task Sequence Execution Order Optimization Unit tests the cooperation efficiency of sub-tasks in the data sharing center using a multi-agent simulation environment and optimizes the execution order of the sub-task sequence; the Skill Matching Degree Dynamic Task Allocation Unit dynamically allocates sub-tasks according to agent load and skill matching degree; Agent Interaction and Task Execution Module: It includes: Data Real-time Push Unit, Prompt Engineering Optimization Decision-making Unit, and Sub-task Execution Unit; among them, in the Data Real-time Push Unit, the agent accesses the knowledge relationship graph through the unified data interface, obtains associated data, and uses a message queue to achieve real-time push of data changes; in the Prompt Engineering Optimization Decision-making Unit, the agent calls an external knowledge base according to the task requirements and optimizes the decision-making of the large language model through prompt engineering. The Sub-task Execution Unit uses the tool library component to perform specific operations, and the agent executes the operations according to the sub-task sequence.
Citation Information
Patent Citations
Multi-agent cooperation method and system
CN118917632A
Production traceability and transaction collaboration method and system of MES (Manufacturing Execution System)
CN119067689A
Heterogeneous multi-agent networking cooperative scheduling planning method based on autonomous obstacle bypassing
WO2024016457A1
Cited By
Task processing method and device based on tool and electronic equipment
CN120892474A
A tool-based task processing method, device and electronic equipment
CN120892474B
Multi-agent collaborative commodity plot advertisement script generation system and method
CN120893577A
Business processing method and device, medium and product
CN120909557A
A service processing method, device, medium and product
CN120909557B