Multi-agent collaborative task state management and abnormal backtracking method and system

By constructing a multi-agent collaborative task management system based on ontology models and Bayesian networks, the problem of difficulty in understanding the dependencies between agents was solved, and the accurate location and orderly recovery of anomaly sources were achieved, thereby improving the robustness and anomaly handling efficiency of the system.

CN121636241BActive Publication Date: 2026-05-08BEIJING YIZHUANG INTELLIGENT CITY RES INST GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING YIZHUANG INTELLIGENT CITY RES INST GRP CO LTD
Filing Date
2026-02-03
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing multi-agent systems struggle to understand the dependencies and influence mechanisms between agents when facing complex task scenarios, resulting in inefficient exception handling and significant resource waste.

Method used

By constructing an initial task knowledge graph based on an ontology model and applying a Bayesian network algorithm, a bidirectional causal chain is established, anomaly propagation nodes are identified, anomaly impact chains are generated, and a task recovery priority sequence is determined, thereby achieving orderly rollback of the agent's state.

Benefits of technology

Accurate identification of anomaly sources and scientific assessment of the scope of anomaly impact improve anomaly handling efficiency, ensure efficient recovery of collaborative tasks, and enhance the robustness and reliability of multi-agent systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121636241B_ABST
    Figure CN121636241B_ABST
Patent Text Reader

Abstract

The application provides a multi-agent cooperative task state management and abnormal backtracking method and system, relates to the technical field of artificial intelligence, and comprises the following steps: obtaining interaction data, state data and execution logs, constructing an initial task knowledge graph based on an ontology model, establishing a bidirectional causal chain by using a Bayesian network to form a dynamic knowledge graph, analyzing state migration rules when an abnormality is detected, identifying a propagation node, constructing an abnormal propagation subgraph, generating an influence chain, determining a recovery priority and triggering state rollback. The method can quickly trace the abnormal source, effectively control abnormal diffusion, and improve system robustness and task recovery efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to artificial intelligence technology, and more particularly to a method and system for state management and anomaly backtracking in multi-agent collaborative tasks. Background Technology

[0002] With the rapid development of artificial intelligence technology, multi-agent systems have been widely applied in fields such as industrial manufacturing, intelligent transportation, drone swarms, and distributed computing. Multi-agent cooperative task systems refer to systems where multiple agents work together to complete complex tasks through information interaction and behavioral coordination. In these systems, each agent possesses a certain degree of autonomous decision-making ability and interacts with other agents according to preset protocols or rules. As task complexity increases and the number of agents grows, the collaborative relationships between agents become more complex, making system state management and anomaly handling particularly important.

[0003] State management in multi-agent systems primarily relies on centralized monitoring systems or distributed state-sharing mechanisms. During collaborative task execution, agents continuously generate interaction data, state updates, and task execution records, which together constitute the system's operational state. When an agent malfunctions, quickly locating the source of the anomaly, assessing its impact, and effectively restoring the system become key challenges in multi-agent collaborative tasks.

[0004] Existing technologies lack the ability to deeply understand the semantics of multi-agent interaction data and state information, making it difficult to construct a complete knowledge structure that reflects the collaborative relationships between agents. Most systems only stay at the level of data collection and simple analysis, failing to accurately model complex agent collaborative behaviors, resulting in difficulties in understanding the dependencies and influence mechanisms between agents when facing complex task scenarios. Summary of the Invention

[0005] This invention provides a method and system for state management and anomaly backtracking in multi-agent collaborative tasks, which can solve the problems in the prior art.

[0006] A first aspect of this invention provides a method for state management and anomaly backtracking in multi-agent cooperative tasks, comprising:

[0007] Acquire interaction data, state data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks; perform semantic parsing on the interaction data, state data, and task execution logs based on a predefined ontology model to construct an initial task knowledge graph;

[0008] Based on the Bayesian network algorithm, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph. The historical behavior sequence of the agent and the task dependency depth are used as inputs to calculate the state transition probability of the edge, thus forming a dynamic knowledge graph.

[0009] When an abnormality is detected in the execution of an agent, a historical state sequence is constructed. Based on the historical state sequence, the state transition patterns between agents are analyzed to identify the propagation nodes of the abnormal state. According to the location information and task association information of the propagation nodes, the scope of the impact of the abnormality is determined, and a local subgraph reflecting the propagation trend of the abnormality is constructed.

[0010] Based on the analysis of the local subgraph, the scope of the anomaly propagation is analyzed, and an anomaly impact chain is generated. The task recovery priority sequence is determined according to the propagation depth in the anomaly impact chain. The state rollback operation of the agent is triggered level by level according to the order of the task recovery priority sequence. The state rollback result of each level is updated to the dynamic knowledge graph. After all rollback operations are completed, the task state transition probability is recalculated.

[0011] Based on a predefined ontology model, semantic parsing is performed on the interaction data, the state data, and the task execution logs to construct an initial task knowledge graph, including:

[0012] Entity type definitions and attribute constraint rules are extracted from the predefined ontology model. Based on the entity type definitions, multi-source data fusion is performed on the interaction data, the state data, and the task execution log to identify intelligent agent entities, task entities, and resource entities. Semantic consistency verification is performed on the identified entities according to the attribute constraint rules, and entities that pass the verification are labeled with unique identifiers.

[0013] Based on the relational pattern definition in the predefined ontology model, the collaboration pattern in the interaction data and the state dependency relationship in the state data are parsed, and initial relational edges are established between the intelligent agent entity, the task entity, and the resource entity.

[0014] The event sequence and state transition record are extracted from the task execution log. The timestamp information in the event sequence and the triggering conditions in the state transition record are correlated and analyzed to identify event pairs with causal transmission characteristics. Based on the event pairs, the initial relation edge is assigned a temporal weight and a causal strength identifier.

[0015] Using intelligent agent entities, task entities, and resource entities labeled with unique identifiers as entity nodes, and connecting the corresponding entity nodes with initial relation edges that are assigned temporal weights and causal strength identifiers, an initial task knowledge graph is constructed.

[0016] Based on the Bayesian network algorithm, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph. The historical behavior sequence of the agent and the task dependency depth are used as inputs to calculate the state transition probability of the edge, forming a dynamic knowledge graph including:

[0017] The dependencies between task entities and the historical behavior sequences of intelligent entities are extracted from the initial task knowledge graph. A forward chain is established for each relation edge based on the directionality of the dependencies, and a reverse chain is established for each relation edge based on the state change propagation pattern in the historical behavior sequence, forming a bidirectional causal chain structure.

[0018] Calculate the dependency depth of each task entity in the initial task knowledge graph in the forward chain, use the dependency depth as a task complexity feature, and simultaneously count the state transition frequency of the agent entity in the historical behavior sequence in the reverse chain.

[0019] The dependency depth and the state transition frequency are constructed as a condition variable pair. Based on the Bayesian network algorithm, the conditional probability of the successor node undergoing a state transition is calculated under the condition of the dependency depth of the predecessor node. The conditional probability is used as the state transition probability of the corresponding relation edge in the bidirectional causal chain structure. The state transition probability is labeled to the corresponding relation edge in the forward chain and the reverse chain respectively to form a dynamic knowledge graph.

[0020] Based on the directionality of the dependency relationship, a forward chain is established for each relation edge, and based on the state change propagation pattern in the historical behavior sequence, a reverse chain is established for each relation edge, forming a bidirectional causal chain structure including:

[0021] The dependencies between task entities in the initial task knowledge graph are analyzed, the directional features of the dependencies are extracted, the execution order between task entities is determined according to the directional features, a forward chain is established for each relation edge along the execution order, and a dependency level identifier is marked for each relation edge in the forward chain.

[0022] Extract the state records of the intelligent entity at different times from the historical behavior sequence, calculate the state change of the intelligent entity between adjacent times, and identify state transition events where the state change exceeds a preset change threshold.

[0023] Analyze the propagation path of the state transition event corresponding to the relation edge in the initial task knowledge graph, establish a reverse chain for each relation edge based on the reverse tracing direction of the propagation path, and mark the propagation delay identifier for each relation edge in the reverse chain according to the triggering sequence of the state transition event.

[0024] The forward chain labeled with the dependency level identifier and the reverse chain labeled with the propagation delay identifier are associated with the same relation edge in the initial task knowledge graph to form a bidirectional causal chain structure.

[0025] Based on the historical state sequence analysis, the state transition patterns between agents are analyzed to identify the propagation nodes of abnormal states; according to the location information and task association information of the propagation nodes, the scope of the impact of the anomaly is determined, and a local subgraph reflecting the propagation trend of the anomaly is constructed, including:

[0026] Analyze the state transition trajectories of intelligent entities in adjacent time steps in the historical state sequence, count the transition frequency of each state transition in the state transition trajectory, mark the transition direction of each state transition, and map the transition frequency and the transition direction to the state transition rules between intelligent entities.

[0027] Based on the state transition rules, the propagation path of the abnormal state is traced back along the reverse chain in the dynamic knowledge graph to obtain the state transition probability of each predecessor node on the propagation path. The state transition probability and the transition frequency are then fused to quantify the contribution weight of each predecessor node.

[0028] Determine the relationship between the contribution weight of each predecessor node and the dynamic threshold, filter predecessor nodes whose contribution weight exceeds the dynamic threshold and mark them as propagation nodes, and record the topological position information of the propagation nodes in the dynamic knowledge graph.

[0029] Query the task entities associated with the propagation nodes in the dynamic knowledge graph, obtain the task association information of the task entities, define the scope of the impact of the anomaly based on the topological location information and the task association information, extract the entity nodes and relation edges within the scope of the impact with the propagation node as the central node, and organize them into a local subgraph that reflects the propagation trend of the anomaly.

[0030] Based on the analysis of the local subgraph, the scope of anomaly propagation is analyzed, an anomaly impact chain is generated, and the task recovery priority sequence is determined according to the propagation depth in the anomaly impact chain, including:

[0031] The relational edges in the local subgraph are analyzed, and the propagation trajectory of the abnormal state from the propagation node to the successor node is drawn along the propagation direction of the relational edges. The temporal chain of entity nodes through which the propagation trajectory passes is formed, and the propagation level from the propagation node to each successor node in the propagation trajectory is calculated. Based on the temporal chain of entity nodes and the propagation level, the abnormal impact topology is constructed.

[0032] The attribute information of intelligent entities and task entities associated with each entity node in the anomaly-affected topology is mapped, and the attribute information is fused with the association features of the propagation level. A corresponding recovery priority is set for entity nodes at different propagation levels, and the entity nodes in the anomaly-affected topology are reorganized according to the quantitative index of the recovery priority to generate a multi-level task recovery sequence.

[0033] Mapping the attribute information of intelligent entities and task entities associated with each entity node in the topology affected by the anomaly, fusing the attribute information with the association features of the propagation level, and setting corresponding recovery priorities for entity nodes at different propagation levels includes:

[0034] Obtain the entity nodes in the topology affected by the anomaly, and map the attribute information of the corresponding intelligent entity and task entity based on the association relationship of the entity nodes; perform feature fusion of the attribute information and the propagation level of each entity node to form a node-level association matrix, characterize the degree of influence of nodes at different levels based on the node-level association matrix, and set the recovery priority for entity nodes at different propagation levels according to the degree of influence.

[0035] A second aspect of the present invention provides a state management and anomaly backtracking system for multi-agent cooperative tasks, comprising:

[0036] The first unit is used to acquire interaction data, status data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks; and to perform semantic parsing on the interaction data, status data, and task execution logs based on a predefined ontology model to construct an initial task knowledge graph.

[0037] The second unit is used to establish a bidirectional causal chain for each relation edge in the initial task knowledge graph based on the Bayesian network algorithm, and to use the agent's historical behavior sequence and task dependency depth as input to calculate the state transition probability of the edge, thereby forming a dynamic knowledge graph.

[0038] The third unit is used to construct a historical state sequence when an abnormality in the execution of an agent is detected, analyze the state transition patterns between agents based on the historical state sequence, identify the propagation nodes of the abnormal state, determine the scope of the abnormality's impact based on the location information and task association information of the propagation nodes, and construct a local subgraph reflecting the propagation trend of the abnormality.

[0039] The fourth unit is used to analyze the scope of anomaly propagation based on the local subgraph, generate anomaly impact chains, determine the task recovery priority sequence according to the propagation depth in the anomaly impact chains, trigger the state rollback operation of the agent level by level according to the order of the task recovery priority sequence, update the state rollback result of each level to the dynamic knowledge graph, and recalculate the task state transition probability after completing all rollback operations.

[0040] A third aspect of the present invention provides an electronic device, comprising:

[0041] processor;

[0042] Memory used to store processor-executable instructions;

[0043] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0044] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0045] The beneficial effects of this application are as follows:

[0046] By constructing an initial task knowledge graph based on an ontology model and applying a Bayesian network algorithm to establish a bidirectional causal chain, a structured expression and dynamic management of the state information of agent collaborative tasks is realized, effectively solving the problem that traditional methods are difficult to capture complex dependencies between agents.

[0047] By analyzing the state transition patterns between agents based on historical state sequences, we can accurately identify anomaly propagation nodes, improving the accuracy of anomaly source localization and reducing the complexity of anomaly diagnosis compared to traditional methods. By constructing a local subgraph reflecting the anomaly propagation trend and generating anomaly impact chains, we can scientifically assess the scope of anomaly impact, avoiding the waste of system resources caused by global state backtracking and improving the efficiency of anomaly handling.

[0048] By determining the task recovery priority sequence based on the propagation depth in the anomaly impact chain, the orderly rollback of agent states is achieved, ensuring efficient recovery of collaborative tasks after anomalies occur and enhancing the robustness and reliability of multi-agent systems. Attached Figure Description

[0049] Figure 1 This is a flowchart illustrating the state management and anomaly backtracking method for multi-agent collaborative tasks according to an embodiment of the present invention.

[0050] Figure 2 This is a flowchart of the intelligent agent task recognition optimization based on multi-source attribute constraint rules in an embodiment of the present invention. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0053] Figure 1 This is a flowchart illustrating the state management and anomaly backtracking method for multi-agent collaborative tasks according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0054] Acquire interaction data, state data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks; perform semantic parsing on the interaction data, state data, and task execution logs based on a predefined ontology model to construct an initial task knowledge graph;

[0055] Based on the Bayesian network algorithm, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph. The historical behavior sequence of the agent and the task dependency depth are used as inputs to calculate the state transition probability of the edge, thus forming a dynamic knowledge graph.

[0056] When an abnormality is detected in the execution of an agent, a historical state sequence is constructed. Based on the historical state sequence, the state transition patterns between agents are analyzed to identify the propagation nodes of the abnormal state. According to the location information and task association information of the propagation nodes, the scope of the impact of the abnormality is determined, and a local subgraph reflecting the propagation trend of the abnormality is constructed.

[0057] Based on the analysis of the local subgraph, the scope of the anomaly propagation is analyzed, and an anomaly impact chain is generated. The task recovery priority sequence is determined according to the propagation depth in the anomaly impact chain. The state rollback operation of the agent is triggered level by level according to the order of the task recovery priority sequence. The state rollback result of each level is updated to the dynamic knowledge graph. After all rollback operations are completed, the task state transition probability is recalculated.

[0058] In one optional implementation, semantic parsing of the interaction data, the state data, and the task execution log based on a predefined ontology model is performed to construct an initial task knowledge graph, including:

[0059] Entity type definitions and attribute constraint rules are extracted from the predefined ontology model. Based on the entity type definitions, multi-source data fusion is performed on the interaction data, the state data, and the task execution log to identify intelligent agent entities, task entities, and resource entities. Semantic consistency verification is performed on the identified entities according to the attribute constraint rules, and entities that pass the verification are labeled with unique identifiers.

[0060] Based on the relational pattern definition in the predefined ontology model, the collaboration pattern in the interaction data and the state dependency relationship in the state data are parsed, and initial relational edges are established between the intelligent agent entity, the task entity, and the resource entity.

[0061] The event sequence and state transition record are extracted from the task execution log. The timestamp information in the event sequence and the triggering conditions in the state transition record are correlated and analyzed to identify event pairs with causal transmission characteristics. Based on the event pairs, the initial relation edge is assigned a temporal weight and a causal strength identifier.

[0062] Using intelligent agent entities, task entities, and resource entities labeled with unique identifiers as entity nodes, and connecting the corresponding entity nodes with initial relation edges that are assigned temporal weights and causal strength identifiers, an initial task knowledge graph is constructed.

[0063] like Figure 2 As shown, the method includes:

[0064] Entity type definitions and attribute constraint rules are extracted from a predefined ontology model. This ontology model predefines the conceptual hierarchy, attribute characteristics, and relational constraints of various entities in the intelligent collaborative environment. For example, intelligent agent entities include two subtypes: "human operator" and "automated agent," each with a different set of attributes. For human operators, attributes include "specialty," "skill level," and "response time"; while automated agents include attributes such as "algorithm type," "computing power," and "decision accuracy." Task entities can be divided into "main tasks" and "subtasks," with attributes such as "priority," "deadline," and "completion status," respectively. Resource entities include "data resources," "computing resources," and "physical devices," each with different availability constraints and access permissions.

[0065] Based on the extracted entity type definitions, multi-source data is fused. Natural language processing techniques are applied to communication records in the interaction data to identify the identities of agents, task assignments, and resource calls mentioned in the dialogue. Simultaneously, the current attribute values ​​and state markers of each entity are extracted from the structured records of the state data. For task execution logs, log parsing algorithms are applied to extract operation sequences and event records. These three data sources are then linked using an entity matching algorithm to resolve data inconsistencies and form a unified set of entity descriptions.

[0066] Semantic consistency checks are performed on the identified entities. Based on the attribute constraint rules defined in the ontology model, the attribute values ​​of each entity are verified to meet the requirements of value range, type, and logical consistency. For example, it checks whether the "deadline" of a task entity is later than its "creation time," and verifies whether the "usage status" of a resource entity matches its "availability flag." Entities that do not conform to the constraint rules are marked as pending correction, and the reasons for the inconsistency are recorded. For entities that pass the verification, a unique identifier is generated, using the format "entity type-timestamp-random string" to ensure global uniqueness.

[0067] Based on the relational schema definitions in the ontology model, entity relationships in interaction data and state data are parsed. In the interaction data, collaboration patterns such as "assignment," "assistance," and "supervision" are identified by analyzing dialogue content, establishing relationship edges between agents and tasks. From the state data, state dependencies such as "dependency," "preconditions," and "resource consumption" are extracted to connect relationships between tasks and between tasks and resources. Initial relationship edges contain basic attributes such as relationship type, establishment time, and relationship strength.

[0068] To enhance the semantic depth of the knowledge graph, temporal information and causal relationships are extracted from task execution logs. First, the logs are parsed into structured event sequences, with each event containing event type, occurrence time, related entities, and state changes. Time window analysis is used to identify time-proximity event pairs and calculate the time interval between them. Simultaneously, triggering relationships between events are analyzed based on state transition records. By comparing the outcome state of the preceding event with the triggering conditions of the following event, a causal relationship between the two events is determined. The causal strength of the identified event pairs is calculated, considering factors such as event co-occurrence frequency, time interval, and state matching degree.

[0069] The identified causal relationship information is used to enhance the semantic expression of the initial relationship edges, and a temporal weight is assigned to each relationship edge to reflect the temporal pattern of interaction between entities; at the same time, the causal strength is labeled to quantify the directness of the influence between entities. For example, if there is a high frequency of co-occurrence and a short time interval between the completion event of task A and the start event of task B, the causal strength value of the relationship edge between them is increased.

[0070] Entity nodes labeled with unique identifiers and enhanced relation edges are integrated into an initial task knowledge graph. The graph is stored using an attribute graph model. Each node contains entity type, identifier, and attribute set, and each edge contains relation type, direction, temporal weight, and causal strength identifier. Graph database technology is used to implement the graph's storage and query functions, supporting subsequent graph refinement and applications.

[0071] In practical applications, such as in intelligent manufacturing environments, this method can construct a knowledge graph from the interaction data of production equipment (intelligent agents), production tasks, and material resources (resources). For example, it can identify entities such as "CNC machining center" (intelligent agent), "part machining task" (task), and "raw materials" (resources) from equipment communication logs, production plan status tables, and quality inspection records, and construct the relationships between them based on the temporal dependencies in the production process, forming a knowledge graph that reflects the collaborative process of intelligent manufacturing, providing a knowledge foundation for production optimization and fault diagnosis.

[0072] In one optional implementation, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph based on a Bayesian network algorithm. The agent's historical behavior sequence and task dependency depth are used as inputs to calculate the state transition probabilities of the edges, forming a dynamic knowledge graph, including:

[0073] The dependencies between task entities and the historical behavior sequences of intelligent entities are extracted from the initial task knowledge graph. A forward chain is established for each relation edge based on the directionality of the dependencies, and a reverse chain is established for each relation edge based on the state change propagation pattern in the historical behavior sequence, forming a bidirectional causal chain structure.

[0074] Calculate the dependency depth of each task entity in the initial task knowledge graph in the forward chain, use the dependency depth as a task complexity feature, and simultaneously count the state transition frequency of the agent entity in the historical behavior sequence in the reverse chain.

[0075] The dependency depth and the state transition frequency are constructed as a condition variable pair. Based on the Bayesian network algorithm, the conditional probability of the successor node undergoing a state transition is calculated under the condition of the dependency depth of the predecessor node. The conditional probability is used as the state transition probability of the corresponding relation edge in the bidirectional causal chain structure. The state transition probability is labeled to the corresponding relation edge in the forward chain and the reverse chain respectively to form a dynamic knowledge graph.

[0076] When extracting dependencies between task entities from the initial task knowledge graph, a graph traversal algorithm is used to identify directed edge connections between all task nodes, recording the starting node identifier, target node identifier, edge weight, and edge type attribute for each edge. Task entities include specific execution units, resource allocation nodes, constraint condition nodes, etc., and each entity has a unique identifier, a set of state attributes, a priority value, and a resource requirement description. Dependencies are stored using an adjacency matrix or adjacency list data structure. Matrix element values ​​represent dependency strength, ranging from 0 to 1 as floating-point numbers, with precision maintained to 4 decimal places. The historical behavior sequence of the agent entity is represented by a timestamp-sorted list of state change records. Each record includes a timestamp, agent identifier, state change type, state value before change, state value after change, trigger condition, and execution result flag. State values ​​are represented using an enumeration type or a numerical range, and timestamps are accurate to the millisecond level.

[0077] The forward chain structure is built based on the natural directionality of dependencies. A directed acyclic graph (DAG) is constructed along the task dependency direction. Each forward chain path starts from the root task node and extends to the leaf task nodes in dependency order. The path length reflects the depth of the dependency chain. The forward chain construction process uses a depth-first search algorithm, starting from a node with an in-degree of 0 and recursively visiting all successor nodes, recording complete path information and detecting the existence of cycles. When a cycle is detected, the weakest dependency edge is broken through heuristic rules or manual intervention to ensure the acyclicity of the graph structure. The reverse chain structure is built based on the propagation pattern of state changes in historical behavior sequences. By analyzing the frequency and direction of state transitions during task execution, a reverse reasoning link from the result state to the cause state is constructed. The reverse chain construction algorithm statistically analyzes the frequency distribution of adjacent state transitions in the historical sequence, identifies high-frequency transition patterns, and establishes reverse causal relationships. The weight of the reverse edge is calculated based on the transition frequency and a time decay factor, with the time decay factor ranging from 0.5 to 0.95 and a default value of 0.8.

[0078] The dependency depth of a task entity in the forward chain is calculated using a level-order traversal algorithm. Starting from the root node, the maximum path length of each node is calculated layer by layer. The dependency depth is equal to the longest path length from the root node to the current node plus 1. In scenarios with multiple root nodes, the maximum value of all path lengths is taken as the dependency depth of that node. Parallel dependency branches need to be handled during dependency depth calculation. A dynamic programming method is used to cache intermediate calculation results to avoid redundant computation. Dependency depth serves as a task complexity feature, with a value ranging from positive integers, typically between 1 and 15. Depth values ​​exceeding 15 require manual review and confirmation. When counting the frequency of state transitions of an agent entity in the reverse chain, a state transition counting matrix is ​​established. The row and column indices correspond to the state enumeration values, and the matrix elements record the number of times the corresponding state transition occurred. A sliding window mechanism is used for state transition frequency statistics. The window size is set to 1000 historical records by default, and the sliding step is 100 records to ensure the timeliness and stability of the statistical results.

[0079] When constructing condition variable pairs using dependency depth and state transition frequency, a discretization method is used to map continuous values ​​to a finite state space. Dependency depth is divided into three levels (low, medium, and high) using equal intervals, with cutoff points set at 3 and 7 respectively. State transition frequency is divided into three levels (sparse, moderate, and frequent) using a logarithmic scale, with cutoff points determined based on historical data quantiles. Condition variable pairs are stored as key-value pairs, where the key is a combined encoding of the dependency depth level and the state transition frequency level, and the value is the corresponding sample count or probability estimate.

[0080] When calculating conditional probabilities using Bayesian network algorithms, a probabilistic graphical model is constructed, incorporating the dependency depth of predecessor nodes, state transition events of successor nodes, and relevant environmental variables. The Bayesian network structure is represented as a directed acyclic graph, where nodes correspond to random variables and edges represent conditional dependencies. The conditional probability calculation employs maximum likelihood estimation, utilizing historical data to statistically analyze the joint frequency distribution of each variable combination and estimating the conditional probability value through frequency ratios. Laplace smoothing is used for smoothing, with the smoothing parameter set to 0.1 by default to avoid zero probability issues. The calculation of conditional probabilities must address data sparsity; when the observed samples for some variable combinations are insufficient, hierarchical Bayesian methods or empirical Bayesian estimation are used for probability inference.

[0081] State transition probabilities, as weight parameters of edges in a bidirectional causal chain structure, reflect the likelihood of a successor node undergoing a specific state transition given the state of its predecessor node. The calculated state transition probabilities are stored as floating-point numbers, with a value range limited to 0 to 1 and a precision of 6 decimal places. The calculation process employs numerically stable logarithmic space operations to avoid underflow issues. The state transition probability update mechanism uses incremental learning; when new observation data arrives, existing probability estimates are adjusted using Bayesian update rules. The update frequency can be configured for real-time or batch update modes, with the default batch update period set to 24 hours.

[0082] The process of annotating state transition probabilities to corresponding edges in the forward and reverse chains utilizes a graph database or in-memory graph structure for efficient storage and access. Forward chain edge weights are stored in the `forward_transition_probability` field of the edge attribute, while reverse chain edge weights are stored in the `backward_transition_probability` field. Edge weight annotation employs atomic operations to ensure data consistency and supports concurrent read / write access. The dynamic knowledge graph update process includes incremental probability updates, edge weight recalculation, graph structure optimization, and anomaly detection mechanisms. Detailed logs are maintained for update operations to facilitate auditing and rollback.

[0083] The validation case uses an initial knowledge graph containing 5 task entities, labeled TaskA, TaskB, TaskC, TaskD, and TaskE. Dependencies include 7 directed edges: TaskA depends on TaskB and TaskC, TaskB depends on TaskD, and TaskC depends on TaskE. The agent's historical behavior sequence contains 1000 state change records spanning 30 days, with four state types: waiting, executing, completed, and abnormal. Dependency depth calculations show a depth of 1 for TaskD and TaskE, 2 for TaskB and TaskC, and 3 for TaskA. State transition frequency statistics show 320 transitions from waiting to executing, 285 transitions from executing to completed, and 35 transitions from executing to abnormal. The Bayesian network is trained using the expectation-maximization algorithm with 50 iterations and a convergence threshold of 0.001. In the final generated dynamic knowledge graph, the weight of the forward link from TaskB to TaskA is 0.783, and the weight of the reverse link from TaskA to TaskB is 0.217. The weight values ​​range from 0.1 to 0.9. The update cycle is 12 hours. The computational resource consumption includes approximately 500 megabytes of memory usage and a peak CPU utilization of 15%.

[0084] In one optional implementation, a forward chain is established for each relation edge based on the directionality of the dependency, and a reverse chain is established for each relation edge based on the state change propagation pattern in the historical behavior sequence, forming a bidirectional causal chain structure, including:

[0085] The dependencies between task entities in the initial task knowledge graph are analyzed, the directional features of the dependencies are extracted, the execution order between task entities is determined according to the directional features, a forward chain is established for each relation edge along the execution order, and a dependency level identifier is marked for each relation edge in the forward chain.

[0086] Extract the state records of the intelligent entity at different times from the historical behavior sequence, calculate the state change of the intelligent entity between adjacent times, and identify state transition events where the state change exceeds a preset change threshold.

[0087] Analyze the propagation path of the state transition event corresponding to the relation edge in the initial task knowledge graph, establish a reverse chain for each relation edge based on the reverse tracing direction of the propagation path, and mark the propagation delay identifier for each relation edge in the reverse chain according to the triggering sequence of the state transition event.

[0088] The forward chain labeled with the dependency level identifier and the reverse chain labeled with the propagation delay identifier are associated with the same relation edge in the initial task knowledge graph to form a bidirectional causal chain structure.

[0089] When parsing the dependencies between task entities in the initial task knowledge graph, a graph parsing module is used to perform a depth-first traversal of the knowledge graph, identifying all task entity nodes and their connected directed edges. Task entity nodes contain core fields such as entity identifier, entity type, set of state attributes, resource requirements, and priority weight. Entity identifiers are in string format with a length limit of 32 characters. The entity type enumeration includes four categories: computational task, data task, control task, and resource task. Dependencies are represented as directed edges. Each edge contains attributes such as source node identifier, target node identifier, dependency type, dependency strength value, and constraints. The dependency strength value is represented as a floating-point number in the range of 0.0 to 1.0, with precision maintained to three decimal places.

[0090] Directional features of dependencies are extracted to determine the execution order of tasks by identifying the start and end nodes of edges. These directional features are labeled with Boolean values ​​indicating whether each edge represents the forward or reverse direction. The graph analysis algorithm uses topological sorting to detect cycles. When a cycle is detected, the cycle path is recorded and an exception handling mechanism is triggered. Cycle detection employs a depth-first search algorithm with a time complexity of O(V+E), where V represents the number of nodes and E represents the number of edges. An adjacency list data structure is established during directional feature extraction. Each node corresponds to a linked list storing all its outgoing edge information. The memory space occupied by the adjacency list is proportional to the number of edges in the graph; in typical scenarios, the memory consumption is approximately the number of edges multiplied by 48 bytes.

[0091] When determining the execution order of task entities based on directional characteristics, a topological sorting algorithm is used to generate the task execution sequence. The execution order is stored as an ordered list, where each element is a sorted sequence of task entity identifiers. The topological sorting process maintains an in-degree counter, recording the number of predecessor nodes for each node. Nodes with an in-degree of 0 are prioritized for execution. When multiple nodes simultaneously meet the condition of having an in-degree of 0, they are sorted according to their priority weights. Nodes with higher weights are executed first, and if weights are the same, they are arranged lexicographically according to their identifiers. The determination of the execution order needs to handle concurrent execution scenarios. Tasks that can be executed in parallel are marked as being at the same execution level, with level numbers starting from 0 and increasing sequentially. Tasks within the same level can be executed concurrently without dependency conflicts.

[0092] When building a forward chain for each relation edge in the execution order, the forward chain represents the propagation direction of task dependencies, pointing from the source task to the target task. The forward chain construction algorithm traverses the topology sorting result and assigns a forward chain identifier to each directed edge. The identifier is a string format consisting of the source node ID and the target node ID, separated by an underscore. The forward chain data structure includes fields such as chain identifier, source node, target node, chain length, propagation delay, and activation status. The chain length represents the shortest path length from the source node to the target node. The propagation delay is calculated based on historical execution data and ranges from 1 millisecond to 10 seconds, with a default value of 100 milliseconds.

[0093] When labeling each relation edge in the forward chain with a dependency level identifier, the dependency level identifier reflects the task's depth position in the entire execution flow. The level value starts from 0, with the root node having a level of 0, its direct successor nodes having a level of 1, and so on. The level identifier calculation uses a breadth-first search algorithm, starting from all nodes with an in-degree of 0 and propagating the level value downwards layer by layer. The level of each node is equal to the maximum level of all its predecessor nodes plus 1. When a task entity has multiple predecessor paths, the maximum level value among the paths is taken as the final level of that node, ensuring the monotonicity and consistency of the level identifier. The dependency level identifier is stored in the edge attributes, with the field name being "dependency level," the data type being a non-negative integer, and the value range being 0 to 100. Level values ​​outside this range trigger data validation anomalies.

[0094] When extracting state records of intelligent agents at different times from historical behavior sequences, the historical behavior sequences are stored in a time-series data structure. Each record contains fields such as timestamp, agent identifier, state value, state type, and context information. The timestamp uses the Unix timestamp format, accurate to the millisecond level. The agent identifier uses a globally unique identifier. The state value uses different data formats depending on the state type: numerical states are represented as floating-point numbers, and enumerated states are represented as string constants. The state record extraction process uses a sliding time window mechanism, with a default window size of 1000 records and a sliding step of 100 records, ensuring the continuity and completeness of state extraction.

[0095] When calculating the state change of an agent entity between adjacent time steps, the state change is defined as the difference or rate of change between the current state value and the previous state value. Numerical state changes are calculated using the absolute difference, i.e., the absolute value of the current value minus the absolute value of the previous time step. Enumerated state changes use Hamming distance or edit distance to measure the degree of state difference. State change calculation supports multiple state types, including continuous numerical states, discrete enumerated states, vector states, and composite states, each with a specific change calculation method. During the change calculation process, missing and outlier values ​​must be handled. Missing values ​​are handled using linear interpolation or previous value imputation methods, while outliers are detected and filtered using the 3x standard deviation rule or quartile interval method.

[0096] When a state transition event is identified where the change in state exceeds a preset threshold, the preset threshold is dynamically set based on historical data statistical characteristics. For numerical states, the threshold is set to twice the standard deviation of historical changes; for enumerated states, it is set to 0.5; and for vector states, the threshold uses a cosine similarity of less than 0.8 as a criterion. State transition event detection employs a sliding window anomaly detection algorithm with a window length of 50 time points. Detection sensitivity can be adjusted via a threshold multiplier ranging from 1.0 to 5.0, with a default value of 2.0. State transition event records include fields such as event identifier, occurrence time, agent identifier, state before change, state after change, change magnitude, and event type. The event identifier uses a combination of timestamp and random number to ensure global uniqueness.

[0097] When analyzing the propagation paths of state transition events along the corresponding edges in the initial task knowledge graph, the propagation path represents how state changes spread along task dependencies within the graph. The propagation path analysis algorithm employs a breadth-first search method, starting from the source node where the state transition event occurs and expanding outwards along the directed edges of the graph, recording all propagation paths and their distances. Propagation paths are stored as a path list, with each path containing information such as node sequence, edge sequence, path length, and propagation delay. The path length represents the number of edges in the path, and the propagation delay is calculated cumulatively based on the edge weights. A maximum search depth limit is set during propagation path analysis, with a default depth of 10 levels to avoid generating excessively long search paths in complex graph structures.

[0098] When establishing a reverse chain for each relation edge based on the reverse tracing direction of the propagation path, the reverse chain represents the reverse propagation direction of the state change, pointing from the affected node of the state change to the source node of the change. The reverse chain construction algorithm reverses the direction of the forward propagation path to generate the corresponding reverse propagation path. The reverse chain identifier is a string format of the target node ID concatenated with the source node ID. The reverse chain data structure is similar to that of the forward chain, including fields such as chain identifier, source node, target node, reverse length, backtracking delay, and activation state. The backtracking delay represents the time required for the state change to trace back from the target node to the source node, and its value ranges from 0.5 times to 2 times the propagation delay.

[0099] When each relation edge in the reverse chain is labeled with a propagation delay identifier based on the triggering sequence of state transition events, the propagation delay identifier reflects the time consumption characteristics of state changes during the reverse propagation process. Propagation delay calculation is based on statistical analysis of historical state transition events, using the average time interval between events as the baseline delay, while also considering factors such as network transmission latency, processing computation latency, and queue waiting latency. The propagation delay identifier is stored in the reverse chain edge attributes, with the field name "Propagation Delay," data type being a positive integer, and unit being milliseconds. Delay values ​​exceeding the range trigger a performance warning mechanism. The delay identifier update mechanism uses an exponential moving average method, with a weight of 0.1 for new observations and a weight of 0.9 for historical averages, ensuring the stability and adaptability of the delay estimation.

[0100] When a forward chain labeled with a dependency hierarchy identifier and a reverse chain labeled with a propagation delay identifier are associated with the same relation edge in the initial task knowledge graph, the association operation achieves pairing and binding of the forward and reverse chains through edge identifiers. The association data structure uses a doubly linked list or hash table to achieve fast lookup and access. Each relation edge corresponds to a forward chain object and a reverse chain object, and an index mapping relationship is established through the edge ID. The doubly causal chain structure is stored in the form of a graph database or in-memory graph structure, supporting high-concurrency read and write operations and transaction consistency guarantees. The storage space consumption is about 3 times that of the original knowledge graph, and the query performance is O(1) time complexity.

[0101] In one optional implementation, the state transition patterns between agents are analyzed based on the historical state sequence to identify propagation nodes of abnormal states; the scope of the impact of the abnormality is determined according to the location information and task association information of the propagation nodes, and a local subgraph reflecting the propagation trend of the abnormality is constructed, including:

[0102] Analyze the state transition trajectories of intelligent entities in adjacent time steps in the historical state sequence, count the transition frequency of each state transition in the state transition trajectory, mark the transition direction of each state transition, and map the transition frequency and the transition direction to the state transition rules between intelligent entities.

[0103] Based on the state transition rules, the propagation path of the abnormal state is traced back along the reverse chain in the dynamic knowledge graph to obtain the state transition probability of each predecessor node on the propagation path. The state transition probability and the transition frequency are then fused to quantify the contribution weight of each predecessor node.

[0104] Determine the relationship between the contribution weight of each predecessor node and the dynamic threshold, filter predecessor nodes whose contribution weight exceeds the dynamic threshold and mark them as propagation nodes, and record the topological position information of the propagation nodes in the dynamic knowledge graph.

[0105] Query the task entities associated with the propagation nodes in the dynamic knowledge graph, obtain the task association information of the task entities, define the scope of the impact of the anomaly based on the topological location information and the task association information, extract the entity nodes and relation edges within the scope of the impact with the propagation node as the central node, and organize them into a local subgraph that reflects the propagation trend of the anomaly.

[0106] Analyzing the state transition trajectories of intelligent agents in historical state sequences involves extracting the state records of each agent at different time points from a time-series database. For example, for a vehicle agent in an intelligent transportation system, its states include "normal driving," "deceleration," and "stopping." Through time window sliding analysis, the state changes of each agent from time point t to t+1 are extracted, such as the transition from "normal driving" to "deceleration." The state transitions of all agents are statistically analyzed, and the frequency of each state transition is calculated. For example, the number of times state A transitions to state B is divided by the total number of times state A occurs, yielding the transition probability P(B|A). Simultaneously, the directions of these state transitions are labeled, and the source and target agents of the state transitions are recorded. A directed weighted graph is constructed to represent the state transition relationships between agents, where the edge weight represents the transition frequency, and the edge direction represents the transition direction.

[0107] Based on the aforementioned state transition rules, when an abnormal state is detected in the system, a reverse backtracking is performed along the relational edges in the dynamic knowledge graph to find the predecessor node that caused the abnormality. For example, in a supply chain network, if a retailer experiences an inventory anomaly, the upstream supplier node is traced back. By traversing all incoming edges of the abnormal node, the set of directly connected predecessor nodes is obtained. Then, the backtracking continues recursively to these predecessor nodes until a preset backtracking depth is reached or a confirmed source of the anomaly is encountered. During the backtracking process, the state transition probability of each predecessor node is calculated, i.e., the probability that the node will transition to an abnormal state. Simultaneously, the transition frequency observed in historical data is considered, and the state transition probability and transition frequency are combined using a weighted average to obtain a comprehensive index as the contribution weight of the predecessor node. The calculation formula can be expressed as: Contribution weight = α × State transition probability + β × Transition frequency, where α and β are weight coefficients, and α + β = 1.

[0108] When determining the relationship between the contribution weight of each predecessor node and the dynamic threshold, a dynamic threshold is set. Unlike a static fixed value, the dynamic threshold adaptively adjusts based on the current network state, historical anomaly distribution, and node importance. Specifically, the initial threshold can be set using the percentile method based on the contribution weight distribution of anomalous propagation nodes in historical data, such as taking the 90th percentile of the contribution weight distribution. This threshold is dynamically adjusted according to the overall state of the current network: when the overall network state is stable, the threshold is increased to reduce false alarms; when the network fluctuates significantly, the threshold is appropriately decreased to improve detection sensitivity. For each predecessor node, its contribution weight is compared with the current dynamic threshold. If the weight exceeds the threshold, the node is marked as a propagation node, and its topological location information in the dynamic knowledge graph is recorded, including node ID, level, and distance from the anomalous node.

[0109] When querying task entities associated with propagation nodes in a dynamic knowledge graph, the relational query function of the graph database is used to retrieve task entities directly connected to the propagation node. For example, in a manufacturing system, if a device node is identified as a propagation node, the production task entities related to that device are queried. Task association information for each task entity is obtained, including task priority, completion deadline, and resource dependencies. Based on the topological location information of the propagation node and the task association information, the scope of the anomaly's impact is comprehensively assessed. Specifically, first, the direct impact range of the propagation node is determined, including entities directly connected to it; then, based on task dependencies, indirectly affected entities are inferred; finally, the severity and urgency of the impact are assessed by combining task priority and deadline.

[0110] Centered on the propagation node, graph algorithms (such as n-hop neighbor lookup or community detection algorithms) are applied to extract entity nodes and relational edges within the affected range. For example, a breadth-first search starting from the propagation node can be performed to extract all nodes and edges within its n-hop range, where n can be dynamically determined based on the impact range. The extracted nodes and edges are organized into a subgraph structure, with the direction of the edges representing the trend of anomaly propagation and the weight of the edges representing the propagation intensity. To enhance visualization, nodes can be colored according to their roles (such as propagation source, propagation node, affected node), and edges can be differentiated in thickness according to propagation intensity.

[0111] In practical applications, such as in a smart manufacturing environment, when a piece of equipment on a production line experiences an abnormal state, the system can quickly trace back to the propagation node that caused the abnormality (such as upstream supply equipment), and by analyzing its related production tasks, determine the scope of affected production orders, thereby generating a local graph reflecting how the abnormality propagates in the production network, providing decision-makers with intuitive assessment of the impact of the abnormality and support for intervention decisions.

[0112] In one optional implementation, the process of analyzing the scope of anomaly propagation based on the local subgraph, generating anomaly impact chains, and determining the task recovery priority sequence based on the propagation depth within the anomaly impact chains includes:

[0113] The relational edges in the local subgraph are analyzed, and the propagation trajectory of the abnormal state from the propagation node to the successor node is drawn along the propagation direction of the relational edges. The temporal chain of entity nodes through which the propagation trajectory passes is formed, and the propagation level from the propagation node to each successor node in the propagation trajectory is calculated. Based on the temporal chain of entity nodes and the propagation level, the abnormal impact topology is constructed.

[0114] The attribute information of intelligent entities and task entities associated with each entity node in the anomaly-affected topology is mapped, and the attribute information is fused with the association features of the propagation level. A corresponding recovery priority is set for entity nodes at different propagation levels, and the entity nodes in the anomaly-affected topology are reorganized according to the quantitative index of the recovery priority to generate a multi-level task recovery sequence.

[0115] When parsing relational edges in a local subgraph, the relational edge parsing module uses a graph traversal algorithm to perform a depth scan of the local subgraph, identifying the connection relationships and direction attributes of all directed edges within the subgraph. The local subgraph is stored using an adjacency list data structure, with each node corresponding to a linked list recording its outgoing edge information. The edge information includes fields such as the target node identifier, edge weight value, propagation delay, and edge status flag. During the relational edge parsing process, an edge index mapping table is established, with the key being a combination string of the source node identifier and the target node identifier, and the mapping value being a pointer to the memory address of the edge object, supporting edge lookup operations with O(1) time complexity. The edge parsing algorithm adopts a breadth-first search strategy, starting from the propagation node detected by the anomaly and expanding the search range layer by layer, with the search depth limited to 8 layers to avoid generating excessively deep traversal paths in complex subgraphs.

[0116] When depicting the propagation trajectory of an abnormal state from its propagation node to its successor node along the propagation direction of relation edges, the propagation trajectory represents the propagation path and influence range of the abnormal state in the graph structure. The propagation trajectory depiction algorithm adopts a multi-source breadth-first search method, simultaneously starting the propagation search from multiple abnormal propagation nodes, recording the shortest path and propagation time for the abnormal state to reach each successor node. The propagation trajectory is stored in a path tree structure, with the root node as the abnormal propagation source, leaf nodes as the propagation endpoints, and intermediate nodes representing the entity nodes traversed during the propagation process. The path tree construction process needs to handle path merging and branching issues. When multiple paths converge to the same node, the path with the shortest propagation time is selected as the primary propagation trajectory, and other paths are marked as auxiliary propagation trajectories. The propagation trajectory calculation supports a weight decay mechanism; the abnormal intensity decays exponentially with the propagation distance. The decay factor is set to 0.8 by default and can be adjusted from 0.5 to 0.95.

[0117] When forming the entity node time-series chain through which the diffusion trajectory passes, the entity node time-series chain records all entity nodes involved in the propagation of the abnormal state and their affected time order. The time-series chain construction algorithm sorts the nodes in the diffusion trajectory according to propagation time, generating an ordered node access sequence. The time-series chain uses a doubly linked list data structure to implement fast insertion and deletion operations. The entity node time-series chain includes fields such as node identifier, propagation timestamp, abnormality strength value, node state, and predecessor and successor pointers. The propagation timestamp adopts the Unix timestamp format with millisecond precision, and the abnormality strength value ranges from 0.0 to 1.0 as a floating-point number, maintaining a precision of 4 decimal places. During the time-series chain construction process, concurrent propagation scenarios need to be handled. When multiple abnormal sources affect the same node simultaneously, the abnormality strength value adopts a maximum value merging strategy, and the propagation timestamp is the earliest arrival time.

[0118] When calculating the propagation level from the propagating node to each successor node in the propagation trajectory, the propagation level represents the depth position of the node in the anomaly propagation tree. The level of the propagation source node is defined as 0, and the level of its direct successor node is 1, and so on, calculating the value of each level recursively. The propagation level calculation adopts a level-order traversal algorithm, maintaining a level counter to record the current search level, and simultaneously maintaining a queue of nodes to be visited to store the set of nodes for the next level. The propagation level value is stored in the node attribute, with the field name being propagation level, the data type being a non-negative integer, and a typical value range of 0 to 15. A propagation depth exceeding 15 levels triggers a depth warning mechanism. During the propagation level calculation process, the loop problem in the graph needs to be handled. An access marking mechanism is used to avoid duplicate calculations. Visited nodes are marked as processed, and the level update operation is skipped when a node is visited again.

[0119] When constructing an anomaly impact topology based on the temporal chain of entity nodes and propagation hierarchy, the anomaly impact topology is organized in the form of a directed acyclic graph. Nodes represent entities affected by the anomaly, and edges represent anomaly propagation relationships. The topology contains multi-dimensional information such as propagation hierarchy, temporal relationships, and impact strength. The topology construction algorithm arranges nodes in the temporal chain hierarchically according to propagation hierarchy. Nodes within the same hierarchy are arranged in chronological order, and different hierarchies are connected through propagation edges. The anomaly impact topology uses a matrix sparse storage format, where row indices represent propagation source nodes, column indices represent target nodes, and matrix element values ​​record a composite index of propagation strength and propagation delay. The storage space complexity of the topology is O(N+E), where N represents the number of nodes and E represents the number of edges. In typical scenarios, the memory usage is approximately the number of nodes multiplied by 64 bytes plus the number of edges multiplied by 32 bytes.

[0120] When mapping anomalies affect the attribute information of intelligent entities and task entities associated with each entity node in the topology, the attribute information mapping module establishes the association between the topology node and the original entity object through entity identifiers. Intelligent entity attribute information includes fields such as intelligent entity type, current state, resource consumption, processing capacity, historical fault frequency, and recovery time statistics. Task entity attribute information includes fields such as task type, task priority, resource requirements, execution duration, dependencies, and business importance. Attribute information mapping uses a hash table for fast lookup; the key is the entity identifier, and the mapping value is a reference pointer to the attribute object, with a lookup time complexity of O(1). The attribute information update mechanism adopts the observer pattern; when the original entity attributes change, the corresponding information in the topology is automatically updated synchronously, with an update delay controlled within 100 milliseconds.

[0121] When fusing attribute information and propagation hierarchy correlation features, the correlation features represent the correlation measure between an entity's attributes and its position in the propagation topology. The fusion algorithm uses a weighted feature combination method to calculate the comprehensive correlation degree. The correlation features of agent entities include the inverse relationship between processing power and propagation hierarchy, and the direct relationship between failure frequency and anomaly sensitivity. The correlation features of task entities include the direct relationship between task priority and recovery urgency, and the direct relationship between resource requirements and recovery complexity. Correlation feature calculation employs normalization, mapping attribute values ​​of different dimensions to a unified range of 0.0 to 1.0. The normalization method uses minimum-maximum scaling or Z-score standardization, with the specific choice determined based on the attribute value distribution characteristics. The fusion weight coefficients are obtained through training with historical data. The weight for agent processing power is set to 0.3, the weight for failure frequency is set to 0.2, the weight for task priority is set to 0.4, and the weight for resource requirements is set to 0.1. The weight coefficients support dynamic adjustment, with an adjustment range of 0.0 to 1.0, and the total weight sum is constrained to 1.0.

[0122] When setting corresponding recovery priorities for entity nodes at different propagation levels, the recovery priority reflects the processing order and resource allocation priority of entity nodes during the anomaly recovery process. Recovery priority calculation is based on multiple factors such as propagation level depth, entity importance, dependency complexity, and recovery cost, and employs a multi-attribute decision-making method for comprehensive evaluation. Nodes with shallower propagation levels have higher recovery priorities; level depth and priority are inversely proportional. The calculation formula is the base priority value minus the level depth multiplied by the level penalty factor. The level penalty factor is set to 0.1 by default and can be adjusted from 0.05 to 0.2. Entity importance is determined based on the scope of business impact and critical path analysis. The priority weighting coefficient for nodes on the critical path is set to 1.5, and the weighting coefficient for ordinary nodes is set to 1.0. The recovery priority value ranges from 0.0 to 10.0 as a floating-point number, with two decimal places; a larger value indicates a higher priority.

[0123] When reorganizing entities in the topology affected by anomalies based on a quantitative index of recovery priority, the reorganization algorithm sorts the nodes in descending order of recovery priority, generating a priority queue for recovery processing. During reorganization, the dependency constraints of the topology must be maintained, ensuring that the recovery operation of predecessor nodes is executed before that of successor nodes. When priority ordering conflicts with dependencies, dependency constraints take precedence. Node reorganization employs an algorithm combining topology sorting and priority queues, maintaining an in-degree counter to record the number of incomplete predecessors for each node. Nodes with an in-degree of 0 and the highest priority are prioritized for entry into the recovery queue. Reorganization results are stored in a multi-level queue, with each priority level corresponding to a sub-queue. Nodes within the same priority level can be processed concurrently, while a strict execution order is maintained between different priorities.

[0124] When generating a multi-level task recovery sequence, the recombined nodes are grouped according to recovery priority to form a hierarchical task execution plan. The recovery sequence generation algorithm divides the recovery levels according to priority value ranges: high priority range is 8.0 to 10.0, medium priority range is 5.0 to 8.0, and low priority range is 0.0 to 5.0. The boundary values ​​of the ranges can be adjusted according to actual needs. Each recovery level contains the recovery operations of all task entities within that level. The specific execution order within a level is determined according to dependencies, and between levels, execution is performed in descending order of priority. The multi-level task recovery sequence is serialized and stored in JSON format, containing fields such as level identifier, task list, estimated recovery time, resource requirements, and concurrency limits. The recovery sequence execution engine supports dynamic scheduling and resource allocation, adjusting the task execution plan according to real-time resource availability, and recording detailed operation logs and performance metrics during execution.

[0125] In one optional implementation, the attribute information of the intelligent entities and task entities associated with each entity node in the anomaly-affected topology is mapped, and the association features of the attribute information and the propagation level are fused. The corresponding recovery priorities are then set for entity nodes at different propagation levels, including:

[0126] Obtain the entity nodes in the topology affected by the anomaly, and map the attribute information of the corresponding intelligent entity and task entity based on the association relationship of the entity nodes; perform feature fusion of the attribute information and the propagation level of each entity node to form a node-level association matrix, characterize the degree of influence of nodes at different levels based on the node-level association matrix, and set the recovery priority for entity nodes at different propagation levels according to the degree of influence.

[0127] The system identifies the entity nodes in the anomaly-affected topology. When an anomaly is detected in the system, a topology reflecting the propagation of the anomaly's impact is constructed. This topology includes multiple entity nodes and their relationships. These entity nodes can be network servers, applications, databases, or other system components. For example, in a cloud computing environment, a failure in the core network switch affects all server nodes connected to that switch, thereby impacting the applications and services running on those servers.

[0128] Based on the relationships between entity nodes, the attribute information of corresponding intelligent entities and task entities is mapped. Intelligent entities refer to components in the system that can autonomously perform specific functions, such as automated operation and maintenance modules and self-healing components; task entities refer to various business tasks being executed in the system. Each entity node is associated with a specific intelligent entity and task entity, and these associations have rich attribute information.

[0129] Retrieve the identification information of each entity node, and search the list of intelligent agent entities and task entities associated with that node through the system configuration library; then extract the key attributes of each intelligent agent entity, including function type, response time, reliability level, and resource consumption; at the same time, extract the key attributes of the task entities, including business priority, deadline, dependencies, and scope of impact.

[0130] For a database server node, its associated intelligent entities include an automatic database backup intelligent entity, a performance monitoring intelligent entity, and a fault detection intelligent entity. The attributes of these intelligent entities reflect the data security assurance capability, performance monitoring accuracy, and anomaly identification capability, respectively. The task entities associated with this node include user data query tasks, transaction processing tasks, and data synchronization tasks. The attributes of these tasks reflect the importance and timeliness requirements of different business processes.

[0131] The attribute information is fused with the propagation level of each entity node to form a node-level association matrix. The propagation level refers to the order or distance at which entity nodes are affected during the propagation of anomalies, usually represented numerically as first level, second level, etc. Feature fusion uses a weighted combination method, combining agent attributes and task attributes with propagation level information.

[0132] The weight coefficients for each attribute are determined, which can be obtained based on system operation and maintenance experience or through machine learning methods. For each entity node, the weighted average of its agent attributes and the weighted average of its task attributes are calculated. Then, these attribute values ​​are combined with the values ​​of the propagation level where the node is located to form a multi-dimensional feature vector. Finally, the feature vectors of all entity nodes are combined into a node hierarchy association matrix.

[0133] For example, in a certain enterprise information system, when performing feature fusion on the financial data processing server, considering that its intelligent entity has high security protection and self-repair capabilities, the task entity has high business priority and strict timeliness requirements, and the node is located at the second level of anomaly propagation, a high feature value is obtained through weighted fusion calculation, indicating that the node is important in the recovery process.

[0134] The influence of nodes at different levels is characterized by a node hierarchy association matrix. The influence assessment adopts a multi-factor comprehensive analysis method, considering the node's position in the topology, connectivity, importance of associated tasks, and the agent's capabilities. For each element in the matrix, the influence score of its corresponding node is calculated. The higher the score, the more severely the node is affected by anomalies or the greater its impact on the overall system function.

[0135] Calculate the local impact of each node, i.e. the impact of damage to the node itself on directly related components; then calculate the global impact, taking into account the node's position and connectivity in the entire topology; finally, combine the local and global impact to obtain the overall impact score of the node.

[0136] Recovery priorities are assigned to entity nodes at different propagation levels based on the degree of impact. Recovery priority refers to the order in which nodes are repaired during system recovery, and is usually expressed as a numerical value or a ranking. Priority settings are based on an impact score, but also need to consider factors such as recovery difficulty and resource constraints.

[0137] Nodes are sorted in descending order of impact score, and the dependencies between nodes are considered to ensure that critical dependent nodes are restored first; the recovery difficulty and required resources of each node are assessed; and based on the above factors, a recovery priority level is assigned to each node, such as "very high", "high", "medium", "low", etc.

[0138] In practical applications, such as when an e-commerce platform experiences a partial service interruption, the above method can identify that the payment processing node is at the first level and has the highest impact, and should be restored first. Although the log analysis node is also affected, it is at a more distant level and has a lower impact, so it can be restored later. This ensures that critical business functions are restored first and minimizes the negative impact of abnormal events.

[0139] A second aspect of the present invention provides a state management and anomaly backtracking system for multi-agent cooperative tasks, comprising:

[0140] The first unit is used to acquire interaction data, status data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks; and to perform semantic parsing on the interaction data, status data, and task execution logs based on a predefined ontology model to construct an initial task knowledge graph.

[0141] The second unit is used to establish a bidirectional causal chain for each relation edge in the initial task knowledge graph based on the Bayesian network algorithm, and to use the agent's historical behavior sequence and task dependency depth as input to calculate the state transition probability of the edge, thereby forming a dynamic knowledge graph.

[0142] The third unit is used to construct a historical state sequence when an abnormality in the execution of an agent is detected, analyze the state transition patterns between agents based on the historical state sequence, identify the propagation nodes of the abnormal state, determine the scope of the abnormality's impact based on the location information and task association information of the propagation nodes, and construct a local subgraph reflecting the propagation trend of the abnormality.

[0143] The fourth unit is used to analyze the scope of anomaly propagation based on the local subgraph, generate anomaly impact chains, determine the task recovery priority sequence according to the propagation depth in the anomaly impact chains, trigger the state rollback operation of the agent level by level according to the order of the task recovery priority sequence, update the state rollback result of each level to the dynamic knowledge graph, and recalculate the task state transition probability after completing all rollback operations.

[0144] A third aspect of the present invention provides an electronic device, comprising:

[0145] processor;

[0146] Memory used to store processor-executable instructions;

[0147] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0148] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0149] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications 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 the present invention.

Claims

1. A method for state management and anomaly backtracking in multi-agent cooperative tasks, characterized in that, include: Acquire interaction data, status data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks; Based on a predefined ontology model, semantic parsing is performed on the interaction data, the state data, and the task execution log to construct an initial task knowledge graph; Based on the Bayesian network algorithm, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph. The historical behavior sequence of the agent and the task dependency depth are used as inputs to calculate the state transition probability of the edge, thus forming a dynamic knowledge graph. When an abnormality is detected in the action of an agent, a historical state sequence is constructed, and the state transition patterns between agents are analyzed based on the historical state sequence to identify the propagation nodes of the abnormal state. Based on the location information of the propagation nodes and the task association information, the scope of the anomaly's impact is determined, and a local subgraph reflecting the anomaly's propagation trend is constructed, including: Analyze the state transition trajectories of intelligent entities in adjacent time steps in the historical state sequence, count the transition frequency of each state transition in the state transition trajectory, mark the transition direction of each state transition, and map the transition frequency and the transition direction to the state transition rules between intelligent entities. Based on the state transition rules, the propagation path of the abnormal state is traced back along the reverse chain in the dynamic knowledge graph to obtain the state transition probability of each predecessor node on the propagation path. The state transition probability and the transition frequency are then fused to quantify the contribution weight of each predecessor node. Determine the relationship between the contribution weight of each predecessor node and the dynamic threshold, filter predecessor nodes whose contribution weight exceeds the dynamic threshold and mark them as propagation nodes, and record the topological position information of the propagation nodes in the dynamic knowledge graph. Query the task entities associated with the propagation nodes in the dynamic knowledge graph, obtain the task association information of the task entities, define the scope of the impact of the anomaly based on the topological location information and the task association information, extract the entity nodes and relation edges within the scope of the impact with the propagation node as the central node, and organize them into a local subgraph that reflects the propagation trend of the anomaly. Based on the analysis of the local subgraph, the scope of anomaly propagation is analyzed, an anomaly impact chain is generated, and the task recovery priority sequence is determined according to the propagation depth in the anomaly impact chain. The state rollback operation of the agent is triggered step by step according to the order of the task recovery priority sequence. The state rollback result of each level is updated to the dynamic knowledge graph, and the task state transition probability is recalculated after all rollback operations are completed.

2. The method according to claim 1, characterized in that, Based on a predefined ontology model, semantic parsing is performed on the interaction data, the state data, and the task execution logs to construct an initial task knowledge graph, including: Entity type definitions and attribute constraint rules are extracted from the predefined ontology model. Based on the entity type definitions, multi-source data fusion is performed on the interaction data, the state data, and the task execution log to identify intelligent agent entities, task entities, and resource entities. Semantic consistency verification is performed on the identified entities according to the attribute constraint rules, and entities that pass the verification are labeled with unique identifiers. Based on the relational pattern definition in the predefined ontology model, the collaboration pattern in the interaction data and the state dependency relationship in the state data are parsed, and initial relational edges are established between the intelligent agent entity, the task entity, and the resource entity. The event sequence and state transition record are extracted from the task execution log. The timestamp information in the event sequence and the triggering conditions in the state transition record are correlated and analyzed to identify event pairs with causal transmission characteristics. Based on the event pairs, the initial relation edge is assigned a temporal weight and a causal strength identifier. Using intelligent agent entities, task entities, and resource entities labeled with unique identifiers as entity nodes, and connecting the corresponding entity nodes with initial relation edges that are assigned temporal weights and causal strength identifiers, an initial task knowledge graph is constructed.

3. The method according to claim 1, characterized in that, Based on the Bayesian network algorithm, a bidirectional causal chain is established for each relation edge in the initial task knowledge graph. The historical behavior sequence of the agent and the task dependency depth are used as inputs to calculate the state transition probability of the edge, forming a dynamic knowledge graph including: The dependencies between task entities and the historical behavior sequences of intelligent entities are extracted from the initial task knowledge graph. A forward chain is established for each relation edge based on the directionality of the dependencies, and a reverse chain is established for each relation edge based on the state change propagation pattern in the historical behavior sequence, forming a bidirectional causal chain structure. Calculate the dependency depth of each task entity in the initial task knowledge graph in the forward chain, use the dependency depth as a task complexity feature, and simultaneously count the state transition frequency of the agent entity in the historical behavior sequence in the reverse chain. The dependency depth and the state transition frequency are constructed as a condition variable pair. Based on the Bayesian network algorithm, the conditional probability of the successor node undergoing a state transition is calculated under the condition of the dependency depth of the predecessor node. The conditional probability is used as the state transition probability of the corresponding relation edge in the bidirectional causal chain structure. The state transition probabilities are labeled to the corresponding edges in the forward chain and the reverse chain, respectively, to form a dynamic knowledge graph.

4. The method according to claim 3, characterized in that, Based on the directionality of the dependency relationship, a forward chain is established for each relation edge, and based on the state change propagation pattern in the historical behavior sequence, a reverse chain is established for each relation edge, forming a bidirectional causal chain structure including: The dependencies between task entities in the initial task knowledge graph are analyzed, the directional features of the dependencies are extracted, the execution order between task entities is determined according to the directional features, a forward chain is established for each relation edge along the execution order, and a dependency level identifier is marked for each relation edge in the forward chain. Extract the state records of the intelligent entity at different times from the historical behavior sequence, calculate the state change of the intelligent entity between adjacent times, and identify state transition events where the state change exceeds a preset change threshold. Analyze the propagation path of the state transition event corresponding to the relation edge in the initial task knowledge graph, establish a reverse chain for each relation edge based on the reverse tracing direction of the propagation path, and mark the propagation delay identifier for each relation edge in the reverse chain according to the triggering sequence of the state transition event. The forward chain labeled with the dependency level identifier and the reverse chain labeled with the propagation delay identifier are associated with the same relation edge in the initial task knowledge graph to form a bidirectional causal chain structure.

5. The method according to claim 1, characterized in that, Based on the analysis of the local subgraph, the scope of anomaly propagation is analyzed, an anomaly impact chain is generated, and the task recovery priority sequence is determined according to the propagation depth in the anomaly impact chain, including: The relational edges in the local subgraph are analyzed, and the propagation trajectory of the abnormal state from the propagation node to the successor node is drawn along the propagation direction of the relational edges. The temporal chain of entity nodes through which the propagation trajectory passes is formed, and the propagation level from the propagation node to each successor node in the propagation trajectory is calculated. Based on the temporal chain of entity nodes and the propagation level, the abnormal impact topology is constructed. The attribute information of intelligent entities and task entities associated with each entity node in the anomaly-affected topology is mapped, and the attribute information is fused with the association features of the propagation level. A corresponding recovery priority is set for entity nodes at different propagation levels, and the entity nodes in the anomaly-affected topology are reorganized according to the quantitative index of the recovery priority to generate a multi-level task recovery sequence.

6. The method according to claim 5, characterized in that, Mapping the attribute information of intelligent entities and task entities associated with each entity node in the topology affected by the anomaly, fusing the attribute information with the association features of the propagation level, and setting corresponding recovery priorities for entity nodes at different propagation levels includes: Obtain the entity nodes in the topology affected by the anomaly, and map the attribute information of the corresponding intelligent entity and task entity based on the association relationship of the entity nodes; The attribute information is fused with the propagation level of each entity node to form a node-level association matrix. The influence of nodes at different levels is characterized based on the node-level association matrix, and a recovery priority is set for entity nodes at different propagation levels according to the influence.

7. A state management and anomaly backtracking system for multi-agent cooperative tasks, used to implement the method of any one of claims 1-6, characterized in that, include: The first unit is used to acquire interaction data, status data, and task execution logs generated by multiple intelligent agents during the execution of collaborative tasks. Based on a predefined ontology model, semantic parsing is performed on the interaction data, the state data, and the task execution log to construct an initial task knowledge graph; The second unit is used to establish a bidirectional causal chain for each relation edge in the initial task knowledge graph based on the Bayesian network algorithm, and to use the agent's historical behavior sequence and task dependency depth as input to calculate the state transition probability of the edge, thereby forming a dynamic knowledge graph. The third unit is used to construct a historical state sequence when an abnormality in the execution of an agent is detected, analyze the state transition patterns between agents based on the historical state sequence, and identify the propagation nodes of the abnormal state. Based on the location information of the propagation nodes and the task association information, the scope of the impact of the anomaly is determined, and a local subgraph reflecting the propagation trend of the anomaly is constructed. The fourth unit is used to analyze the scope of anomaly propagation based on the local subgraph, generate anomaly impact chains, and determine the task recovery priority sequence based on the propagation depth in the anomaly impact chains. The state rollback operation of the agent is triggered step by step according to the order of the task recovery priority sequence. The state rollback result of each level is updated to the dynamic knowledge graph, and the task state transition probability is recalculated after all rollback operations are completed.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Task rollback method and device

    CN119718690A

  • Unified representation and dynamic knowledge reasoning method and device for intelligent cluster system

    CN120338114A

  • Routing inspection system and method for heating and ventilation system based on knowledge graph

    CN120450374A

Cited By

  • Multi-step decision-making method for agent based on reasoning and action alternately performed

    CN122433784A