Multi-agent cooperation method, device and equipment, storage medium and program product
By analyzing tasks, generating agent collaboration maps and clustering, reasonable scheduling and collaboration of multi-agent systems are achieved, and the problems of insufficient flexibility and decision-making conflicts in the existing technology are solved, and task execution efficiency is improved.
Patent Information
- Application Number
- CN202510102851.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-05-16
AI Technical Summary
The existing multi-agent system faces problems such as insufficient flexibility, low communication and coordination efficiency, and poor decision-making accuracy in the collaboration process, resulting in unreasonable scheduling and conflict in decision-making.
By obtaining the tasks to be executed, analyzing and determining the key operations and their relationships, querying the role correspondence between the predetermined operations and the agent, generating the agent collaboration map and the agent clustering, realizing the role mapping between the operations and the agent, and dynamically dispatching the agent to perform tasks.
It realizes reasonable scheduling and collaboration of the agent, improves the speed of task execution, shortens the task execution time, and avoids decision-making conflicts of the agent.
Smart Images

Figure CN120011836A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to multi-agent collaboration methods, devices, equipment, storage media and program products. Background Art
[0002] The field of artificial intelligence has made significant progress in recent years, especially in the research and application of multi-agent systems. By simulating group behavior in biological systems, multi-agent systems can effectively solve complex problems and improve decision-making efficiency. With the development of technology, multi-agent systems have shown great potential and application value in the fields of automated control, intelligent transportation, and robot collaboration.
[0003] At present, multi-agent systems face several key challenges in the collaboration process. First, the agents need to be able to understand and adapt to changing task requirements, which requires the system to have a high degree of flexibility. Second, the communication and coordination mechanisms between agents need to be more efficient to reduce delays and errors in information transmission. In addition, the decision-making process of the agents needs to be more precise to ensure that the best decisions are made in complex environments. The current collaboration modes of agents mainly include the following types: single agent mode, master-slave collaboration mode, peer-to-peer collaboration mode, and hierarchical collaboration mode.
[0004] The multi-intelligence collaboration modes in the existing technologies all have their applicable scenarios. Choosing the appropriate mode requires considering multiple factors such as task complexity, system scale, and performance requirements. Effectively coordinating the behaviors of various agents to achieve the overall goal is a complex problem. In practical applications, as the collaboration mode becomes more complex, it is a challenge to ensure that all agents maintain consistent states and goals. It is also easy for multiple agents to make inconsistent or conflicting decisions, which makes system design, implementation, and maintenance extremely difficult. Therefore, how to reasonably coordinate and schedule multiple agents has become a problem to be solved. Summary of the invention
[0005] The present invention provides a multi-agent collaboration method, device, equipment, storage medium and program product to achieve reasonable scheduling of multi-agents.
[0006] According to one aspect of the present invention, a multi-agent collaboration method is provided, comprising:
[0007] Acquire tasks to be executed, parse the tasks to be executed, and determine key operations to be executed and the relationship between the key operations to be executed;
[0008] Querying a predetermined correspondence between an operation and an agent role, and determining an agent corresponding to the key operation to be performed, wherein the correspondence between the operation and the agent role is determined by clustering an agent collaboration graph, and the agent collaboration graph is generated according to the operation and the relationship between the operations;
[0009] According to the relationship between the key operations to be executed, the agents corresponding to the key operations to be executed are scheduled in sequence so that the agents execute the corresponding key operations to be executed.
[0010] According to another aspect of the present invention, there is provided a multi-agent collaboration device, comprising:
[0011] A task parsing module is used to obtain tasks to be executed, parse the tasks to be executed, determine key operations to be executed and the relationship between the key operations to be executed;
[0012] An agent determination module, used to query the predetermined operation and the agent role correspondence relationship, and determine the agent corresponding to the key operation to be performed, wherein the operation and the agent role correspondence relationship is determined by clustering the agent collaboration map, and the agent collaboration map is generated according to the operation and the relationship between the operations;
[0013] The agent scheduling module is used to schedule the agents corresponding to the key operations to be executed in sequence according to the relationship between the key operations to be executed, so that the agents execute the corresponding key operations to be executed.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor, and a memory communicatively coupled to the at least one processor;
[0016] Among them, the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-agent collaboration method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-agent collaboration method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the multi-agent collaboration method described in any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention obtains the tasks to be executed, parses the tasks to be executed, determines the key operations to be executed and the relationship between the key operations to be executed; queries the predetermined correspondence between the operations and the roles of the agents, determines the agent corresponding to the key operations to be executed, wherein the correspondence between the operations and the roles of the agents is determined by clustering the agent collaboration graph, and the agent collaboration graph is generated according to the operations and the relationship between the operations; according to the relationship between the key operations to be executed, schedules the agents corresponding to the key operations to be executed in turn, so that the agents execute the corresponding key operations to be executed, thereby solving the problem of unreasonable multi-agent scheduling, and generating agent collaboration in advance according to the operations and the relationship between the operations. Graph, cluster the agent collaboration graph to determine the correspondence between operations and the roles of agents, realize the mapping of operations and roles of agents, flexibly and dynamically perform role allocation and task adjustment to adapt to complex and changeable task scenarios; obtain the tasks to be executed and parse them, determine the key operations to be executed and the relationship between the key operations to be executed, query the role correspondence between operations and agents, determine the agents corresponding to the key operations to be executed, map the key operations to be executed to the agents, and according to the relationship between the key operations to be executed, schedule the agents corresponding to each key operation to be executed in turn so that the agents execute the corresponding key operations to be executed, realize the reasonable scheduling and collaboration of agents, improve the task execution speed, shorten the task execution time, and avoid the decision conflicts of agents.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of a multi-agent collaboration method provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flowchart of a multi-agent collaboration method provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is an example diagram of implementing multi-agent collaboration according to Embodiment 2 of the present invention;
[0025] Figure 4 is a schematic diagram of the structure of a multi-agent collaboration device provided according to Embodiment 3 of the present invention;
[0026] Figure 5 It is a schematic diagram of the structure of an electronic device for implementing the multi-agent collaboration method of an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 This is a flowchart of a multi-agent collaboration method provided in the first embodiment of the present invention. This embodiment is applicable to the situation of coordinating and cooperating multiple agents. The method can be executed by a multi-agent collaboration device. The multi-agent collaboration device can be implemented in the form of hardware and / or software. The multi-agent collaboration device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0031] S101, obtaining tasks to be executed, parsing the tasks to be executed, and determining key operations to be executed and the relationship between the key operations to be executed.
[0032] In this embodiment, the tasks to be performed can be understood as tasks that need to be performed, for example, please analyze the crime committed by XX. The key operations to be performed can be understood as operations that need to be performed by the agent, for example, plot analysis, legal article retrieval, article comparison, crime prediction, etc. The relationship between the key operations to be performed can be a sequential execution order, a dependency relationship, etc.
[0033] Obtain tasks to be executed. Tasks to be executed can be determined based on information input by the user. For example, the user enters the information they want to query on the search platform, and the information entered by the user is used as the tasks to be executed; or, tasks to be executed can also be sent by other platforms, devices, systems, etc., and the execution subject receives the tasks to be executed. Tasks to be executed can be decomposed into different key operations, and the processing of tasks to be executed is finally completed by executing different key operations; tasks to be executed are parsed by pre-set algorithms, models, etc., to determine the key operations to be executed included in the tasks to be executed and the relationship between the key operations to be executed.
[0034] Exemplarily, after parsing the task to be executed, the task parsing result obtained includes: task type, key operations and the relationship between operations. The output result format is: Taski = {Task_Type, Workflow_Graph (OP1->OP2; ... OPi->OPj...)}, where Task_Type is the task type corresponding to the sample; OP is the key operation of the task execution, that is, the key operation to be executed; -> represents the sequence and dependency relationship before the operation, that is, the relationship between the key operations to be executed. The task to be executed is parsed by natural language processing (NLP) technology; natural language processing technology can identify keywords and phrases in the task description to determine the task type and key operations; named entity recognition (NER) technology helps to identify entities in the text, which may be key operations or conditions in the task. Dependency syntactic analysis can reveal the dependency relationship between words in a sentence, which helps to understand the sequence and dependency relationship between operations.
[0035] S102. Query the correspondence between predetermined operations and roles of agents, and determine the agent corresponding to the key operation to be performed, wherein the correspondence between operations and roles of agents is determined by clustering the agent collaboration graph, and the agent collaboration graph is generated based on operations and the relationships between operations.
[0036] In this embodiment, the correspondence between operations and roles of agents refers to the operations that agents can perform. One operation corresponds to one agent. One agent can correspond to multiple operations, that is, perform multiple operations. Usually, one agent performs one type of operation, which facilitates the agent to conduct targeted learning and improves the accuracy of execution. The agent collaboration graph can be understood as a knowledge graph formed by the relationship between operations, which is used to realize multi-agent collaboration.
[0037] Determine different operations and the relationships between them in advance, generate an agent collaboration graph based on the operations and the relationships between them, represent the relationships between the operations, cluster the agent collaboration graph, assign similar operations to the same agent, and establish a role correspondence between operations and agents so that the agents can perform the corresponding operations. After determining the key operations to be performed, query the role correspondence between operations and agents, determine the operations that match the key operations to be performed, and use the agent corresponding to this operation as the agent corresponding to the key operations to be performed.
[0038] Exemplarily, by querying the correspondence between operations and roles of agents, the corresponding roles (operations) and the agents used as well as the collaborative relationships between agents are queried, and the output format is: Taski = {Task_Type, Workflow_Graph (OP1 (Agent1) -> OP2 (Agent3); ... OPi (AgentX) -> OPj (AgentY) ...)}.
[0039] S103 . According to the relationship between the key operations to be executed, the agents corresponding to the key operations to be executed are scheduled in sequence, so that the agents execute the corresponding key operations to be executed.
[0040] The relationship between the key operations to be executed can represent the execution order, dependency, etc. of different key operations to be executed. By analyzing the relationship between the key operations to be executed, the execution order of each key operation to be executed is determined, and the intelligent agents corresponding to each key operation to be executed are scheduled in turn. The intelligent agents respond to the scheduling and execute the corresponding key operations to be executed. After each key operation to be executed is executed in turn, the processing of the task to be executed is completed and the corresponding processing result is obtained. The processing result can be directly fed back to the user, or it can be used as input to continue data processing, or it can be fed back to other devices, platforms, etc.
[0041] The current collaboration modes of several major intelligent agents all have certain shortcomings:
[0042] 1. Single agent mode: This is the most basic mode, using only one agent to handle tasks. Its advantages are simple implementation, low deployment and maintenance costs, fast response speed, and suitable for handling relatively simple and independent tasks; its disadvantages are limited capabilities, difficulty in handling complex tasks, and lack of multi-angle thinking and complementarity.
[0043] 2. Master-slave collaboration mode: This mode includes a master agent and multiple slave agents, and the master agent is responsible for task allocation and coordination. Its advantages are that it can handle more complex tasks, the master agent can coordinate and manage the slave agents, and the task division is clear; the disadvantage is that the master agent may become a performance bottleneck, and the capabilities of the slave agents may not be fully utilized.
[0044] 3. Peer-to-peer collaboration mode: In this mode, multiple agents collaborate equally to complete tasks together. Its advantages are that it can give full play to the advantages of each agent, process tasks in parallel to improve efficiency, and has stronger robustness and fault tolerance; its disadvantages are that the coordination and communication overhead is large, and decision conflicts may occur.
[0045] 4. Hierarchical collaboration mode: This mode organizes agents into multiple levels, with the upper level responsible for macro decision-making and the lower level performing specific tasks. Its advantages are that it can handle very complex tasks, the clear hierarchy is easy to manage, and it can achieve macro-to-micro task decomposition; its disadvantages are that it is complex to implement, requires a carefully designed hierarchical structure, and information transmission may be delayed or distorted.
[0046] The intelligent agent collaboration method provided in the embodiment of the present application generates an intelligent agent collaboration map in advance based on operations and the relationships between operations, clusters the intelligent agent collaboration map to determine the corresponding relationship between operations and the roles of the agents, realizes the role mapping of operations and the agents, flexibly performs dynamic role allocation and task adjustment, can adapt to complex and changeable task scenarios, and realizes the reasonable scheduling and collaboration of intelligent agents.
[0047] The embodiment of the present invention provides a multi-agent collaboration method, which solves the problem of unreasonable multi-agent scheduling. An agent collaboration map is generated in advance according to operations and the relationship between operations, and the agent collaboration map is clustered to determine the corresponding relationship between operations and roles of agents, so as to achieve role mapping between operations and agents, and flexibly perform dynamic role allocation and task adjustment to adapt to complex and changeable task scenarios; tasks to be executed are obtained and analyzed to determine the relationship between key operations to be executed and the relationship between key operations to be executed, the corresponding relationship between operations and roles of agents is queried, the agent corresponding to the key operations to be executed is determined, the key operations to be executed are mapped to the agents, and according to the relationship between the key operations to be executed, the agents corresponding to each key operation to be executed are scheduled in turn, so that the agents execute the corresponding key operations to be executed, so as to achieve reasonable scheduling and collaboration of agents, improve the task execution speed, shorten the task execution time, and avoid decision conflicts of agents.
[0048] Embodiment 2
[0049] Figure 2 This is a flowchart of a multi-agent collaboration method provided in Embodiment 2 of the present invention. This embodiment is refined on the basis of the above embodiment. Figure 2 As shown, the method includes:
[0050] S201, obtaining tasks to be executed, parsing the tasks to be executed, and determining key operations to be executed and the relationship between the key operations to be executed.
[0051] S202: Query the correspondence between predetermined operations and roles of agents, and determine the agent corresponding to the key operation to be executed.
[0052] As an optional embodiment, this optional embodiment further optimizes the step of determining the corresponding relationship between the operation and the role of the agent, including A1-A3:
[0053] A1. Obtain a pre-constructed intelligent agent collaboration graph, cluster the operation nodes in the intelligent agent collaboration graph, and form a first data cluster, where the first data cluster includes at least one operation node.
[0054] In this embodiment, the first data cluster can be understood as a cluster formed by clustering. The number of first data clusters can be pre-set, that is, the number of clusters is set before clustering, and clustering is performed based on this number; or, the number of first data clusters is not set, and in the clustering process, a corresponding number of clusters are automatically generated after clustering according to the information of the operation node; the number of first data clusters is usually multiple. The operation node can be understood as a node in the intelligent agent collaboration graph, and each node represents a key operation.
[0055] Preliminarily construct an agent collaboration graph based on the operation nodes, obtain the agent collaboration graph, cluster the operation nodes in the agent collaboration graph according to a suitable clustering algorithm to form a first data cluster, the number of the first data clusters is multiple, and the first data cluster includes at least one operation node.
[0056] Exemplarily, the clustering algorithm may be K-means, DBSCAN or Agglomerative, etc. The operation data points in the knowledge graph are clustered by the clustering algorithm to form multiple clusters, and the center point and data point of each cluster are recorded, and the data point is the operation node. Then, a classification algorithm (such as logistic regression, SVM or decision tree) is used to classify the data points, determine multiple categories and their feature description information, explain the categories through the feature description information, and record the feature description information and data points of each category. The feature description information of the category can be saved as the attribute information of the data point for subsequent clustering.
[0057] The initial clustering results are in the form of:
[0058] R={R 1 ,R 2 ,R 3 ...R n}={R 1 {op 1 ,op 3 ,…},R 2 {op 5 ,op 8 ,…},…R i {…op xx …},...},
[0059] Where R i is a clustering result, namely the first data cluster.
[0060] As an optional embodiment, this optional embodiment further optimizes the steps of constructing the agent collaboration graph, including B1-B3:
[0061] B1. Obtain task samples corresponding to at least one task type.
[0062] In this embodiment, the task type can be understood as the type of task to be performed, such as crime case analysis, popularization of scientific and cultural knowledge, etc. The task sample can be understood as sample data describing the task. The sample content of the task sample can be an interaction process record.
[0063] The task type can be preset. For example, 10 task types are preset, and at least one is selected from the 10 task types. The corresponding task samples are obtained according to the selected task type; or, the task type specified by the user is obtained, or the task type sent by other platforms, devices, etc. is received. The number of task types can be preset. Determine the task type, collect different task samples according to the task type, extract different task samples for a task type, and extract one or more task samples for each task type. In order to ensure data diversity and improve the accuracy of data processing, a large number of task samples are usually extracted for each task type. When extracting task samples, select representative task samples.
[0064] B2. Analyze each task sample based on natural language processing technology, determine the key operations included in the task sample and the relationship between the operations, and determine the attribute information of the key operations.
[0065] For each task sample, the task sample is parsed based on natural language processing technology to determine the key operations in the execution process of the task sample, as well as the relationship between the operations, that is, the relationship between each key operation and other key operations, and the relationship between the key operations and operations included in the task sample; and the attribute information of the key operation is determined based on the name of the key operation, the description of the operation, and other information. Exemplarily, the attribute information of the key operation includes: the operation name and the operation description.
[0066] For example, the task sample is parsed and the operation is extracted based on natural language processing technology. The sample parsing result includes: task type, key operations and the relationship between operations. The output result format is: {Task_Type, Workflow_Graph (OP 1 ->OP 2 ;…OP i ->OP j …)}, where Task_Type is the task type corresponding to the sample; OP is the key operation of the task execution; -> indicates the sequence and dependency relationship between the operations.
[0067] For example, TaskSampleE = "USER: Can you analyze for me whether Cheng Yong in "Dying to Survive" committed a crime based on relevant laws and regulations? What crime did he commit? AI: In the movie "Dying to Survive", Cheng Yong's behavior did involve illegal crimes. The following is a detailed analysis of the legal basis: According to the relevant provisions on smuggling in the Criminal Law of the People's Republic of China, smuggling refers to the serious behavior of an individual or unit deliberately violating customs regulations, evading customs supervision, and transporting contraband imports and exports or evading customs duties through various means. In the movie, Cheng Yong obtained the goods through illegal channels. India imported unapproved drugs (Indian generic drug "Glenin") and sold them domestically. This behavior violated customs regulations, evaded customs supervision, and constituted the crime of smuggling. In particular, he brought drugs into the country many times by cargo ship or mail, and drugs did not belong to the specific duty-free or allowed import goods stipulated in the crime of smuggling, so he should be identified as smuggling ordinary goods and articles. ", the result after extraction is TaskTypeE = {Task_Type: Case Analysis, Workflow_Graph: (Plot Analysis->Legal Article Search->Article Comparison->Criminal Prediction)}.
[0068] B3. Take each key operation as an operation node, the relationship between operations as edges, and the attribute information of the key operations as the attribute information of the operation nodes to construct an intelligent agent collaboration graph.
[0069] The knowledge graph is composed of nodes and edges, and each node and edge may also have corresponding attribute information; each key operation is used as an operation node in the knowledge graph, the relationship between the operations is used as the edge between the nodes, and the attribute information of the key operations is used as the attribute information of the operation nodes to construct an intelligent agent collaboration graph. The intelligent agent collaboration graph can be constructed based on manual operations or based on algorithms, models, etc., which is not limited in the embodiments of the present application; the nodes and edges in the intelligent agent collaboration graph can be stored in a graph database to facilitate query and other operations.
[0070] When constructing an intelligent agent collaboration graph, the embodiment of the present application may only use key operations as operation nodes and save task types as attribute information of the operation nodes. The task types of different operation nodes may be the same; or both key operations and task types may be used as operation nodes.
[0071] Exemplarily, the agent collaboration map is explained by taking the example that the operation nodes in the agent collaboration map include two types of Task_Type nodes and Operation nodes. The Task_Type node is used to indicate the type of task, such as "Case Analysis", and its attributes include name, which is used to specify the name of the task type. The Operation node represents each operation step in the workflow, and its attributes include name (operation name) and description (operation description). The edge design (Relationships) defines a type of edge, namely the sequential edge, which is used to indicate the sequence and dependency between operations. The type of this edge is next_step, which indicates that one operation is the subsequent step of another operation. Through this design, the execution order and relationship of each operation in the workflow can be clearly described.
[0072] The Task_Type node is generally the central node of a certain type of task, connected to the first operation node "Plot Analysis". Each Operation node is connected to the next operation node through the next_step relationship, forming a clear operation process chain. If further refinement is required, more sub-nodes can be mounted under each Operation node, such as relevant legal provisions, cases, evidence, etc. More attributes can be added to each operation step, such as execution time, execution results, relevant responsible persons, etc. The relationship between nodes is described by attribute information. For example, the sub-nodes included in a node can be determined by attribute information.
[0073] Taking the above task sample TaskSampleE as an example, its corresponding node and edge information are:
[0074] node:
[0075] Node("Task_Type",name="Case Analysis")
[0076] Node("Operation",name="Plot Analysis")
[0077] Node("Operation",name="Legal Article Retrieval")
[0078] Node("Operation",name="Article Comparison")
[0079] Node("Operation",name="Criminal Prediction")
[0080] side:
[0081] Relationship("Operation","Plot Analysis","next_step","Legal Article Search")
[0082] Relationship("Operation","Legal Article Search","next_step","Article Comparison")
[0083] Relationship("Operation","Article Comparison","next_step","Charge Prediction")
[0084] A2. For each first data cluster, cluster each operation node according to the attribute information of the operation node in the first data cluster to obtain an initial clustering result, perform hierarchical clustering on the initial clustering result to obtain a hierarchical clustering result, the hierarchical clustering result includes a second data cluster, and the second data cluster includes at least one operation node.
[0085] In this embodiment, the initial clustering result can be understood as the result of preliminary clustering of the operation nodes in the first data cluster; the hierarchical clustering result can be understood as the result of hierarchical clustering of the nodes. The second data cluster can be understood as a cluster obtained through clustering, and the second data cluster is composed of operation nodes, that is, clustering is obtained by taking the operation nodes as the basic unit.
[0086] For each first data cluster, the operation nodes included in the first data cluster are analyzed, the node information is extracted from the intelligent agent collaboration map, and the attribute information of the operation nodes is determined; based on the attribute information of the operation nodes, a similarity measurement method is determined, and each operation node is clustered based on the clustering algorithm of the similarity measurement to obtain an initial clustering result; wherein, the similarity measurement method can be name similarity, description similarity, etc., and the similarity between nodes can be calculated using Jaccard similarity, cosine similarity, etc. The clustering algorithm can be K-means, hierarchical clustering, etc. The initial clustering result is hierarchically clustered, and the algorithm of hierarchical clustering can be pre-set, for example, hierarchical clustering is performed using an agglomerative hierarchical clustering algorithm; a hierarchical clustering result is obtained through hierarchical clustering, and the operation nodes are hierarchically organized to form a tree structure. The hierarchical clustering result includes a second data cluster, and the second data cluster includes at least one operation node.
[0087] For example, the hierarchical clustering result is in the form of:
[0088] R={R 1 ,R 2 ,R 3 ...R n}={R 1 {R 1.1 (op 1 ,op 3),…},R 2 {…,R 2.2 (op 5 ,op 8 ),…},…R i {…,R i.j (…,op xx, …),…},...}, where R i.j It is the clustering result of a certain level, that is, the second data cluster.
[0089] Optionally, use a graph visualization tool to visualize the multi-level clustering results to ensure that the results are intuitive and easy to understand, which is helpful for further analysis. The graph visualization tool can be tools such as Gephi or Neo4j.
[0090] The embodiment of the present application can also extract node and edge information from the intelligent agent collaboration graph, determine the attribute information of each operation node, and determine the type and associated nodes of each edge.
[0091] The embodiment of the present application mainly divides clustering into two steps: the first step is to perform preliminary clustering to obtain the first data cluster. The preliminary clustering uses a fusion method of clustering and classification to perform cluster analysis on the operations in the intelligent agent collaboration map; the second step is to perform hierarchical clustering, which is to perform multi-level aggregation processing operations on the nodes in the intelligent agent collaboration map to form a clustering result with a hierarchical structure. By performing multi-level clustering on the operation nodes of the intelligent agent collaboration map, the potential patterns and relationships between the operation nodes are determined.
[0092] After completing the hierarchical clustering, you can also analyze the hierarchical clustering results to ensure the rationality of each level and cluster, and adjust the similarity measurement method and clustering algorithm based on the analysis results.
[0093] A3. Assign roles to the agents according to the predetermined number of agents and the hierarchical clustering results corresponding to each first data cluster, and generate a corresponding relationship between operations and roles of the agents.
[0094] The number of agents can be pre-set, that is, before the agents collaborate to perform tasks, the number of agents is first determined, and the number of agents can be set according to business scenarios, business complexity, etc. Each agent performs a part of key operations, and an agent can perform a class or similar key operations.
[0095] Based on the number of agents, the hierarchical clustering results corresponding to each first data cluster are analyzed, and the operation nodes are divided into clusters matching the number of agents. The operation nodes are assigned to the corresponding agents in turn to complete the role assignment of the agents. The corresponding agent is assigned to each key operation, and the corresponding relationship between the operation and the role of the agent is generated according to the assignment results.
[0096] As an optional embodiment, this optional embodiment further assigns roles to the agents according to the predetermined number of agents and the hierarchical clustering results corresponding to each first data cluster, generates a corresponding relationship between operations and roles of the agents, and optimizes it as follows:
[0097] C1. Taking the predetermined number of agents as the number of clusters, clustering the hierarchical clustering results corresponding to each first data cluster to obtain a third data cluster, where the third data cluster includes the first data cluster and / or the second data cluster.
[0098] In this embodiment, the third data cluster can be understood as a cluster obtained by clustering, and the number of the third data clusters is equal to the number of agents; the third data cluster includes the first data cluster and / or the second data cluster.
[0099] The number of agents is used as the number of clusters for clustering, and the hierarchical clustering results corresponding to each first data cluster are clustered by a pre-set or randomly selected clustering algorithm. Exemplarily, the clustering algorithm may be KMEANS, DBSCAN, a hierarchical clustering method, etc.; a third data cluster is obtained by clustering, and the third data cluster includes the first data cluster and / or the second data cluster, that is, this step performs clustering with the first data cluster or the second data cluster as the basic unit.
[0100] It should be noted that the third data cluster includes the first data cluster and / or the second data cluster, and both the first data cluster and the second data cluster are substantially composed of operation nodes. Therefore, the third data cluster is substantially still composed of operation nodes, but the operation nodes are divided by clusters.
[0101] C2. Assign a third data cluster to each agent and establish a corresponding relationship between operations and the roles of the agent.
[0102] The number of intelligent agents is the same as the number of third data clusters, and a third data cluster is allocated to each intelligent agent. The allocation method can be random allocation, or allocation according to certain rules. For example, the third data cluster is allocated to the intelligent agent according to the data processing capability of the intelligent agent and the number of operation nodes in the third data cluster. For example, the stronger the data processing capability of the intelligent agent, the greater the number of operation nodes in the corresponding third data cluster.
[0103] By setting the number of agents and the hierarchical relationship of the operation nodes, different operation nodes are associated and matched with the agents, and a corresponding relationship between the operation and the role of the agent is established. The embodiment of the present application can also store the matching results in the collaboration map to guide the scheduling between the agents in the future. Exemplarily, by using KMEANS or DBSCAN or hierarchical clustering method, the hierarchical clustering results are clustered again based on the setting of "number of agents = number of new clusters". The result after clustering is: A = {Agent1{R1, R2, ...}, Agent2{R4.1, R4.2, ...}, ...}, thereby completing the role allocation of the agent, where Agent1, Agent2, etc. are different agents. This allocation result can be updated into the agent collaboration map, and the clustering information can be stored as attribute information.
[0104] The embodiment of the present application performs a two-stage hierarchical clustering analysis on the role-behavior information to avoid the separation of the same type of task operations across agents, improve the rationality of task allocation and the training effect of the agents, help the system better understand the role behavior characteristics, and ensure the stability of system services.
[0105] As an optional embodiment, this optional embodiment is further optimized to include: for each intelligent agent, determining the key operation corresponding to the intelligent agent based on the corresponding relationship between the operation and the role of the intelligent agent; generating training samples based on the key operations corresponding to the intelligent agent; and training the intelligent agent based on the training samples.
[0106] For each agent, all key operations corresponding to the agent are determined based on the corresponding relationship between the operation and the role of the agent; based on the key operations corresponding to the agent, corresponding historical cases, external data and other information are obtained to generate corresponding training samples for the agent. When generating training samples, the embodiment of the present application can filter out corresponding information from historical data based on the key operations corresponding to the agent, attribute information of the key operations, etc. to generate training samples, and can also expand the information or training samples based on the model or other methods to generate customized training samples for the agent. The agent is trained based on the generated training samples, and the trained agent can perform corresponding key operations based on the learned knowledge.
[0107] Agent training includes at least one of the following steps: data preparation, data cleaning, data set division, pre-training, instruction training, fine-tuning training, and alignment training. The trained agents can form a multi-agent system that can perform dynamic collaboration.
[0108] S203. According to the relationship between the key operations to be executed, the first key operation to be executed is used as the target key operation, and the agent corresponding to the first key operation to be executed is used as the agent to be scheduled.
[0109] In this embodiment, the target key operation can be understood as the key operation that needs to be executed currently. The agent to be scheduled can be understood as the agent that needs to be scheduled currently, and is used to execute the target key operation.
[0110] Analyze the relationship between the key operations to be executed, determine the execution order of each key operation to be executed, and then determine the first key operation to be executed; further determine the intelligent agent corresponding to the first key operation to be executed; take the first key operation to be executed as the target key operation, and take the intelligent agent corresponding to the first key operation to be executed as the intelligent agent to be scheduled.
[0111] S204: Generate a prompt text according to the target key operation, and send the prompt text to the intelligent agent to be scheduled, so that the intelligent agent to be scheduled performs the target key operation according to the prompt text.
[0112] Analyze the target key operation, generate prompt text based on the attribute information of the target key operation, the template of the corresponding prompt text and other information, and send the prompt text to the intelligent agent to be scheduled; after receiving the prompt text, the intelligent agent to be scheduled can perform the target key operation according to the prompt text.
[0113] S205. According to the relationship between the key operations to be executed, determine whether the target key operation has a next key operation to be executed. If so, execute S206; otherwise, execute S207.
[0114] The execution order of the key operations to be executed can be determined according to the relationship between the key operations to be executed. According to the execution order of the key operations to be executed, it is determined whether the target key operation has a corresponding next key operation to be executed, that is, whether the target key operation is the last key operation to be executed. If so, execute S206; otherwise, execute S207.
[0115] S206: Determine the next to-be-executed key operation corresponding to the target key operation as the new target key operation, take the agent corresponding to the next to-be-executed key operation as the new to-be-scheduled agent, and return to execute S204.
[0116] If the target key operation has a next key operation to be executed, the next key operation to be executed corresponding to the target key operation is determined as the new target key operation, and the intelligent agent corresponding to the next key operation to be executed is used as the new intelligent agent to be scheduled, so as to update the target key operation and the intelligent agent to be scheduled, return to execute S204, regenerate the prompt text, continue to schedule the intelligent agent to be scheduled, and realize the sequential scheduling of the intelligent agents.
[0117] S207, end the scheduling.
[0118] In the multi-agent scheduling process, the embodiment of the present application can sequentially schedule the agent corresponding to the key node to be executed to perform each step of the operation according to the dependency relationship between the key operations to be executed. The dependency order of the operation nodes after different tasks are parsed is different, so the interaction mode of the multi-agent is also different, thereby realizing the entire process of dynamic collaboration between agents. For example, Table 1 shows an example of agent scheduling for different tasks.
[0119] Table 1
[0120] Task2 Agent1 Agent2 Agent3 step1 √ Step 2 √ Task3 Agent1 Agent2 Agent3 step1 √ step2 √ step3 √
[0121] After the dynamic collaborative task of the multi-agent system is executed, the execution result of the entire task is finally output.
[0122] The agent collaboration graph in the embodiment of the present application can be updated in real time. After the update, it can be re-clustered and the corresponding relationship between operations and agent roles can be re-established. Alternatively, if the agent collaboration graph is not updated and the number of agents changes, the roles of the agents can be re-assigned according to the number of agents, and the corresponding relationship between operations and agent roles can be generated. Only one re-clustering is required to complete the role assignment. Using the knowledge graph as an agent capability management tool, the system can more easily support the introduction and expansion of new capabilities.
[0123] For example, Figure 3 This paper provides an implementation example diagram of multi-agent collaboration, which is mainly divided into two stages: stage 1 and stage 2. Among them, stage 1: multi-agent role clustering and learning. This stage mainly builds event-type knowledge graphs by parsing task samples, realizes role clustering of capability modules, assigns agents by roles, generates task fine-tuning samples, and trains agents. In this way, by optimizing the role-task allocation, the collaborative working ability between agents is enhanced to adapt to complex and changing task requirements; stage 2: multi-agent dynamic collaborative task execution. This stage uses the trained multi-agent system to process tasks.
[0124] Stage 1 mainly includes the following steps:
[0125] step11: sample analysis.
[0126] By sampling the task sample set, the task type Task_Type and Workflow_Graph are parsed. The Workflow_Graph includes the key operations OP of task execution and the relationship between the operations ->.
[0127] step12: knowledge graph construction.
[0128] The knowledge graph is constructed through the graph construction module to obtain the intelligent agent collaboration graph.
[0129] step13: Multi-level task clustering analysis.
[0130] Multi-level task clustering analysis is performed through the clustering analysis module. Clustering is mainly divided into PART1: preliminary clustering and PART2 hierarchical clustering; PART1 performs preliminary clustering to determine the first data cluster R i PART2 Continue clustering and hierarchical clustering to obtain the hierarchical clustering result R i.j .
[0131] step14: Multi-level task role clustering.
[0132] Multi-level task role clustering is performed through the role assignment module, each operation is assigned to an agent, and a role correspondence between the operation and the agent is established. This role correspondence between the operation and the agent can be stored in the agent collaboration graph. For example, the agent corresponding to the operation node (i.e., the key operation) is saved in the agent collaboration graph as the attribute information of the operation node.
[0133] step15: sample generation and agent learning.
[0134] The instruction sample generation module determines the key operation corresponding to each agent and generates training samples for it according to the corresponding relationship between the operation and the role of the agent. The agent training module trains the agent according to the training samples to obtain a multi-agent system with multi-agent collaboration; the multi-agent system consists of multiple agents, each of which can perform corresponding key operations.
[0135] Stage 2 mainly includes the following steps:
[0136] step21: Task paradigm analysis.
[0137] Through the task parsing module, new tasks are i Analyze and decompose the new task into task paradigms; i Parse to obtain key operations (e.g., key operations to be performed) and the relationship between the operations, and create a new task Task i Refers to tasks to be performed.
[0138] step22: task matching.
[0139] Match the analyzed key operations with the agent collaboration graph to determine the agent corresponding to the key operations.
[0140] step23: Multi-agent scheduling and collaboration.
[0141] The multi-agent collaborative scheduling module coordinates the interactions of agents based on the agent collaboration graph.
[0142] Step 24: Integrate the results.
[0143] The output results of multiple agents are integrated to obtain the results of task execution. That is, after the dynamic collaborative task of the multi-agent system is executed, the execution result of the entire task is finally output.
[0144] The multi-agent collaboration method provided in the embodiment of the present application can effectively alleviate the shortcomings of the current multi-agent system in task allocation, execution efficiency and collaboration through sophisticated task analysis, agent allocation, training and collaboration strategies based on the knowledge graph.
[0145] The embodiment of the present application provides a multi-agent collaboration method, which can more flexibly perform dynamic role allocation and task adjustment by extracting role and behavior information from the agent collaboration map to adapt to complex and changeable task scenarios; through hierarchical clustering analysis, it can avoid the cross-agent separation of the same type of task operations, improve the rationality of task allocation and the training effect of the agent, and help the system better understand the role behavior characteristics and ensure the stability of system services; the multi-agent dynamic collaboration mode can dynamically adjust the collaboration mode of the agent according to task requirements, with high flexibility, can dynamically adjust the collaboration mode according to the task, has strong adaptability, can handle changing environments and requirements, and effectively improve the flexibility and accuracy of the multi-intelligent system in processing tasks.
[0146] Embodiment 3
[0147] Figure 4 This is a schematic diagram of the structure of a multi-agent collaboration device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device includes: a task parsing module 31, an agent determination module 32 and an agent scheduling module 33.
[0148] The task parsing module 31 is used to obtain the tasks to be executed, parse the tasks to be executed, determine the key operations to be executed and the relationship between the key operations to be executed;
[0149] An agent determination module 32, used to query the predetermined correspondence between the operation and the role of the agent, and determine the agent corresponding to the key operation to be performed, wherein the correspondence between the operation and the role of the agent is determined by clustering the agent collaboration graph, and the agent collaboration graph is generated according to the operation and the relationship between the operations;
[0150] The agent scheduling module 33 is used to schedule the agents corresponding to the key operations to be executed in sequence according to the relationship between the key operations to be executed, so that the agents execute the corresponding key operations to be executed.
[0151] The embodiment of the present invention provides a multi-agent collaboration device, which solves the problem of unreasonable multi-agent scheduling. It generates an agent collaboration map in advance according to operations and the relationship between operations, clusters the agent collaboration map to determine the corresponding relationship between operations and roles of agents, realizes role mapping between operations and agents, and flexibly performs dynamic role allocation and task adjustment to adapt to complex and changeable task scenarios; obtains and parses tasks to be executed, determines the relationship between key operations to be executed and the relationship between key operations to be executed, queries the corresponding relationship between operations and roles of agents, determines the agent corresponding to the key operations to be executed, maps the key operations to be executed to the agents, and schedules the agents corresponding to each key operation to be executed in turn according to the relationship between the key operations to be executed, so that the agents execute the corresponding key operations to be executed, realizes reasonable scheduling and collaboration of agents, improves the task execution speed, shortens the task execution time, and avoids decision conflicts of agents.
[0152] Optionally, the device further comprises:
[0153] A collaboration graph acquisition module, used to acquire a pre-built agent collaboration graph, cluster the operation nodes in the agent collaboration graph to form a first data cluster, wherein the first data cluster includes at least one operation node;
[0154] A clustering module, configured to cluster each of the operation nodes in each first data cluster according to the attribute information of the operation nodes in the first data cluster to obtain an initial clustering result, perform hierarchical clustering on the initial clustering result to obtain a hierarchical clustering result, wherein the hierarchical clustering result includes a second data cluster, and the second data cluster includes at least one operation node;
[0155] The role allocation module is used to allocate roles to the agents according to the predetermined number of agents and the hierarchical clustering results corresponding to each first data cluster, and generate a corresponding relationship between operations and roles of the agents.
[0156] Optionally, the device further comprises:
[0157] A task sample acquisition module, used to acquire a task sample corresponding to at least one task type;
[0158] A sample parsing module, used to parse each of the task samples based on natural language processing technology, determine the key operations and the relationship between the operations included in the task samples, and determine the attribute information of the key operations;
[0159] The collaborative graph construction module is used to construct an intelligent agent collaborative graph by taking each of the key operations as an operation node, the relationship between the operations as an edge, and the attribute information of the key operations as the attribute information of the operation node.
[0160] Optionally, the role assignment module is specifically used to: take a predetermined number of agents as the number of clusters, cluster the hierarchical clustering results corresponding to each of the first data clusters to obtain a third data cluster, wherein the third data cluster includes the first data cluster and / or the second data cluster; assign a third data cluster to each agent, and establish a corresponding relationship between operations and the roles of the agents.
[0161] Optionally, the device further comprises:
[0162] An operation determination module, used for determining, for each agent, a key operation corresponding to the agent according to a corresponding relationship between the operation and the role of the agent;
[0163] A training sample generation module, used to generate training samples according to the key operations corresponding to the intelligent agent;
[0164] A training module is used to train the intelligent agent according to the training samples.
[0165] Optionally, the agent scheduling module 33 includes:
[0166] A to-be-scheduled agent determining unit, configured to, based on the relationship between the to-be-scheduled key operations, take the first to-be-scheduled key operation as the target key operation, and take the agent corresponding to the first to-be-scheduled key operation as the to-be-scheduled agent;
[0167] A prompt text generating unit, configured to generate a prompt text according to the target key operation, and send the prompt text to the to-be-scheduled intelligent agent, so that the to-be-scheduled intelligent agent performs the target key operation according to the prompt text;
[0168] The next operation judgment unit is used to judge whether there is a next key operation to be executed for the target key operation based on the relationship between the key operations to be executed. If so, the next key operation to be executed corresponding to the target key operation is determined as a new target key operation, and the intelligent agent corresponding to the next key operation to be executed is used as a new intelligent agent to be scheduled, and the step of generating a prompt text according to the target key operation and sending the prompt text to the intelligent agent to be scheduled is returned.
[0169] The multi-agent collaboration device provided in the embodiment of the present invention can execute the multi-agent collaboration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0170] Embodiment 4
[0171] Figure 5A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0172] like Figure 5 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0173] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0174] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a multi-agent collaboration method.
[0175] In some embodiments, the multi-agent collaboration method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the multi-agent collaboration method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the multi-agent collaboration method in any other appropriate manner (e.g., by means of firmware).
[0176] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0177] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0178] An embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the multi-agent collaboration method described in any embodiment of the present invention.
[0179] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0180] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0181] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0182] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0183] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0184] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A multi-agent collaboration method, characterized in that: include: Acquire tasks to be executed, parse the tasks to be executed, and determine key operations to be executed and the relationship between the key operations to be executed; Querying a predetermined correspondence between an operation and an agent role, and determining an agent corresponding to the key operation to be performed, wherein the correspondence between the operation and the agent role is determined by clustering an agent collaboration graph, and the agent collaboration graph is generated according to the operation and the relationship between the operations; According to the relationship between the key operations to be executed, the agents corresponding to the key operations to be executed are scheduled in sequence so that the agents execute the corresponding key operations to be executed.
2. The method according to claim 1, characterized in that The step of determining the correspondence between the operation and the role of the agent includes: Acquire a pre-constructed agent collaboration graph, cluster the operation nodes in the agent collaboration graph to form a first data cluster, wherein the first data cluster includes at least one operation node; For each first data cluster, clustering each of the operation nodes in the first data cluster according to the attribute information of the operation nodes to obtain an initial clustering result, performing hierarchical clustering on the initial clustering result to obtain a hierarchical clustering result, wherein the hierarchical clustering result includes a second data cluster, and the second data cluster includes at least one operation node; According to the predetermined number of agents and the hierarchical clustering results corresponding to each first data cluster, roles are assigned to the agents, and a corresponding relationship between operations and roles of the agents is generated.
3. The method according to claim 2, characterized in that The steps of constructing the agent collaboration graph include: Obtaining a task sample corresponding to at least one task type; Parsing each of the task samples based on natural language processing technology to determine key operations and relationships between operations included in the task samples, and determining attribute information of the key operations; Each of the key operations is used as an operation node, the relationship between the operations is used as an edge, and the attribute information of the key operations is used as the attribute information of the operation node to construct an intelligent agent collaboration graph.
4. The method according to claim 2, characterized in that: The step of assigning roles to the agents according to the predetermined number of agents and the hierarchical clustering results corresponding to each first data cluster, and generating a corresponding relationship between operations and roles of the agents, includes: Using a predetermined number of agents as the number of clusters, clustering the hierarchical clustering results corresponding to each of the first data clusters to obtain a third data cluster, wherein the third data cluster includes the first data cluster and / or the second data cluster; Assign a third data cluster to each agent and establish a corresponding relationship between operations and the roles of the agent.
5. The method according to any one of claims 1 to 4, characterized in that: Also includes: For each intelligent agent, determining a key operation corresponding to the intelligent agent according to a corresponding relationship between the operation and the role of the intelligent agent; Generate training samples according to the key operations corresponding to the agent; The intelligent agent is trained according to the training samples.
6. The method according to claim 1, characterized in that The step of sequentially scheduling the agents corresponding to the key operations to be executed according to the relationship between the key operations to be executed includes: According to the relationship between the key operations to be executed, the first key operation to be executed is used as the target key operation, and the agent corresponding to the first key operation to be executed is used as the agent to be scheduled; Generate a prompt text according to the target key operation, and send the prompt text to the agent to be scheduled, so that the agent to be scheduled performs the target key operation according to the prompt text; According to the relationship between the key operations to be executed, determine whether the target key operation has the next key operation to be executed. If so, determine the next key operation to be executed corresponding to the target key operation as the new target key operation, and use the agent corresponding to the next key operation to be executed as the new agent to be scheduled. Return to execute the step of generating a prompt text according to the target key operation and sending the prompt text to the agent to be scheduled.
7. A multi-agent collaboration device, characterized in that: include: A task parsing module is used to obtain tasks to be executed, parse the tasks to be executed, determine key operations to be executed and the relationship between the key operations to be executed; An agent determination module, used to query the predetermined operation and the agent role correspondence relationship, and determine the agent corresponding to the key operation to be performed, wherein the operation and the agent role correspondence relationship is determined by clustering the agent collaboration map, and the agent collaboration map is generated according to the operation and the relationship between the operations; The agent scheduling module is used to schedule the agents corresponding to the key operations to be executed in sequence according to the relationship between the key operations to be executed, so that the agents execute the corresponding key operations to be executed.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor, and a memory communicatively coupled to the at least one processor; Wherein, the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the multi-agent collaboration method described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the multi-agent collaboration method described in any one of claims 1-6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program which, when executed by a processor, implements the multi-agent collaboration method according to any one of claims 1 to 6.
Citation Information
Cited By
Role-aware based multi-agent collaborative reasoning method, device and equipment
CN122674845A
Role-aware based multi-agent collaborative reasoning method, device and equipment
CN122674845B