Task planning and execution generation method and device, electronic equipment and storage medium
By constructing multi-dimensional dynamic task context information and a multi-agent collaborative mechanism, the task execution graph is dynamically adjusted, realizing the transformation from static planning to adaptive planning. This improves the execution efficiency and content quality of complex generated tasks and solves the problems of insufficient reliability of collaborative decision-making and limited exception handling capabilities in existing systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEISEN CLOUD COMPUTING CO LTD
- Filing Date
- 2026-03-16
- Publication Date
- 2026-06-19
AI Technical Summary
Existing intelligent generation systems suffer from insufficient task decomposition capabilities, high coupling between planning and execution, lack of in-depth decision-making mechanisms for multi-capability collaboration, coarse-grained context management, and insufficient exception handling capabilities when faced with complex generation tasks. This results in insufficient reliability of static task planning and collaborative decision-making, as well as limited exception handling capabilities.
By constructing multi-dimensional dynamic task context information, generating task execution graphs using planning agents, generating candidate execution schemes by combining multi-agent collaborative mechanisms, and monitoring feedback information in real time, the graph structure or content is dynamically adjusted. Non-blocking deviations are corrected, and self-healing operations are performed for blocking faults, achieving high robustness and self-repair.
It significantly improves the reliability and efficiency of collaborative decision-making in complex tasks, enhances content quality and success rate, solves the problem of resource redundancy or information loss caused by imprecise context management, and ensures standardized output.
Smart Images

Figure CN122243049A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, and in particular to a method, apparatus, electronic device, and storage medium for generating task planning and execution. Background Technology
[0002] With the development of large-scale language models, multimodal models, and intelligent agent technologies, artificial intelligence systems have been widely applied in content generation, task automation, and intelligent decision support. Existing intelligent generation systems typically employ a single intelligent agent or a single-model chain-calling approach to complete the entire process from task understanding and planning to execution and output.
[0003] However, when faced with complex generation tasks, existing technologies have gradually revealed the following shortcomings: 1. Insufficient task decomposition capability. A single intelligent agent struggles to effectively decompose complex tasks involving multiple objectives, constraints, or stages of logic.
[0004] 2. Task planning and execution are highly coupled. The planning process is neither interpretable nor reusable, and the execution phase is difficult to dynamically adjust.
[0005] 3. Lack of deep decision-making mechanisms for multi-ability collaboration. The allocation of executive agents is usually based on simple rules or scoring, lacking collaborative verification among multiple agents.
[0006] 4. Coarse-grained context management. Simply piecing together context can easily lead to information redundancy, interference, or target deviation.
[0007] 5. Insufficient exception handling capabilities. Existing systems typically only support simple retries and cannot pinpoint the root cause of exceptions, leading to repeated failures.
[0008] In summary, traditional intelligent generation systems suffer from technical problems when faced with complex generation tasks, including static task planning, insufficient reliability of collaborative decision-making, and limited ability to handle anomalies. Summary of the Invention
[0009] In view of this, the purpose of the present invention is to provide a method, apparatus, electronic device and storage medium for generating task planning and execution, so as to alleviate the technical problems of insufficient reliability of static task planning and collaborative decision-making and limited ability to handle anomalies in traditional intelligent generation systems when facing complex generation tasks.
[0010] In a first aspect, the present invention provides a method for generating task planning and execution, comprising: Parse user-generated tasks and construct task context information that includes task intent, constraints, and output specifications; Based on the task context information, the planning agent decomposes the user-generated task into multiple sub-tasks with dependencies, generating a task execution graph. For the subtasks to be executed in the task execution graph, multiple candidate execution schemes are generated through a multi-agent collaborative mechanism, and the consistency of the candidate execution schemes is evaluated based on the task context information. The target execution scheme is determined and executed based on the evaluation results. During the execution of subtasks, the execution status is monitored in real time and feedback information is collected; If the feedback information indicates that the current execution path deviates from the expected path but no blocking failure occurs, the structure or content of the task execution graph is dynamically adjusted, and subsequent subtasks are executed according to the adjusted graph. If the feedback information indicates a blocking fault, a self-healing operation is performed based on the root cause of the fault to restore the execution process; Aggregate the execution results of all subtasks to generate the final content that conforms to the output specifications.
[0011] Furthermore, the user-generated task is parsed to construct task context information containing task intent, constraints, and output specifications, including: Initialize a multidimensional context space, wherein the multidimensional context space includes at least: a global intent context for storing the core objectives of the task, a local state context for storing the real-time execution state of subtasks, and a transient tool context for storing temporary data of external tool interactions; Extract the semantic features of the user-generated task, generate a global intent vector, and load it into the global intent context; The restrictive descriptions in the user-generated task are parsed to form a set of hard constraints. After the set of hard constraints is parameterized, it is loaded into the global intent context. The set of hard constraints includes: format constraints, content taboos, and resource restrictions. Define the final presentation format of the content and generate an output specification template, which is then loaded into the global intent context. A context routing mechanism is established. For each subtask in the task execution graph, the target context dimension is dynamically selected from the multidimensional context space according to its task type through the context routing function. Nonlinear injection is performed using at least one of key feature extraction, structured summarization or constraint parameterization to generate a simplified context instance dedicated to the subtask. During the execution of a subtask, the execution status data is updated in real time to the local state context, and the simplified context instance dedicated to each subtask is dynamically updated according to the context routing mechanism. The task context information includes the full data of the multidimensional context space, as well as the simplified context instance dedicated to each subtask dynamically derived from the multidimensional context space during the execution phase.
[0012] Furthermore, the task execution graph is represented using a directed acyclic graph. Based on the task context information, a planning agent decomposes the user-generated task into multiple sub-tasks with dependencies to generate the task execution graph, including: Identify data dependencies and control dependencies among the multiple subtasks; Each of the subtasks is mapped to a node in the directed acyclic graph, and the data dependencies and control dependencies are mapped to directed edges between nodes; Label each node with its execution priority, task type, and required agent capabilities.
[0013] Furthermore, multiple candidate execution schemes are generated through a multi-agent collaborative mechanism, and a consistency evaluation of the candidate execution schemes is performed based on the task context information, including: N candidate execution agents are selected. Based on the task type of the subtask to be executed, the context routing function is called to distribute the corresponding simplified context instance as the baseline input to each candidate execution agent. Each candidate execution agent is controlled to generate an execution plan simulation for the subtask to be executed without actually calling external tools. The execution plan simulation includes: a planned sequence of actions and a description of the expected results. An intelligent monitoring agent is introduced to perform multi-dimensional consistency checks on multiple execution schemes based on the task context information. The multi-dimensional consistency checks include at least the following: Calculate the consistency between the target understanding of each execution scheme pre-simulation and the global intent vector in the task context information; Calculate the consistency of constraint coverage between the pre-execution schemes and the set of hard constraints; Calculate the consistency of execution logic between each of the aforementioned execution schemes; The proportion of execution schemes that meet the above multi-dimensional consistency checks is statistically analyzed. When the quantity ratio reaches a preset ratio threshold, the multi-dimensional consistency check is deemed to have passed, and the subtask to be executed is authorized to enter the actual execution stage. When the quantity ratio does not reach the preset ratio threshold, the process is replanned or the candidate execution agents are reassigned.
[0014] Furthermore, the feedback information includes: execution result, confidence score, constraint satisfaction flag, and uncertainty flag; if the feedback information indicates that the current execution path deviates from expectations but no blocking failure occurs, specifically, it means that any of the following dynamic correction trigger conditions are met: The semantic deviation calculated based on the execution result exceeds the preset allowable range; The confidence score is lower than the preset confidence threshold; The constraint satisfaction flag indicates that a constraint in the set of hard constraints is not satisfied. The uncertainty flag indicates the presence of uncertainty.
[0015] Furthermore, the structure or content of the task execution graph is dynamically adjusted, and subsequent subtasks are executed based on the adjusted graph, including: Locate the abnormal subtask node that causes the deviation from the expected result and determine its abnormality type, wherein the abnormality type includes: incomplete result type, incorrect dependency type, and unreasonable planning granularity type; Perform the corresponding graph correction operation based on the anomaly type: If the result is incomplete, instantiate one or more compensation subtasks to supplement missing information or verify intermediate results, and insert the compensation subtasks after the abnormal subtask node. If the dependency relationship is incorrect, the connection relationship between the relevant nodes in the task execution graph is adjusted to correct the incorrect dependency path; If the planning granularity is unreasonable, the abnormal subtask node will be split into multiple fine-grained subtask nodes with serial or parallel relationships. Based on the adjusted map generated after performing the above map correction operation, identify the local sub-maps affected by the correction operation; Only the local subgraph is re-topologically sorted to generate an updated execution sequence, and subsequent subtasks are scheduled according to the updated execution sequence.
[0016] Furthermore, the disruptive faults include: execution failure, verification failure, or confidence level below a preset threshold; self-healing operations are performed based on the root cause of the fault to restore the execution flow, including: Collect failure evidence of the occurrence of the aforementioned blocking failure, wherein the failure evidence includes at least: the number of consecutive failures, the difference in matching degree between the agent's capability label and the subtask requirement label, and the response status code of the external tool; Based on the failure evidence and the task context information, causal inference is performed, and the root cause of the failure is classified into one of the following preset failure types: Planning logic error: The judgment is based on the failure evidence indicating that there is a conflict in the node dependency relationship in the task execution graph, or based on the remaining task set in the task context information, the execution path is determined to be unreachable; Mismatch in agent capabilities: The determination criteria are that the difference in matching degree is lower than a preset matching threshold, or in a scenario involving the parallel execution of multiple agents, the consistency score of the output results of each agent is lower than a preset consistency threshold. External tool error: The determination is based on the response status code indicating a failed call, or the tool response time exceeding a preset timeout threshold; Based on the identified fault type, execute the corresponding self-healing strategy: If the error is classified as a planning logic error, a planning rollback operation is performed, and based on the completed sub-task results and the set of remaining unexecuted sub-tasks contained in the task context information, the local topology of the task execution graph is reconstructed to generate a corrected local execution sequence. If the problem is classified as a mismatch in agent capabilities, then based on the difference in matching degree, the system dynamically switches from the agent registration center to a backup agent with the appropriate capability tag to take over the execution, and redistributes the subtasks based on the task context information. If the error is classified as an external tool exception, then based on the response status code, a tool hot-swapping will be performed to call the backup interface, or a delayed retry and degraded execution strategy will be initiated.
[0017] Secondly, the present invention also provides a task planning and execution generation apparatus, comprising: The parsing and construction unit is used to parse user-generated tasks and construct task context information that includes task intent, constraints, and output specifications. The decomposition and generation unit is used to decompose the user-generated task into multiple sub-tasks with dependencies based on the task context information and using a planning agent to generate a task execution graph. The generation and evaluation unit is used to generate multiple candidate execution schemes for the sub-tasks to be executed in the task execution graph through a multi-agent collaborative mechanism, perform consistency evaluation on the candidate execution schemes based on the task context information, determine the target execution scheme based on the evaluation results, and drive the execution. The real-time monitoring and data acquisition unit is used to monitor the execution status and collect feedback information in real time during the execution of subtasks. The dynamic adjustment unit is used to dynamically adjust the structure or content of the task execution graph if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, and to continue to execute subsequent sub-tasks according to the adjusted graph. The self-healing operation unit is used to perform a self-healing operation based on the root cause of the fault to restore the execution process if the feedback information indicates that a blocking fault has occurred. The aggregation unit is used to aggregate the execution results of all subtasks and generate the final content that conforms to the output specification.
[0018] Thirdly, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in the first aspect.
[0019] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method described in the first aspect.
[0020] This invention provides a method for generating task planning and execution, comprising: parsing a user-generated task and constructing task context information including task intent, constraints, and output specifications; based on the task context information, using a planning agent to decompose the user-generated task into multiple sub-tasks with dependencies, generating a task execution graph; for the sub-tasks to be executed in the task execution graph, generating multiple candidate execution schemes through a multi-agent collaborative mechanism, and performing a consistency evaluation on the candidate execution schemes based on the task context information, determining the target execution scheme based on the evaluation results and driving execution; during the execution of sub-tasks, monitoring the execution status in real time and collecting feedback information; if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, dynamically adjusting the structure or content of the task execution graph, and continuing to execute subsequent sub-tasks based on the adjusted graph; if the feedback information indicates that a blocking failure occurs, performing a self-healing operation based on the root cause of the failure to restore the execution process; and aggregating the execution results of all sub-tasks to generate final content that conforms to the output specifications. As described above, the task planning and execution generation method of the present invention achieves a transformation from static planning to dynamic adaptive planning by constructing dynamic task context information containing multiple dimensions and combining it with the task execution graph generated by the planning agent. It utilizes a multi-agent collaborative mechanism to generate candidate execution schemes and introduces consistency evaluation, significantly improving the reliability and accuracy of collaborative decision-making under complex tasks. By monitoring feedback in real time during sub-task execution, it dynamically adjusts the task execution graph structure for non-blocking deviations and performs self-healing operations based on root causes for blocking faults, effectively overcoming the limitations of traditional systems' anomaly handling capabilities and achieving high robustness and self-repair of the execution process. Simultaneously, the refined context management and dynamic routing mechanism ensure that each sub-task obtains accurate context support, solving the problem of resource redundancy or information loss caused by imprecise context management. Ultimately, while ensuring output standardization, it significantly improves the execution efficiency, success rate, and content quality of complex generation tasks, alleviating the technical problems of insufficient reliability in static task planning and collaborative decision-making, and limited anomaly handling capabilities in traditional intelligent generation systems when facing complex generation tasks. Attached Figure Description
[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 A flowchart illustrating a task planning and execution generation method provided in an embodiment of the present invention; Figure 2 A schematic diagram of a task planning and execution generation device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0023] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. 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.
[0024] Traditional intelligent generation systems suffer from insufficient reliability in static task planning and collaborative decision-making, as well as limited ability to handle anomalies when faced with complex generation tasks.
[0025] Based on this, the task planning and execution generation method of the present invention realizes the transformation from static planning to dynamic adaptive planning by constructing dynamic task context information containing multiple dimensions and combining it with the task execution graph generated by the planning agent; by using a multi-agent collaborative mechanism to generate candidate execution schemes and introducing consistency evaluation, the reliability and accuracy of collaborative decision-making under complex tasks are significantly improved; by monitoring feedback in real time during the execution of sub-tasks, the task execution graph structure is dynamically adjusted for non-blocking deviations and self-healing operations are performed based on root causes for blocking faults, effectively overcoming the shortcomings of the limited anomaly handling capabilities of traditional systems and achieving high robustness and self-repair of the execution process; at the same time, the refined context management and dynamic routing mechanism ensure that each sub-task obtains accurate context support, solving the problem of resource redundancy or information loss caused by imprecise context management, and finally, while ensuring output standardization, significantly improving the execution efficiency, success rate and content quality of complex generation tasks.
[0026] To facilitate understanding of this embodiment, a task planning and execution generation method disclosed in this embodiment will first be described in detail.
[0027] Example 1: According to an embodiment of the present invention, an embodiment of a task planning and execution generation method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0028] Figure 1 This is a flowchart of a task planning and execution generation method according to an embodiment of the present invention, such as... Figure 1As shown, the method includes the following steps: Step S102: Parse the user-generated task and construct task context information containing task intent, constraints, and output specifications; Step S104: Based on task context information, the planning agent decomposes the user-generated task into multiple sub-tasks with dependencies, and generates a task execution graph. Step S106: For the sub-tasks to be executed in the task execution graph, multiple candidate execution schemes are generated through a multi-agent collaboration mechanism, and the consistency of the candidate execution schemes is evaluated based on the task context information. The target execution scheme is determined and executed based on the evaluation results. Specifically, the target execution plan is the candidate execution plan that passes the consistency assessment among the candidate execution plans.
[0029] Step S108: During the execution of the subtask, monitor the execution status in real time and collect feedback information; Step S110: If the feedback information indicates that the current execution path deviates from the expected path but no blocking failure has occurred, then the structure or content of the task execution graph is dynamically adjusted, and subsequent sub-tasks are executed according to the adjusted graph. Step S112: If the feedback information indicates that a blocking fault has occurred, then perform a self-healing operation based on the root cause of the fault to restore the execution process. Step S114: Aggregate the execution results of all subtasks to generate the final content that conforms to the output specifications.
[0030] This invention provides a method for generating task planning and execution, comprising: parsing a user-generated task and constructing task context information including task intent, constraints, and output specifications; based on the task context information, using a planning agent to decompose the user-generated task into multiple sub-tasks with dependencies, generating a task execution graph; for the sub-tasks to be executed in the task execution graph, generating multiple candidate execution schemes through a multi-agent collaborative mechanism, and performing a consistency evaluation on the candidate execution schemes based on the task context information, determining the target execution scheme based on the evaluation results and driving execution; during the execution of sub-tasks, monitoring the execution status in real time and collecting feedback information; if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, dynamically adjusting the structure or content of the task execution graph, and continuing to execute subsequent sub-tasks based on the adjusted graph; if the feedback information indicates that a blocking failure occurs, performing a self-healing operation based on the root cause of the failure to restore the execution process; and aggregating the execution results of all sub-tasks to generate final content that conforms to the output specifications. As described above, the task planning and execution generation method of the present invention achieves a transformation from static planning to dynamic adaptive planning by constructing dynamic task context information containing multiple dimensions and combining it with the task execution graph generated by the planning agent. It utilizes a multi-agent collaborative mechanism to generate candidate execution schemes and introduces consistency evaluation, significantly improving the reliability and accuracy of collaborative decision-making under complex tasks. By monitoring feedback in real time during sub-task execution, it dynamically adjusts the task execution graph structure for non-blocking deviations and performs self-healing operations based on root causes for blocking faults, effectively overcoming the limitations of traditional systems' anomaly handling capabilities and achieving high robustness and self-repair of the execution process. Simultaneously, the refined context management and dynamic routing mechanism ensure that each sub-task obtains accurate context support, solving the problem of resource redundancy or information loss caused by imprecise context management. Ultimately, while ensuring output standardization, it significantly improves the execution efficiency, success rate, and content quality of complex generation tasks, alleviating the technical problems of insufficient reliability in static task planning and collaborative decision-making, and limited anomaly handling capabilities in traditional intelligent generation systems when facing complex generation tasks.
[0031] The above provides a brief overview of the task planning and execution generation method of the present invention. The specific details involved are described in detail below.
[0032] In an optional embodiment of the present invention, parsing the user-generated task and constructing task context information including task intent, constraints, and output specifications specifically includes the following steps: (1) Initialize the multidimensional context space, wherein the multidimensional context space includes at least: the global intent context for storing the core objective of the task, the local state context for storing the real-time execution state of the subtask, and the transient tool context for storing temporary data of external tool interactions; (2) Extract the semantic features of the user-generated task, generate a global intent vector and load it into the global intent context; (3) Parse the restrictive descriptions in the user-generated task to form a set of hard constraints, and load the set of hard constraints into the global intent context after parameterizing the constraints. The set of hard constraints includes: format constraints, content taboos and resource restrictions. (4) Define the final presentation format of the content and generate an output specification template to load into the global intent context; (5) Establish a context routing mechanism. For each subtask in the task execution graph, the target context dimension is dynamically selected from the multi-dimensional context space according to its task type through the context routing function. At least one of the following methods is used for nonlinear injection: key feature extraction, structured summarization or constraint parameterization, to generate a simplified context instance dedicated to the subtask. Specifically, in the process of establishing the context routing mechanism described above, the subtask in each subtask of the task execution graph refers to the subtask to be executed. The process of generating the simplified context instance dedicated to the subtask can be as follows: identify the task type label of the subtask to be executed, where the task type label represents the functional attribute of the subtask; determine the target context dimension that matches the task type label based on the preset "task type-context dimension" mapping relationship, where the target context dimension is a subset of the global intent context, local state context, and transient tool context; extract only the context data belonging to the target context dimension from the multi-dimensional context space; perform nonlinear injection on the extracted context data using at least one of the following methods: key feature extraction, structured summarization, or constraint parameterization (specifically, at least one of the following methods can be used to compress and reorganize the selected context data) to generate a simplified context instance dedicated to the subtask.
[0033] Key feature extraction: High-weight tokens are extracted using TF-IDF or Attention mechanisms.
[0034] Structured summaries: Convert long text into JSON or key-value pairs.
[0035] Constraint parameterization: Transforms natural language constraints into Boolean logic or regular expressions.
[0036] (6) During the execution of a subtask, the execution status data is updated to the local state context in real time, and the simplified context instance dedicated to each subtask is dynamically updated according to the context routing mechanism. The task context information includes the full data of the multidimensional context space, as well as the simplified context instance dedicated to each subtask dynamically derived from the multidimensional context space during the execution phase.
[0037] The above process will be further described below: Multidimensional context information routing and injection mechanism The system divides the context into: ContextSpace = { GlobalIntentContext, LocalTaskStateContext, TransientToolContext } For different task types and subtasks, the required context dimension (i.e. target context dimension) is selected through a context routing function, and non-linear injection is performed using key feature extraction, structured summarization, and constraint parameterization to avoid context inflation caused by simple splicing.
[0038] In an optional embodiment of the present invention, the task execution graph is represented by a directed acyclic graph. Based on task context information, a planning agent decomposes the user-generated task into multiple sub-tasks with dependencies to generate the task execution graph. Specifically, the steps include: (1) Identify data dependencies and control dependencies among multiple subtasks; (2) Map each subtask to a node in a directed acyclic graph, and map data dependencies and control dependencies to directed edges between nodes; Specifically, user-generated tasks can be formally represented as follows:
[0039] in: : A set of subtasks; : Set of subtask dependencies Based on the dependencies, a directed acyclic graph (DAG) is constructed to obtain the initial task execution graph.
[0040] (3) Label each node with execution priority, task type label and required agent capability label.
[0041] Specifically, based on the semantic features of the subtask and its position in the dependency chain, the execution priority is labeled for each node; according to the tool type and processing modality required by the subtask, the agent capability label is labeled for each node. The label is used to match the execution agent with the corresponding skills in the subsequent execution stage.
[0042] In an optional embodiment of the present invention, multiple candidate execution schemes are generated through a multi-agent cooperative mechanism, and the consistency of the candidate execution schemes is evaluated based on task context information, specifically including the following steps: (1) Select N candidate execution agents, and according to the task type of the subtask to be executed, call the context routing function to distribute the corresponding simplified context instance as the baseline input to each candidate execution agent; (2) Control each candidate execution agent to generate an execution plan simulation for the subtask to be executed without actually calling external tools. The execution plan simulation includes: the planned action sequence and the description of the expected results; The above-mentioned execution plan simulation is the candidate execution plan.
[0043] (3) Introduce a monitoring agent to perform multi-dimensional consistency verification on multiple execution schemes based on task context information. The multi-dimensional consistency verification includes at least the following: Calculate the consistency between the target understanding of each execution plan simulation and the global intent vector in the task context information; Calculate the consistency of constraint coverage between the pre-execution scenarios and the set of hard constraints; Calculate the consistency of execution logic between each execution plan; Specifically, the task context information mentioned above in the multi-dimensional consistency verification of multiple execution schemes based on task context information refers to the global intent vector and the set of hard constraints.
[0044] (4) Statistically calculate the proportion of execution schemes that meet the above multi-dimensional consistency checks; (5) When the quantity ratio reaches the preset ratio threshold, the multi-dimensional consistency verification is deemed to have passed, and the subtask to be executed is authorized to enter the actual execution stage; Specifically, candidate execution agents corresponding to candidate execution schemes that pass multi-dimensional consistency verification are selected to enter the actual execution phase.
[0045] (6) When the quantity ratio does not reach the preset ratio threshold, trigger the replanning process or reallocate candidate execution agents.
[0046] Specifically, if the consistency assessment fails (i.e. the number ratio does not reach the preset ratio threshold), the scheme iteration mechanism is triggered, and the specific dimensions of inconsistency are fed back to the candidate execution agent, requiring the regeneration of the execution scheme simulation. If the regenerated execution scheme simulation still fails the consistency assessment within a preset number of times, the planning rollback mechanism is triggered, returning to the previous level subtask or calling the planning agent again to break down the current subtask.
[0047] The above process will be explained in more detail below: Execution scheme confirmation mechanism based on multi-agent collaborative consensus: Perform topological sorting on the DAG to generate a sequence of subtasks to be executed, supporting both sequential and parallel scheduling.
[0048] Before the subtask is officially executed, the system selects multiple candidate execution agents to generate execution plans for the same subtask in a pre-simulation.
[0049] The system is configured with a monitoring agent to perform consistency evaluations on multiple execution plans, including: Consistency in understanding the objectives; Constraint coverage consistency; Consistency in execution logic; Only when the proportion of consistent solutions reaches a preset threshold is the actual execution phase allowed; otherwise, replanning or reallocation of execution agents is triggered.
[0050] In an optional embodiment of the present invention, the feedback information includes: execution result, confidence score, constraint satisfaction flag, and uncertainty flag; if the feedback information indicates that the current execution path deviates from expectations but no blocking failure occurs, specifically, it means that any of the following dynamic correction triggering conditions are met: The semantic deviation calculated based on the execution results exceeds the preset allowable range; The confidence score is lower than the preset confidence threshold; The constraint satisfaction flag indicates that constraints in the set of hard constraints are not satisfied. The uncertainty indicator signifies the presence of uncertainty.
[0051] Specifically, a dynamic task planning and correction mechanism based on execution feedback: During the subtask execution phase, each executing agent returns the following execution feedback information after completing the subtask: ExecutionFeedback = { Result, ConfidenceScore Constraint Satisfaction UncertaintyFlag } Dynamic programming correction is triggered when any of the following conditions are met: ConfidenceScore below the threshold ConstraintSatisfaction is no UncertaintyFlag is true The aforementioned uncertainty refers to the fact that the confidence level of the model's self-assessment fluctuates beyond a preset range, or the difference in output results of different execution paths exceeds a preset threshold.
[0052] In an optional embodiment of the present invention, the structure or content of the task execution graph is dynamically adjusted, and subsequent subtasks are executed based on the adjusted graph. Specifically, this includes the following steps: (1) Locate the abnormal subtask node that causes the deviation from the expectation and determine its abnormal type. The abnormal types include: incomplete result type, incorrect dependency type, and unreasonable planning granularity type. (2) Perform the corresponding graph correction operation according to the anomaly type: If the result is incomplete, instantiate one or more compensation subtasks to supplement missing information or verify intermediate results, and insert the compensation subtasks after the abnormal subtask node. If the dependency error is the cause, adjust the connections between relevant nodes in the task execution graph to correct the incorrect dependency path. If the planning granularity is unreasonable, the abnormal subtask node will be split into multiple fine-grained subtask nodes with serial or parallel relationships. (3) Based on the adjusted map generated after performing the above map correction operation, identify the local sub-maps affected by the correction operation; (4) Only perform topological sorting on the local subgraph to generate an updated execution sequence, and schedule subsequent subtasks according to the updated execution sequence.
[0053] Specifically, the correction process includes: locating abnormal subtask nodes, determining the type of abnormality (incomplete planning granularity, dependencies, or results), inserting compensating subtasks, adjusting the local topology of the DAG or splitting subtasks, generating a corrected task planning model (P'), and reordering only the subgraphs. This mechanism upgrades task planning from a static structure to an execution-time correctable structure.
[0054] In an optional embodiment of the present invention, the blocking fault includes: execution failure, verification failure, or confidence level below a preset threshold; and a self-healing operation is performed based on the root cause of the fault to restore the execution flow, specifically including the following steps: (1) Collect failure evidence of the occurrence of blocking failure, wherein the failure evidence includes at least: the number of consecutive failures, the difference in matching degree between the agent's capability label and the subtask requirement label, and the response status code of the external tool; (2) Based on failure evidence and task context information, causal inference is performed, and the root cause of the failure is classified into one of the following preset failure types: Planning logic error: The judgment is based on failure evidence indicating a conflict in the node dependencies in the task execution graph, or on the determination that the execution path is unreachable based on the set of remaining tasks in the task context information; Mismatch in agent capabilities: The determination criteria are that the difference in matching degree is lower than the preset matching threshold, or in scenarios involving parallel execution of multiple agents, the consistency score of the output results of each agent is lower than the preset consistency threshold. External tool error: The determination is based on the response status code indicating that the call failed, or the tool response time exceeding the preset timeout threshold; (3) Based on the identified fault type, execute the corresponding self-healing strategy: If the error is classified as a planning logic error, a planning rollback operation is performed, and the local topology of the task execution graph is reconstructed based on the results of completed subtasks and the set of remaining unexecuted subtasks contained in the task context information, generating a corrected local execution sequence. If the problem is classified as a mismatch in agent capabilities, the system will dynamically switch from the agent registry center to a backup agent with the appropriate capability tag to take over the execution based on the difference in matching degree, and redistribute the subtasks according to the task context information. If the error is classified as an external tool exception, then based on the response status code, perform a tool hot-swap to call the backup interface, or initiate a delayed retry and degradation execution strategy.
[0055] Specifically, the above execution failure refers to the subtask being completely unable to be completed at the physical or logical level, causing the process to be interrupted. The above verification failure refers to the subtask "completing" and producing a result, but the result does not conform to the preset rules, format, or hard constraints. The above confidence level being lower than the preset threshold refers to the subtask executing successfully and the result conforming to the format, but the system (or the agent itself) is "unsure" about the correctness of the result.
[0056] The execution monitoring and causal repair mechanism with self-healing capabilities is as follows: The system performs causal classification for execution exceptions: FailureType ∈{ PlanningError, AgentMismatchError, ExternalToolError } And execute the corresponding self-healing strategy:
[0057] This mechanism avoids simple repetitive failures and achieves self-healing control of the execution process.
[0058] The method of the present invention will be described below through specific application scenarios: AI introductory course generation for beginners 1. Application Scenarios and Task Initialization This embodiment is applied to the scenario of intelligent education content generation. The user input command is: "Generate an introductory artificial intelligence course for beginners, including a course outline, explanation of core concepts, case examples, and exercises; the language should be easy to understand, and each chapter should be no less than 800 words." The system first executes the step of "parsing the user-generated task and constructing the task context information," which is implemented as follows: Initialize the multidimensional context space: The system constructs a context storage space with three dimensions: Global Intent Context ( The storage task's core objectives (course generation), style constraints (easy-to-understand language), and resource limitations are defined.
[0059] Local state context ( ): Initially empty, used to store the real-time execution status of subtasks and a summary of completed content.
[0060] Transient tool context ( ): Used to store temporary data returned by external retrieval tools (such as the latest AI terminology definitions).
[0061] Constructing a set of hard constraints: Parsing the restrictive descriptions in user instructions to form a set of hard constraints. .in: The output format is Markdown; Content restrictions (no obscure terminology), word count restrictions (each chapter ≥ 800 words); The system generates a time limit. It parameterizes the above constraints, for example, converting "each chapter must have at least 800 words" into a computable logical judgment function Len(text)≥800, and loads it into the system. .
[0062] Define output specifications: Generate a structured template for Markdown documents and load them. .
[0063] 2. Task decomposition and execution graph construction Based on the aforementioned task context information, the system utilizes a planning agent to break down user tasks into dependent subtasks, generating a task execution graph: Graphical representation: Directed acyclic graphs are used. Characterization.
[0064] Node mapping: Overall Course Structure and Chapter Outline (Task Type: Structure Planning); Explanation of core concepts (Task type: Content generation); Example Case (Task Type: Content Generation); Exercise generation (task type: content generation).
[0065] Edge mapping: Identifies data dependencies and control dependencies. For example, All depend on The output (outline) is thus established by creating directed edges. .
[0066] Node labeling: Label each node with execution priority, task type label (such as "content generation"), and required agent capability label (such as "education expert" or "logic verification").
[0067] 3. Multi-agent cooperation and consensus assessment For the subtask to be executed (Explanation of core concepts), the system implements a multi-agent collaborative mechanism: Candidate Solution Preview: Selection Candidate execution agents .
[0068] Context injection: Invoking the context routing function, based on... The "content generation" task type is selected from a multi-dimensional context space. (Global constraints) and some (Outline Summary), generated via non-linear injection (using a structured summarization method). Dedicated Simplified Context Instance .
[0069] Preview generation: control Without actually calling external tools, based on Generate execution plan rehearsal Each rehearsal includes a planned sequence of actions and a description of the expected results.
[0070] Invigilation and Consistency Verification: An invigilation agent is introduced to perform multi-dimensional consistency verification of the pre-performance based on the global intent context and set of hard constraints.
[0071] Computational goal understanding consistency: Does the rehearsal cover global intent vector features such as "beginner" and "core concepts"?
[0072] Computational constraint coverage consistency: Does the pre-run plan include a word count check step (satisfying the requirement)? ).
[0073] Calculate the consistency of execution logic: whether the logic of the three pre-rendered action sequences conflicts.
[0074] Consensus determination formula: The system counts the proportion R of pre-runs that satisfy all verifications, and the calculation formula is as follows:
[0075] Explanation of the physical meaning of the parameters: N: The total number of candidate agents (3 in this example).
[0076] : Preview of the execution plan generated by the i-th candidate agent.
[0077] : Global intent context, containing the core objective vector of the task.
[0078] H: A set of hard constraints, including format, content, and resource limitations.
[0079] : Consistent predicate function. When Simultaneously satisfy and If the target understanding is consistent with the constraint coverage of H, and is consistent with other pre-drilled logic, return 1; otherwise, return 0.
[0080] : Indicator function, returns 1 if the condition is true, otherwise returns 0.
[0081] R: The proportion of the consensus scheme, ranging from [0,1].
[0082] Decision logic: Set a preset ratio threshold of 0.67. If R reaches 0.67, the verification is passed, and A1 (or the agent with the highest number of votes) is authorized to enter the actual execution phase; otherwise, a replanning or replacement of the agent is triggered.
[0083] 4. Dynamic monitoring and map adjustment During the execution of subtasks, the system monitors the execution status in real time and collects feedback information: Feedback information collection: hypothetical subtask (Example Case) After execution, feedback information is returned. .
[0084] : The generated case text.
[0085] Confidence score (model self-evaluation).
[0086] Constraint satisfaction flag (checks whether the word count and accessibility are satisfied).
[0087] Uncertainty indicator.
[0088] Deviation from Expectations Judgment: If any of the following dynamic correction trigger conditions are met, the condition is determined to be "deviation from expectations but no blocking fault has occurred": semantic deviation (Exceeding the preset allowable range); (Below the preset confidence threshold, for example, 0.7); (Hard constraints were not met, such as insufficient word count); (This indicates uncertainty, specifically defined as: the confidence level of the model's self-assessment fluctuates beyond a preset range, or the difference in results between different execution paths exceeds a preset threshold.)
[0089] Dynamically adjust execution: Assuming that a detection is made... The generated cases and Inconsistent core concept terminology (belonging to dependency error or incomplete result anomaly): Location anomaly: Locked node .
[0090] Graph Correction: Instantiate a Compensation Subtask ("Case and Concept Consistency Verification and Repair"), insert it into Then, establish dependency edges. and .
[0091] Local reordering: only affects the local subgraphs. Re-sort the topology, generate an updated execution sequence, and schedule. implement.
[0092] Dynamically modify the trigger and execution formula:
[0093] Explanation of the physical meaning of the parameters: : Boolean variable, a true value indicates that dynamic correction is triggered. : Preset reliability threshold. Constraint satisfaction flag (1 for satisfied, 0 for not satisfied). Uncertainty indicator (1 indicates uncertainty, 0 indicates certainty).
[0094] G: Original task execution graph.
[0095] : Abnormal subtask nodes that cause deviations from expectations.
[0096] : Anomaly type enumeration values (incomplete result type, incorrect dependency type, unreasonable planning granularity type).
[0097] G': The adjusted task execution graph, which includes newly added compensation nodes or corrected dependency edges.
[0098] 5. Self-healing of blocking faults (alternative path) If, during the execution of a subtask, the external tool fails to execute three consecutive times (more than two consecutive failures), and the response status code is 503: Fault classification: Based on the evidence of failure, it is inferred that the external tool is abnormal.
[0099] Self-healing strategy: Perform hot switching of execution tools and automatically call backup API interfaces; if the backup interface is unavailable, start the degraded execution strategy (use local knowledge base to generate content and mark it as requiring manual review) to restore the execution process.
[0100] 6. Results Aggregation After all subtasks (including dynamically inserted compensation tasks) have been completed, the system aggregates the execution results and, based on... The output specification template defined in the document is used to generate the final Markdown format AI introductory course document, ensuring consistent terminology, complete structure, and compliance with word count requirements.
[0101] This is just one example of the application scenario mentioned above. It can also be used for multimodal marketing generation, code generation, enterprise policy generation, etc., which will not be introduced one by one here.
[0102] Compared with the prior art, the present invention has at least the following beneficial effects: Enables dynamic adjustment of task planning; Enhance the depth and reliability of multi-agent collaboration; Significantly improves the accuracy of context management; It possesses the ability to locate abnormal causes and self-heal. The project is highly feasible and has a wide range of applications.
[0103] Main protection points: Protection Point 1: A dynamic task planning mechanism that can be corrected during the execution period; Protection Point 2: Multi-agent collaborative consensus confirmation mechanism before execution; Protection Point 3: Multidimensional Context Information Routing and Nonlinear Injection Mechanism; Protection Point 4: A self-healing execution monitoring mechanism with causal localization capabilities; Protection Point 5 (Combined Type): The synergistic effect of the above four mechanisms in the same generation process.
[0104] Example 2: This invention also provides a task planning and execution generation device, which is mainly used to execute the task planning and execution generation method provided in Embodiment 1 of this invention. The task planning and execution generation device provided in this invention will be described in detail below.
[0105] Figure 2 This is a schematic diagram of a task planning and execution generation device according to an embodiment of the present invention, such as... Figure 2 As shown, the device mainly includes: a parsing and construction unit 10, a disassembly and generation unit 20, a generation and evaluation unit 30, a real-time monitoring and acquisition unit 40, a dynamic adjustment unit 50, a self-healing operation unit 60, and an aggregation unit 70, wherein: The parsing and construction unit is used to parse user-generated tasks and construct task context information that includes task intent, constraints, and output specifications. The decomposition and generation unit is used to decompose user-generated tasks into multiple sub-tasks with dependencies based on task context information and using a planning agent to generate a task execution graph. The generation and evaluation unit is used to generate multiple candidate execution schemes for the sub-tasks to be executed in the task execution graph through a multi-agent collaborative mechanism, and to perform consistency evaluation on the candidate execution schemes based on task context information. Based on the evaluation results, the target execution scheme is determined and the execution is driven. The real-time monitoring and data acquisition unit is used to monitor the execution status and collect feedback information in real time during the execution of subtasks. The dynamic adjustment unit is used to dynamically adjust the structure or content of the task execution graph if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, and to continue to execute subsequent subtasks according to the adjusted graph. The self-healing operation unit is used to perform self-healing operations to restore the execution process based on the root cause of the fault if the feedback information indicates that a blocking fault has occurred. The aggregation unit is used to aggregate the execution results of all subtasks and generate the final content that conforms to the output specifications.
[0106] This invention provides a task planning and execution generation device, comprising: parsing a user-generated task and constructing task context information including task intent, constraints, and output specifications; based on the task context information, using a planning agent to decompose the user-generated task into multiple sub-tasks with dependencies, generating a task execution graph; for the sub-tasks to be executed in the task execution graph, generating multiple candidate execution schemes through a multi-agent collaborative mechanism, and performing a consistency evaluation on the candidate execution schemes based on the task context information, determining the target execution scheme based on the evaluation results and driving execution; during the execution of sub-tasks, monitoring the execution status in real time and collecting feedback information; if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, dynamically adjusting the structure or content of the task execution graph, and continuing to execute subsequent sub-tasks according to the adjusted graph; if the feedback information indicates that a blocking failure occurs, performing a self-healing operation based on the root cause of the failure to restore the execution process; and aggregating the execution results of all sub-tasks to generate final content that conforms to the output specifications. As described above, the task planning and execution generation device of the present invention achieves a transformation from static planning to dynamic adaptive planning by constructing dynamic task context information containing multiple dimensions and combining it with the task execution graph generated by the planning agent. It utilizes a multi-agent collaborative mechanism to generate candidate execution schemes and introduces consistency evaluation, significantly improving the reliability and accuracy of collaborative decision-making under complex tasks. By monitoring feedback in real time during sub-task execution, it dynamically adjusts the task execution graph structure for non-blocking deviations and performs self-healing operations based on root causes for blocking faults, effectively overcoming the limitations of traditional systems' anomaly handling capabilities and achieving high robustness and self-repair of the execution process. Simultaneously, the refined context management and dynamic routing mechanism ensure that each sub-task obtains accurate context support, solving the problem of resource redundancy or information loss caused by imprecise context management. Ultimately, while ensuring output standardization, it significantly improves the execution efficiency, success rate, and content quality of complex generation tasks, alleviating the technical problems of insufficient reliability in static task planning and collaborative decision-making, and limited anomaly handling capabilities in traditional intelligent generation systems when facing complex generation tasks.
[0107] Optionally, the parsing and construction unit is also used to: initialize a multi-dimensional context space, wherein the multi-dimensional context space includes at least: a global intent context storing the core objectives of the task, a local state context storing the real-time execution state of subtasks, and a transient tool context storing temporary data of external tool interactions; extract semantic features of the user-generated task, generate a global intent vector and load it into the global intent context; parse the restrictive descriptions in the user-generated task, form a set of hard constraints, and load the set of hard constraints into the global intent context after constraint parameterization processing, wherein the set of hard constraints includes: format constraints, content taboos and resource restrictions; define the presentation format of the final content, generate an output specification template and load it into the global intent context. Graph context; Establish a context routing mechanism. For each subtask in the task execution graph, dynamically select the target context dimension from the multidimensional context space according to its task type through the context routing function, and perform nonlinear injection using at least one of key feature extraction, structured summarization, or constraint parameterization to generate a simplified context instance dedicated to the subtask. During the execution of the subtask, update the execution status data to the local state context in real time, and dynamically update the simplified context instances dedicated to each subtask according to the context routing mechanism. The task context information includes the full data of the multidimensional context space, as well as the simplified context instances dedicated to each subtask dynamically derived from the multidimensional context space during the execution phase.
[0108] Optionally, the task execution graph is represented by a directed acyclic graph. Based on the task context information, the decomposition generation unit is also used to: identify the data dependencies and control dependencies between multiple subtasks; map each subtask to a node in the directed acyclic graph, and map the data dependencies and control dependencies to directed edges between nodes; and label each node with execution priority, task type label, and required agent capability label.
[0109] Optionally, the generation and evaluation unit is also used to: select N candidate execution agents, and according to the task type of the subtask to be executed, call the context routing function to distribute the corresponding simplified context instance as the baseline input to each candidate execution agent; control each candidate execution agent to generate an execution plan simulation for the subtask to be executed without actually calling external tools, wherein the execution plan simulation includes: the planned action sequence and the description of the expected results; introduce a monitoring agent to perform multi-dimensional consistency verification on multiple execution plan simulations based on task context information, wherein the multi-dimensional consistency verification includes at least: calculating the consistency between each execution plan simulation and the target understanding of the global intent vector in the task context information; calculating the consistency between each execution plan simulation and the constraint coverage of the set of hard constraints; calculating the consistency of the execution logic between each execution plan simulation; counting the proportion of execution plan simulations that satisfy the above multi-dimensional consistency verification; when the proportion reaches a preset proportion threshold, determining that the multi-dimensional consistency verification has passed and authorizing the subtask to be executed to enter the actual execution stage; when the proportion does not reach the preset proportion threshold, triggering a replanning process or reallocating candidate execution agents.
[0110] Optionally, the feedback information includes: execution result, confidence score, constraint satisfaction flag, and uncertainty flag; if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, specifically, it means that any of the following dynamic correction trigger conditions are met: the semantic deviation calculated based on the execution result exceeds the preset allowable range; the confidence score is lower than the preset confidence threshold; the constraint satisfaction flag indicates that the constraints in the set of hard constraints are not met; and the uncertainty flag indicates that uncertainty exists.
[0111] Optionally, the dynamic adjustment unit is further configured to: locate the abnormal subtask node that causes deviation from expectations and determine its abnormality type, wherein the abnormality type includes: incomplete result type, dependency error type, and unreasonable planning granularity type; perform corresponding graph correction operations according to the abnormality type: if it is an incomplete result type, instantiate one or more compensation subtasks to supplement missing information or verify intermediate results, and insert the compensation subtasks after the abnormal subtask node; if it is a dependency error type, adjust the connection relationship between relevant nodes in the task execution graph to correct the erroneous dependency path; if it is an unreasonable planning granularity type, split the abnormal subtask node into multiple fine-grained subtask nodes with serial or parallel relationships; based on the adjusted graph generated after performing the above graph correction operations, identify the local subgraph affected by the correction operations; only re-sort the local subgraph topologically to generate an updated execution sequence, and schedule subsequent subtasks according to the updated execution sequence.
[0112] Optionally, the blocking faults include: execution failure, verification failure, or confidence level below a preset threshold; the self-healing operation unit is also used to: collect failure evidence of the blocking fault, wherein the failure evidence includes at least: the number of consecutive failures, the difference in matching degree between the execution agent's capability label and the sub-task requirement label, and the response status code of the external tool; perform causal inference based on the failure evidence and task context information, and classify the root cause of the fault into one of the following preset fault types: planning logic error: the judgment basis is that the failure evidence indicates a conflict in the node dependency relationship in the task execution graph, or the execution path is unreachable based on the remaining task set in the task context information; agent capability mismatch: the judgment basis is that the matching degree difference is below a preset matching threshold, or in the scenario involving the parallel execution of multiple agents, the consistency score of the output results of each agent. The error is below the preset consistency threshold; external tool malfunction: the judgment is based on the response status code indicating call failure, or the tool response time exceeding the preset timeout threshold; according to the categorized fault type, the corresponding self-healing strategy is executed: if it is categorized as a planning logic error, a planning rollback operation is executed, and based on the completed sub-task results and the set of remaining unexecuted sub-tasks contained in the task context information, the local topology of the task execution graph is reconstructed to generate a corrected local execution sequence; if it is categorized as an agent capability mismatch, based on the matching degree difference, the agent is dynamically switched from the agent registration center to a backup agent with an adaptation capability tag to take over the execution, and the sub-tasks are redistributed according to the task context information; if it is categorized as an external tool malfunction, based on the response status code, a tool hot switch is executed to call the backup interface, or a delayed retry and degraded execution strategy is initiated.
[0113] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0114] like Figure 3 As shown in the embodiment of this application, an electronic device 600 includes a processor 601, a memory 602, and a bus. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device is running, the processor 601 communicates with the memory 602 via the bus, and the processor 601 executes the machine-readable instructions to perform the steps of the task planning and execution generation method described above.
[0115] Specifically, the memory 602 and processor 601 mentioned above can be general-purpose memory and processor, without any specific limitations. When the processor 601 runs the computer program stored in the memory 602, it can execute the above-mentioned task planning and execution generation method.
[0116] The processor 601 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 601 or by instructions in software form. The processor 601 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 602, and processor 601 reads the information from memory 602 and, in conjunction with its hardware, completes the steps of the above method.
[0117] Corresponding to the above-described task planning and execution generation method, this application embodiment also provides a computer-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to perform the steps of the above-described task planning and execution generation method.
[0118] The task planning and execution generation device provided in this application embodiment can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this application embodiment are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0119] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0120] For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0121] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0122] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0123] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the task planning and execution generation method described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0124] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0125] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for generating task planning and execution, characterized in that, include: Parse user-generated tasks and construct task context information that includes task intent, constraints, and output specifications; Based on the task context information, the planning agent decomposes the user-generated task into multiple sub-tasks with dependencies, generating a task execution graph. For the subtasks to be executed in the task execution graph, multiple candidate execution schemes are generated through a multi-agent collaborative mechanism, and the consistency of the candidate execution schemes is evaluated based on the task context information. The target execution scheme is determined and executed based on the evaluation results. During the execution of subtasks, the execution status is monitored in real time and feedback information is collected; If the feedback information indicates that the current execution path deviates from the expected path but no blocking failure occurs, the structure or content of the task execution graph is dynamically adjusted, and subsequent subtasks are executed according to the adjusted graph. If the feedback information indicates a blocking fault, a self-healing operation is performed based on the root cause of the fault to restore the execution process; Aggregate the execution results of all subtasks to generate the final content that conforms to the output specifications.
2. The method according to claim 1, characterized in that, Parse the user-generated task and construct task context information containing task intent, constraints, and output specifications, including: Initialize a multidimensional context space, wherein the multidimensional context space includes at least: a global intent context for storing the core objectives of the task, a local state context for storing the real-time execution state of subtasks, and a transient tool context for storing temporary data of external tool interactions; Extract the semantic features of the user-generated task, generate a global intent vector, and load it into the global intent context; The restrictive descriptions in the user-generated task are parsed to form a set of hard constraints. After the set of hard constraints is parameterized, it is loaded into the global intent context. The set of hard constraints includes: format constraints, content taboos, and resource restrictions. Define the final presentation format of the content and generate an output specification template, which is then loaded into the global intent context. A context routing mechanism is established. For each subtask in the task execution graph, the target context dimension is dynamically selected from the multidimensional context space according to its task type through the context routing function. Nonlinear injection is performed using at least one of key feature extraction, structured summarization or constraint parameterization to generate a simplified context instance dedicated to the subtask. During the execution of a subtask, the execution status data is updated in real time to the local state context, and the simplified context instance dedicated to each subtask is dynamically updated according to the context routing mechanism. The task context information includes the full data of the multidimensional context space, as well as the simplified context instance dedicated to each subtask dynamically derived from the multidimensional context space during the execution phase.
3. The method according to claim 1, characterized in that, The task execution graph is represented using a directed acyclic graph. Based on the task context information, a planning agent decomposes the user-generated task into multiple sub-tasks with dependencies, generating the task execution graph, including: Identify data dependencies and control dependencies among the multiple subtasks; Each of the subtasks is mapped to a node in the directed acyclic graph, and the data dependencies and control dependencies are mapped to directed edges between nodes; Label each node with its execution priority, task type, and required agent capabilities.
4. The method according to claim 2, characterized in that, Multiple candidate execution schemes are generated through a multi-agent collaborative mechanism, and the consistency of the candidate execution schemes is evaluated based on the task context information, including: N candidate execution agents are selected. Based on the task type of the subtask to be executed, the context routing function is called to distribute the corresponding simplified context instance as the baseline input to each candidate execution agent. Each candidate execution agent is controlled to generate an execution plan simulation for the subtask to be executed without actually calling external tools. The execution plan simulation includes: a planned sequence of actions and a description of the expected results. An intelligent monitoring agent is introduced to perform multi-dimensional consistency checks on multiple execution schemes based on the task context information. The multi-dimensional consistency checks include at least the following: Calculate the consistency between the target understanding of each execution scheme pre-simulation and the global intent vector in the task context information; Calculate the consistency of constraint coverage between the pre-execution schemes and the set of hard constraints; Calculate the consistency of execution logic between each of the aforementioned execution schemes; The proportion of execution schemes that meet the above multi-dimensional consistency checks is statistically analyzed. When the quantity ratio reaches a preset ratio threshold, the multi-dimensional consistency check is deemed to have passed, and the subtask to be executed is authorized to enter the actual execution stage. When the quantity ratio does not reach the preset ratio threshold, the process is replanned or the candidate execution agents are reassigned.
5. The method according to claim 1, characterized in that, The feedback information includes: execution result, confidence score, constraint satisfaction flag, and uncertainty flag; if the feedback information indicates that the current execution path deviates from expectations but no blocking failure occurs, specifically, it means that any of the following dynamic correction trigger conditions are met: The semantic deviation calculated based on the execution result exceeds the preset allowable range; The confidence score is lower than the preset confidence threshold; The constraint satisfaction flag indicates that a constraint in the set of hard constraints is not satisfied. The uncertainty flag indicates the presence of uncertainty.
6. The method according to claim 1, characterized in that, Dynamically adjust the structure or content of the task execution graph, and continue to execute subsequent subtasks based on the adjusted graph, including: Locate the abnormal subtask node that causes the deviation from the expected result and determine its abnormality type, wherein the abnormality type includes: incomplete result type, incorrect dependency type, and unreasonable planning granularity type; Perform the corresponding graph correction operation based on the anomaly type: If the result is incomplete, instantiate one or more compensation subtasks to supplement missing information or verify intermediate results, and insert the compensation subtasks after the abnormal subtask node. If the dependency relationship is incorrect, the connection relationship between the relevant nodes in the task execution graph is adjusted to correct the incorrect dependency path; If the planning granularity is unreasonable, the abnormal subtask node will be split into multiple fine-grained subtask nodes with serial or parallel relationships. Based on the adjusted map generated after performing the above map correction operation, identify the local sub-maps affected by the correction operation; Only the local subgraph is re-topologically sorted to generate an updated execution sequence, and subsequent subtasks are scheduled according to the updated execution sequence.
7. The method according to claim 1, characterized in that, The disruptive faults include: execution failure, verification failure, or confidence level below a preset threshold; self-healing operations are performed based on the root cause of the fault to restore the execution flow, including: Collect failure evidence of the occurrence of the aforementioned blocking failure, wherein the failure evidence includes at least: the number of consecutive failures, the difference in matching degree between the agent's capability label and the subtask requirement label, and the response status code of the external tool; Based on the failure evidence and the task context information, causal inference is performed, and the root cause of the failure is classified into one of the following preset failure types: Planning logic error: The judgment is based on the failure evidence indicating that there is a conflict in the node dependency relationship in the task execution graph, or based on the remaining task set in the task context information, the execution path is determined to be unreachable; Mismatch in agent capabilities: The determination criteria are that the difference in matching degree is lower than a preset matching threshold, or in a scenario involving the parallel execution of multiple agents, the consistency score of the output results of each agent is lower than a preset consistency threshold. External tool error: The determination is based on the response status code indicating a failed call, or the tool response time exceeding a preset timeout threshold; Based on the identified fault type, execute the corresponding self-healing strategy: If the error is classified as a planning logic error, a planning rollback operation is performed, and based on the completed sub-task results and the set of remaining unexecuted sub-tasks contained in the task context information, the local topology of the task execution graph is reconstructed to generate a corrected local execution sequence. If the problem is classified as a mismatch in agent capabilities, then based on the difference in matching degree, the system dynamically switches from the agent registration center to a backup agent with the appropriate capability tag to take over the execution, and redistributes the subtasks based on the task context information. If the error is classified as an external tool exception, then based on the response status code, a tool hot-swapping will be performed to call the backup interface, or a delayed retry and degraded execution strategy will be initiated.
8. A task planning and execution generation device, characterized in that, include: The parsing and construction unit is used to parse user-generated tasks and construct task context information that includes task intent, constraints, and output specifications. The decomposition and generation unit is used to decompose the user-generated task into multiple sub-tasks with dependencies based on the task context information and using a planning agent to generate a task execution graph. The generation and evaluation unit is used to generate multiple candidate execution schemes for the sub-tasks to be executed in the task execution graph through a multi-agent collaborative mechanism, perform consistency evaluation on the candidate execution schemes based on the task context information, determine the target execution scheme based on the evaluation results, and drive the execution. The real-time monitoring and data acquisition unit is used to monitor the execution status and collect feedback information in real time during the execution of subtasks. The dynamic adjustment unit is used to dynamically adjust the structure or content of the task execution graph if the feedback information indicates that the current execution path deviates from the expectation but no blocking failure occurs, and to continue to execute subsequent sub-tasks according to the adjusted graph. The self-healing operation unit is used to perform a self-healing operation based on the root cause of the fault to restore the execution process if the feedback information indicates that a blocking fault has occurred. The aggregation unit is used to aggregate the execution results of all subtasks and generate the final content that conforms to the output specification.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by the processor to perform the method of any one of claims 1 to 7.