A knowledge graph-based multi-agent collaborative task allocation method
By constructing a knowledge graph and improving the GraphSAGE model, combined with the MAPPO algorithm, the problem of expressing multi-hop relationship paths in multi-agent task allocation was solved, achieving efficient and accurate task allocation strategy generation and improving the collaborative execution capability of multi-agent systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Filing Date
- 2026-04-13
- Publication Date
- 2026-07-14
AI Technical Summary
Existing multi-agent task allocation methods are unable to effectively characterize the structural information of multi-hop relationship paths, resulting in a lack of global consistency and structural rationality in task allocation results. They also suffer from the accumulation of redundant path information and allocation conflicts, and lack the ability to collaboratively express themselves in heterogeneous multi-relationship graphs, making it difficult to support refined decision-making in complex collaborative task allocation scenarios.
By constructing a knowledge graph to generate a multi-relationship heterogeneous graph, extracting multi-hop relationship path sequences and learning path representations, using an improved GraphSAGE model for node representation, and generating a collaborative task allocation strategy based on the MAPPO algorithm, the modeling process of task dependency, capability matching, and resource consumption relationships is described in detail.
It improves the structural consistency and global correlation of multi-agent collaborative task allocation, eliminates redundant path information, enhances the stability and execution efficiency of collaborative task allocation strategies, and improves the accuracy and execution efficiency of dynamic task allocation results.
Smart Images

Figure CN122387656A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph and multi-agent collaborative decision-making technology, and in particular to a multi-agent collaborative task allocation method based on knowledge graph. Background Technology
[0002] With the continuous expansion of complex task systems and the rapid development of multi-agent collaborative application scenarios, task allocation technology for multi-task, multi-resource, and multi-agent collaborative relationships has received widespread attention. Existing multi-agent task allocation methods mainly rely on rule-driven approaches or simple graph-based matching strategies, but these methods generally suffer from the following problems in practical applications: In multi-agent systems, task dependencies, capability matching relationships, and resource consumption relationships exhibit a complex structure involving multiple levels and interwoven paths. Existing methods typically model these relationships based only on single-hop adjacency relationships or local features, making it difficult to effectively characterize the structural information within multi-hop paths. This results in a lack of global consistency and structural rationality in task allocation. Furthermore, the collaborative process between multiple agents involves dynamic changes in task execution order, resource competition status, and capability inheritance relationships. Existing methods lack effective structural representation methods when dealing with multi-path branching and path convergence structures, easily leading to the accumulation of redundant path information and allocation conflicts, thus reducing task execution efficiency. For redundant paths and equivalent structures in multi-agent task execution trajectories, traditional reinforcement learning methods often directly optimize the original trajectory, lacking the ability to identify and compress topological equivalence relationships. This results in redundant information interference and low convergence efficiency during policy learning. Moreover, existing technologies, when constructing knowledge graphs, often focus on modeling node attributes or single relationships, lacking sufficient ability to express collaborative relationships between different relationship types in multi-relationship heterogeneous graphs, making it difficult to support the refined decision-making needs in complex collaborative task allocation scenarios.
[0003] Therefore, how to provide a knowledge graph-based multi-agent collaborative task allocation method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] One objective of this invention is to propose a multi-agent collaborative task allocation method based on knowledge graphs. This invention constructs a knowledge graph and generates a multi-relation heterogeneous graph, extracts multi-hop relation path sequences and forms path representation sequences, introduces an improved GraphSAGE model to learn node representations of the path representation sequences, and uses the MAPPO algorithm to generate collaborative task allocation strategies based on the multi-agent task execution trajectories. The invention details the modeling and strategy generation process of task dependencies, capability matching relationships, and resource occupancy relationships in the multi-agent collaborative task allocation process, and possesses the advantages of strong structural expression capabilities, high consistency in task allocation, and high accuracy in collaborative decision-making.
[0005] A knowledge graph-based multi-agent collaborative task allocation method according to an embodiment of the present invention includes the following steps: S1. Obtain task data, agent state data, and resource constraint data, and generate task node set, agent node set, and resource node set through structured parsing; S2. Construct a knowledge graph based on task node set, agent node set and resource node set, establish task dependency relationship, capability matching relationship and resource occupation relationship in the knowledge graph, and generate a multi-relationship heterogeneous graph; S3. Extract the multi-hop relationship path sequence starting from the task node in the multi-relation heterogeneous graph, encode it according to the node connection order in the multi-hop relationship path sequence to obtain the path feature sequence, and perform continuous mapping processing on the path feature sequence to generate the path representation sequence. S4. Input the path representation sequence into the improved GraphSAGE model, introduce a relationship branching and docking mechanism in the neighborhood aggregation module, identify the branching points and docking points in the path representation sequence, and perform neighborhood aggregation processing based on the branch paths corresponding to the same branching source to generate task node representations. S5. Construct a multi-agent state sequence based on the task node representation, and generate a multi-agent task execution trajectory; S6. Based on the multi-agent task execution trajectory, the MAPPO algorithm is used to perform topological equivalence compression on the multi-agent policy trajectory to generate a cooperative task allocation strategy. S7. Generate the allocation relationship between task nodes and agent nodes based on the collaborative task allocation strategy, and output the dynamic task allocation result.
[0006] Optionally, S1 specifically includes: The system acquires task identification information, task content information, task timing information, and task constraint information to form task data; it acquires agent identification information, agent capability information, agent load information, and agent position and status information to form agent status data; and it acquires resource identification information, resource type information, resource capacity information, and resource occupancy status information to form resource constraint data. The task data is split into fields and entities are extracted to obtain the task name, task type, task start time, task end time, task priority, and task constraints; the agent status data is split into fields and entities are extracted to obtain the agent name, capability category, load status, and location status; the resource constraint data is split into fields and entities are extracted to obtain the resource name, resource type, resource capacity, and occupancy status. A task node set is constructed based on the task name, task type, task start time, task end time, task priority, and task constraints. An agent node set is constructed based on the agent name, capability category, load status, and location status. A resource node set is constructed based on the resource name, resource type, resource capacity, and occupancy status.
[0007] Optionally, the construction of the knowledge graph based on the task node set, agent node set, and resource node set specifically involves: The task node table is obtained by registering the node identifier and node attributes of the task nodes in the task node set; the agent node table is obtained by registering the node identifier and node attributes of the agent nodes in the agent node set; and the resource node table is obtained by registering the node identifier and node attributes of the resource nodes in the resource node set. The task node table, agent node table, and resource node table are labeled with type according to node category to obtain task node category label, agent node category label, and resource node category label; A knowledge graph node set is constructed based on node identifiers, node attributes, and node category tags, and the nodes in the knowledge graph node set are indexed and assigned to obtain a knowledge graph node index set. The task node table, agent node table, and resource node table are organized in a unified manner according to the knowledge graph node index set to generate knowledge graph node data.
[0008] Optionally, the step of establishing task dependency relationships, capability matching relationships, and resource consumption relationships in the knowledge graph to generate a multi-relationship heterogeneous graph specifically involves: Based on the task start time, task end time and task constraints in the task node table, perform a front-to-back correlation analysis between task nodes to generate a task dependency edge set; Based on the task type and task constraint items in the task node table, and combined with the capability category, load status and position status in the agent node table, the association analysis between the task node and the agent node is performed to generate a capability matching relationship edge set. Based on the task constraints in the task node table, and combined with the resource type, resource capacity and occupancy status in the resource node table, the association analysis between task nodes and resource nodes is performed to generate a resource occupancy relationship edge set. The task dependency relationship edge set, capability matching relationship edge set, and resource consumption relationship edge set are labeled with relationship type to obtain relationship edge data; Construct a multi-relationship heterogeneous graph based on knowledge graph node data and relation edge data.
[0009] Optionally, the step of extracting the multi-hop relationship path sequence starting from the task node in the multi-relationship heterogeneous graph and encoding it according to the node connection order in the multi-hop relationship path sequence to obtain the path feature sequence is as follows: Read the task node index from the knowledge graph node data, and read the task dependency relationship edge, capability matching relationship edge, and resource consumption relationship edge associated with the task node index from the relationship edge data; Along the node connection directions corresponding to the task dependency relationship edge, capability matching relationship edge and resource consumption relationship edge, traverse the nodes associated with the task node index one hop at a time, record the node index and relationship type mark passed during the traversal, and generate a multi-hop relationship path sequence. Arrange the node indices in the multi-hop relation path sequence according to the node connection order to generate a node index sequence; arrange the relation type tags in the multi-hop relation path sequence according to the node connection order to generate a relation tag sequence. Read the node attributes corresponding to the node index sequence, and combine the node attributes and relationship tag sequence according to the node connection order to generate a path feature sequence.
[0010] Optionally, the step of performing continuous mapping processing on the path feature sequence to generate a path representation sequence specifically involves: The adjacent path features in the path feature sequence are sequentially concatenated according to the node connection order to generate a path segment sequence. Perform position association processing on adjacent path segments in the path segment sequence to generate a segment association sequence; Based on the path segment sequence and the segment association sequence, a continuous expansion process is performed on the path feature sequence to generate a continuous feature sequence; Vectorize the continuous feature sequence to generate a path representation sequence.
[0011] Optionally, the improved GraphSAGE model specifically includes an input encoding module, a neighborhood sampling module, a neighborhood aggregation module, and a representation update module; The input encoding module inputs the path representation vectors in the path representation sequence into the improved GraphSAGE model according to the node connection order of the corresponding task nodes in the multi-hop relationship path sequence, and maps the path representation vectors to the node indices corresponding to the path representation vectors to generate a node input sequence. The neighborhood sampling module reads the node index corresponding to the task node from the node input sequence, finds the preceding node index and the successor node index directly connected to the node index according to the node connection relationship in the multi-relation heterogeneous graph, reads the path representation vector corresponding to the preceding node index and the successor node index, generates a neighborhood node sequence, and then generates a neighborhood path sequence according to the arrangement result of the preceding node index, the node index corresponding to the task node and the successor node index in the multi-hop relationship path sequence. The neighborhood aggregation module introduces a relationship branching and docking mechanism during the neighborhood aggregation process. First, it counts the number of successor node indices corresponding to each node index in the neighborhood path sequence. Node indices with a successor node index greater than 1 are determined as branching points. Then, it counts the number of preceding node indices corresponding to each node index in the neighborhood path sequence. Node indices with a preceding node index greater than 1 are determined as docking points. Starting from each branching point, it extracts the node index sequence and path representation vector sequence between the branching point and the docking point along the node connection order in the neighborhood path sequence to generate a branch path sequence. Construct a mooring path group based on the branch path sequence corresponding to the same branching point and the branch path sequence corresponding to the same mooring point. Arrange the path representation vectors in the mooring path group item by item according to the node connection order. Concatenate the arranged path representation vectors in sequence to generate a branch path representation sequence. Merge the branch path representation sequences in the mooring path group according to the node connection position corresponding to the mooring point to generate a neighborhood aggregation representation. The representation update module reads the path representation vector corresponding to the task node in the node input sequence, and connects the path representation vector with the neighborhood aggregation representation in sequence to obtain the node update input sequence, and generates the task node representation based on the node update input sequence.
[0012] Optionally, S5 specifically includes: Read the representation vector corresponding to the task node from the task node representation, and read the agent name, capability category, load status and position status from the agent node table; Based on the capability matching relationship edge between task nodes and agent nodes, the representation vector corresponding to the task node and the capability category, load state and position state corresponding to the agent node are associated and arranged to generate a task agent association sequence. Read the task dependency relationship edges and resource occupation relationship edges corresponding to the task nodes from the relationship edge data, and combine the task dependency relationship edges, resource occupation relationship edges and task agent association sequences in sequence according to the node connection order in the multi-hop relationship path sequence to generate a multi-agent state sequence. According to the arrangement order in the multi-agent state sequence, read the task node index and agent node index corresponding to each state position, and record the task node index, agent node index and node connection order accordingly to generate the multi-agent task execution trajectory.
[0013] Optionally, S6 specifically includes: The task node index, agent node index, and node connection order in the multi-agent task execution trajectory are read according to the trajectory arrangement order to generate a multi-agent policy trajectory sequence. Based on the task node index connection relationship and agent node index connection relationship in the multi-agent policy trajectory sequence, the connection forms between adjacent trajectory positions are compared item by item to obtain the trajectory connection sequence. Based on the trajectory connection sequence, topological equivalence discrimination is performed on the multi-agent policy trajectory sequences, and multi-agent policy trajectory sequences with the same task node index arrangement order, the same agent node index succession order, and the same node connection order are classified into the same trajectory equivalence class. For multi-agent policy trajectory sequences in the same trajectory equivalence class, perform length statistics and duplicate position statistics, retain multi-agent policy trajectory sequences with complete node connection order, delete duplicate task node index segments and duplicate agent node index segments, and generate cooperative task allocation strategies.
[0014] Optionally, S7 specifically includes: The correspondence between task node indices and agent node indices is read from the collaborative task allocation strategy, and the correspondence is sorted according to the node connection order in the multi-agent strategy trajectory sequence to generate a task allocation sequence. Based on the correspondence between the task node index and the agent node index in the task allocation sequence, the task nodes in the task node set and the agent nodes in the agent node set are matched item by item to generate the allocation relationship between the task nodes and the agent nodes. The dynamic task allocation result is output according to the task node index order and agent node index order in the allocation relationship.
[0015] The beneficial effects of this invention are: By constructing a knowledge graph and generating a multi-relation heterogeneous graph, this paper addresses the problem of multiple relationship intertwining among task node sets, agent node sets, and resource node sets. It adopts a multi-hop relationship path sequence extraction and path feature sequence construction method to uniformly map task dependency relationship edges, capability matching relationship edges, and resource occupation relationship edges to the path representation sequence, thereby realizing a unified expression of the multi-relation structure and improving the structural consistency and global association capability of multi-agent collaborative task allocation. In the neighborhood aggregation module of the improved GraphSAGE model, a relation branching and docking mechanism is introduced to classify and align the branch path sequences between branch points and docking points in the multi-relation heterogeneous graph. The branch path representation vectors are combined according to the node connection order to form a neighborhood aggregation representation, so that the task node representation can reflect the multi-branch path structure and convergence structure, and improve the ability of node representation to express complex relation structures. The MAPPO algorithm is used to perform topological equivalence compression on multi-agent policy trajectories. By partitioning the trajectory into equivalence classes and deleting duplicate segments, redundant path information in the multi-agent policy trajectories is eliminated, improving the stability and convergence efficiency of the cooperative task allocation strategy. Furthermore, the allocation relationship between task nodes and agent nodes is generated through the task allocation sequence, thereby improving the accuracy and execution efficiency of the dynamic task allocation results. Attached Figure Description
[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a multi-agent collaborative task allocation method based on knowledge graphs proposed in this invention; Figure 2 This is a schematic diagram of the improved GraphSAGE model proposed in this invention; Figure 3 This is a data flow diagram of a knowledge graph-based multi-agent collaborative task allocation method proposed in this invention. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0018] refer to Figures 1-3 A knowledge graph-based multi-agent collaborative task allocation method includes the following steps: S1. Obtain task data, agent state data, and resource constraint data, and generate task node set, agent node set, and resource node set through structured parsing; S2. Construct a knowledge graph based on task node set, agent node set and resource node set, establish task dependency relationship, capability matching relationship and resource occupation relationship in the knowledge graph, and generate a multi-relationship heterogeneous graph; S3. Extract the multi-hop relationship path sequence starting from the task node in the multi-relation heterogeneous graph, encode it according to the node connection order in the multi-hop relationship path sequence to obtain the path feature sequence, and perform continuous mapping processing on the path feature sequence to generate the path representation sequence. S4. Input the path representation sequence into the improved GraphSAGE model, introduce a relationship branching and docking mechanism in the neighborhood aggregation module, identify the branching points and docking points in the path representation sequence, and perform neighborhood aggregation processing based on the branch paths corresponding to the same branching source to generate task node representations. S5. Construct a multi-agent state sequence based on task node representation and generate multi-agent task execution trajectory; S6. Based on the multi-agent task execution trajectory, the MAPPO algorithm is used to perform topological equivalence compression on the multi-agent policy trajectory to generate a cooperative task allocation strategy. S7. Generate the allocation relationship between task nodes and agent nodes based on the collaborative task allocation strategy, and output the dynamic task allocation result.
[0019] In this embodiment, S1 specifically refers to: The system acquires task identification information, task content information, task timing information, and task constraint information to form task data; it acquires agent identification information, agent capability information, agent load information, and agent position and status information to form agent status data; and it acquires resource identification information, resource type information, resource capacity information, and resource occupancy status information to form resource constraint data. The task data is split into fields and entities are extracted to obtain the task name, task type, task start time, task end time, task priority, and task constraints; the agent state data is split into fields and entities are extracted to obtain the agent name, capability category, load status, and location status; the resource constraint data is split into fields and entities are extracted to obtain the resource name, resource type, resource capacity, and occupancy status. A task node set is constructed based on task name, task type, task start time, task end time, task priority, and task constraints. An agent node set is constructed based on agent name, capability category, load status, and location status. A resource node set is constructed based on resource name, resource type, resource capacity, and occupancy status.
[0020] In this implementation, a knowledge graph is constructed based on the task node set, agent node set, and resource node set, specifically as follows: The task node table is obtained by registering the node identifier and node attributes of the task nodes in the task node set; the agent node table is obtained by registering the node identifier and node attributes of the agent nodes in the agent node set; and the resource node table is obtained by registering the node identifier and node attributes of the resource nodes in the resource node set. The task node table, agent node table, and resource node table are labeled according to node category to obtain task node category label, agent node category label, and resource node category label. A knowledge graph node set is constructed based on node identifiers, node attributes, and node category tags, and the nodes in the knowledge graph node set are indexed and assigned to obtain a knowledge graph node index set. The task node table, agent node table, and resource node table are organized in a unified manner according to the knowledge graph node index set to generate knowledge graph node data.
[0021] In this implementation, task dependency relationships, capability matching relationships, and resource consumption relationships are established in the knowledge graph to generate a multi-relationship heterogeneous graph, specifically: Based on the task start time, task end time and task constraints in the task node table, perform a front-to-back correlation analysis between task nodes to generate a task dependency edge set; Based on the task type and task constraint items in the task node table, and combined with the capability category, load status and position status in the agent node table, the association analysis between the task node and the agent node is performed to generate a capability matching relationship edge set. Based on the task constraints in the task node table, and combined with the resource type, resource capacity and occupancy status in the resource node table, the association analysis between task nodes and resource nodes is performed to generate a resource occupancy relationship edge set. The task dependency relationship edge set, capability matching relationship edge set, and resource consumption relationship edge set are labeled with relationship type to obtain relationship edge data; Construct a multi-relationship heterogeneous graph based on knowledge graph node data and relation edge data.
[0022] In this embodiment, the multi-hop relationship path sequence starting from the task node is extracted from the multi-relation heterogeneous graph, and encoded according to the node connection order in the multi-hop relationship path sequence to obtain the path feature sequence, specifically: Read the task node index from the knowledge graph node data, and filter the task dependency relationship edge, capability matching relationship edge, and resource consumption relationship edge from the relationship edge data whose start node index or end node index is consistent with the task node index. Determine the node connection direction according to the start node index and end node index in the relation edge data. Starting from the task node index, search for the next hop relation edge that connects to the end node index of the previous hop along the node connection direction. Record the start node index, end node index and relation type mark in each hop in sequence to generate a multi-hop relation path sequence. Extract the starting node index, intermediate node index, and ending node index from the multi-hop relationship path sequence in sequence, and arrange them according to the order of appearance in the path to generate a node index sequence; Extract relation type tags sequentially from the multi-hop relation path sequence, arrange them according to their order of appearance in the path, and generate a relation tag sequence; Read the node attributes corresponding to each node index in the node index sequence from the knowledge graph node data, and form an attribute sequence according to the arrangement order in the node index sequence; The node index sequence, relation tag sequence, and attribute sequence are matched according to the node connection order. The node index, relation type tag, and node attribute at the same position are written to the same feature position to generate a path feature sequence.
[0023] In this embodiment, the path feature sequence is continuously mapped to generate a path representation sequence, specifically as follows: Read the first and second path features in the path feature sequence according to the node connection order. Write the node index, relation type marker and node attribute in the first path feature to the front position in sequence. Write the node index, relation type marker and node attribute in the second path feature to the back position in sequence to generate the first path segment. Continue reading two adjacent path features in the path feature sequence in the same way, and write the path feature at the previous position and the path feature at the next position into the same sequence in turn to generate all path segments and obtain the path segment sequence. Read two adjacent path segments in the path segment sequence in sequence, compare the positional correspondence between the last node index of the previous path segment and the first node index of the next path segment, mark the path segments with the same last node index and first node index as related path segments, and write the position of the previous path segment and the position of the next path segment in the path segment sequence into the segment association sequence. According to the order of the preceding and following positions in the fragment association sequence, the preceding and following associated path fragments are arranged continuously. The node index that coincides with the last position of the preceding path fragment and the first position of the following path fragment is retained once. The path features outside the overlapping positions are written sequentially to generate a continuous feature sequence. According to the arrangement order in the continuous feature sequence, the node index, relation type label and node attribute of each position are read in sequence, and the values corresponding to the node index, relation type label and node attribute are arranged in fixed positions to generate a feature value sequence. The values at the same position in the feature numerical sequence are sequentially combined to generate the corresponding representation vector. All representation vectors are then arranged in the order of arrangement in the continuous feature sequence to generate the path representation sequence.
[0024] In this embodiment, the improved GraphSAGE model specifically includes an input encoding module, a neighborhood sampling module, a neighborhood aggregation module, and a representation update module; The input encoding module reads the path representation vector in the path representation sequence according to the node connection order in the multi-hop relationship path sequence. At the same time, it reads the node index corresponding to each path representation vector, writes the node index to the index position, writes the path representation vector to the representation position, and arranges them in the order of node connection to generate the node input sequence. The neighborhood sampling module reads the node index corresponding to the task node from the node input sequence, finds the predecessor node index and successor node index directly connected to the node index corresponding to the task node according to the relation edge connection results in the multi-relation heterogeneous graph, and then reads the path representation vector corresponding to the predecessor node index and successor node index from the node input sequence. The predecessor node index, the node index corresponding to the task node, the successor node index and the corresponding path representation vector are arranged according to the node connection order to generate the neighborhood node sequence. Based on the node arrangement in the multi-hop path sequence, the connection segments between the previous node index, the node index corresponding to the task node, and the successor node index are extracted from the neighboring node sequence. The node index and path representation vector in the same connection segment are written in sequence to generate the neighboring path sequence. Count the number of successor node indices corresponding to each node index in the neighborhood path sequence, and determine the node index with a successor node index greater than 1 as the branching point. Count the number of preceding node indices corresponding to each node index in the neighborhood path sequence, and determine the node index with a preceding node index greater than 1 as the homing point. Starting from each branch point, read the node index and path representation vector item by item along the node connection order in the neighborhood path sequence until the destination point is read. Write the node index and path representation vector that are passed between the branch point and the destination point in the same sequence in order to generate the branch path sequence. The branch path sequences corresponding to the same branching point and the branch path sequences corresponding to the same mooring point are classified and written into the same mooring path group. For each branch path sequence in the homing path group, read the path representation vector item by item according to the node connection order, write the first path representation vector into the first position, write the second path representation vector into the next position, and continue writing in the same order until the end of the branch path to generate the branch path representation sequence. Read the branch path representation sequence in the homing path group according to the node connection position of the homing point in the neighborhood path sequence, write the path representation vector with the same node connection position into the same position, arrange the path representation vector in the same position in sequence, and generate the neighborhood aggregation representation. The relationship branching and mooring mechanism is the process of determining branching points, mooring points, branch path sequences, and mooring path groups during neighborhood aggregation. A branching point is a node index with a successor node index greater than 1, a mooring point is a node index with a predecessor node index greater than 1, and a mooring path group is a set of branch path sequences with the same starting position and the same ending position. The representation update module reads the path representation vector corresponding to the task node from the node input sequence, writes the path representation vector corresponding to the task node into the first position, writes the neighborhood aggregation representation into the last position, arranges them in order to generate the node update input sequence, and then reads the values item by item in the node update input sequence to generate the task node representation.
[0025] In this embodiment, both the improved GraphSAGE model and the standard GraphSAGE model learn node representations based on graph structure data, extract neighborhood information according to node connection relationships, obtain neighboring node sets through neighborhood sampling and generate node representations by combining node features, and fuse neighborhood information with node input information during node representation updates to obtain new node representations. Furthermore, the improved GraphSAGE model replaces traditional neighborhood node feature inputs with path representation sequences, combining the node connection order, relationship type label, and node attributes in multi-hop relationship paths to form the input representation, thus including path structure information such as task dependencies, capability matching relationships, and resource occupancy relationships in the node representation. During neighborhood sampling, the improved GraphSAGE model no longer obtains neighborhood nodes solely based on first-order adjacency relationships, but instead extracts neighborhood path sequences by combining the node arrangement results in multi-hop relationship path sequences, allowing neighborhood information to unfold along the path connection direction and enhancing the ability to express long-distance relationships between nodes. During neighborhood aggregation, the improved GraphSAGE model introduces a relationship branching and mooring mechanism, determining branching points and mooring points by statistically analyzing the number of predecessor and successor nodes corresponding to a node. The model extracts branch path sequences based on the node connection order between branching points and homing points. Branch path sequences with the same start and end positions are grouped into the same homing path group. The path representation vectors in the homing path group are arranged and aligned according to the node connection order. Path representation vectors at the same node connection position are combined to form a neighborhood aggregation representation, enabling the node representation to reflect the structural consistency of multi-branch paths at the convergence position. During the representation update process, the improved GraphSAGE model connects the path representation vectors in the node input sequence with the neighborhood aggregation representation according to the node connection order. This ensures that the updated node representation contains both continuous path evolution information and branch merging information, thereby improving the node representation's ability to characterize multi-relationship structures. Through these improvements, the node representation can simultaneously reflect the sequential structure, branch expansion structure, and convergence structure in multi-hop relationship paths. This enhances the accuracy of expressing task dependency links, capability inheritance relationships, and resource occupation paths during multi-agent task allocation, improves the structural consistency of multi-agent state sequence construction, reduces the interference of path redundancy information on node representation, and improves the stability of subsequent multi-agent task execution trajectories and the accuracy of collaborative task allocation strategies.
[0026] In this embodiment, S5 specifically refers to: Read the representation vector corresponding to the task node index item by item from the task node representation, and read the agent name, capability category, load status and position status corresponding to the agent node index item by item from the agent node table; Read the capability matching relationship edges between task nodes and agent nodes from the relationship edge data. Determine the correspondence between task node index and agent node index according to the start node index and end node index in the capability matching relationship edge. Write the representation vector corresponding to the task node into the front position. Write the agent name, capability category, load status and position status into the back position in a fixed order to generate the task agent association sequence. Read the task dependency relationship edge and resource occupation relationship edge corresponding to the task node from the relationship edge data. According to the node connection order in the multi-hop relationship path sequence, write the relationship type mark in the task dependency relationship edge, the relationship type mark in the resource occupation relationship edge and the corresponding content in the task agent association sequence into the same permutation sequence to generate a multi-agent state sequence. Read the task node index, agent node index and node connection order corresponding to each state position sequentially from the multi-agent state sequence, write the task node index into the task position, write the agent node index into the agent position, and write the node connection order into the order position. Continuously record according to the order of the state positions to generate the multi-agent task execution trajectory. The multi-agent state sequence is a sequence of state contents arranged in the order of node connection. Each state position includes the task node index, agent node index, relation type label corresponding to the task dependency relation edge, relation type label corresponding to the resource occupation relation edge, representation vector corresponding to the task node, agent name, capability category, load status and position status. The multi-agent task execution trajectory is a sequence of trajectory records formed according to the arrangement order in the multi-agent state sequence. Each trajectory position contains the task node index, agent node index, and node connection order.
[0027] In this embodiment, S6 specifically refers to: Read the task node index, agent node index and node connection order sequentially from the multi-agent task execution trajectory, write the trajectory position sequence according to the front and back positions in the trajectory, and arrange the task node index, agent node index and node connection order in each trajectory position accordingly to generate a multi-agent policy trajectory sequence. Read two adjacent trajectory positions sequentially from the multi-agent policy trajectory sequence. Compare whether the task node index in the previous trajectory position and the task node index in the next trajectory position maintain the connection order of the task dependency relationship edge. Compare whether the agent node index in the previous trajectory position and the agent node index in the next trajectory position maintain the connection order of the capability matching relationship edge. Compare whether the node connection order in the previous trajectory position and the node connection order in the next trajectory position are continuous. Write the comparison results to the corresponding positions to generate the trajectory connection sequence. Read the connection results corresponding to each trajectory position sequentially from the trajectory connection sequence, write the multi-agent policy trajectory sequences with consistent task node index arrangement order, consistent agent node index succession order, and consistent node connection order into the same set, and generate trajectory equivalence class; The trajectory equivalence class is the classification result containing multiple multi-agent policy trajectory sequences. Each multi-agent policy trajectory sequence in the trajectory equivalence class satisfies the following conditions: the order of task node index arrangement, the order of agent node index succession, and the order of node connection. The number of trajectory positions for each multi-agent policy trajectory sequence is read sequentially from the same trajectory equivalence class to obtain the trajectory length statistics. Then, the task node index and agent node index of different multi-agent policy trajectory sequences in the same trajectory equivalence class are compared sequentially to obtain the duplicate position statistics. The multi-agent policy trajectory sequence with complete node connection order is selected from the trajectory length statistics results. The task node index segment and the agent node index segment that appear repeatedly are deleted from the repeated position statistics results. The task node index, agent node index and node connection order after deleting the repeated segments are rearranged according to the original trajectory position order to generate the compressed multi-agent policy trajectory sequence. The correspondence between task node indices and agent node indices in the compressed multi-agent policy trajectory sequence is written into the policy content sequence according to the trajectory position order, and the node connection order is written into the corresponding positions to generate a collaborative task allocation policy.
[0028] In this embodiment, both the MAPPO algorithm and existing MAPPO algorithms perform policy learning based on multi-agent task execution trajectories, construct policy trajectories according to the state change process of multi-agents, and generate task allocation results based on the policy trajectories. The difference lies in that existing MAPPO algorithms primarily rely on state information and policy update processes during multi-agent interactions to optimize policies. Repeated paths with the same topology in the trajectory participate in policy generation simultaneously, easily leading to the continuous retention of repeated task node segments and repeated agent connection segments in the policy trajectory, thereby increasing trajectory redundancy and weakening the structural expressiveness of task succession relationships. In contrast, the MAPPO algorithm, during policy optimization, first extracts task node indices, agent node indices, and node connection sequences from the multi-agent task execution trajectory to generate a multi-agent policy trajectory sequence. Then, it constructs a trajectory connection sequence based on the task node index connection relationship, agent node index sequence, and node connection sequence, assigning tasks accordingly. Multi-agent policy trajectory sequences with consistent task node index order, agent node index succession order, and node connection order are grouped into the same trajectory equivalence class. Within the same trajectory equivalence class, trajectory length and repetition positions are further statistically analyzed. Multi-agent policy trajectory sequences with complete node connection order are retained, while continuously recurring task node index fragments and agent node index fragments are deleted, resulting in a compressed multi-agent policy trajectory sequence. A collaborative task allocation strategy is then generated based on the compressed multi-agent policy trajectory sequence. Therefore, the MAPPO algorithm no longer directly generates strategies from the original policy trajectories. Instead, it first classifies and compresses trajectory content with the same topological structure before forming a collaborative task allocation strategy. This makes the task succession relationship and agent succession relationship in the policy trajectory clearer, reduces the interference of repetitive trajectory fragments on the strategy generation process, and improves the ability of the collaborative task allocation strategy to maintain task dependencies, capability matching relationships, and resource consumption relationships.
[0029] In this embodiment, S7 specifically refers to: Read the corresponding content between the task node index and the agent node index in the collaborative task allocation strategy in sequence, and read the trajectory position of the corresponding content in the multi-agent policy trajectory sequence. The trajectory positions are arranged according to the node connection order in the multi-agent policy trajectory sequence. The task node index and agent node index of the trajectory position at the beginning are written into the beginning position, and the task node index and agent node index of the trajectory position at the end are written into the end position in sequence to generate a task allocation sequence. Read the task node index and the agent node index from the task node set and the agent node set respectively, match the task node index in the task allocation sequence with the task node index in the task node set, and match the agent node index in the task allocation sequence with the agent node index in the agent node set. According to the order of the task allocation sequence, write the task node index and agent node index at the same position into the same allocation position to generate the allocation relationship between task nodes and agent nodes. Read the corresponding task nodes and agent nodes from the task node set and agent node set respectively in the allocation relationship, and write them into the result sequence in the order of arrangement in the allocation relationship; output the dynamic task allocation result in the order of task node index and agent node index in the result sequence.
[0030] Example 1: To verify the feasibility of this invention in practice, it was applied to a multi-robot collaborative picking and delivery scenario in a smart warehousing and logistics park. The park's warehousing area is 18,000 square meters, and the work area is divided into an inbound area, a storage area, a sorting area, and an outbound area. A total of 24 intelligent agents, including 12 handling robots, 8 sorting robots, and 4 inspection robots, are deployed on-site. Resource information such as shelves, conveyor lines, charging piles, and temporary buffer spaces are also integrated. In actual operation, order tasks, replenishment tasks, warehouse transfer tasks, and inspection tasks occur in parallel. There are clear dependencies between different tasks, robot capabilities vary, and resource occupancy status changes in real time. Traditional rule-based allocation methods are prone to problems such as task congestion, duplicate task grabbing by similar robots, local path conflicts, and delayed response of high-priority tasks.
[0031] In application, the system first collects task identification information, task content information, task timing information, and task constraint information from the warehouse management system. Simultaneously, it collects agent identification information, agent capability information, agent load information, and agent position status information from the robot control platform. It also collects resource identification information, resource type information, resource capacity information, and resource occupancy status information from shelves, conveyor lines, charging piles, and buffer positions. Subsequently, the task data, agent status data, and resource constraint data are structured and parsed to form task node sets, agent node sets, and resource node sets. Taking a specific time period as an example, the system receives 96 tasks within a 10-minute window, including 52 order picking tasks, 18 replenishment tasks, 14 warehouse transfer tasks, and 12 inspection tasks; and 39 resource nodes, including 6 charging piles, 8 conveyor line segments, 15 buffer positions, and 10 sets of key shelves. Then, based on the task node sets, agent node sets, and resource node sets, a knowledge graph is constructed, and task dependencies, capability matching relationships, and resource occupancy relationships are established, generating a multi-relationship heterogeneous graph. In the diagram, each task node is connected to the executable agent node through capability matching edges, each task node is connected to the resource node through resource occupancy edges, and task nodes with preceding procedures are connected through task dependency edges.
[0032] During task allocation, multi-hop relationship path sequences originating from task nodes are extracted from a heterogeneous multi-relation graph. Node indices, relationship type labels, and node attributes are combined to form a path feature sequence, which is then processed through continuous mapping to generate a path representation sequence. After inputting the path representation sequence into the improved GraphSAGE model, the relationship branching and merging mechanism in the neighborhood aggregation module can identify the branching expansion and merging positions of the same task chain during multi-robot assignment, generating a more stable task node representation. Subsequently, a multi-agent state sequence is constructed based on the task node representation, capability matching edges, task dependency edges, and resource occupancy edges, generating multi-agent task execution trajectories. Then, based on the multi-agent task execution trajectories, the MAPPO algorithm is used to perform topological equivalence compression on the multi-agent policy trajectories, removing duplicate trajectory fragments and generating a collaborative task allocation strategy. The system ultimately outputs the allocation relationship between task nodes and agent nodes and dynamically updates the task allocation results. After 14 days of continuous operation, the dispatch center records showed that the average response time for high-priority orders decreased from 18.6 seconds to 11.2 seconds, the task completion rate increased from 91.8% to 97.4%, the robot empty-run rate decreased from 19.7% to 11.5%, and the number of resource conflicts decreased from an average of 43 times per day to an average of 17 times per day.
[0033] Table 1. Performance Comparison of Warehouse Collaborative Task Allocation
[0034] Table 1 reflects the significant advantages of the proposed method in overall scheduling performance. While traditional rule-based allocation is simple to implement, its response speed and stability are poor in scenarios with intertwined task dependencies and resource occupancy relationships. Graph matching allocation improves performance in static scenarios, but its adaptability to continuously arriving tasks and dynamic resource occupancy changes remains insufficient. The proposed method uses a knowledge graph to uniformly express the multi-relationship structure between task nodes, agent nodes, and resource nodes, and combines this with an improved GraphSAGE model to obtain a more accurate representation of task nodes, increasing the task completion rate to 97.4%, a 5.6 percentage point improvement over traditional rule-based allocation. The average response time for high-priority tasks is reduced to 11.2 seconds, indicating more timely capture of urgent tasks. The number of resource conflicts and reassignments decreases simultaneously, demonstrating that the collaborative task allocation strategy not only improves efficiency but also reduces scheduling oscillations. The agent load balancing deviation decreases to 9.8%, indicating a more even distribution of tasks among robots, which helps extend the continuous operating time of equipment and reduce the risk of local overload.
[0035] Table 2 Comparison of Multi-Relation Path Modeling and Strategy Compression Effects
[0036] Table 2 further illustrates that the key improvements of this invention are concentrated in two aspects: path structure representation and policy trajectory compression. Without the relation branching and merging mechanism, the model fails to adequately identify branch expansion and merging positions in the task chain, resulting in a branch path identification accuracy of only 84.5% and a task dependency retention rate below 90%. Without topological equivalence compression, although multi-agent policy trajectories can be obtained, the proportion of repeated trajectory segments reaches 22.7%, the trajectory length is too long, and policy updates are easily interfered with by redundant information. After introducing both the relation branching and merging mechanism and topological equivalence compression, the average length of the path representation sequence is shortened to 18.9, the average length of the multi-agent policy trajectory is shortened to 14.1, the proportion of repeated trajectory segments drops to 8.4%, and the number of dynamic task allocation result corrections and resource occupation conflict rollbacks are significantly reduced. This demonstrates that this invention can not only more accurately represent complex multi-relationship structures but also effectively compress redundant trajectories at the policy level, thereby improving the stability and practical executability of collaborative task allocation strategies.
[0037] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A multi-agent collaborative task allocation method based on knowledge graphs, characterized in that, Includes the following steps: S1. Obtain task data, agent state data, and resource constraint data, and generate task node set, agent node set, and resource node set through structured parsing; S2. Construct a knowledge graph based on task node set, agent node set and resource node set, establish task dependency relationship, capability matching relationship and resource occupation relationship in the knowledge graph, and generate a multi-relationship heterogeneous graph; S3. Extract the multi-hop relationship path sequence starting from the task node in the multi-relation heterogeneous graph, encode it according to the node connection order in the multi-hop relationship path sequence to obtain the path feature sequence, and perform continuous mapping processing on the path feature sequence to generate the path representation sequence. S4. Input the path representation sequence into the improved GraphSAGE model, introduce a relationship branching and docking mechanism in the neighborhood aggregation module, identify the branching points and docking points in the path representation sequence, and perform neighborhood aggregation processing based on the branch paths corresponding to the same branching source to generate task node representations. S5. Construct a multi-agent state sequence based on the task node representation, and generate a multi-agent task execution trajectory; S6. Based on the multi-agent task execution trajectory, the MAPPO algorithm is used to perform topological equivalence compression on the multi-agent policy trajectory to generate a cooperative task allocation strategy. S7. Generate the allocation relationship between task nodes and agent nodes based on the collaborative task allocation strategy, and output the dynamic task allocation result.
2. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, Specifically, S1 is: The system acquires task identification information, task content information, task timing information, and task constraint information to form task data; it acquires agent identification information, agent capability information, agent load information, and agent position and status information to form agent status data; and it acquires resource identification information, resource type information, resource capacity information, and resource occupancy status information to form resource constraint data. The task data is split into fields and entities are extracted to obtain the task name, task type, task start time, task end time, task priority, and task constraints; the agent status data is split into fields and entities are extracted to obtain the agent name, capability category, load status, and location status; the resource constraint data is split into fields and entities are extracted to obtain the resource name, resource type, resource capacity, and occupancy status. A task node set is constructed based on the task name, task type, task start time, task end time, task priority, and task constraints. An agent node set is constructed based on the agent name, capability category, load status, and location status. A resource node set is constructed based on the resource name, resource type, resource capacity, and occupancy status.
3. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, The construction of the knowledge graph based on the task node set, agent node set, and resource node set is specifically as follows: Register the node identifiers and node attributes of the task nodes in the task node set to obtain the task node table; register the node identifiers and node attributes of the agent nodes in the agent node set to obtain the agent node table. Register the node identifiers and node attributes of the resource nodes in the resource node set to obtain the resource node table; The task node table, agent node table, and resource node table are labeled with type according to node category to obtain task node category label, agent node category label, and resource node category label; A knowledge graph node set is constructed based on node identifiers, node attributes, and node category tags, and the nodes in the knowledge graph node set are indexed and assigned to obtain a knowledge graph node index set. The task node table, agent node table, and resource node table are organized in a unified manner according to the knowledge graph node index set to generate knowledge graph node data.
4. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, The process of establishing task dependency relationships, capability matching relationships, and resource consumption relationships in the knowledge graph to generate a multi-relationship heterogeneous graph specifically involves: Based on the task start time, task end time and task constraints in the task node table, perform a front-to-back correlation analysis between task nodes to generate a task dependency edge set; Based on the task type and task constraint items in the task node table, and combined with the capability category, load status and position status in the agent node table, the association analysis between the task node and the agent node is performed to generate a capability matching relationship edge set. Based on the task constraints in the task node table, and combined with the resource type, resource capacity and occupancy status in the resource node table, the association analysis between task nodes and resource nodes is performed to generate a resource occupancy relationship edge set. The task dependency relationship edge set, capability matching relationship edge set, and resource consumption relationship edge set are labeled with relationship type to obtain relationship edge data; Construct a multi-relationship heterogeneous graph based on knowledge graph node data and relation edge data.
5. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, The extraction of multi-hop relationship path sequences originating from task nodes in the multi-relation heterogeneous graph, followed by encoding according to the node connection order in the multi-hop relationship path sequences, yields a path feature sequence, specifically: Read the task node index from the knowledge graph node data, and read the task dependency relationship edge, capability matching relationship edge, and resource consumption relationship edge associated with the task node index from the relationship edge data; Along the node connection directions corresponding to the task dependency relationship edge, capability matching relationship edge and resource consumption relationship edge, traverse the nodes associated with the task node index one hop at a time, record the node index and relationship type mark passed during the traversal, and generate a multi-hop relationship path sequence. Arrange the node indices in the multi-hop relation path sequence according to the node connection order to generate a node index sequence; arrange the relation type tags in the multi-hop relation path sequence according to the node connection order to generate a relation tag sequence. Read the node attributes corresponding to the node index sequence, and combine the node attributes and relationship tag sequence according to the node connection order to generate a path feature sequence.
6. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, The step of performing continuous mapping processing on the path feature sequence to generate a path representation sequence specifically involves: The adjacent path features in the path feature sequence are sequentially concatenated according to the node connection order to generate a path segment sequence. Perform position association processing on adjacent path segments in the path segment sequence to generate a segment association sequence; Based on the path segment sequence and the segment association sequence, a continuous expansion process is performed on the path feature sequence to generate a continuous feature sequence; Vectorize the continuous feature sequence to generate a path representation sequence.
7. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, The improved GraphSAGE model specifically includes an input encoding module, a neighborhood sampling module, a neighborhood aggregation module, and a representation update module; The input encoding module inputs the path representation vectors in the path representation sequence into the improved GraphSAGE model according to the node connection order of the corresponding task nodes in the multi-hop relationship path sequence, and maps the path representation vectors to the node indices corresponding to the path representation vectors to generate a node input sequence. The neighborhood sampling module reads the node index corresponding to the task node from the node input sequence, finds the preceding node index and the successor node index directly connected to the node index according to the node connection relationship in the multi-relation heterogeneous graph, reads the path representation vector corresponding to the preceding node index and the successor node index, generates a neighborhood node sequence, and then generates a neighborhood path sequence according to the arrangement result of the preceding node index, the node index corresponding to the task node and the successor node index in the multi-hop relationship path sequence. The neighborhood aggregation module introduces a relationship branching and docking mechanism during the neighborhood aggregation process. First, it counts the number of successor node indices corresponding to each node index in the neighborhood path sequence. Node indices with a successor node index greater than 1 are determined as branching points. Then, it counts the number of preceding node indices corresponding to each node index in the neighborhood path sequence. Node indices with a preceding node index greater than 1 are determined as docking points. Starting from each branching point, it extracts the node index sequence and path representation vector sequence between the branching point and the docking point along the node connection order in the neighborhood path sequence to generate a branch path sequence. Construct a mooring path group based on the branch path sequence corresponding to the same branching point and the branch path sequence corresponding to the same mooring point. Arrange the path representation vectors in the mooring path group item by item according to the node connection order. Concatenate the arranged path representation vectors in sequence to generate a branch path representation sequence. Merge the branch path representation sequences in the mooring path group according to the node connection position corresponding to the mooring point to generate a neighborhood aggregation representation. The representation update module reads the path representation vector corresponding to the task node in the node input sequence, and connects the path representation vector with the neighborhood aggregation representation in sequence to obtain the node update input sequence, and generates the task node representation based on the node update input sequence.
8. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, Specifically, S5 is: Read the representation vector corresponding to the task node from the task node representation, and read the agent name, capability category, load status and position status from the agent node table; Based on the capability matching relationship edge between task nodes and agent nodes, the representation vector corresponding to the task node and the capability category, load state and position state corresponding to the agent node are associated and arranged to generate a task agent association sequence. Read the task dependency relationship edges and resource occupation relationship edges corresponding to the task nodes from the relationship edge data, and combine the task dependency relationship edges, resource occupation relationship edges and task agent association sequences in sequence according to the node connection order in the multi-hop relationship path sequence to generate a multi-agent state sequence. According to the arrangement order in the multi-agent state sequence, read the task node index and agent node index corresponding to each state position, and record the task node index, agent node index and node connection order accordingly to generate the multi-agent task execution trajectory.
9. The multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, Specifically, S6 is: The task node index, agent node index, and node connection order in the multi-agent task execution trajectory are read according to the trajectory arrangement order to generate a multi-agent policy trajectory sequence. Based on the task node index connection relationship and agent node index connection relationship in the multi-agent policy trajectory sequence, the connection form between adjacent trajectory positions is compared item by item to obtain the trajectory connection sequence. Based on the trajectory connection sequence, topological equivalence discrimination is performed on the multi-agent policy trajectory sequences, and multi-agent policy trajectory sequences with the same task node index arrangement order, the same agent node index succession order, and the same node connection order are classified into the same trajectory equivalence class. For multi-agent policy trajectory sequences in the same trajectory equivalence class, perform length statistics and duplicate position statistics, retain multi-agent policy trajectory sequences with complete node connection order, delete duplicate task node index segments and duplicate agent node index segments, and generate cooperative task allocation strategies.
10. A multi-agent collaborative task allocation method based on knowledge graphs according to claim 1, characterized in that, Specifically, S7 is: The correspondence between task node indices and agent node indices is read from the collaborative task allocation strategy, and the correspondence is sorted according to the node connection order in the multi-agent strategy trajectory sequence to generate a task allocation sequence. Based on the correspondence between the task node index and the agent node index in the task allocation sequence, the task nodes in the task node set and the agent nodes in the agent node set are matched item by item to generate the allocation relationship between the task nodes and the agent nodes. The dynamic task allocation result is output according to the task node index order and agent node index order in the allocation relationship.