Layered multi-agent task allocation method, medium and equipment
By analyzing task state features to generate execution structures, accurately matching subtasks with intelligent agents, and monitoring and dynamically adjusting the task graph in real time, the problems of task execution discrepancies and handling of emergencies in existing technologies are solved, thereby improving the quality and efficiency of task execution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING YUCHEN SHIMEI SCI & TECH
- Filing Date
- 2026-04-15
- Publication Date
- 2026-05-12
AI Technical Summary
Existing serial allocation methods fail to effectively uncover the inherent logical dependencies between subtasks, resulting in a discrepancy between the subtask execution sequence and the actual business logic. This makes it impossible to replace and adapt the intelligent agent in a timely manner, leading to a decline in task execution quality and efficiency. Furthermore, the lack of a dynamic replanning mechanism makes it difficult to cope with unexpected situations.
By analyzing task state characteristics, an execution structure containing serial, parallel, or hybrid modes is generated, subtasks and agents are accurately matched, execution status is monitored in real time and replanning operations are triggered, and the task graph is dynamically adjusted.
It improves the accuracy and efficiency of task allocation, ensures the stability and continuity of complex task execution, and avoids overall task failure due to local problems.
Smart Images

Figure CN122022418A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of task allocation technology, and in particular to a hierarchical multi-agent task allocation method, medium, and device. Background Technology
[0002] With the rapid development of artificial intelligence and multi-agent system technologies, the intelligent allocation and execution of complex tasks has become a key research focus in the field. In scenarios such as industrial process control, intelligent question answering, and cross-domain information integration, complex tasks often have multi-step and highly dependent characteristics, requiring them to be decomposed into several sub-tasks and executed in a specific order.
[0003] Existing serial task allocation methods typically employ static rule-driven approaches, manually pre-setting fixed process templates to decompose complex tasks and define their execution order. This lack of deep, structured task analysis prevents the uncovering of inherent logical dependencies between subtasks, resulting in a lack of unified, structured representation of subtask execution order. This can easily lead to discrepancies between the subtask execution sequence and the actual business logic. Furthermore, existing methods fail to establish a quantitative matching system between task requirements and agent capabilities, and do not optimize matching strategies based on agent execution state data. When agent capabilities change due to resource consumption or performance fluctuations, the methods are forced to continue following a fixed process, unable to promptly replace with suitable agents, leading to a significant decline in overall task execution quality and efficiency. Additionally, the absence of dynamic replanning mechanisms makes it difficult to quickly adjust subtask sequences and agent configurations in the face of unforeseen circumstances such as agent execution anomalies or resource conflicts. This often results in task interruption or acceptance of low-quality results, failing to meet the high-precision and high-efficiency requirements of complex scenarios.
[0004] Therefore, how to construct a hierarchical multi-agent serial task allocation method that can perceive the execution state of agents and support dynamic replanning has become an urgent problem to be solved. Summary of the Invention
[0005] To address the aforementioned technical problems, the present invention provides a hierarchical multi-agent task allocation method, which includes the following steps: S1, analyze the task state characteristics corresponding to the target task to obtain several sub-tasks, the logical dependencies between sub-tasks and the execution structure, wherein the execution structure is a serial mode, a parallel mode or a hybrid mode.
[0006] S2, if the execution structure is in a serial mode, then sort all the subtasks according to the logical dependencies to generate a first task graph containing the serial execution order, where the serial execution order indicates the order in which the subtasks are processed.
[0007] S3. Based on the task requirement characteristics of each subtask in the first task diagram and the capability characteristics of each initial agent, the target agent corresponding to each subtask is selected, and a chain of agent execution is constructed.
[0008] S4 controls the sequential execution chain of intelligent agents to execute each subtask of the first task graph in the sequential execution order, and obtains the execution status data and task execution results corresponding to each target intelligent agent.
[0009] S5 determines whether to trigger a replanning operation based on the execution state data of all target agents.
[0010] S6. If the replanning operation is not triggered, the target execution result is obtained based on the task execution results corresponding to all target agents. Otherwise, the first task graph is updated based on the execution status data up to the trigger time, the completed task execution results, and the remaining unexecuted sub-tasks, and the execution step S3 is returned with the updated first task graph.
[0011] The present invention also provides a non-transitory computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the above-described hierarchical multi-agent task allocation method.
[0012] The present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0013] This invention has at least the following beneficial effects: By decomposing subtasks, analyzing dependencies, and determining execution structures based on task state characteristics, a sequential execution order that conforms to task characteristics is determined, generating a first task graph containing the sequential execution order. This solves the problem that static rule-driven methods cannot adapt to dynamic task changes and improves the accuracy of task allocation. By accurately matching subtask requirement characteristics with agent capability characteristics, the optimal target agent is assigned to each subtask, and an efficient sequential agent execution chain is constructed, improving the basic efficiency and quality of subtask execution. By collecting agent execution state data and triggering replanning operations, subtask execution anomalies are detected in real time, and the task graph and agent configuration are adjusted in a timely manner, ensuring the stability and continuity of complex sequential task execution. Through a closed-loop process of updating the task graph after replanning and returning to execution, the task execution path is continuously optimized based on real-time execution data, avoiding overall task failure due to local execution problems and improving the final completion quality and execution efficiency of complex sequential tasks. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart of a hierarchical multi-agent task allocation method provided in Embodiment 1 of the present invention; Figure 2 A flowchart of a task allocation method in parallel mode provided in Embodiment 2 of the present invention; Figure 3 This is a flowchart of a task allocation method in a hybrid mode provided in Embodiment 3 of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the terms used to distinguish similar objects can be interchanged so that the invention can also be implemented in other embodiments besides the illustrated or described embodiments. Furthermore, the terms "including," "having," and any variations are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
[0018] Example 1 This embodiment provides a hierarchical multi-agent task allocation method, such as... Figure 1 As shown, the hierarchical multi-agent task allocation method includes the following steps: S1 analyzes the task state characteristics corresponding to the target task to obtain several sub-tasks, the logical dependencies between sub-tasks, and the execution structure.
[0019] The target task is a complex task with a single core execution objective, implicitly containing several sub-tasks, and with exploitable logical dependencies between these sub-tasks. This complex task cannot be efficiently completed independently by a single agent, and the relationships are not explicitly presented. It requires steps such as semantic parsing, feature extraction, sub-task decomposition, and logical dependency prediction to transform it into several sub-tasks that can be executed independently by agents. These sub-tasks are then executed collaboratively by multiple agents through serial, parallel, or hybrid execution structures to achieve the final objective. The target task is typically represented as a requirement instruction described in natural language text, but can also be extended to structured task instructions, visualized task requirements, etc.
[0020] Task state features are unified low-dimensional dense feature vectors generated by fusing information from multiple sources. They are a comprehensive representation of the semantic essence, historical experience, and execution environment of the target task.
[0021] A subtask is a task unit that is extracted from a target task, has a single execution objective, and can be completed independently. As the basic unit for task allocation among multiple agents, it can realize the distributed execution of complex tasks.
[0022] Logical dependencies include sequential dependencies, parallel feasibility, and no dependencies. Sequential dependencies refer to the order in which subtasks are executed; the result of a preceding subtask becomes the input condition for a subsequent subtask. This can be used to define a sequence of subtasks that can be executed sequentially. Parallel feasibility means that there are no sequential constraints between subtasks, allowing them to execute synchronously in time. This can be used to define a set of subtasks that can be executed in parallel, improving the overall execution efficiency of the task. No dependencies mean that subtasks are independent of each other, with no sequential constraints or resource / data dependencies. The execution order and method do not affect each other or the overall task result. This can be used to define completely independent subtasks, providing flexibility for task allocation.
[0023] The execution structure can be sequential, parallel, or hybrid. Sequential execution refers to a structure where all subtasks are executed sequentially according to their dependencies, forming a single execution sequence. This structure is suitable for tasks with strong sequential dependencies and high requirements for execution consistency. Parallel execution refers to a structure where subtasks are either parallel or independent and can be executed synchronously. This structure is suitable for tasks without strong sequential dependencies and high requirements for execution efficiency, improving overall execution speed. Hybrid execution refers to a structure where subtasks are divided into multiple subsets, with each subset operating in a sequential manner and the subsets operating in a parallel manner, or vice versa. This structure is suitable for complex target tasks that combine sequential dependencies and parallel feasible subtasks, balancing execution consistency and efficiency.
[0024] As described above, by performing a full-dimensional structured analysis of the target task, the unstructured natural language task requirements are transformed into machine-executable structured task elements, thereby improving the accuracy and efficiency of subsequent multi-agent task allocation.
[0025] In one specific embodiment, S1 includes the following steps: S11, perform natural language processing on the target task to extract semantic information of the target task, including task intent, key entities and constraints.
[0026] S12, based on semantic information, retrieve historical execution records and contextual information related to the target task.
[0027] S13, the semantic information, historical execution records and context information are fused and encoded to obtain the task state features of the target task.
[0028] S14: Input the task state features into the task decomposition network in the meta-decisioner, and output several sub-tasks and a semantic description of each sub-task.
[0029] S15. Based on the semantic descriptions of each subtask and the relation prediction network in the meta-decisioner, predict the logical dependency between any two subtasks.
[0030] S16. Based on the logical dependencies between subtasks, the execution structure of the target task is determined by the structure decision-maker in the meta-decision-maker.
[0031] Among these, semantic understanding technology based on natural language processing analyzes the text description of the target task through pre-trained language models to uncover the core demands, key elements, and execution constraints of the task. Specifically, it employs pre-trained language models such as BERT pre-training method with robust optimization based on Transformer bidirectional encoder representation and generative pre-trained Transformer to perform word segmentation, part-of-speech tagging, and semantic encoding on the target task text. Based on an attention mechanism, it extracts the task intent, i.e., the core objective of the task, to clarify the ultimate direction of the system's task execution; identifies key entities, i.e., the core objects involved in the task, to limit the scope of task processing; and extracts constraints, i.e., the limiting rules for task execution, to define the boundaries of task execution.
[0032] The intelligent information retrieval mechanism based on feature similarity matching first encodes semantic information into retrieval feature vectors; then, using algorithms such as cosine similarity and Euclidean distance, it retrieves several historical execution records with the highest feature similarity to the target task from the historical task database; simultaneously, it collects contextual information of the task, such as the task initiator's preferences, the current resource status of the system, and execution environment parameters; finally, it outputs a set of relevant historical execution records and contextual information, providing experience reference and environmental basis for the analysis of the current task.
[0033] Based on the heterogeneous information fusion and feature encoding mechanism, three types of heterogeneous data—semantic information, historical execution records, and contextual information—are encoded into feature vectors respectively. Then, a unified low-dimensional dense feature vector is generated through algorithms such as weighted fusion and attention fusion to obtain the task state features of the target task. This eliminates the redundancy and conflict of heterogeneous data and realizes the organic integration of multi-source information.
[0034] The meta-decision maker is the high-level core decision-making module of a hierarchical multi-agent system. It includes multiple modules such as task decomposition network, relationship prediction network, and structure decision maker. It coordinates the entire process of decision-making, including task parsing, task allocation, execution monitoring, and replanning, and controls the rhythm and direction of task allocation and execution for multi-agent systems.
[0035] The task decomposition network transforms standardized task state feature vectors into a set of subtasks with appropriate granularity and semantic descriptions of the subtasks. Essentially, it's a feature-based sequence generation / task splitting process, with an encoder-decoder architecture at its core. Those skilled in the art will recognize that any existing task decomposition network falls within the scope of this invention. For example, in this embodiment, the task decomposition network employs a three-tier architecture: a feature encoding layer, a task granularity control layer, and a subtask generation layer. The feature encoding layer receives fixed-dimensional task state features and performs deep feature extraction through fully connected layers and residual connections, mapping the original features to a high-dimensional task semantic representation, eliminating redundant information, and strengthening the core features of the task. The task granularity control layer introduces a preset granularity threshold and an attention gating mechanism to limit the granularity of subtask splitting based on the task type (e.g., industrial process / intelligent question answering) (e.g., minimum execution unit, whether it can be completed by a single agent), avoiding over-decomposition / under-decomposition and outputting task representations that meet the granularity requirements. The subtask generation layer transforms the high-dimensional task representation into a sequence of subtasks and generates standardized semantic descriptions for each subtask. The output layer uses a Softmax activation and sequence truncation mechanism to ensure the reasonableness of the number and description of subtasks.
[0036] The relation prediction network predicts the logical dependency relationship between any two subtasks based on the node features of the semantic description of the subtasks. Essentially, it is a node relationship classification task for graph-structured data, with a core architecture of a graph neural network. Those skilled in the art will recognize that any relation prediction network in the prior art falls within the protection scope of this invention. For example, in this embodiment, the relation prediction network adopts a three-level architecture: a subtask node encoding layer, a graph convolutional aggregation layer, and a relation classification layer. The subtask node encoding layer transforms the semantic description of each subtask into a fixed-dimensional node feature vector, eliminating text redundancy and strengthening the execution target features of the subtasks. The graph convolutional aggregation layer constructs an initial subtask graph using subtasks as nodes and initial associations (such as semantic similarity) between nodes as edges. It aggregates the node's own features and neighboring node features through graph convolution operations to mine potential logical associations between subtasks. The relation classification layer classifies the aggregated node pair features, outputs the dependency relationship type for each pair of subtasks, and ultimately forms a logical dependency relationship matrix between subtasks.
[0037] The structure decision maker determines the execution structure of the target task based on the subtask dependency matrix and system state characteristics (auxiliary criteria, such as the number of agents and resource utilization). It is essentially a classification decision task with multi-feature fusion. Its core is a hybrid architecture of "rule engine + lightweight inference model", which takes into account the interpretability and flexibility of decision-making. Those skilled in the art will recognize that any structural decision-maker in the prior art falls within the protection scope of this invention. For example, in this embodiment, the structural decision-maker adopts a four-layer architecture: feature fusion layer + rule preliminary judgment layer + model fine judgment layer + result output layer. The feature fusion layer concatenates and normalizes the subtask dependency matrix (converted into statistical features, such as the proportion of sequential dependencies and the number of parallel feasible subtask groups) with system state features (number of agents, resource utilization rate, task timeliness requirements) to generate a decision feature vector. The rule preliminary judgment layer makes a preliminary judgment on the execution structure based on preset judgment rules for industrial application and outputs the preliminary judgment result, including a single result or a set of candidate results. The model fine judgment layer optimizes and verifies the result of the rule preliminary judgment. If the preliminary judgment result is a single result, it performs a rationality check; if the preliminary judgment result is a set of candidate results, it performs a precise classification. The result output layer outputs the final execution structure, i.e., serial mode, parallel mode, or hybrid mode, and can also output the judgment criteria, such as "the proportion of sequential dependencies is 80%, and it is judged as a serial mode," to ensure the interpretability of the decision.
[0038] The preset judgment rules for the initial rule judgment layer can be flexibly adjusted according to the actual scenario. For example, in the intelligent control scenario of industrial production lines, due to the high requirements for consistency and stability of the execution process and the relatively fixed system resources, the preset judgment rules are: if the sequential dependency ratio is ≥60%, it is directly judged as serial mode; if the number of parallel feasible subtask groups is ≥4 and the system resource utilization rate is ≤40%, and the number of available intelligent agents is ≥ the number of parallel groups, it is judged as parallel mode; otherwise, it is judged as hybrid mode. In the cross-domain big data analysis scenario, which is used for high execution efficiency requirements and sufficient computing power / intelligent agent resources, the preset judgment rules are: if the number of parallel feasible subtask groups is ≥3 and the number of available intelligent agents is ≥ the number of parallel groups × 1.2, it is directly judged as parallel mode; if the sequential dependency ratio is ≥80%, it is judged as serial mode; otherwise, it is judged as hybrid mode. In intelligent customer service Q&A scenarios, which are designed for lightweight tasks, a small number of subtasks, and extremely high response time requirements, the preset judgment rules are as follows: when the total number of subtasks is ≤5, if there is no sequential dependency, it is judged as parallel mode; if there is sequential dependency, it is judged as serial mode; when the total number of subtasks is >5, if the proportion of parallel feasible subtasks is ≥50%, it is judged as hybrid mode.
[0039] The sequential dependency ratio is the proportion of the number of subtask pairs in the target task that have sequential dependencies to the total number of all subtask pairs that have logical dependencies.
[0040] As described above, the task decomposition network enables the standardized and automatic breakdown of complex target tasks, the relationship prediction network accurately mines the potential logical dependencies between sub-tasks, and the structure decision-maker comprehensively determines the execution structure, so that the execution structure is highly matched with the logical dependencies of sub-tasks and conforms to the actual state of the system, thereby improving the efficiency and rationality of multi-agent task allocation and collaborative execution.
[0041] In one specific embodiment, S16 includes the following steps: S161. Based on the logical dependency relationship between any two subtasks, construct a logical dependency graph with subtasks as nodes and dependency relationships as directed edges.
[0042] S162, perform structural analysis on the logical dependency graph to extract key topological features.
[0043] S163, based on key topological features and preset judgment rules in the structure decision-maker, performs pattern classification and outputs the execution structure of the target task.
[0044] Based on the structured representation principle of graph theory, the logical dependencies between discrete subtasks are transformed into a directed graph structure. Through the combination of nodes and directed edges, the relationships between all subtasks and the overall execution logic are presented intuitively and completely, realizing the visualization and structured implementation of abstract dependencies. Specifically, subtasks are treated as nodes in the logical dependency graph, and each node is assigned a unique identifier, such as subtask ID or subtask name. Directed edges are drawn according to the logical dependencies between any two subtasks. Sequential dependencies are represented by unidirectional directed edges, such as drawing a directed edge from A to B if subtask A is a prerequisite for B; parallel feasibility is represented by bidirectional or undirected edges. All nodes and edges are integrated to form a complete logical dependency graph, and the adjacency matrix of the graph is generated for subsequent computational machine-based structural analysis.
[0045] Based on the principles of graph theory and topological structure analysis, this invention quantifies the logical dependency graph at both the node level (association attributes of individual subtasks) and the global level (overall association characteristics of all subtasks). It extracts key topological features that characterize the core attributes of the graph structure, including node out-degree, node in-degree, graph connectivity, critical path length, graph depth, and parallel clusters. This provides a quantitative description of the task execution logic and a computable quantitative basis for determining the execution structure. Those skilled in the art will recognize that the methods for extracting the aforementioned key topological features in the prior art fall within the scope of this invention, and will not be elaborated upon further here.
[0046] By taking key topological features as input, they are matched one by one with the judgment rules preset in the structure decision-maker that are adapted to different task scenarios. Through feature threshold judgment and comprehensive consideration of multiple features, the classification of execution structure is completed, realizing the transformation from quantitative features to structured execution mode, and taking into account the objectivity of judgment and scenario adaptability.
[0047] As described above, by transforming logical dependencies into logical dependency graphs and extracting quantified key topological features, the subjectivity of manual judgment of execution structure is avoided; by using pattern classification based on key topological features and preset judgment rules, the judgment of execution structure is made more in line with the internal logic of the task, thus improving the scientificity and consistency of the judgment results.
[0048] S2, if the execution structure is in a serial mode, then sort all the subtasks according to the logical dependencies to generate a first task graph containing the serial execution order, where the serial execution order indicates the order in which the subtasks are processed.
[0049] Topological sorting is an algorithm for sorting nodes in a directed acyclic graph. It guarantees that if there is a directed edge from node A to node B in the graph, then after sorting, A will always appear before B. It is used to transform the sequential dependencies of subtasks into an executable order.
[0050] Correspondingly, based on the logical dependency graph, unidirectional directed edges with sequential dependencies are selected, redundant interference from parallel feasible edges is eliminated, and a topological sorting algorithm is used to sort all subtask nodes acyclically to generate a serial execution order that satisfies all sequential dependency constraints. If multiple feasible sorting results exist, the sequence with the optimal critical path length is selected first to determine the unique and optimal serial execution order. Then, a first task graph containing subtask nodes, execution order, and logical dependencies is constructed with the serial execution order as the core, clarifying the sequential processing logic of subtasks.
[0051] As described above, by performing subtask topological sorting based on logical dependencies, the execution order of subtasks in the serial mode is made to perfectly match their inherent sequential dependency constraints, avoiding execution order chaos or logical conflicts, and ensuring the orderliness and coherence of subsequent multi-agent serial execution.
[0052] S3. Based on the task requirement characteristics of each subtask in the first task diagram and the capability characteristics of each initial agent, the target agent corresponding to each subtask is selected, and a chain of agent execution is constructed.
[0053] In one specific embodiment, S3 includes the following steps: S31, extract the task requirement features of each subtask and the capability features of each initial agent. The task requirement features include functional requirement features, accuracy requirement features and computational complexity requirement features, and the capability features include functional label features, historical execution accuracy and resource utilization.
[0054] S32, for any subtask in the first task graph, input the task requirement features of the current subtask and the capability features of any initial agent into the preset weight allocation network to obtain the adaptation weights between the current subtask and any initial agent. The preset weight allocation network is trained and optimized based on the execution state data of agents in historical tasks.
[0055] S33, determine the initial agent corresponding to the largest adaptation weight as the target agent corresponding to the current subtask.
[0056] S34, traverse all subtasks in the first task graph to obtain the target agent corresponding to each subtask.
[0057] S35. Following the sequential execution order, connect the target agents corresponding to each subtask in turn to obtain the sequential agent execution chain.
[0058] Specifically, from the execution requirement level, the functional requirement features (such as the quantitative coding of functional types such as data crawling, data analysis, and report generation), accuracy requirement features (such as quantitative indicators such as data accuracy and result error rate), and computational complexity requirement features (such as quantitative values such as data volume, calculation steps, and computing power requirements) of each subtask are extracted to form a fixed-dimensional task requirement feature vector.
[0059] Extract the functional label features (such as the quantified encoding of the functional types and proficiency of the agent), historical execution accuracy (the average accuracy of executing similar subtasks in the past), and resource utilization (the average consumption of CPU, memory, and other resources when executing tasks) for each initial agent to form a fixed-dimensional capability feature vector. Normalize all features to eliminate differences in units and ensure the fairness and accuracy of subsequent weight calculations.
[0060] A pre-defined weight allocation network, trained and optimized using historical task execution state data, performs deep fusion and nonlinear fitting on the input task requirement features and agent capability features. It automatically learns the compatibility correlation between the two and outputs quantified adaptation weights, achieving objective calculation of the compatibility between subtasks and agents. Specifically, the task requirement features of the current subtask are concatenated with the capability features of any initial agent to form a fused feature vector. This fused feature vector is input into the pre-defined weight allocation network for feature fusion and inference, outputting a quantized value between 0 and 1, which represents the adaptation weight between the current subtask and that initial agent. The closer the value is to 1, the higher the compatibility. For the current subtask, all initial agents in the agent pool are traversed to complete the calculation of all adaptation weights.
[0061] It should be noted that, for the current subtask, if there are multiple initial agents with the same adaptation weight and all of them are the maximum value, the initial agent with the higher historical execution accuracy will be selected as the target agent for the current subtask.
[0062] Based on the sequential execution order of the subtasks in the first task diagram, the corresponding target agents are linearly connected in the same order. The execution result of the previous target agent is defined as the input basis for the next target agent. The collaborative execution rules between target agents are clarified, and a complete chain of sequential agent execution is finally formed.
[0063] As described above, by inputting the task requirements of subtasks and the capability characteristics of initial agents into a preset weight allocation network, the objectivity and rationality of matching subtasks with agents are improved. By constructing a sequential agent execution chain according to the sequential execution order, the agent collaborative architecture is highly consistent with the task execution logic of the first task graph, avoiding the disorder and data deviation of the sequential execution of multiple agents, and ensuring the continuity and orderliness of the collaborative execution of multiple agents.
[0064] In one specific implementation, the training optimization steps of the preset weight allocation network are as follows: Collect instance data matching each subtask and its corresponding execution agent in historical tasks to obtain several training samples. Each training sample includes the task requirement characteristics of the subtask, the capability characteristics of the execution agent, and the execution status data of the execution agent after executing the corresponding subtask. The execution status data includes output quality indicators, execution efficiency indicators, and resource consumption indicators.
[0065] Based on the execution status data, determine the supervision signal corresponding to each training sample.
[0066] The task requirement features of each training sample and the ability features of the executing agent are input into the weight allocation network to be trained to obtain the predicted adaptation weights.
[0067] The model loss is calculated based on the prediction adaptation weights and supervision signals corresponding to all training samples.
[0068] The training weight allocation network is updated based on the model loss until the model loss converges, resulting in a pre-trained weight allocation network.
[0069] This involves sorting out the execution records of historical tasks, extracting complete data for each "subtask-executing agent" matching pair, integrating the data according to the task requirements characteristics of the subtask, the capability characteristics of the executing agent, and the dimensions of execution status data, and removing abnormal and missing data to form a standardized training sample set.
[0070] Based on the principle of multi-dimensional index weighted quantization, the three types of execution status indicators, namely output quality, execution efficiency and resource consumption, are normalized and weighted according to the actual scenario requirements. The weighted calculation yields a quantized value in the 0-1 range, which serves as the supervision signal for the sample, thus realizing the transformation of execution effect into training label.
[0071] The task requirement features of each training sample's subtasks are concatenated with the capability features of the executing agent to form a fused feature sample. This fused feature sample is then input into the weight allocation network to be trained. Feature inference is performed through the fully connected layers and activation layers of the weight allocation network, ultimately outputting the predicted adaptation weights for that training sample. Those skilled in the art will recognize that any specific implementation of a weight allocation network in the prior art falls within the protection scope of this invention, such as multilayer perceptrons and lightweight convolutional neural networks, and will not be elaborated upon here.
[0072] The prediction and adaptation weights of all training samples are combined into a set of predicted values, and the corresponding supervision signals are combined into a set of labeled values. The mean squared error is selected as the core loss function, and the overall loss value of the two sets is calculated as the model loss. The smaller the loss value, the smaller the deviation between the network prediction result and the actual adaptation effect.
[0073] Optimizers such as Adam / Stochastic Gradient Descent are used. Based on the calculated model loss, the gradients of each parameter in the weight allocation network are calculated using the backpropagation algorithm. The network parameters are then updated along the gradient descent direction according to a preset learning rate, completing one round of training. The process of sample input, loss calculation, and parameter update is repeated until the model loss value drops to a preset threshold and stabilizes over several consecutive rounds. At this point, training stops, the final network parameters are saved, and the trained preset weight allocation network is obtained.
[0074] As described above, by obtaining a preset weight allocation network that can accurately quantify adaptability, an objective and reliable model basis is provided for the optimal matching of subsequent subtasks and agents, thereby improving the accuracy and rationality of agent matching.
[0075] S4 controls the sequential execution chain of intelligent agents to execute each subtask of the first task graph in the sequential execution order, and obtains the execution status data and task execution results corresponding to each target intelligent agent.
[0076] In one specific embodiment, S4 includes the following steps: S41, control the first target agent in the serial agent execution chain to execute the corresponding assigned sub-task and obtain the corresponding task execution result.
[0077] S42 collects the execution status data of each target agent in real time.
[0078] S43, following the sequential execution order, after the preceding subtask is completed, the corresponding task execution result is transmitted to the target agent corresponding to the subsequent subtask according to a preset communication protocol.
[0079] S44, control the target agent of the subsequent sub-task to execute the corresponding sub-task according to the received task execution result, repeat steps S42-S43 until all sub-tasks are completed, and obtain the execution status data and task execution result of each target agent.
[0080] Starting with the sequential execution order, an execution instruction containing subtask requirements and execution standards is issued to the first target agent in the sequential agent execution chain, driving the target agent to execute the assigned subtask, outputting the independent task execution result of the subtask, and temporarily storing it in the system data buffer.
[0081] Throughout the entire process of the target agent executing subtasks, the system's built-in monitoring module collects three types of execution status data in real time at a preset collection frequency (e.g., milliseconds / seconds): output quality indicators (e.g., data accuracy, result completeness, error rate), execution efficiency indicators (e.g., execution time, task processing volume / unit time, instruction response speed), and resource consumption indicators (e.g., CPU utilization, memory usage, computing power consumption). The collected data is then synchronized to the system status database in real time and labeled with a "agent ID - subtask ID" association. The preset collection frequency is a pre-defined interval for collecting status data, used to balance the real-time nature of data collection with system resource consumption, adapting to the monitoring needs of different task scenarios.
[0082] After the system monitoring module determines that the preceding subtask has been completed, it retrieves the execution result from the data buffer. The result data is then formatted, encrypted, and verified according to a preset communication protocol to eliminate data format differences and transmission risks. The encapsulated result data is then unidirectionally transmitted to the input port of the target agent matching the subsequent subtask, triggering the execution preparation process of the subsequent agent. The preset communication protocol is a standardized set of rules for data transmission between agents, including data format, encapsulation method, verification mechanism, and transmission path. This protocol ensures cross-agent data compatibility between different agents, guaranteeing the accuracy, security, and standardization of execution result transmission.
[0083] The system controls the subsequent target agent that receives the execution result from the preceding process. Based on the input result data, it executes the corresponding subtask and simultaneously performs real-time status acquisition during execution. After the subtask is completed, its execution result is passed to the next target agent according to rule S43. This acquisition, transmission, and execution process is repeated until all target agents in the chain have completed their corresponding subtasks. Finally, the system extracts the execution status data and task execution results for all target agents from the system data buffer and state database.
[0084] As described above, by collecting real-time execution status data across all dimensions and transmitting execution results in a standardized manner, the task execution process is made monitorable and traceable, while providing complete sub-task result data for generating the target execution result.
[0085] S5 determines whether to trigger a replanning operation based on the execution state data of all target agents.
[0086] In one specific embodiment, S5 includes the following steps: Monitor the execution status data of each target agent. If the output quality index of any target agent is less than the preset quality threshold, the execution efficiency index is less than the preset efficiency threshold, or the resource consumption index is greater than the preset consumption threshold, a replanning operation is triggered.
[0087] The preset quality threshold is the minimum acceptable value set by the system for output quality indicators. It serves as a quantitative standard for determining whether the execution result of a subtask meets quality requirements, and is used to avoid the cascading impact of low-quality execution results on subsequent subtasks. The preset efficiency threshold is the minimum acceptable value set by the system for execution efficiency indicators. It serves as a quantitative standard for determining whether the execution speed of a subtask meets the overall task timeliness requirements, and is used to prevent slow execution of a single subtask from causing the overall task to time out. The preset resource consumption threshold is the maximum acceptable value set by the system for resource consumption indicators. It serves as a quantitative standard for determining whether the resource consumption of a subtask is within a reasonable range, and is used to avoid system resource strain caused by excessive resource consumption of a single agent, which could affect the execution of other agents.
[0088] The specific values of the preset quality threshold, preset efficiency threshold, and preset consumption threshold can be set by the implementer according to the actual situation.
[0089] The above-mentioned single anomaly triggering rules for any agent and any metric enable early detection and triggering of abnormal execution, minimizing the impact of abnormal execution on subsequent subtasks and the overall task.
[0090] S6. If the replanning operation is not triggered, the target execution result is obtained based on the task execution results corresponding to all target agents. Otherwise, the first task graph is updated based on the execution status data up to the trigger time, the completed task execution results, and the remaining unexecuted sub-tasks, and the execution step S3 is returned with the updated first task graph.
[0091] In one specific embodiment, S6 includes the following steps: S61, if a replanning operation is triggered, the execution status data up to the trigger time, the execution results of completed tasks, and the remaining unexecuted subtasks are encoded and input into a preset replanning decision network to obtain a first task adjustment scheme. The first task adjustment scheme includes skipping subtasks, replacing the target agent, adjusting the logical dependencies between the remaining subtasks, or inserting new error correction subtasks.
[0092] S62, Update the first task map according to the first task adjustment plan, and generate the updated first task map.
[0093] S63, return to step S3 based on the updated first task graph, until no replanning operation is triggered.
[0094] The pre-defined replanning decision network is a deep learning model trained and optimized using historical replanning case data. It is a multi-classification and scenario-based decision-making model that can automatically learn the correspondence between abnormal scenarios and adjustment schemes, quickly generating scientific and efficient first-task adjustment schemes, avoiding the lag and subjectivity of manual decision-making. Those skilled in the art will understand that any replanning decision network in the prior art falls within the protection scope of this invention. For example, in this embodiment, the pre-defined replanning decision network adopts a four-layer serial architecture consisting of a feature encoding layer, a feature fusion layer, a decision reasoning layer, and an output layer. The feature encoding layer independently encodes the execution status data up to the trigger time, the completed task execution results, the task requirement features of the remaining unexecuted sub-tasks, and their logical dependencies, mapping each source feature to a unified high-dimensional feature space, eliminating the dimensional and dimensional differences of heterogeneous features. The feature fusion layer uses a dual fusion method of concatenation and attention fusion to deeply fuse the feature encoding results, mining the potential correlation between "abnormal state - completed result - remaining task," and generating a global feature vector representing the overall abnormal scenario. The decision-making and reasoning layer consists of 2-3 fully connected layers, performing deep reasoning on the globally fused features to uncover the essential problems in abnormal scenarios, such as agent capability mismatch, unreasonable sub-task dependencies, and single-execution errors, providing a reasoning basis for subsequent solution outputs. The output layer uses a multi-classification output head with an output dimension of 4 to correspond to four basic first-task adjustment schemes. It is used to transform the reasoned features into specific first-task adjustment schemes, supporting single-scheme output or multi-scheme combination output. The output results have clear decision-making direction and are used for updating the first-task graph.
[0095] Specifically, the first task adjustment scheme can select one or more combinations of four adjustment methods: skipping subtasks (for abnormal subtasks without core impact); replacing the target agent (for agents whose capabilities are mismatched and cause abnormalities); adjusting the logical dependencies of the remaining subtasks (for scenarios where the original dependencies cause execution to be blocked); and inserting new error correction subtasks (for scenarios where it is necessary to correct the abnormal results that have already been completed).
[0096] The adjustment plan for the first task is broken down into specific operation instructions, corresponding to the modification dimensions of the first task graph, including adding and deleting nodes, replacing agent associations, and adjusting dependencies. Specifically, the targeted update operation for skipping subtasks is: delete the subtask node and its corresponding directed edges from the original first task graph, and adjust the direct dependencies between adjacent subtasks. The targeted update operation for replacing the target agent is: update the target agent association information corresponding to the subtask in the original first task graph, retaining the task requirement characteristics and logical dependencies of the subtask. The targeted update operation for adjusting the dependencies of the remaining subtasks is: modify the directed edges between the remaining subtasks, update the serial execution order, and ensure there are no logical loops. The targeted update operation for inserting error correction subtasks is: add error correction subtask nodes at the corresponding positions, add reasonable forward and backward directed edges, and integrate them into the serial execution sequence.
[0097] It should be noted that further verification is needed to ensure that the updated task graph conforms to the sequential execution logic, has no circular dependencies, and has complete sub-task nodes. After the verification is passed, the final updated first task graph is generated.
[0098] The updated first task graph is used as the new first task graph. Return to step S3 and repeat the entire process of S3, S4, and S5. If replanning is triggered again, repeat the operations of S61-S63. If replanning is not triggered, stop the iteration and enter the result fusion stage to generate the target execution result.
[0099] As described above, by matching the optimal target agent with the updated task graph, reliable agent support is provided for task execution in abnormal scenarios. Through multiple iterations until replanning is no longer triggered, a closed-loop optimization of task execution is formed, gradually eliminating the impact of various execution anomalies, ensuring that the overall task can be completed with high quality, and greatly improving fault tolerance and robustness.
[0100] In one specific embodiment, S6 includes the following steps: The task execution results of all target agents that do not trigger replanning operations are integrated according to their corresponding serial execution order to form the target execution result.
[0101] In this process, after determining that no replanning operation is triggered, the valid task execution results corresponding to all target agents are extracted. According to the predetermined sequential execution order in the first task graph, the results are processed by data splicing, logical verification, content summarization and format standardization in order from the previous order to the next order. Finally, the results are integrated to form a complete target execution result, ensuring the consistency and integrity of the results.
[0102] As described above, by fusing the results of subtasks to generate the target execution result when replanning is not triggered, the standardized integration of the execution results of serial tasks is achieved; by generating adjustment schemes based on the decision network and iteratively executing them when replanning is triggered, a closed-loop optimization of task execution is formed, which effectively eliminates the impact of abnormal execution and ensures the stability, fault tolerance and final completion quality of the overall task execution.
[0103] The above-mentioned approach decomposes subtasks, analyzes dependencies, and determines execution structures based on task state characteristics to identify a sequential execution order that conforms to task characteristics. This generates a first task graph containing the sequential execution order, solving the problem that static rule-driven methods cannot adapt to dynamic task changes and improving the accuracy of task allocation. By accurately matching subtask requirement characteristics with agent capability characteristics, the optimal target agent is assigned to each subtask, and an efficient sequential agent execution chain is constructed, improving the basic efficiency and quality of subtask execution. By collecting agent execution state data and triggering replanning operations, subtask execution anomalies are detected in real time, and the task graph and agent configuration are adjusted in a timely manner, ensuring the stability and continuity of complex sequential task execution. Through a closed-loop process of updating the task graph after replanning and returning to execution, the task execution path is continuously optimized based on real-time execution data, avoiding overall task failure due to local execution problems and improving the final completion quality and execution efficiency of complex sequential tasks.
[0104] Example 2 This second embodiment provides a method for parallel task allocation in parallel mode, such as... Figure 2 As shown, the parallel task allocation method in this parallel mode includes the following steps: S10: Analyze the task state characteristics corresponding to the target task to obtain several sub-tasks, the logical dependencies between sub-tasks, and the execution structure. The execution structure can be a serial mode, a parallel mode, or a hybrid mode.
[0105] The specific principles and implementation methods of step S10 can be found in the specific principles and implementation methods of step S1 in Example 1.
[0106] S20, if the execution structure is in parallel mode, then according to the logical dependency relationship, a second task graph containing at least one parallel branch is generated, wherein the parallel branch indicates that each subtask is executed in parallel by several initial agents, and different subtasks are executed in parallel.
[0107] In one specific embodiment, S20 includes the following steps: Each subtask in the logical dependency relationship that is marked as parallel feasible or dependency-free is defined as a parallel branch.
[0108] Based on the principle of adaptability between logical dependencies and parallel execution, parallel feasible subtasks have no execution order constraints and can proceed synchronously, while dependent subtasks do not require other subtasks to be executed beforehand and can proceed independently. Both types of subtasks fully meet the core requirement of synchronous execution of multiple tasks in parallel mode. By treating each subtask marked as parallel feasible or dependent in the logical dependency relationship as a separate parallel branch, independent parallel management of subtasks can be achieved, avoiding execution interference between branches and maximizing the efficiency advantages of parallel execution.
[0109] Correspondingly, each parallel branch corresponds to a subtask adapted for parallel execution. This is used to define the parallel execution boundary of each subtask, realize independent parallel management of subtasks, avoid execution interference between branches, and provide a corresponding carrier for matching a dedicated parallel intelligent agent team to a single subtask.
[0110] The second task graph is a structured task execution framework specifically for parallel execution mode. It consists of several independent parallel branches and is used to represent all subtasks adapted for parallel execution and their parallel relationships. It provides a visualized and standardized framework for the subsequent formation of parallel agent teams and parallel execution management, and clarifies the core logic of multi-agent parallel execution.
[0111] As described above, by selecting subtasks that are suitable for parallel execution based on logical dependencies, it is ensured that the parallel branches of the second task graph fit the internal execution logic of the subtasks, avoiding parallel conflicts caused by the mixing of sequentially dependent subtasks. Furthermore, by defining each suitable subtask as an independent parallel branch and constructing the second task graph, the orderliness and efficiency of parallel execution are guaranteed.
[0112] S30, for any parallel branch in the second task graph, input the task requirement features of the subtask corresponding to the current parallel branch and the capability features of each initial agent into the preset weight allocation network to obtain the adaptation weight between each initial agent and the subtask.
[0113] In one specific embodiment, S30 includes the following steps: S310, extract the task requirement features of each subtask and the capability features of each initial agent. The task requirement features include functional requirement features, accuracy requirement features and computational complexity requirement features, and the capability features include functional label features, historical execution accuracy and resource utilization.
[0114] S320: For the subtask corresponding to the current parallel branch, the task requirement features of the subtask corresponding to the current parallel branch and the capability features of any initial agent are input into the preset weight allocation network to obtain the adaptation weight between any initial agent and the subtask. The preset weight allocation network is trained and optimized based on the execution state data of agents in historical tasks.
[0115] Specifically, from the execution requirement level, the functional requirement features (such as the quantitative coding of functional types such as data crawling, data analysis, and report generation), accuracy requirement features (such as quantitative indicators such as data accuracy and result error rate), and computational complexity requirement features (such as quantitative values such as data volume, calculation steps, and computing power requirements) of each subtask are extracted to form a fixed-dimensional task requirement feature vector.
[0116] Extract the functional label features (such as the quantified encoding of the functional types and proficiency of the agent), historical execution accuracy (the average accuracy of executing similar subtasks in the past), and resource utilization (the average consumption of CPU, memory, and other resources when executing tasks) for each initial agent to form a fixed-dimensional capability feature vector. Normalize all features to eliminate differences in units and ensure the fairness and accuracy of subsequent weight calculations.
[0117] A pre-defined weight allocation network, trained and optimized using historical task execution state data, performs deep fusion and nonlinear fitting on the input task requirement features and agent capability features. It automatically learns the compatibility correlation between the two, outputting quantified adaptation weights to achieve objective calculation of the compatibility between subtasks and agents. Specifically, the task requirement features of the current parallel branch's corresponding subtask are concatenated with the capability features of any initial agent and input into the pre-defined weight allocation network for feature fusion and inference. The output is a quantized value between 0 and 1, which represents the adaptation weight between the current parallel branch's corresponding subtask and that initial agent; the closer the value is to 1, the higher the compatibility. For the current parallel branch's corresponding subtask, all initial agents in the agent pool are traversed to complete the calculation of all adaptation weights.
[0118] As described above, by inputting the task requirements features of the subtask and the capability features of the initial agent into a preset weight allocation network, the matching weights between the two are obtained, thereby improving the objectivity and rationality of the matching between the subtask and the agent.
[0119] S40. Based on the adaptation weight, select several target agents corresponding to the subtask and form a parallel agent team corresponding to the subtask.
[0120] In one specific embodiment, S40 includes the following steps: S410: For any parallel branch, the initial agent whose corresponding adaptation weight is greater than or equal to the preset weight threshold is determined as the candidate agent for that subtask.
[0121] S420, if the number of candidate agents is greater than or equal to the preset upper limit N, then select the top N candidate agents with the highest adaptation weight as the target agent.
[0122] S430, if the number of candidate agents is less than the preset upper limit N, then all candidate agents are taken as target agents.
[0123] S440 combines all target agents to obtain the parallel agent team corresponding to the subtask.
[0124] The preset weight threshold is a quantitative value pre-set by the system to indicate the suitability of the agent and the subtask. It is the core standard for determining whether the initial agent has the basic ability to execute the subtask, and is used to filter out agents with mismatched capabilities to prevent low-suitability agents from joining the team and affecting the parallel execution effect. The specific value of the preset weight threshold can be set by the implementer according to the actual situation.
[0125] Candidate agents are initial agents that have been filtered by preset weight thresholds and possess the basic ability to execute corresponding sub-tasks. They are used to provide the scope boundary for the subsequent determination of target agents and ensure the minimum capability adaptability of target agents.
[0126] The preset upper limit N is the maximum size of the parallel agent team, which is pre-set based on the principles of subtask computational complexity, execution resource requirements, and optimal parallel execution efficiency. It is used to avoid resource waste and reduced collaboration efficiency caused by excessively large team size, so that the team size matches the subtask execution requirements.
[0127] When the number of candidate agents exceeds the preset upper limit N, the top N agents with the best fit weight are selected as the target agents. This ensures that the selected target agents are the group with the best fit for the subtask, and avoids the team size from becoming too large, which would lead to excessive occupation of system resources and increased collaboration costs between agents. This balances the fit of parallel execution with the rationality of resources.
[0128] When the number of candidate agents does not reach the preset upper limit N, all candidate agents are determined as target agents. Under the premise of ensuring that all selected agents meet the capability adaptability baseline, the existing qualified agent resources are maximized to form a parallel team of suitable size. This avoids the inefficiency of parallel execution of subtasks due to the small team size, which would prevent the advantages of multi-agent parallel computing power from being fully utilized.
[0129] For any parallel branch, all target agents are integrated and assigned a unique parallel agent team identifier, which is then associated with the corresponding parallel branch subtask. The core execution goal of the team is to complete the parallel execution of the subtask, thus forming a dedicated and directly schedulable parallel agent team for that subtask.
[0130] As described above, by controlling the target intelligent agent size by setting a preset upper limit N, the resource waste caused by an excessively large team size or the low execution efficiency caused by an excessively small team size is avoided; by building a dedicated parallel execution entity for each subtask, the advantages of multi-agent parallel computing power are fully utilized, thereby improving the efficiency and stability of the parallel execution of subtasks.
[0131] S50 controls each parallel agent team to execute its corresponding subtask and obtains the task execution result for each parallel branch.
[0132] In one specific embodiment, S50 includes the following steps: S510: For any parallel intelligent agent team, control each target intelligent agent in the current parallel intelligent agent team to execute the corresponding sub-task in parallel, and obtain the initial execution result of each target intelligent agent.
[0133] S520 integrates the initial execution results of all target agents within the current parallel agent team to obtain the task execution results of the parallel branches corresponding to the current parallel agent team.
[0134] Specifically, for any parallel agent team, a synchronous execution instruction is issued to all target agents within that team. This instruction includes the requirements, execution criteria, and output requirements for the corresponding subtask. All target agents are controlled to start execution simultaneously, processing the subtask in parallel. After each target agent completes its execution, it independently outputs initial execution results that meet preset criteria. All initial execution results are associated and temporarily stored using the "team ID - agent ID" structure to ensure traceability.
[0135] The system retrieves the initial execution results of all target agents within the current parallel agent team and processes these results according to preset integration rules. The core integration methods include data complementarity (supplementing differentiated data content output by different agents), logical verification (verifying the consistency of multiple results and eliminating contradictory or erroneous data), optimal fusion (selecting the best data from each dimension for integration), and format standardization (unifying the format of the integrated data according to the requirements of the sub-tasks). The integrated results undergo a final validity verification. Once the verification is passed, the task execution results of the corresponding parallel branch of the team are generated and synchronized to the system result buffer to prepare for subsequent global result fusion.
[0136] In one specific implementation, it is suitable for intelligent agent teams to perform binary / multi-classification tasks such as "risk level determination", "task type classification", and "compliance review". It can statistically analyze the classification and decision conclusions in the initial execution results of all target intelligent agents and select the conclusion with the highest frequency as the integrated result of that dimension. If there is a tie, a priority can be preset (such as selecting the conclusion with the highest confidence) or a secondary verification can be triggered.
[0137] In one specific implementation, adapted to the intelligent agent team performing numerical output tasks such as "price estimation", "performance scoring" and "time consumption calculation", each intelligent agent can be assigned a weight (the total weight is 1) according to the agent's historical execution accuracy, task adaptability and other dimensions, and the weighted average of the numerical results output by each intelligent agent is calculated to obtain the integrated result.
[0138] In one specific implementation, adapted to intelligent agent teams performing information-related tasks such as "extracting key information from text", "locating the cause of failure", and "analyzing user needs", each intelligent agent can be required to return a confidence level (0-1) when outputting the initial result. Results with a confidence level greater than a preset confidence threshold (such as 0.8) are selected, and the result with the highest confidence level is selected as the core. The results are then combined with the differentiated information of other high-confidence results for supplementation and integration.
[0139] As described above, by controlling the parallel execution of sub-tasks by each target agent within the parallel agent team, the computing power collaboration of multiple agents within the branch is realized, giving full play to the advantages of multi-agent parallelism and ensuring the standardization and effectiveness of task execution results.
[0140] S60 merges the task execution results corresponding to all parallel branches to obtain the target execution result corresponding to the target task.
[0141] This process involves retrieving the task execution results corresponding to all parallel branches, and then processing the multiple branch results in an integrated manner according to the global fusion rules preset by the target task, including result splicing, content completion, logical consistency verification, and output format standardization. First, the validity and logical consistency of each branch result are verified, and then the content is integrated and the format is encapsulated according to the output requirements of the target task. Finally, the target execution result corresponding to the target task that meets the core requirements is generated.
[0142] In one specific implementation, when controlling each parallel agent team to execute the corresponding sub-task, the execution state data of each target agent is also obtained. This multi-agent-based parallel task allocation method further includes the following steps: S70 collects the execution status data of each target agent when controlling each target agent in the current parallel agent team to execute the corresponding sub-task in parallel. S80 determines whether to trigger a replanning operation based on the execution state data of all target agents.
[0143] S90: If the replanning operation is not triggered, the target execution result is obtained based on the task execution results corresponding to all parallel branches. Otherwise, the second task graph is updated based on the execution status data up to the trigger time, the completed task execution results, and the remaining unexecuted subtasks, and the execution step S30 is returned with the updated second task graph.
[0144] In this embodiment, the remaining unexecuted subtasks are "complete parallel branches that have not yet started execution, or subtasks within parallel branches that have started execution but have not yet been completed". The execution results of completed and verified tasks can be directly reused without re-executing the corresponding subtasks.
[0145] In one specific embodiment, S80 includes the following steps: Monitor the execution status data of each target agent. If the output quality index of any target agent is less than the preset quality threshold, the execution efficiency index is less than the preset efficiency threshold, or the resource consumption index is greater than the preset consumption threshold, a replanning operation is triggered.
[0146] In one specific embodiment, S90 includes the following steps: S910, if a replanning operation is triggered, the execution status data up to the trigger time, the results of completed task execution, and the remaining unexecuted subtasks are encoded and input into the preset replanning decision network to obtain a second task adjustment scheme. The second task adjustment scheme includes skipping subtasks, replacing the target agent, or inserting new error correction subtasks.
[0147] S920 updates the second mission diagram according to the second mission adjustment plan, generating the updated second mission diagram.
[0148] S930, return to step S30 based on the updated second task graph, until no replanning operation is triggered.
[0149] In this embodiment, the output layer of the pre-defined replanning decision network adopts a multi-classification output head with an output dimension of 3 to correspond to the three basic second task adjustment schemes. This is used to transform the inferred features into specific second task adjustment schemes, supporting single scheme output or multi-scheme combination output. The output results have clear decision orientation and are used for updating the second task graph.
[0150] Specifically, the second task adjustment scheme can select one or more combinations of the following adjustment methods: skipping subtasks (for abnormal subtasks without core impact); replacing the target agent (for agents whose abnormalities are caused by capability mismatch); inserting new error correction subtasks (for scenarios that need to correct completed abnormal results).
[0151] The adjustment scheme for the second task is broken down into specific operation instructions, corresponding to the modification dimensions of the second task graph, including adding and deleting nodes, replacing agent associations, and adjusting dependency edges. Specifically, the targeted update operation for skipping a subtask is to delete the subtask node from the original second task graph. The targeted update operation for replacing the target agent is to update the target agent association information corresponding to the subtask in the original second task graph, retaining the task requirement characteristics and logical dependencies of the subtask. The targeted update operation for inserting an error correction subtask is to add an error correction subtask node at the corresponding position, add reasonable forward and backward directed edges, and integrate it into the serial execution sequence.
[0152] It should be noted that further verification is needed to ensure that the updated task graph conforms to the sequential execution logic, has no circular dependencies, and that the subtask nodes are complete. After the verification is passed, the final updated second task graph is generated.
[0153] The updated second task graph is used as the new second task graph. The process returns to step S30 until no replanning is triggered. Then the iteration stops, and the process enters the result fusion stage to generate the target execution result.
[0154] As described above, by decomposing subtasks, analyzing dependencies, and determining execution structures based on task state characteristics, a second task graph containing at least one parallel branch is generated. This clarifies the parallel execution relationships and branch divisions of subtasks, avoiding branch conflicts during parallel execution. By selecting target agents, the parallel agent teams are controlled to execute corresponding subtasks and the execution results of all parallel branches are integrated. This fully leverages the parallel computing power advantages of multiple agents, achieving efficient parallel collaborative execution of multiple agents, ensuring the integrity and high quality of target execution results, and thus improving the overall efficiency and completion quality of parallel execution of complex target tasks.
[0155] Example 3 This third embodiment provides a task allocation method in a hybrid mode, such as... Figure 3 As shown, the task allocation method in this hybrid mode includes the following steps: S100: Analyze the task state characteristics corresponding to the target task to obtain several sub-tasks, the logical dependencies between sub-tasks, and the execution structure.
[0156] S200, if the execution structure is a hybrid mode, a hybrid task graph is generated according to the logical dependencies. The hybrid task graph contains at least one parallel subgraph composed of parallelizable subtasks, several independent tasks without parallel association, and the target execution order between the parallel subgraph and the independent subtasks.
[0157] S300: For any parallel subgraph, the task requirement features of the corresponding subtask in the current parallel subgraph and the capability features of each initial agent are input into a preset weight allocation network to filter out several target agents corresponding to the subtask and construct the parallel agent team corresponding to the subtask.
[0158] S400: For any independent task, the task requirements features of the independent task and the capability features of each initial agent are input into a preset weight allocation network to filter out several target agents corresponding to the independent task and construct a dedicated agent team corresponding to the independent task.
[0159] S500, based on the target execution order between parallel subgraphs and independent subtasks, sequentially schedules the agent teams corresponding to each parallel subgraph and the dedicated agent teams corresponding to each independent task to execute the corresponding tasks, and obtains several task execution results.
[0160] S600, according to the target execution order of the hybrid task graph, merges the execution results of all tasks to obtain the target execution result corresponding to the target task.
[0161] The specific principles and implementation methods of step S100 can be found in the specific principles and implementation methods of step S1 in Embodiment 1.
[0162] An independent task is a single subtask that has no parallel associations and no other subtasks forming execution constraints with it. It is used to identify subtasks that only need to be executed independently in the hybrid mode, supplementing the execution unit type of the hybrid task graph and covering all subtasks.
[0163] Based on the structured mapping principle of hybrid execution logic, and in line with the core feature of the hybrid mode of "serial and parallel combination", the discovered logical dependencies are transformed into a visual and executable structured task graph. Parallel subgraphs encapsulate groups of subtasks that can be executed in parallel, and independent tasks identify single subtasks without parallel association. At the same time, according to the sequential dependencies between subtasks, the execution order of all parallel subgraphs and independent tasks is clarified, that is, the target execution order, which is used to clarify the start-up and execution constraints of each execution unit and ensure the orderly progress of the execution process in the hybrid mode.
[0164] Specifically, the process involves selecting groups of subtasks that can be executed in parallel within logical dependencies, encapsulating each subtask group into a separate parallel subgraph, and maintaining parallel execution logic for the subtasks within each parallel subgraph. Subtasks without parallel associations or execution constraints from other subtasks within the logical dependencies are extracted and defined as independent tasks. Based on the sequential dependencies between subtasks, the execution order of all parallel subgraphs and independent tasks is determined, i.e., the target execution order. Finally, all parallel subgraphs, independent tasks, and the target execution order are integrated to construct a hybrid task graph, which is then labeled with the execution constraints and relationships of each unit to ensure the executability of the task graph.
[0165] The selection principle and implementation method of target intelligent agents in S300 and S400 can refer to the selection principle and implementation method of target intelligent agents in Example 1.
[0166] Following the target execution order, the execution entities of the preceding execution units are first scheduled to start execution: if it is a parallel subgraph, all parallel agent teams within it are controlled to execute the corresponding subtasks in parallel, and the results of the subtasks are integrated after execution to obtain the overall task execution result of the parallel subgraph; if it is an independent task, its dedicated agent team is controlled to execute the corresponding task to obtain the task execution result of the independent task. After the preceding execution unit completes execution and generates results, the next execution entity is scheduled to start execution according to the target execution order, and the above execution process is repeated to complete the execution of all parallel subgraphs and independent tasks in sequence, obtaining several task execution results corresponding to all execution units, which are temporarily stored in the system buffer according to the target execution order.
[0167] The system retrieves the overall task execution results and independent task execution results of all parallel subgraphs from the system buffer. These results are then sorted according to the target execution order of the hybrid task graph. Based on this sorting, all task execution results are sequentially integrated. Data is stitched together, content is complemented, and results are summarized according to the core requirements of the target task. The integrated results undergo logical verification to confirm the consistency and correlation between the results of each unit, eliminating contradictory and erroneous data to ensure accuracy. The verified results are then standardized in format, unifying the result format and encapsulating the data content according to the output requirements of the target task. Finally, these are merged to form the target execution result corresponding to the target task.
[0168] As described above, by decomposing the target task and determining the hybrid execution structure, and constructing a hybrid task graph containing parallel subgraphs and independent tasks, a structured analysis and architectural mapping of complex hybrid logic tasks are achieved. By building parallel agent teams for parallel subgraphs and dedicated agent teams for independent tasks, capable execution subjects are matched to each execution unit. By scheduling according to the target execution order and executing in parallel within the subgraph, a hybrid execution logic of parallel execution within the subgraph and serial execution between units is achieved, fully leveraging the computing power advantages of multiple agents and improving the overall task execution efficiency. By merging the execution results of all tasks according to the target execution order, the accuracy, completeness, and standardization of the target execution results are ensured, achieving high efficiency and high quality in the allocation of complex target tasks in the hybrid mode.
[0169] In one specific embodiment, the task allocation method further includes the following steps: The S700 collects the execution status data of all target agents in real time and determines whether to trigger a replanning operation based on the execution status data.
[0170] S800: If the replanning operation is not triggered, the execution results of all tasks are merged to obtain the target execution result corresponding to the target task. Otherwise, the execution status data up to the trigger time, the completed execution results, and the remaining unexecuted subtasks are encoded and input into the preset replanning decision network to obtain the third task adjustment scheme. The third task adjustment scheme includes skipping subtasks, replacing the target agent, adjusting the logical dependencies between the remaining subtasks, inserting new error correction subtasks, or adjusting the target execution order.
[0171] S900 updates the hybrid task map according to the third task adjustment scheme and generates the updated hybrid task map.
[0172] S1000, based on the updated hybrid task graph, return to execution step S300 until no replanning operation is triggered.
[0173] The logic for determining whether a replanning operation is triggered in step S700 can be referenced from the logic for determining whether a replanning operation is triggered in Embodiment 1.
[0174] In this embodiment, the output layer of the pre-defined replanning decision network adopts a multi-classification output head with an output dimension of 5 to correspond to five basic third task adjustment schemes. This is used to transform the inferred features into specific third task adjustment schemes, supporting single scheme output or multi-scheme combination output. The output results have clear decision orientation and are used for updating the hybrid task graph.
[0175] The third task adjustment plan is broken down, and the five types of adjustment measures are transformed into specific hybrid task graph modification instructions, clarifying the modification objects (parallel subgraphs / independent tasks / target execution order), modification content, and modification boundaries. The original hybrid task graph is updated accordingly, including: skipping subtasks: only skipping abnormal subtasks (subtasks within parallel subgraphs / independent tasks), deleting corresponding nodes and associated logic, while keeping other normal execution units unchanged; replacing target agents: only replacing target agents within abnormal execution units with inadequate adaptation weights or execution abnormalities, maintaining the team size and execution unit architecture unchanged; adjusting logical dependencies between remaining subtasks: only adjusting the parallel / sequential dependencies of remaining subtasks, which can involve splitting / merging the original parallel subgraphs or modifying the associations of independent tasks; inserting new error-correcting subtasks: inserting error-correcting subtasks at the front end / inside of the corresponding abnormal execution unit, affecting only that abnormal unit and not other normal execution units; adjusting the target execution order: only modifying the execution order between the remaining unexecuted parallel subgraphs and independent tasks, maintaining the internal architecture of each execution unit unchanged.
[0176] After the modifications are completed, the updated hybrid task graph is checked for logical consistency to verify that there are no circular dependencies, the execution units are clearly divided, and the execution order of the targets is reasonable. Once the check passes, the updated hybrid task graph is generated.
[0177] As described above, by collecting the execution status data of all target agents in real time and determining whether replanning is triggered, anomaly monitoring of all execution subjects in the hybrid mode is achieved, improving robustness. By generating a third task adjustment scheme that includes adjusting the execution order of targets, the core rules of replanning in serial / parallel modes are reused, and differentiated adaptation is made for the characteristics of serial-parallel combination in the hybrid mode. By iteratively executing back based on the updated hybrid task graph until replanning is not triggered, a fault-tolerant closed loop for hybrid mode task execution is formed, gradually eliminating execution anomalies and ensuring the accuracy, completeness and reliability of the final target execution result.
[0178] Example 4 Embodiment 4 of the present invention provides a non-transitory computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a method in the method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the hierarchical multi-agent task allocation method provided in the above embodiment.
[0179] Example 5 Embodiment 5 of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium of Embodiment 4 of the present invention.
[0180] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A hierarchical multi-agent task allocation method, characterized in that, The method includes the following steps: S1, parse the task state characteristics corresponding to the target task to obtain several sub-tasks, the logical dependencies between sub-tasks and the execution structure, wherein the execution structure is a serial mode, a parallel mode or a hybrid mode. S2, if the execution structure is a serial mode, then all subtasks are sorted according to the logical dependencies to generate a first task graph containing the serial execution order, wherein the serial execution order indicates the order in which the subtasks are processed. S3, based on the task requirement characteristics of each subtask in the first task graph and the capability characteristics of each initial agent, the target agent corresponding to each subtask is selected and a serial agent execution chain is constructed. S4, control the serial intelligent agent execution chain to execute each subtask of the first task graph according to the serial execution order, and obtain the execution status data and task execution results corresponding to each target intelligent agent; S5, based on the execution state data of all target agents, determines whether to trigger a replanning operation; S6. If the replanning operation is not triggered, the target execution result is obtained based on the task execution results corresponding to all target agents. Otherwise, the first task graph is updated based on the execution status data up to the trigger time, the completed task execution results, and the remaining unexecuted sub-tasks, and the execution step S3 is returned with the updated first task graph.
2. The hierarchical multi-agent task allocation method according to claim 1, characterized in that, S1 includes the following steps: S11, Perform natural language processing on the target task to extract the semantic information of the target task, wherein the semantic information includes task intent, key entities and constraints. S12, based on the semantic information, retrieve the historical execution records and context information related to the target task; S13, the semantic information, the historical execution record and the context information are fused and encoded to obtain the task state features of the target task; S14, The task state features are input into the task decomposition network in the meta-decisioner, and several sub-tasks and semantic descriptions of each sub-task are output. S15, based on the semantic description of each subtask and the relation prediction network in the meta-decisioner, predict the logical dependency between any two subtasks, wherein the logical dependency includes sequential dependency, parallel feasibility, or no dependency. S16, Based on the logical dependencies between subtasks, the execution structure of the target task is determined by the structure decision-maker in the meta-decision-maker.
3. The hierarchical multi-agent task allocation method according to claim 2, characterized in that, S16 includes the following steps: S161, Based on the logical dependency relationship between any two subtasks, construct a logical dependency graph with subtasks as nodes and dependency relationships as directed edges; S162, Perform structural analysis on the logical dependency graph to extract key topological features, wherein the key topological features include node out-degree, node in-degree, graph connectivity, critical path length, graph depth, and parallel clusters; S163, perform pattern classification based on the key topological features and the preset judgment rules in the structure decision-maker, and output the execution structure of the target task.
4. The hierarchical multi-agent task allocation method according to claim 1, characterized in that, S3 includes the following steps: S31, extract the task requirement features of each subtask and the capability features of each initial agent, wherein the task requirement features include functional requirement features, accuracy requirement features and computational complexity requirement features, and the capability features include functional label features, historical execution accuracy and resource utilization. S32, for any subtask in the first task graph, the task requirement features of the current subtask and the capability features of any initial agent are input into a preset weight allocation network to obtain the adaptation weight between the current subtask and any initial agent. The preset weight allocation network is trained and optimized based on the execution state data of agents in historical tasks. S33, determine the initial agent corresponding to the largest adaptation weight as the target agent corresponding to the current subtask; S34, traverse all subtasks in the first task graph to obtain the target agent corresponding to each subtask; S35, according to the serial execution order, connect the target intelligent agents corresponding to each subtask in sequence to obtain the serial intelligent agent execution chain.
5. The hierarchical multi-agent task allocation method according to claim 1, characterized in that, S4 includes the following steps: S41, control the first target agent in the serial agent execution chain to execute the corresponding assigned sub-task and obtain the corresponding task execution result; S42, collect the execution status data of each target agent in real time, wherein the execution status data includes output quality indicators, execution efficiency indicators and resource consumption indicators; S43, according to the serial execution order, after the previous subtask is completed, the corresponding task execution result is transmitted to the target intelligent agent corresponding to the subsequent subtask according to the preset communication protocol; S44, control the target agent of the subsequent sub-task to execute the corresponding sub-task according to the received task execution result, repeat steps S42-S43 until all sub-tasks are completed, and obtain the execution status data and task execution result of each target agent.
6. The hierarchical multi-agent task allocation method according to claim 5, characterized in that, S5 includes the following steps: Monitor the execution status data of each target agent. If the output quality index of any target agent is less than a preset quality threshold, the execution efficiency index is less than a preset efficiency threshold, or the resource consumption index is greater than a preset consumption threshold, then a replanning operation is triggered.
7. The hierarchical multi-agent task allocation method according to claim 6, characterized in that, S6 includes the following steps: S61, if a replanning operation is triggered, the execution status data up to the trigger time, the execution results of completed tasks and the remaining unexecuted subtasks are encoded and input into a preset replanning decision network to obtain a first task adjustment scheme, wherein the first task adjustment scheme includes skipping subtasks, replacing the target agent, adjusting the logical dependencies between the remaining subtasks or inserting new error correction subtasks. S62, Update the first task diagram according to the first task adjustment scheme, and generate the updated first task diagram; S63, return to step S3 based on the updated first task graph, until no replanning operation is triggered.
8. The hierarchical multi-agent task allocation method according to claim 1, characterized in that, S6 includes the following steps: The task execution results of all target agents that do not trigger replanning operations are integrated according to their corresponding serial execution order to form the target execution result.
9. A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores at least one instruction or at least one program, characterized in that, The at least one instruction or the at least one program segment is loaded and executed by the processor to implement the hierarchical multi-agent task allocation method as described in any one of claims 1-8.
10. An electronic device, characterized in that, Includes a processor and the non-transitory computer-readable storage medium as described in claim 9.