A feedback-based dynamic topology replanning method and medium
By generating feedback events and calculating capability vectors, the DAG task topology is dynamically adjusted, solving the problems of insufficient utilization of feedback data and illegality of replanning in existing technologies, and realizing efficient reflection and legality verification of execution status.
Patent Information
- Application Number
- CN202611311769.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-11-17
AI Technical Summary
Existing DAG task topologies struggle to fully utilize feedback data at different granularities during execution, making it difficult to distinguish between local and global deviations. They are also prone to losing effective execution states during replanning and lack validation of the legality of the replanned topology.
By generating feedback events, calculating feedback weights and fusing them into a capability vector, calculating global deviation scores and local deviation scores based on the capability vector, outputting the replanning type, and performing legality verification after replanning, inserting reinforcement nodes or generating candidate new topologies to adjust the topology structure.
It improves the responsiveness to execution status, reduces frequent replanning due to short-term feedback fluctuations, preserves effective execution progress, and ensures the legality of the replanned topology.
Smart Images

Figure CN123114666A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent agents, and in particular to a feedback-based dynamic topology replanning method and medium. Background Technology
[0002] A Directed Acyclic Graph (DAG) is a data structure used to represent task dependencies, execution order, and state transitions. It is widely used in task scheduling, workflow orchestration, automated operations and maintenance, intelligent process control, R&D process management, complex operation guidance, resource allocation, and multi-stage decision-making. A DAG typically consists of multiple nodes and directed edges connecting them. Nodes represent tasks, operations, or capability units, while directed edges represent dependencies or execution order between nodes.
[0003] Traditional Directed Acyclic Graph (DAG) task topologies are typically generated all at once before task execution, based on task objectives, context information, constraints, resource status, or historical states. During subsequent execution, the nodes, dependencies, and execution order of the DAG usually remain unchanged. This approach implicitly assumes that the initially generated DAG matches the actual execution environment and that no significant capability deviations, resource changes, decreased feedback results, or local task objective shifts will occur during task execution.
[0004] With the development of rule engines, model algorithms, and automated execution systems, DAG task topologies can be automatically generated based on objectives and context, and node partitioning can be more refined. During DAG execution, the system can continuously obtain feedback data at different granularities, such as node completion status, scoring results, interaction behavior, time consumption, anomaly information, and pass / fail status. This feedback data can reflect the degree of matching between the current DAG task topology and the actual execution status, and can be used to identify weak capability units or execution anomalies.
[0005] However, the adaptive capabilities of existing DAG task topologies during execution are still insufficient. Once a DAG is generated, its node dependencies, execution order, and state transition relationships typically remain fixed. When situations arise during execution, such as weak capabilities, consecutive node failures, an increase in anomalies, abnormal execution time, or a decline in feedback results, existing technologies struggle to automatically adjust subsequent task topologies accordingly, easily leading to a mismatch between subsequent execution content and the actual capability state.
[0006] Meanwhile, existing technologies have limited ways of utilizing feedback data. Feedback data at different granularities is usually only used for log recording, result statistics, or manual analysis, and has not yet formed a unified feedback information that can directly drive DAG task topology adjustments. Due to the differences in the generation time, feedback quality, and reliability of feedback at different granularities, it is difficult to distinguish between local, minor execution deviations and global deviations that affect the overall task structure when judging based on a single result or a single indicator. This can easily lead to unnecessary replanning or failure to replan in a timely manner.
[0007] Furthermore, existing reprogramming methods are typically quite crude. One approach is to regenerate the complete DAG, but this may result in the loss of completed and still valid execution states, increasing the cost of repeated executions. Another approach is to keep the original DAG unchanged, but this may cause execution deviations that have already occurred to accumulate in subsequent tasks. Existing technologies also lack automatic differentiation between local and global reprogramming, as well as a mechanism for unified verification of the acyclicity, dependency integrity, state consistency, and version validity of the reprogrammed DAG topology.
[0008] Therefore, how to uniformly process feedback data of different granularities, determine whether replanning is needed and the type of replanning based on the feedback information, and make verifiable and traceable dynamic adjustments to the DAG task topology while preserving effective execution progress as much as possible, are problems that existing technologies need to solve. Summary of the Invention
[0009] This application aims to provide a feedback-based dynamic topology replanning method and medium to solve the problems of existing DAG task topologies not being able to fully utilize feedback data of different granularities during execution, difficulty in distinguishing between local deviations and global deviations, easy loss of effective completion states during replanning, and lack of legality verification of the replanned DAG topology.
[0010] To achieve the above objectives, the technical solution of the present invention includes: A feedback-based dynamic topology replanning method, comprising: Generate and maintain the topology of the directed acyclic graph (DAG) based on the target context and constraints; During the execution of the DAG topology, multi-granularity feedback associated with DAG nodes is collected, and the multi-granularity feedback is uniformly generated into feedback events. Feedback weights are calculated based on the feedback granularity, timestamp, feedback quality, and confidence of each feedback event, and the set of feedback events is fused into a capability vector based on the feedback weights. The capability vector and the current DAG topology state are input into the replanning trigger decision module to calculate the global deviation score and the local deviation score, and output whether replanning is not required, local replanning, or global replanning is required. When outputting local replanning, extract the successor subgraph around the current active node, generate reinforcement nodes based on the set of weak capability units in the feedback event, insert the reinforcement nodes between the current active node and the original successor node, and rewrite the dependency edges of the original successor node to depend on the reinforcement nodes that match it. When outputting a global replanning, a candidate new DAG topology is generated based on the original target corresponding to the target context, the capability vector, the set of weak capability units, the set of completed nodes in the current DAG topology, and the old topology summary. The valid completed states in the old DAG topology are then migrated to the candidate new DAG topology. Perform a validity check on the replanned DAG topology, and activate the replanned DAG topology version after passing the validity check.
[0011] A further improvement of the present invention is that the DAG topology includes a set of nodes, a set of dependent edges, node states, topology levels, and node metadata; the node states include locked state, open state, active state, and completed state; the node metadata includes a combination of at least one of node target, node description, capability unit tag, recommended execution content, replanning tag, and source version.
[0012] A further improvement of the present invention is that when all the preceding dependent nodes of a node meet the completion conditions, the node is changed from a locked state to an open state; during the replanning process, the completion state of completed nodes is maintained, and the number of active nodes in the same DAG topology version does not exceed a preset upper limit; the legality verification includes node identifier uniqueness verification, dependency reference integrity verification, acyclicity verification, hierarchical monotonicity verification, active node number verification, and non-reversible status verification of completed nodes.
[0013] A further improvement of this invention is that each feedback event is associated with at least one DAG node and includes feedback granularity, timestamp, feedback value, feedback quality, confidence level, a set of positive capability units, and a set of weak capability units; the feedback granularity includes intra-node instantaneous feedback, node-level completion feedback, and stage-level comprehensive feedback; a time decay factor is determined based on the time difference between the current calculation time and the timestamp of the feedback event, a granularity weight is determined based on the feedback granularity, and the time decay factor, granularity weight, feedback quality, and confidence level are combined to obtain the feedback weight; The feedback weight of the i-th feedback event is calculated according to the following formula: ; in, For the feedback granularity of the i-th feedback event The corresponding granularity weights, The time decay coefficient, For the current calculation time, Let i be the timestamp of the i-th feedback event. To provide feedback on quality, , where is the confidence level.
[0014] A further improvement of the present invention is that the task completion rate is determined based on the number of completed nodes and the total number of nodes; the evaluation accuracy rate is determined based on the number of weighted correct items and the total number of weighted items; the evaluation pass rate is determined based on the weighted pass count and the total feedback weight; the weighted average score is determined based on the feedback score and the feedback weight; the vulnerability is determined based on the positive evidence corresponding to the positive capability unit set in the feedback event and the weak evidence corresponding to the weak capability unit set; the capability stability is determined based on the score sequence within the most recent multiple time windows; the topology unlocking rate is determined based on the proportion of completed nodes, active nodes, and open nodes in the node set; and the interaction density or anomaly density is determined based on the number of interactions, the number of abnormal events, and the anomaly event penalty weight during the execution process.
[0015] A further improvement of the present invention is that the capability vector includes task completion rate, evaluation accuracy rate, evaluation pass rate, weighted average score, weakness, capability stability, topology unlocking rate, and interaction density or anomaly density.
[0016] A further improvement of the present invention is that when the global deviation score reaches the global deviation threshold, or when at least one index in the capability vector reaches the global replanning trigger threshold, global replanning is output. If the global replanning condition is not met, and at least one of the following conditions is met, local replanning is output: the local deviation score reaches the local deviation threshold, the evaluation accuracy is lower than the accuracy threshold, or the number of weak capability units in the weak capability unit set reaches the weak capability unit number threshold; otherwise, no replanning is output. By using a cooling window and hysteresis mechanism to suppress frequent replanning in a short period of time, if the time interval between the current moment and the last replanning time is less than the preset minimum replanning interval, the replanning decision result is corrected to no replanning required. The global deviation score is determined based on the evaluation pass rate, weighted average score, weakness, capability stability, and topology unlocking rate; the local deviation score is determined based on the evaluation accuracy, weakness, interaction density or anomaly density, and the local deviation intensity of the capability units associated with the currently active node.
[0017] A further improvement of the present invention is that the local replanning includes: Starting from the current active node, extract the successor node and successor dependency edge within the preset local replanning radius to obtain the successor subgraph; One or more reinforcement nodes are generated based on the set of weak capability units, and each reinforcement node is used to cover one or more weak capability units. Establish a dependency edge from the current active node to the reinforcement node, and rewrite the dependency edge of the original successor node to depend on the best matching reinforcement node. The topological hierarchy of the successor subgraph is recalculated, and the rewritten successor subgraph is checked for acyclicity and dependency reference integrity. The most matching reinforcement node is determined based on the similarity of the capability unit label between the reinforcement node and the original successor node; the editing cost of the local replanning is determined based on the sum of the number of reinforcement nodes, the number of deleted or disabled dependency edges, and the number of newly added dependency edges.
[0018] A further improvement of the present invention is that the global replanning includes: Freeze the current DAG topology version and read the current DAG topology, the capability vector, the set of completed nodes, the set of weak capability units, the original objective, the constraints, and the historical feedback summary; Generate candidate new DAG topologies while keeping the original objective unchanged; Based on at least one of node identifier, node title similarity, capability unit label similarity, and structural position similarity, the completed nodes in the old DAG topology and the nodes in the candidate new DAG topology are matched; When the matching result meets the preset migration conditions, the completion status of the corresponding node in the old DAG topology is migrated to the matching node in the candidate new DAG topology; If there are no active nodes in the candidate new DAG topology, then the first open node whose preceding dependent nodes are all in a completed state is set as the active node. If the number of active nodes in the candidate new DAG topology exceeds a preset limit, then the preset number of active nodes ranked first are retained, and the remaining active nodes are adjusted to an open state.
[0019] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the above-described feedback-based dynamic topology replanning method.
[0020] Compared with the prior art, the beneficial technical effects of this application include: (1) This application converts feedback data at the node level, task level, session level or other different granularities into a unified feedback event, and combines feedback granularity, timestamp, feedback quality and confidence to determine feedback weight, and then integrates them to form a capability vector, so that the feedback data can serve as the basis for dynamic adjustment of DAG task topology, which helps to improve the degree of reflection of actual execution status and capability status.
[0021] (2) This application calculates the global deviation score and the local deviation score based on the capability vector and the current state of the DAG task topology, and determines whether to replan, replan locally or replan globally, so that different degrees and ranges of execution deviation can be handled in different ways. With the setting of cooldown time and hysteresis conditions, it can also reduce the frequent replanning caused by short-term feedback fluctuations.
[0022] (3) In the process of local replanning, this application mainly adjusts the successor subgraph of the current active node, generates enhanced nodes based on the set of weak capability units, and re-establishes relevant dependencies. Therefore, it can make targeted adjustments to local weak capabilities while preserving other parts of the DAG task topology, reducing unnecessary overall reconstruction.
[0023] (4) During the global replanning process, this application generates a candidate new DAG task topology based on the original task objectives, capability vectors, weak capability unit set, completed node set and original DAG task topology summary, and migrates the still valid completed states in the original DAG task topology to the candidate new DAG task topology, which helps to retain the effective execution progress already achieved and reduce repeated execution.
[0024] (5) Before activating the reprogrammed DAG task topology, this application performs a legality check on the uniqueness of node identifiers, dependency integrity, acyclicity, node hierarchical relationship and state consistency, so that the activated DAG task topology can meet the execution requirements and facilitate the traceability of the reprogramming results and their corresponding versions. Attached Figure Description
[0025] Figure 1 This is a schematic diagram of the overall architecture of the feedback-based dynamic topology replanning system of the present invention; Figure 2 This is a schematic diagram of the multi-granularity feedback event fusion and capability vector calculation of the present invention; Figure 3 This is a schematic diagram of the replanning trigger decision process of the present invention; Figure 4 This is a schematic diagram illustrating the global replanning and node state transition process of this invention; Figure 5 This is a schematic diagram of the insertion of reinforcement nodes and the rewriting of dependent edges in the local replanning of this invention; Figure 6 This is a schematic diagram of the DAG node state automaton of the present invention. Detailed Implementation
[0026] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0027] like Figure 1 As shown, embodiments of the present invention provide a feedback-based dynamic topology replanning method. The core technical concept of this method lies in transforming the execution feedback from passive recording into an active control signal for topology replanning, converting a static DAG into a feedback-driven dynamic DAG, and ensuring system state consistency before and after replanning through topology validity verification, node state transitions, versioned persistence, and interpretable output. Specifically, the method includes: An initial DAG topology is generated based on the target context and constraints. The node identifiers of the initial DAG topology are normalized, dependency references are corrected, and the topology hierarchy is calculated. The verified initial DAG topology is then saved as the current active topology version.
[0028] The DAG execution engine executes DAG nodes based on node dependencies and node states, and records progress data, node execution results, and stage evaluation results.
[0029] Collect multi-granularity feedback associated with DAG nodes, and generate the multi-granularity feedback into a unified feedback event.
[0030] The feedback weights are calculated based on the timestamps, granularity, quality, and confidence of each feedback event, and the set of feedback events is then fused into a capability vector based on these weights.
[0031] The global deviation score and local deviation score are calculated based on the capability vector and the current DAG topology state, respectively. The replanning decision result is then output by combining the cooling window and hysteresis mechanism.
[0032] When the replanning decision is local replanning, extract the local successor subgraph around the currently active node, insert reinforcement nodes and rewrite the local dependency edges; when the replanning decision is global replanning, freeze the current DAG topology version, generate candidate new DAG topologies and migrate the effective completed state; when the replanning decision is no replanning required, continue to execute the current DAG topology.
[0033] Perform a validity check on the reprogrammed DAG topology; after the verification is successful, mark the old DAG topology version as inactive and mark the reprogrammed DAG topology version as active, and save the triggering indicators, reprogramming type, topology difference summary and number of state transitions.
[0034] In this embodiment, a DAG topology refers to a computer-processable graph structure composed of nodes and directed dependent edges, without directed loops. Nodes in a DAG topology represent task units, operation units, or processing units to be executed, and directed dependent edges represent pre-existing constraints between nodes. If a directed dependent edge is denoted as... , then it represents a node Dependent on nodes ,node For nodes The preceding dependency nodes.
[0035] In this embodiment, each DAG node can be configured with one or more capability unit labels. When feedback indicates that the performance of the executing entity in a certain capability unit meets the preset requirements, the capability unit can be recorded as a positive capability unit; when feedback indicates that the executing entity has a deviation in a certain capability unit, the capability unit can be recorded as a weak capability unit.
[0036] Local replanning refers to using the currently active node as a baseline, only inserting, replacing, deleting, splitting, merging, or rewriting dependent edges in a local successor subgraph within a preset topology range, while keeping the DAG topology outside the local successor subgraph unchanged or substantially unchanged. The "global replanning" referred to in this application refers to regenerating a candidate new DAG topology covering the entire subsequent execution process based on the original objective and the current execution state. "Global" and "local" represent the topology range affected by the replanning; the global deviation score and local deviation score are used to evaluate the overall mismatch degree of the current DAG topology and the mismatch degree within the range of the currently active node and its successor nodes, respectively.
[0037] The process of generating and maintaining a stateful DAG topology includes: at any given time The system maintains a stateful DAG topology. Its expression is: in, Represents a set of nodes; Represents the set of directed dependent edges; Represents the node state function; Represents topological hierarchy functions; This represents the collection of node metadata.
[0038] Node metadata may include at least one of the following: node identifier, stage identifier, node title, node goal, node description, capability unit tag, recommended execution content, replanning marker, and source version. In a structured data implementation, each node has at least a node identifier, a node status, and a dependent node field, whereby the dependent node field records the identifiers of the preceding dependent nodes pointing to that node.
[0039] The initial DAG topology can be generated from a large model, a rule engine, an optimization algorithm, a template library combination, a graph search algorithm, or manual configuration. Taking large model generation as an example, the DAG topology maintenance module constructs structured input based on the target context and constraints, requiring the model output to contain structured data including stage arrays and node arrays. After performing format parsing and field validation on the model output, it enters the node normalization process. Whether or not a large model is used does not affect the subsequent feedback fusion, replanning decision, state transition, and legality verification processes.
[0040] The node normalization process includes correcting for missing node identifiers, duplicate node identifiers, illegal dependencies, self-dependencies, forward dependencies, and multiple root nodes. After node normalization is complete, the system recalculates the topology hierarchy based on directed dependency edges.
[0041] The system requires that the DAG topology has no self-dependencies: The system also requires that there are no directed closed loops consisting of more than two nodes, i.e., no node sequences. ,in , making and For any dependent edge The topology hierarchy satisfies: This ensures that the topology hierarchy and the direction of dependency remain consistent.
[0042] See Figure 6 The node state is maintained by a four-state automaton. The locked state indicates that not all of the node's prerequisite nodes have completed; the open state indicates that all of the node's prerequisite nodes have completed and the node can be scheduled; the active state indicates that the node is currently executing; and the done state indicates that the node has passed completion verification. The set of preceding dependent nodes is represented as: The expression for the condition that a node changes from a locked state to an open state: For completed nodes, if the old version node matches the new version node, its completed state is retained to avoid duplicate execution.
[0043] See Figure 2 The feedback generated during the execution process is divided into intra-node immediate feedback, node-level completion feedback, and stage-level comprehensive feedback, and the three types of feedback are uniformly generated into feedback events.
[0044] Intra-node real-time feedback reflects real-time deviations during execution; node-level completion feedback reflects whether a single node has been reliably completed; and stage-level comprehensive feedback reflects structural deviations after a group of related nodes have been completed. Feedback event The expression is: in, Indicates the feedback event identifier; Indicates the identifier of the associated node; Indicates the granularity of feedback; Indicates the feedback timestamp; Indicates the feedback value; Indicates the quality of feedback; Indicates the confidence level of the feedback; Represents a set of positive capability units; This represents a set of units with weak capabilities. Feedback values. It can be a single numerical value, or a structured set of numerical values including the number of correct items, the total number of evaluated items, whether it passed, the score, the number of interactions, and the number of exceptions.
[0045] The expression for feedback granularity: in, This indicates real-time feedback within the node. This indicates that feedback has been completed at the node level. This represents phased, comprehensive feedback. The feedback event generation module normalizes field names, numerical ranges, time formats, and node identifiers from different sources, and discards invalid feedback that cannot be associated with current or historical DAG nodes. Feedback quality. The confidence level can be determined based on data completeness, format validity, and acquisition link status; It can be determined based on the reliability of the feedback source, the confidence level of the evaluation model, or the results of repeated validation.
[0046] Let the current calculation time be... The system provides feedback events. Calculate feedback weights : in, The time decay coefficient, This refers to the granularity weight corresponding to the feedback granularity. Newer feedback events have larger time decay factors. Preferably, the following can be set: Node-level feedback is given higher weight than intra-node real-time feedback, and stage-level comprehensive feedback is given higher weight when judging structural deviations. In other implementations, different granularity weights can be set for global deviation calculation and local deviation calculation.
[0047] The system merges the set of feedback events into a capability vector. : in, Indicates completion rate. Indicates accuracy rate. Indicates the pass rate. This represents the weighted average score. Indicates the degree of weakness. Indicates stability. Indicates the topology unlocking rate. This indicates the interaction density or anomalous density.
[0048] Let the set of completed nodes be: The completion rate can be calculated using the following formula: Accuracy can be calculated as the ratio of the number of weighted correct items to the total number of weighted evaluation items: The pass rate can be calculated as the ratio of the weighted number of passes to the total weight of the feedback: in, A score of 1 is assigned if the feedback is approved, and 0 otherwise. The weighted average score can be calculated using the following formula: If the feedback event does not contain a score field, then It can be marked as null. The replanning trigger decision module uses accuracy, pass rate, weakness and other available indicators to make a decision.
[0049] For any capability unit The system calculates the strength of the weakness based on positive and weak evidence: The overall weakness can be taken as the maximum weakness strength of all capability units: Alternatively, you can rank the weakest points by strength. Average strength of the capability unit: in, This indicates the top ranks after sorting by weakness strength. Individual capability units. The aggregated set of weak capability units. It can be composed of capability units whose weak strength reaches a preset capability threshold.
[0050] To reduce the impact of isolated, occasional feedback on replanning decisions, the system bases its decisions on the most recent... Score sequence of time windows Calculate stability: in, This represents the average value of the score sequence. Lower stability indicates greater fluctuation in the execution results between adjacent time windows.
[0051] The topology unlock rate can be calculated using the following formula: Interaction density or anomaly density can be calculated using the following formula: in, For the penalty weight of abnormal events, This represents the set of active nodes. Through the above calculations, the system compresses discrete feedback from different sources, times, and granularities into a capability vector with a unified numerical meaning.
[0052] In other implementations, the capability vector may also include at least one of resource utilization, failure retry rate, node latency, throughput, quality defect rate, and average execution time. The newly added metrics, after normalization, can be used to calculate the global deviation score or the local deviation score.
[0053] See Figure 3 The replanning trigger decision module receives the capability vector. and the current DAG topology And output the reprogramming decision result: Among them, NONE means no replanning is needed, LOCAL means local replanning, and GLOBAL means global replanning.
[0054] In one threshold decision implementation, the global deviation score It can be calculated using the following formula: in, to The weighting is for all indicators. The overall deviation score comprehensively reflects the structural deviations caused by decreased pass rate, decreased average score, increased weakness, decreased stability, and decreased topology unlocking rate.
[0055] Local deviation score It can be calculated using the following formula: in, to For local indicator weights, This indicates the local deviation intensity of the capability unit associated with the currently active node.
[0056] The replanning trigger decision module outputs GLOBAL when at least one of the following conditions is met: global deviation score. Weighted average score pass rate .in, The global deviation threshold, As the score threshold, This is the pass rate threshold.
[0057] If the global replanning condition is not met, the replanning trigger decision module outputs LOCAL when at least one of the following conditions is met: local deviation score. Accuracy Number of weak capability units .in, Local deviation threshold, For accuracy threshold, This represents the threshold for the number of weak capability units. If neither the global replanning condition nor the local replanning condition is met, output NONE.
[0058] To suppress frequent replanning within a short period, the system implements a cooling window. Let the last replanning time be... The minimum replanning interval is .when At that time, the revised judgment result can be... Set to NONE; when At that time, output the original judgment result. The system can also be configured with a hysteresis mechanism to prevent replanning from being repeatedly triggered when the deviation score fluctuates around the threshold.
[0059] In addition to threshold rules, the replanning trigger decision module can also use decision trees, scoring functions, statistical classification models or reinforcement decision models, as long as it outputs NONE, LOCAL or GLOBAL based on the capability vector and the current DAG topology state.
[0060] See Figure 5 When the replanning decision is LOCAL (local replanning), the local replanning module does not reconstruct the entire DAG topology, but instead extracts a local successor subgraph around the currently active node. Let the currently active node be... The local successor subgraph is as follows: in: This indicates the direction along the dependency edge from the currently active node. To the successor node The shortest topological distance, This represents the radius of the local replanning. Therefore, It only includes the successor nodes of the currently active node, excluding side nodes that have no successor relationship with the currently active node and completed predecessor nodes.
[0061] The system categorizes the aggregated weak capability units according to their weakness strength. Sort and select the top ones. For each weak capability unit, generate a set of reinforcement nodes: Each reinforcement node Used to cover one or more weak capability units, its node metadata includes at least the newly generated node identifier, node target, capability unit label, recommended execution content, replanning tag, and source version.
[0062] The local replanning module first establishes dependency edges from the currently active node to the reinforcing node: When multiple reinforcement nodes have a capability prerequisite relationship, sequential dependency edges can be established between the reinforcement nodes, but directed cycles must not be formed. Subsequently, the local replanning module rewrites the dependency edges of the original successor nodes of the currently active node. For the original dependency edges... Delete or deactivate the original dependency edge, and establish a dependency edge from the matching reinforcement node to the original successor node: In a preferred embodiment, matching reinforcement nodes are used. Determined based on Jaccard similarity of capability unit tags: in, Indicates reinforcement node The set of covered capability units Indicates the original successor node A set of capability unit tags.
[0063] After completing the insertion of reinforcing nodes and the rewriting of dependent edges, the system recalculates the local successor subgraph and the topological hierarchy of the affected successor nodes, and performs dependency reference integrity checks and acyclicity checks. The editing cost of local replanning can be expressed as: in, This represents the set of dependency edges that have been deleted or disabled. This indicates the addition of a new set of dependency edges. When... and When this happens, the system prioritizes local replanning. This allows the system to correct execution deviations near currently active nodes without altering completed prerequisites or irrelevant side branches.
[0064] In other implementations, local replanning may also include at least one of deleting redundant nodes, replacing unsuitable nodes, splitting complex nodes, merging duplicate nodes, or changing subsequent dependencies. Regardless of the local editing operation used, the topology hierarchy of the affected portion must be recalculated and a validity check performed.
[0065] See Figure 4 When the replanning decision is GLOBAL, the system freezes the current DAG topology version. Freezing means stopping the writing of new topology changes to the current version, but it can continue to save feedback events and audit data used to explain the reason for the replanning. The global replanning module reads the current DAG topology, capability vectors, completed node set, weak capability unit set, original objective, constraints, and historical feedback summaries to form the global replanning input: The global replanning module generates candidate new DAG topologies based on the input: The process of generating candidate new DAG topologies maintains the original objective. Unchanged. In one implementation, the optimization objective of global replanning is: in, This represents the cost of editing the old DAG topology to a candidate new DAG topology; This indicates that the candidate new DAG topology has the risk of dependency conflicts, excessive node density, or resource conflicts; This indicates the coverage gap of the candidate new DAG topology for weak capability elements; Indicates the number of nodes or the estimated execution cost of the candidate new DAG topology; This indicates the extent to which nodes have been preserved and migrated. to The corresponding weights.
[0066] Candidate new DAG topologies can be generated from large models, rule engines, optimization algorithms, template libraries, or graph search algorithms. Taking large model generation as an example, the input includes the original objective, constraints, capability vectors, weak capability unit set, completed node summary, and old DAG topology summary, and the output is required to be in a predefined structured format. The output format must include at least a topology version field, a stage array, and a node array. Each node in the node array must include at least a node identifier, stage identifier, node title, node objective, node status, capability unit label, and dependent node fields. The system only considers the structured output as a candidate result and does not directly activate unvalidated model outputs.
[0067] After generating candidate new DAG topologies, the system sequentially performs field format validation, node identifier normalization, dependency reference correction, acyclicity validation, connectivity validation, and state transition. Dependency reference correction includes deleting self-dependencies, deleting dependency references of non-existent nodes, and correcting unreasonable dependencies according to the phase order. Connectivity validation is used to confirm that non-root nodes can be connected to at least one root node through dependency paths.
[0068] Before completing the state transition, the system checks the completed nodes in the old DAG topology. Nodes in the candidate new DAG topology Calculate node similarity: in, This indicates that the node identifiers are consistent. Indicates the text similarity between node titles and node targets. Indicates the similarity of capability unit labels. Indicates the similarity of structural or stage positions. to For the corresponding weights. When At that time, the old node is considered With candidate new nodes If the migration conditions are met, the completed state of the old node will be migrated to the candidate new node: If there are no active nodes in the candidate new DAG topology, the system selects the first node from those nodes that are in the open state and whose preceding dependent nodes are all in the completed state, and sets it to the active state. If the number of active nodes in the candidate new DAG topology exceeds a preset limit, the system retains the preset number of active nodes ranked first and adjusts the remaining active nodes to the open state. In the serial execution implementation, only one active node is retained.
[0069] For completed nodes, if the old version node matches the new version node, its completed state is retained to avoid duplicate execution.
[0070] Whether performing local or global replanning, the replanned DAG topology must pass a validity check before it can be activated.
[0071] First, perform a uniqueness check on the node identifier. No two different nodes can have the same node identifier. Second, perform dependency reference integrity checks. The start and end nodes of each dependency edge should exist in the node set: Third, perform acyclicity checks. In one implementation, the system uses the Kahn algorithm to calculate the in-degree of each node: The system adds all nodes with an in-degree of zero to a queue, and iteratively removes the head node and decreases the in-degree of its successor nodes until the queue is empty. Let the output topologically sorted node sequence be... ;like ,but ;like ,but Candidate DAG topologies are not activated. Acyclicity checks can also be implemented using depth-first search for cycle detection, incremental topology sorting, or built-in constraints in the graph database.
[0072] Fourth, perform hierarchical monotonicity verification. For any dependency edge... ,verify .
[0073] Fifth, verify the number of active nodes. The number of active nodes must meet the following requirements: In a serial execution implementation, .
[0074] Sixth, the completion status verification cannot be rolled back. For old nodes that have completed and meet the migration conditions, the matching nodes in the candidate new DAG topology remain in the completed state.
[0075] A candidate DAG topology will not be activated if it fails any of the necessary checks.
[0076] The system manages DAG topology changes persistently through versioning. Each topology version is associated with at least the topology version identifier, parent version identifier, generation time, version status, DAG topology data, triggering metric, replanning type, topology difference summary, number of state transitions, and verification results.
[0077] When a replanning is triggered, the system reads and freezes the currently active topology version, and generates a new topology version based on it. The new topology version is marked as a candidate during the generation and verification phases, while the old topology version remains a valid reference version for the execution system. Only after the new topology version passes all necessary validity checks will the system mark the old topology version as inactive and the new topology version as active within the same transaction or an operation with equivalent atomicity. If the new topology version fails validity checks, the old topology version remains active.
[0078] Topology versions can be stored in relational databases, document databases, graph databases, event sourcing logs, or object storage.
[0079] In one specific embodiment, the system maintains the initial DAG topology. The initial DAG topology includes eight nodes. to .node The root node; node and nodes Dependency Nodes ;node Dependency Nodes ;node Dependency Nodes .node Dependency Nodes ,node Dependency Nodes ,node Simultaneously dependent on nodes and nodes .
[0080] Execution subject completion node and nodes Then, at the execution node Multiple real-time feedback messages were generated within the nodes during this period; nodes Upon completion, node-level completion feedback is generated; node and nodes At the end of each phase, a phase-level comprehensive feedback is generated. The system calculates the feedback weight of each feedback event based on feedback granularity, feedback time, feedback quality, and confidence level, and obtains a capability vector: Among them, the completion rate accuracy pass rate Weighted average score Weakness Stability Topology unlock rate Interaction density or anomalous density .
[0081] System setting score threshold Pass rate threshold Accuracy threshold Threshold for the number of weak capability units .because It has already met the conditions for overall replanning; at the same time... The system is at the pass rate trigger boundary. It outputs GLOBAL, freezes the old DAG topology version, and sets the nodes... and nodes The system adds nodes to the completed state transition set and generates candidate new DAG topologies based on the original objective, current capability vector, weak capability unit set, completed node set, and old DAG topology summary. After verifying node uniqueness, dependency reference integrity, and acyclicity, the system will associate the candidate new DAG topologies with the nodes. and nodes The newly matched node is set to the completed state, the open node that is ranked first and whose preceding dependent nodes are all completed is set to the active state, and the candidate new DAG topology is activated as a new version.
[0082] In another feedback scenario with the same initial DAG topology, the weighted average score is 72, and the pass rate is 0.80, thus failing to meet the global replanning condition. However, the accuracy rate within the current active node's associated range is 0.55, lower than the accuracy rate threshold of 0.6, and the number of weak capability units reaches the threshold. At this point, the system outputs LOCAL, extracting only the currently active nodes. The local successor subgraph. Assume the capability unit with the highest weakest strength is... and The system generates reinforcement nodes. and reinforcement nodes This makes the reinforcement node dependent on the currently active node. And based on the matching degree of capability unit labels, the nodes are... The original successor node is replaced with the reinforcement node with the highest dependency matching degree. After rewriting the dependency edges and recalculating the topology level, the system performs acyclicity and dependency reference integrity checks on the local successor subgraph. The states of nodes outside the local successor subgraph and the completed nodes remain unchanged.
[0083] As can be seen from the two feedback scenarios above, when structural deviations occur, the system adopts global replanning and migrates the effectively completed state; when the overall indicators are acceptable but there are obvious local deviations near the currently active node, the system adopts local replanning, inserting only the necessary reinforcement nodes and rewriting the necessary dependency edges, thereby reducing the number of nodes that are repeatedly executed and the number of topology edits.
[0084] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.
Claims
1. A feedback-based dynamic topology replanning method, characterized in that, include: Generate and maintain the topology of the directed acyclic graph (DAG) based on the target context and constraints; During the execution of the DAG topology, multi-granularity feedback associated with DAG nodes is collected, and the multi-granularity feedback is uniformly generated into feedback events. Feedback weights are calculated based on the feedback granularity, timestamp, feedback quality, and confidence of each feedback event, and the set of feedback events is fused into a capability vector based on the feedback weights. The capability vector and the current DAG topology state are input into the replanning trigger decision module to calculate the global deviation score and the local deviation score, and output whether replanning is not required, local replanning, or global replanning is required. When outputting local replanning, extract the successor subgraph around the current active node, generate reinforcement nodes based on the set of weak capability units in the feedback event, insert the reinforcement nodes between the current active node and the original successor node, and rewrite the dependency edges of the original successor node to depend on the reinforcement nodes that match it. When outputting a global replanning, a candidate new DAG topology is generated based on the original target corresponding to the target context, the capability vector, the set of weak capability units, the set of completed nodes in the current DAG topology, and the old topology summary. The valid completed states in the old DAG topology are then migrated to the candidate new DAG topology. Perform a validity check on the replanned DAG topology, and activate the replanned DAG topology version after passing the validity check.
2. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, The DAG topology includes a set of nodes, a set of dependent edges, node states, topology levels, and node metadata; the node states include locked state, open state, active state, and completed state; the node metadata includes a combination of at least one of node objectives, node description, capability unit tags, recommended execution content, replanning markers, and source versions.
3. The feedback-based dynamic topology replanning method according to claim 2, characterized in that, When all the nodes that are dependent on a node meet the completion conditions, the node is changed from a locked state to an open state; during the replanning process, the completion state of completed nodes is maintained, and the number of active nodes in the same DAG topology version does not exceed the preset limit. The legality verification includes node identifier uniqueness verification, dependency reference integrity verification, acyclicity verification, hierarchical monotonicity verification, active node count verification, and non-reversible status verification of completed nodes.
4. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, Each feedback event is associated with at least one DAG node and includes feedback granularity, timestamp, feedback value, feedback quality, confidence level, set of positive capability units, and set of weak capability units. The feedback granularity includes intra-node instantaneous feedback, node-level completion feedback, and stage-level comprehensive feedback. A time decay factor is determined based on the time difference between the current calculation time and the timestamp of the feedback event, and a granularity weight is determined based on the feedback granularity. The time decay factor, granularity weight, feedback quality, and confidence level are combined to obtain the feedback weight. The feedback weight of the i-th feedback event is calculated according to the following formula: ; in, For the feedback granularity of the i-th feedback event The corresponding granularity weights, The time decay coefficient, For the current calculation time, Let i be the timestamp of the i-th feedback event. To provide feedback on quality, , where is the confidence level.
5. The feedback-based dynamic topology replanning method according to claim 4, characterized in that, The task completion rate is determined based on the number of completed nodes and the total number of nodes. The evaluation accuracy rate is determined based on the number of weighted correct items and the total number of weighted items. The evaluation pass rate is determined based on the weighted pass count and the total feedback weight. The weighted average score is determined based on the feedback score and the feedback weight. The vulnerability is determined based on the positive evidence corresponding to the positive capability unit set in the feedback event and the weak evidence corresponding to the weak capability unit set. The capability stability is determined based on the score sequence within the most recent multiple time windows. The topology unlocking rate is determined based on the proportion of completed nodes, active nodes, and open nodes in the node set. The interaction density or anomaly density is determined based on the number of interactions, the number of abnormal events, and the anomaly event penalty weight during execution.
6. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, The capability vector includes task completion rate, evaluation accuracy rate, evaluation pass rate, weighted average score, weakness, capability stability, topology unlocking rate, and interaction density or anomaly density.
7. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, When the global deviation score reaches the global deviation threshold, or when at least one indicator in the capability vector reaches the global replanning trigger threshold, global replanning is output. If the global replanning condition is not met, and at least one of the following conditions is met, local replanning is output: the local deviation score reaches the local deviation threshold, the evaluation accuracy is lower than the accuracy threshold, or the number of weak capability units in the weak capability unit set reaches the weak capability unit number threshold; otherwise, no replanning is required. By using a cooling window and hysteresis mechanism to suppress frequent replanning in a short period of time, if the time interval between the current moment and the last replanning time is less than the preset minimum replanning interval, the replanning decision result is corrected to no replanning required. The global deviation score is determined based on the evaluation pass rate, weighted average score, weakness, capability stability, and topology unlocking rate; the local deviation score is determined based on the evaluation accuracy, weakness, interaction density or anomaly density, and the local deviation intensity of the capability units associated with the currently active node.
8. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, The local replanning includes: Starting from the current active node, extract the successor node and successor dependency edge within the preset local replanning radius to obtain the successor subgraph; One or more reinforcement nodes are generated based on the set of weak capability units, and each reinforcement node is used to cover one or more weak capability units. Establish a dependency edge from the current active node to the reinforcement node, and rewrite the dependency edge of the original successor node to depend on the best matching reinforcement node. The topological hierarchy of the successor subgraph is recalculated, and the rewritten successor subgraph is checked for acyclicity and dependency reference integrity. The most matching reinforcement node is determined based on the similarity of the capability unit label between the reinforcement node and the original successor node; the editing cost of the local replanning is determined based on the sum of the number of reinforcement nodes, the number of deleted or disabled dependency edges, and the number of newly added dependency edges.
9. The feedback-based dynamic topology replanning method according to claim 1, characterized in that, The global replanning includes: Freeze the current DAG topology version and read the current DAG topology, the capability vector, the set of completed nodes, the set of weak capability units, the original objective, the constraints, and the historical feedback summary; Generate candidate new DAG topologies while keeping the original objective unchanged; Based on at least one of node identifier, node title similarity, capability unit label similarity, and structural position similarity, the completed nodes in the old DAG topology and the nodes in the candidate new DAG topology are matched; When the matching result meets the preset migration conditions, the completion status of the corresponding node in the old DAG topology is migrated to the matching node in the candidate new DAG topology; If there are no active nodes in the candidate new DAG topology, then the first open node whose preceding dependent nodes are all in a completed state is set as the active node. If the number of active nodes in the candidate new DAG topology exceeds a preset limit, then the preset number of active nodes ranked first are retained, and the remaining active nodes are adjusted to an open state.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the feedback-based dynamic topology replanning method according to any one of claims 1 to 9.
