Database fault processing method and system based on reinforcement learning

By building a causal decision tree and reinforcement learning action sequence in the database system, the problems of fault root cause identification and dynamic optimization in database fault handling are solved, and efficient and intelligent fault recovery is achieved.

CN120371675BActive Publication Date: 2025-09-16BEIJING AMPLI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510838856.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-16
Estimated Expiration
2045-06-23

AI Technical Summary

Technical Problem

Existing database systems have difficulty quickly and accurately identifying the root cause of faults during fault handling, and lack dynamic optimization capabilities, resulting in long recovery cycles and high costs, affecting business continuity and service quality.

Method used

A reinforcement learning-based approach is used to build a causal decision tree by collecting performance indicators, execution plans, and error log data. This identifies the root cause of the fault and generates a propagation link, generates a fault handling priority list, executes a reinforcement learning action sequence, and adjusts the handling strategy in real time until the fault is recovered.

Benefits of technology

It improves the accuracy and efficiency of fault location, realizes intelligent decision-making and adaptive optimization of fault handling, reduces manual intervention, improves the success rate and efficiency of fault recovery, and reduces the impact time on business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371675B_ABST
    Figure CN120371675B_ABST
Patent Text Reader

Abstract

The present invention provides a database fault handling method and system based on reinforcement learning, relating to the field of database management technology. The method involves collecting performance indicators, execution plans, and error log data at the time of a fault, constructing a causal decision tree to identify the root cause of the fault, and generating a propagation link. A reinforcement learning action sequence is constructed based on a priority list. The action sets are divided into master control actions and adjustment actions according to their impact on node status. The execution strategy is dynamically adjusted based on the performance improvement ratio. The method can accurately locate the root cause of the fault, adaptively optimize the handling strategy, and improve fault recovery efficiency and system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to database management technology, and in particular to a database fault processing method and system based on reinforcement learning. Background Art

[0002] As existing database systems operate, the frequency and types of system failures are becoming increasingly diverse, driven by increasing business complexity and data processing demands. These problems, such as deadlocks, resource bottlenecks, index failures, and SQL execution anomalies, are a frequent occurrence. Traditional database fault handling methods rely on static rules or manual experience, making it difficult to promptly and accurately identify the root cause of failures. This results in long and costly system recovery cycles, severely impacting business continuity and service quality.

[0003] While some research has attempted to enhance automated fault diagnosis capabilities by introducing technologies such as log analysis, fault diagnosis graphs, and causal reasoning, these approaches still suffer from low accuracy, slow response times, and difficulty dynamically adjusting processing priorities when handling complex, dynamic, and multi-source causal links. Furthermore, these approaches generally lack the ability to provide real-time feedback and adaptive optimization of the effects of actions taken during fault handling, making them difficult to meet the intelligent maintenance requirements of modern database systems.

[0004] In recent years, reinforcement learning technology has demonstrated significant advantages in decision optimization and dynamic feedback. However, its application to database fault handling is still in its early stages, and a systematic approach that effectively combines causal chain identification, action selection, and performance feedback regulation has yet to be established. Therefore, a database fault handling method and system based on reinforcement learning is urgently needed to achieve intelligent closed-loop optimization from root cause identification to fault action execution. Summary of the Invention

[0005] The embodiments of the present invention provide a database fault handling method and system based on reinforcement learning, which can solve the problems in the prior art.

[0006] A first aspect of an embodiment of the present invention provides a database fault handling method based on reinforcement learning, comprising:

[0007] Collect performance indicator data, execution plan data, and error log data at the time of database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node;

[0008] Based on the correlation coefficients and resource occupancy of nodes in the propagation link, a fault handling priority list is generated, and a reinforcement learning action sequence is constructed based on the fault handling priority list.

[0009] Execute reinforcement learning action sequences and calculate in real time the impact of executed actions on the node states in the propagation link. Based on the impact, the actions are divided into a set of main control actions and a set of adjustment actions according to the preset impact threshold.

[0010] Collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

[0011] In an optional embodiment,

[0012] Collect performance indicator data, execution plan data, and error log data at the time of database failure, generate a failure state vector, calculate the time series correlation coefficient matrix based on the failure state vector, and construct a causal decision tree based on the time series correlation coefficient matrix, including:

[0013] Collect performance indicator data, execution plan data, and error log data at the time of database failure;

[0014] Periodically sampling the performance indicator data to obtain resource usage, query response time, and data processing volume within each sampling period; extracting query access paths, parallelism, and resource estimates from the execution plan data; and extracting fault type identifiers and associated object identifiers from the error log data;

[0015] Calculating a deviation degree between the resource usage and the corresponding estimated value, calculating a delay degree between the query response time and the reference time, and performing correlation mapping between the fault type identifier and the associated object identifier; generating a fault state vector based on the deviation degree, delay degree, and correlation mapping result;

[0016] Perform sliding window processing on the fault state vector, calculate the time series correlation coefficients between the indicators in the window, and construct a time series correlation coefficient matrix according to the indicator correspondence relationship; weight the correlation coefficients in the time series correlation coefficient matrix according to the resource estimate value, and construct a causal decision tree based on the weighted time series correlation coefficient matrix, wherein the indicator pair with the strongest correlation coefficient is determined as the root node of the tree, and child nodes are constructed in sequence according to the strength of the correlation coefficient, and the resource estimate value is used as a constraint condition for the connection between nodes.

[0017] In an optional embodiment,

[0018] Identifying the fault root cause node from the causal decision tree and generating a propagation link from the fault root cause node to the performance anomaly node includes:

[0019] Calculate the fault impact of each node in the causal decision tree, and combine the node's out-degree value, correlation coefficient strength, and resource occupancy rate to obtain the node's fault impact value;

[0020] Traversing backward from the leaf nodes of the causal decision tree, calculating the impact transfer value of each node based on the connection strength between nodes and the fault impact value, and marking the node with a sudden change in the impact transfer value as a candidate root cause node;

[0021] Taking the candidate root cause node as the starting point, the abnormality value is propagated downward along the causal decision tree based on the fault impact, and the abnormality value is compared with the abnormal value in the performance indicator data. When the comparison result meets the matching condition, the current candidate root cause node is confirmed to be the fault root cause node;

[0022] Starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction according to the strength of the correlation coefficient between nodes. When the temporal correlation coefficient between nodes is lower than a preset correlation threshold, the propagation link currently searched is pruned to obtain the initial propagation link.

[0023] The initial propagation link is verified, the link validity is confirmed based on the performance indicator change trend and time sequence relationship between the nodes, and the fault propagation link from the fault root cause node to the performance abnormality node is output.

[0024] In an optional embodiment,

[0025] Starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction based on the correlation coefficient strength between nodes. When the temporal correlation coefficient between nodes is lower than the preset correlation threshold, the propagation link currently searched is pruned. The initial propagation link includes:

[0026] Obtain performance indicator time series data of the fault root node and connected nodes, analyze the performance indicator time series data using a sliding time window, and calculate the time series correlation coefficient between adjacent nodes;

[0027] Determine the propagation direction between nodes based on the magnitude of the timing correlation coefficient, record all propagation directions of the fault root cause node, and set a preset correlation threshold for propagation link pruning;

[0028] Starting from the fault root node, a depth-first search strategy is used to traverse the nodes, preferentially selecting the propagation direction with the largest timing correlation coefficient. Adjacent nodes with timing correlation coefficients greater than the preset correlation threshold are sequentially added to the current propagation link, and the search is continued with the newly added node as the current search node until the timing correlation coefficients of all adjacent nodes of the current search node are lower than the preset correlation threshold.

[0029] From the current search node, trace back to the previous search node in sequence. For the nodes in the previous search node whose propagation direction has not been searched, select the propagation direction with the second largest time correlation coefficient to continue the depth-first search. After completing the search of all propagation directions, merge the retained propagation links to obtain the initial propagation link.

[0030] In an optional embodiment,

[0031] Based on the correlation coefficients and resource usage of nodes in the propagation link, a fault handling priority list is generated. Based on the fault handling priority list, a reinforcement learning action sequence is constructed, including:

[0032] Obtain the correlation coefficient between each node in the fault propagation link and the resource occupancy data of each node;

[0033] Calculating the correlation coefficient weights between the current node and adjacent nodes based on the correlation coefficient, calculating the resource occupancy intensity of the node based on the resource occupancy data, and counting the number of downstream nodes affected by the node and their importance to obtain the downstream influence range of the node;

[0034] The correlation coefficient weight, resource occupancy intensity, and downstream impact range are weightedly combined to obtain the processing priority of the node, and a fault processing priority list is generated according to the processing priority of the node;

[0035] A state space is constructed by using the performance indicators of the nodes as state variables, an action space is constructed by using the resource adjustment operations of the nodes as action variables, and the operations in the action space are sorted based on the fault handling priority list to obtain an initial action sequence;

[0036] State transition information is extracted from fault processing history data, and the performance benefits of different operation sequences are calculated based on the state transition information. The initial action sequence is adjusted in combination with the resource cost of the operation to obtain the final reinforcement learning action sequence.

[0037] In an optional embodiment,

[0038] Execute the reinforcement learning action sequence and calculate the impact of the executed action on the node status in the propagation link in real time. According to the impact degree, the action is divided into the main control action set and the adjustment action set according to the preset impact threshold, including:

[0039] Execute actions in the reinforcement learning action sequence, collect performance indicator data of nodes in the propagation link before and after the execution of the action in real time, and construct a performance impact evaluation matrix based on the positive change value and negative change value of the performance indicator data;

[0040] Calculating an initial impact vector of an action on a node state in a propagation link based on the performance impact evaluation matrix, and performing time-series weighting on the initial impact vector using a time decay function to obtain a time-series change sequence of the node state;

[0041] Determine the node weight coefficient according to the position relationship of the nodes in the propagation link, perform weighted calculation on the time series change sequence to obtain the degree of influence of the action on the node state, and construct a node state transition probability matrix based on the degree of influence;

[0042] The influence value of the action is calculated by combining the node state transition probability matrix and the state transition benefit, and the influence value is compared with the preset influence threshold. According to the comparison result of the influence value, the executed actions are divided into the main control action set and the adjustment action set.

[0043] In an optional embodiment,

[0044] Collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set based on the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is complete, including:

[0045] Collecting performance monitoring indicator data, the performance monitoring indicator data including the current time indicator value and the reference time indicator value, assigning weight coefficients to different monitoring indicators based on system resource usage, and multiplying the weight coefficients by the change in the monitoring indicator value to obtain a performance improvement ratio;

[0046] Calculate the performance improvement ratio difference before and after the execution of each action in the master control action set to obtain the performance change amount, and calculate the performance change rate based on the ratio of the performance change amount to the execution time interval;

[0047] Prioritizing the actions in the master control action set based on the performance change rate to obtain an execution order for the master control actions, and simultaneously calculating a correlation between an execution parameter of each action in the adjustment action set and a performance improvement ratio, determining a parameter adjustment range based on the correlation, updating the execution parameters of the actions in the adjustment action set based on the parameter adjustment range, and generating an execution configuration for the adjustment action;

[0048] The sorted execution order of the main control actions is combined with the updated execution configuration of the adjustment action to generate an optimized reinforcement learning action sequence. The optimized reinforcement learning action sequence is executed and the performance improvement ratio is updated in real time. The execution order and execution parameters of the unexecuted actions are adjusted according to the updated performance improvement ratio until the fault recovery is completed.

[0049] A second aspect of an embodiment of the present invention provides a database fault handling system based on reinforcement learning, including:

[0050] The first unit is used to collect performance indicator data, execution plan data, and error log data at the time of the database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node of the failure from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node;

[0051] The second unit is used to generate a fault handling priority list based on the correlation coefficient size and resource occupancy of nodes in the propagation link, and construct a reinforcement learning action sequence based on the fault handling priority list;

[0052] The third unit is used to execute the reinforcement learning action sequence and calculate in real time the impact of the executed actions on the node states in the propagation link. According to the impact degree, the actions are divided into a main control action set and a regulation action set according to the preset impact threshold;

[0053] The fourth unit is used to collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

[0054] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:

[0055] processor;

[0056] a memory for storing processor-executable instructions;

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

[0058] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0059] In this embodiment, by establishing a causal decision tree to identify the root cause of the fault and generate a propagation link, the source of the fault can be accurately located and the fault impact path can be understood, avoiding the problem of traditional methods that only focus on surface phenomena and ignore the root cause, and improving the accuracy and efficiency of fault location. According to the correlation coefficient and resource occupancy level, a processing priority list is generated and a reinforcement learning action sequence is constructed, which realizes intelligent decision-making in the fault handling process. The system can automatically determine the optimal sequence of processing steps, reduces manual intervention, and improves the degree of automation and response speed of fault handling. By evaluating the execution effect of the action in real time and dynamically adjusting the processing strategy, the action is divided into main control action and adjustment action, and the execution order and parameters are optimized according to the performance improvement ratio, which realizes adaptive optimization of fault handling, enabling the system to continuously adjust the recovery strategy according to the actual effect, greatly improving the success rate and efficiency of fault recovery, and reducing the impact time of database failure on business. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 This is a flowchart of a database fault handling method based on reinforcement learning according to an embodiment of the present invention;

[0061] Figure 2 This is a schematic diagram of a causal decision tree constructed based on weighted correlation coefficients;

[0062] Figure 3 Schematic diagram of the simulation results of fault handling priority and operational benefits. DETAILED DESCRIPTION

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0064] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0065] Figure 1 FIG. 1 is a flow chart of a database fault handling method based on reinforcement learning according to an embodiment of the present invention. Figure 1 As shown, the method includes:

[0066] Collect performance indicator data, execution plan data, and error log data at the time of database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node;

[0067] Based on the correlation coefficients and resource occupancy of nodes in the propagation link, a fault handling priority list is generated, and a reinforcement learning action sequence is constructed based on the fault handling priority list.

[0068] Execute reinforcement learning action sequences and calculate in real time the impact of executed actions on the node states in the propagation link. Based on the impact, the actions are divided into a set of main control actions and a set of adjustment actions according to the preset impact threshold.

[0069] Collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

[0070] In an optional embodiment, collecting performance indicator data, execution plan data, and error log data at the time of a database failure, generating a failure state vector, calculating a time series correlation coefficient matrix based on the failure state vector, and constructing a causal decision tree based on the time series correlation coefficient matrix includes:

[0071] Collect performance indicator data, execution plan data, and error log data at the time of database failure;

[0072] Periodically sampling the performance indicator data to obtain resource usage, query response time, and data processing volume within each sampling period; extracting query access paths, parallelism, and resource estimates from the execution plan data; and extracting fault type identifiers and associated object identifiers from the error log data;

[0073] Calculating a deviation degree between the resource usage and the corresponding estimated value, calculating a delay degree between the query response time and the reference time, and performing correlation mapping between the fault type identifier and the associated object identifier; generating a fault state vector based on the deviation degree, delay degree, and correlation mapping result;

[0074] Perform sliding window processing on the fault state vector, calculate the time series correlation coefficients between the indicators in the window, and construct a time series correlation coefficient matrix according to the indicator correspondence relationship; weight the correlation coefficients in the time series correlation coefficient matrix according to the resource estimate value, and construct a causal decision tree based on the weighted time series correlation coefficient matrix, wherein the indicator pair with the strongest correlation coefficient is determined as the root node of the tree, and child nodes are constructed in sequence according to the strength of the correlation coefficient, and the resource estimate value is used as a constraint condition for the connection between nodes.

[0075] Figure 2 This is a schematic diagram of a causal decision tree constructed based on weighted correlation coefficients. This embodiment provides a database fault diagnosis method that collects multidimensional data when a database fault occurs and constructs a causal decision tree to perform root cause analysis.

[0076] Automatically collect performance metrics, execution plan data, and error log data when a database system failure occurs. Performance metrics include system resource metrics such as CPU usage, memory usage, I / O throughput, and network transmission volume. Execution plan data includes information such as the access method, number of rows scanned, and number of rows returned in the SQL statement execution plan. Error log data includes error information such as error codes, error descriptions, and exception stack traces.

[0077] The collected performance indicator data is periodically sampled, with a sampling period set to 10 seconds. Taking CPU usage as an example, 30 sampling points are collected before and after a fault occurs, and the usage value at each sampling point is recorded. For example, in one fault case, CPU usage was monitored to rise sharply from 25% to 95%, remaining at a high level for 2 minutes before falling back to 35%. Memory usage increased from a stable 8GB to 14.5GB, approaching the 16GB threshold for total system memory. IO throughput increased from 200MB / s to 800MB / s, and query response time was improved from an average of 50ms to 350ms.

[0078] Regarding execution plan data processing, we extract the execution plan of the currently executing SQL statement and analyze its access path characteristics. For example, in a failure case, a full table scan operation was detected. The estimated number of scanned rows was 5 million, but the actual number of scanned rows reached 7.2 million. The degree of parallelism was set to 8, but only three parallel threads were actually working. The estimated execution time was 2 seconds, but the actual execution time was 12 seconds. Furthermore, key information from the execution plan, such as index usage, JOIN methods, and sorting methods, was extracted.

[0079] When processing error log data, we first extract the error code and description. For example, "ORA-01555" indicates an out-of-date snapshot error, and "ORA-04031" indicates insufficient shared pool memory. We then extract the object identifiers associated with the error, such as the table name "USER_TRANSACTION" and the index name "IDX_USER_ID." In the example failure, multiple "Insufficient shared pool memory" error logs were detected, associated with large, complex queries and temporary tablespaces.

[0080] Based on the processed data, we calculated the degree of resource utilization deviation. Comparing the actual CPU utilization of 95% with the estimated 40%, the deviation rate was calculated to be 137.5%. The memory utilization deviation rate was 81.25%, and the I / O throughput deviation rate was 300%. The query response time latency was calculated to be 600%, far exceeding the system's acceptable threshold of 50%. Error log correlation mapping showed that 90% of errors were related to memory allocation issues, primarily related to the shared pool and temporary tablespaces.

[0081] Combining the above analysis results, we generated a 36-dimensional fault state vector, which includes metrics such as resource usage deviation, query latency, and error correlation. Within this vector, the values ​​for memory usage deviation and shared pool error correlation were significantly higher than those for other metrics.

[0082] The fault state vector is processed using a 30-second sliding window with a step size of 5 seconds. The temporal correlation between each metric within the window is calculated. For example, the correlation coefficient between CPU usage and query response time is 0.78, indicating a strong positive correlation; the correlation coefficient between memory usage and shared pool errors is 0.92, indicating an extremely strong positive correlation; and the correlation coefficient between disk I / O and query response time is 0.45, indicating a moderate positive correlation.

[0083] The calculated correlation coefficients are organized into a 36×36 time series correlation coefficient matrix, where each cell represents the strength of the time series correlation between the corresponding two metrics. The correlation coefficients are then weighted based on the resource estimates in the execution plan. For example, if the memory resource estimate is 60%, the CPU estimate is 25%, and the I / O estimate is 15%, the weights of the coefficients related to these resources are adjusted accordingly. After weighting, the correlation coefficient between memory utilization and shared pool errors increases from 0.92 to 0.95, the highest value in the matrix.

[0084] A causal decision tree was constructed based on the weighted time-series correlation coefficient matrix. The metric pair with the highest correlation coefficient, "Memory Usage - Shared Pool Errors," was selected as the root node, with a correlation coefficient of 0.95. From this node, child nodes were constructed based on the strength of the correlation coefficients: "Shared Pool Errors - Temporary Tablespace Usage" (0.88), "Temporary Tablespace Usage - Large and Complex Queries" (0.86), and "Large and Complex Queries - Full Table Scans" (0.82). Resource estimates were also used as node connection constraints. For example, a connection between "Memory Usage" and other metrics was established only when the estimated memory usage exceeded 50%.

[0085] The constructed causal decision tree clearly shows the fault propagation path from "full table scan operation" to "shared pool error" to "abnormal memory usage", providing database administrators with accurate root cause analysis results, indicating that the source of the fault is memory resource exhaustion caused by a large query.

[0086] In this embodiment, by integrating performance metrics, execution plans, and error log data to construct a fault state vector, and introducing time series correlation analysis and weighted causal modeling, it is possible to accurately characterize database faults from multiple dimensions and mine causal chains. On the one hand, deviation and latency metrics can accurately identify resource anomalies and query bottlenecks, improving the accuracy of fault location. On the other hand, by using sliding windows and weighted correlation coefficient matrices to extract key correlations in time series, the structural rationality and explanatory power of the causal decision tree are enhanced, thereby enabling visual tracing and intelligent analysis of fault root causes, providing effective support for adaptive diagnosis and optimization of database systems.

[0087] In an optional embodiment, identifying a fault root cause node from a causal decision tree and generating a propagation link from the fault root cause node to a performance abnormality node includes:

[0088] Calculate the fault impact of each node in the causal decision tree, and combine the node's out-degree value, correlation coefficient strength, and resource occupancy rate to obtain the node's fault impact value;

[0089] Traversing backward from the leaf nodes of the causal decision tree, calculating the impact transfer value of each node based on the connection strength between nodes and the fault impact value, and marking the node with a sudden change in the impact transfer value as a candidate root cause node;

[0090] Taking the candidate root cause node as the starting point, the abnormality value is propagated downward along the causal decision tree based on the fault impact, and the abnormality value is compared with the abnormal value in the performance indicator data. When the comparison result meets the matching condition, the current candidate root cause node is confirmed to be the fault root cause node;

[0091] Starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction according to the strength of the correlation coefficient between nodes. When the temporal correlation coefficient between nodes is lower than a preset correlation threshold, the propagation link currently searched is pruned to obtain the initial propagation link.

[0092] For example, in a cloud computing environment, a server cluster runs multiple microservice applications, and a system monitoring platform continuously collects performance metrics such as CPU usage, memory usage, and network traffic. When a performance anomaly is detected, the system constructs a causal decision tree based on historical monitoring data to analyze the root cause of the failure and its propagation path.

[0093] After constructing a causal decision tree, the fault impact factor of each node in the tree needs to be calculated. The fault impact factor is determined by combining the node's out-degree value, correlation coefficient strength, and resource utilization. Specifically, for node N, its out-degree value represents the number of downstream nodes directly connected to it; the correlation coefficient strength represents the average of the Pearson correlation coefficients between the node and its downstream nodes; and the resource utilization rate represents the percentage of system resources used by the node. The fault impact factor FI(N) of node N is calculated as the weighted sum of these three factors. In practical applications, the weights can be set to 0.3, 0.4, and 0.3, respectively. For example, if a node has an out-degree value of 4, a correlation coefficient strength of 0.75, and a resource utilization rate of 85%, its fault impact factor is 0.3 × 4 + 0.4 × 0.75 + 0.3 × 0.85 = 1.94.

[0094] After calculating the fault impact of the node, reverse traverse from the leaf node of the causal decision tree to calculate the impact transfer value of each node. For the leaf node L, its impact transfer value IT(L) is initialized to its fault impact FI(L). For the non-leaf node P, its impact transfer value IT(P) is the sum of its fault impact FI(P) and the impact transfer values ​​of all its child nodes multiplied by the corresponding connection strength. The connection strength CS(P, C) is defined as the absolute value of the correlation coefficient between node P and its child node C. During the reverse traversal process, the impact transfer value of each node is recorded, and the rate of change of the impact transfer values ​​between adjacent nodes is calculated. When the rate of change exceeds a preset threshold (such as 30%), the node is marked as a candidate root cause node.

[0095] For example, in a 10-node causal decision tree, the influence transfer values ​​of nodes A to J are 2.1, 1.8, 1.4, 1.9, 2.5, 1.2, 0.9, 1.6, 1.3, and 2.0, respectively. By calculating the rate of change between adjacent nodes, we find that the rate of change from node D to E is (2.5 - 1.9) / 1.9 ≈ 31.6%, exceeding the 30% threshold. Therefore, node E is marked as a candidate root cause node.

[0096] Starting from the candidate root cause node, the anomaly value is propagated downward along the causal decision tree to calculate the anomaly value. For the root cause node R, its anomaly is initialized to 1.0. For other nodes X, its anomaly AD(X) is the anomaly AD(P) of its parent node P multiplied by the connection strength CS(P, X) multiplied by the fault impact FI(X) of node X. The calculated anomaly value is compared with the actual anomaly value in the performance indicator data. The comparison method is to calculate the similarity between the anomaly sequence and the actual anomaly sequence. The cosine similarity or Pearson correlation coefficient can be used. When the similarity exceeds a preset threshold (such as 0.8), the current candidate root cause node is confirmed to be the fault root cause node.

[0097] Starting from node E, the anomaly propagation was calculated, resulting in anomaly values ​​of 1.0, 0.75, 0.62, 0.85, 0.70, and 0.91 from nodes E to J, respectively. These values ​​were compared with the actual monitored performance anomaly data (normalized): 1.0, 0.78, 0.65, 0.82, 0.68, and 0.88. The cosine similarity between the two sequences was 0.997, exceeding the threshold of 0.8, confirming that node E was the root cause of the fault. After determining the root cause node, a depth-first search strategy was used to generate fault propagation links starting from that node. During the search, the propagation direction was determined based on the strength of the correlation coefficient between nodes, with links with the largest absolute value of the correlation coefficient being prioritized. To improve accuracy, the current search path was pruned when the temporal correlation coefficient between nodes fell below a preset threshold (e.g., 0.3).

[0098] In this example, starting from node E, the search finds connected nodes F, G, and H, whose correlation coefficients are 0.65, 0.28, and 0.70, respectively. Because the correlation coefficient of node G, 0.28, is lower than the threshold of 0.3, the path to G is pruned. Continuing the search for nodes F and H, it is found that node H is connected to node J with a correlation coefficient of 0.82, and node F is connected to node I with a correlation coefficient of 0.41. The resulting initial propagation links are: E→H→J and E→F→I. Finally, the initial propagation links are verified, confirming link validity based on the performance indicator trends and temporal relationships between nodes. Verification involves checking whether the performance indicators of adjacent nodes in the link have a reasonable temporal variation pattern. For example, an anomaly in the upstream node should occur before an anomaly in the downstream node.

[0099] In link E→H→J, analyzing the performance indicator time series of the three nodes reveals that the anomaly at node E occurred at T1, at node H at T1+2 seconds, and at node J at T1+5 seconds, which conforms to the sequential logic for fault propagation from E to J. In contrast, in link E→F→I, the anomaly at node F occurred at T1+15 seconds, and at node I at T1+10 seconds, which does not conform to the sequential logic for fault propagation from F to I. Therefore, this link is considered invalid. Finally, a valid fault propagation link, E→H→J, is output, indicating that the fault propagated from the root cause node E to the performance-abnormal node J.

[0100] In this embodiment, by constructing a causal decision tree and introducing a fault impact degree and propagation path identification mechanism, the automatic identification of the root cause of the database fault and the precise construction of the propagation link are achieved. The existing technology mostly relies on static rules or manual experience for fault analysis, which makes it difficult to dynamically characterize the causal relationship between multiple indicators, and lacks systematic modeling of the impact intensity and the effectiveness of the propagation path in the root cause tracing process, resulting in unstable positioning results, redundant or missing links. In response to the above problems, the present application proposes to fuse the node's out-degree, correlation strength and resource occupancy rate to calculate the fault impact degree, quantitatively evaluate the abnormal dominance of the node, and identify the candidate root cause in combination with the change in the impact transfer value, thereby enhancing the accuracy of root cause identification. At the same time, a pruning strategy based on correlation thresholds and a performance trend verification mechanism are adopted to optimize the propagation chain construction process, avoid interference from low-correlation paths, and effectively improve the accuracy and reliability of the link. This improvement takes the enhancement of the discrimination ability of causal path identification as the starting point, and significantly improves the degree of automation and analysis effect of fault location in complex multi-indicator scenarios.

[0101] In an optional embodiment, starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction according to the strength of the correlation coefficient between nodes. When the temporal correlation coefficient between nodes is lower than a preset correlation threshold, the propagation link currently searched is pruned. The initial propagation link includes:

[0102] Obtain performance indicator time series data of the fault root node and connected nodes, analyze the performance indicator time series data using a sliding time window, and calculate the time series correlation coefficient between adjacent nodes;

[0103] Determine the propagation direction between nodes based on the magnitude of the timing correlation coefficient, record all propagation directions of the fault root cause node, and set a preset correlation threshold for propagation link pruning;

[0104] Starting from the fault root node, a depth-first search strategy is used to traverse the nodes, preferentially selecting the propagation direction with the largest timing correlation coefficient. Adjacent nodes with timing correlation coefficients greater than the preset correlation threshold are sequentially added to the current propagation link, and the search is continued with the newly added node as the current search node until the timing correlation coefficients of all adjacent nodes of the current search node are lower than the preset correlation threshold.

[0105] From the current search node, trace back to the previous search node in sequence. For the nodes in the previous search node whose propagation direction has not been searched, select the propagation direction with the second largest time correlation coefficient to continue the depth-first search. After completing the search of all propagation directions, merge the retained propagation links to obtain the initial propagation link.

[0106] In one specific embodiment, the detailed process of the fault propagation link analysis method is as follows: When a fault is detected in the system, the root cause node is first determined. In this embodiment, the root cause node is node S1 in the server cluster. The CPU usage of this node is abnormally high, triggering a system alarm.

[0107] Obtain time series data on the performance indicators of the root cause node S1 and its connected nodes. In this example, performance indicator data for the last 30 minutes is collected for node S1 and its adjacent nodes S2, S3, and S4. This includes key indicators such as CPU usage, memory usage, network throughput, and disk I / O. This data is recorded at a sampling rate of one point every 10 seconds to form a time series dataset.

[0108] The collected performance indicator time series data is analyzed using a sliding time window. The sliding window size is set to 5 minutes, with a step size of 1 minute, that is, it slides forward 1 minute each time. Within each sliding window, the time series correlation coefficients between adjacent nodes are calculated. In this embodiment, the time series correlation coefficients of each indicator between node S1 and adjacent nodes S2, S3, and S4 are calculated. For example, the time series correlation coefficient of the CPU usage of S1 and S2 is 0.85, the time series correlation coefficient of the CPU usage of S1 and S3 is 0.62, and the time series correlation coefficient of the CPU usage of S1 and S4 is 0.35. The propagation direction between the nodes is determined based on the calculated time series correlation coefficients. The preset correlation threshold is set to 0.5 for subsequent propagation link pruning. In this embodiment, there are two propagation directions for node S1: S1→S2 and S1→S3, because the correlation coefficients between these two pairs of nodes are both greater than the preset threshold of 0.5, while the correlation coefficient of S1→S4, 0.35, is less than the threshold and is not used as a valid propagation direction.

[0109] Starting from the root cause node S1, a depth-first search strategy is used to traverse the nodes in the network topology. The propagation direction with the largest timing correlation coefficient is prioritized, that is, S1→S2 (correlation coefficient 0.85) is selected first. Node S2 is added to the current propagation link, forming link S1→S2.

[0110] The search continues with the newly added node S2 as the current search node. Analyzing the temporal correlation coefficients between S2 and its adjacent nodes S5 and S6, the correlation coefficients for S2→S5 are 0.78, and the correlation coefficients for S2→S6 are 0.42. Since the correlation coefficients for S2→S5 are greater than the threshold of 0.5, S5 is added to the propagation link, forming the link S1→S2→S5. However, the correlation coefficient for S2→S6 is less than the threshold, so S6 is not added to the link. The search continues with S5 as the current search node, analyzing the temporal correlation coefficients between S5 and its adjacent nodes S7 and S8, and the correlation coefficients for S5→S7 are 0.33, and the correlation coefficients for S5→S8 are 0.25. Since both correlation coefficients are less than the threshold of 0.5, S7 and S8 are not added to the propagation link. The current link search ends here, and a propagation link S1→S2→S5 is obtained.

[0111] Backtracking to node S1, the search continues for the suboptimal propagation direction S1→S3 (correlation coefficient 0.62). S3 is added to the propagation chain, forming a new chain S1→S3. Analyzing the temporal correlation coefficients between S3 and its neighboring nodes S9 and S10, the correlation coefficients for S3→S9 are 0.71, and the correlation coefficient for S3→S10 is 0.29. Because the correlation coefficients for S3→S9 exceed the threshold, S9 is added to the propagation chain, forming the chain S1→S3→S9. The search continues with S9 as the current search node. Analyzing the temporal correlation coefficients between S9 and its neighboring node S11, the correlation coefficient for S9→S11 is 0.65. Therefore, S11 is added to the propagation chain, forming the chain S1→S3→S9→S11. Continuing with S11 as the current search node, the temporal correlation coefficients between S11 and its neighboring node S12 are analyzed, resulting in a correlation coefficient of 0.41 for S11→S12. Since the correlation coefficient is less than the threshold value of 0.5, S12 is not added to the propagation link. The current link search ends here, and the second propagation link S1→S3→S9→S11 is obtained.

[0112] After completing the search for all propagation directions, the two propagation links S1→S2→S5 and S1→S3→S9→S11 are merged to form the initial propagation link: starting from the root cause node S1, on the one hand, it affects S5 through S2, and on the other hand, it affects S9 and S11 through S3.

[0113] In practical applications, to improve analysis accuracy, preset thresholds can be adjusted based on system characteristics. A higher threshold (such as 0.7) produces shorter but more reliable propagation links, suitable for scenarios requiring high fault propagation accuracy. A lower threshold (such as 0.4) produces longer propagation links, potentially encompassing more affected nodes, suitable for scenarios requiring a comprehensive understanding of the fault's impact range. In this embodiment, a moderate threshold of 0.5 is selected to ensure the reliability of the propagation link without excessively restricting the scope of fault propagation exploration.

[0114] The initial propagation link obtained through this method provides system operators with a visual representation of the fault propagation path, helping them quickly locate affected system components and improve troubleshooting and repair efficiency. This method is particularly suitable for fault analysis in large-scale distributed systems, effectively reducing fault handling time and minimizing losses caused by system unavailability.

[0115] By introducing a depth-first search strategy driven by time-series correlation coefficients, a propagation path with correlation strength support can be constructed in database fault analysis. Existing technologies mostly use static topology structures or path inference methods based on prior rules. They lack modeling of the temporal variation patterns in actual operating data, making it difficult to accurately identify the true impact paths between nodes in the fault propagation chain, and are prone to path omissions or misjudgments. This solution takes the root cause node of the fault as the starting point, combines the temporal correlation coefficient between performance indicators calculated by the sliding time window, dynamically determines the propagation direction, and completes link pruning by setting a threshold, effectively eliminating the interference of weakly correlated nodes. The method of prioritizing the search for the propagation path with the greatest correlation not only improves the accuracy of link construction, but also enhances the interpretability of the path structure. While maintaining search efficiency, this solution ensures the high correlation and practical utility of the path, providing a reliable basis for subsequent fault evolution analysis and performance optimization, and significantly improves the shortcomings of traditional methods in terms of dynamics and correlation.

[0116] In an optional embodiment, a fault handling priority list is generated based on the correlation coefficients and resource occupancy levels of nodes in a propagation link, and a reinforcement learning action sequence is constructed based on the fault handling priority list, including:

[0117] Obtain the correlation coefficient between each node in the fault propagation link and the resource occupancy data of each node;

[0118] Calculating the correlation coefficient weights between the current node and adjacent nodes based on the correlation coefficient, calculating the resource occupancy intensity of the node based on the resource occupancy data, and counting the number of downstream nodes affected by the node and their importance to obtain the downstream influence range of the node;

[0119] The correlation coefficient weight, resource occupancy intensity, and downstream impact range are weightedly combined to obtain the processing priority of the node, and a fault processing priority list is generated according to the processing priority of the node;

[0120] A state space is constructed by using the performance indicators of the nodes as state variables, an action space is constructed by using the resource adjustment operations of the nodes as action variables, and the operations in the action space are sorted based on the fault handling priority list to obtain an initial action sequence;

[0121] State transition information is extracted from fault processing history data, and the performance benefits of different operation sequences are calculated based on the state transition information. The initial action sequence is adjusted in combination with the resource cost of the operation to obtain the final reinforcement learning action sequence.

[0122] In this embodiment, when obtaining the correlation coefficients and resource usage data between nodes in the fault propagation link, the performance indicators and resource usage of each node in the network topology are collected through a distributed monitoring collector. For the node set {A, B, C, D, E} in a cloud platform environment, the correlation coefficient matrix between the nodes is recorded. For example, the correlation coefficient between A and B is 0.85, the correlation coefficient between A and C is 0.72, the correlation coefficient between B and D is 0.68, and the correlation coefficient between C and E is 0.79. At the same time, resource usage data for each node is collected, including CPU utilization, memory utilization, and I / O throughput. For example, the CPU utilization of node A is 85%, the memory utilization is 73%, and the I / O throughput is 620MB / s; the CPU utilization of node B is 65%, the memory utilization is 58%, and the I / O throughput is 480MB / s.

[0123] When calculating the correlation coefficient weights between the current node and its neighboring nodes, the sum of the correlation coefficients between each node and all its neighboring nodes is calculated, and the normalized weight is obtained by dividing the individual correlation coefficients by the sum. For example, node A has correlation coefficients of 0.85 and 0.72 with its neighboring nodes B and C, respectively, and the sum of the correlation coefficients is 1.57. Therefore, the correlation coefficient weights between A and B are 0.85 / 1.57 = 0.54, and the correlation coefficient weights between A and C are 0.72 / 1.57 = 0.46.

[0124] When calculating node resource utilization, the system normalizes each node's resource utilization indicator, assigns different weights, and then calculates the weighted sum. For node A, the CPU utilization of 85%, memory utilization of 73%, and I / O throughput of 620 MB / s (assuming a maximum value of 1000 MB / s, normalized to 0.62) are assigned weights of 0.4, 0.4, and 0.2, respectively. The resulting resource utilization is 85% × 0.4 + 73% × 0.4 + 62% × 0.2 = 76.9%.

[0125] When calculating the number and importance of downstream nodes affected by a node, the system traverses the fault propagation chain, records all downstream nodes that each node may affect, and assigns different weights based on the service importance of the downstream nodes. Taking node A as an example, it directly affects nodes B and C, and indirectly affects nodes D and E. Assuming the node importance weights are B = 0.8, C = 0.9, D = 0.7, and E = 0.6, respectively, the downstream impact range of A is calculated as 0.8 + 0.9 + 0.7 × 0.68 (correlation coefficient from B to D) + 0.6 × 0.79 (correlation coefficient from C to E) = 2.23.

[0126] When calculating the node processing priority by weighting the correlation coefficient, resource usage intensity, and downstream impact, the system sets the weights of these three factors to 0.3, 0.3, and 0.4, respectively. For node A, its processing priority is 0.54 × 0.3 + 0.769 × 0.3 + 2.23 × 0.4 = 1.25. Similarly, the processing priorities of other nodes are calculated. For example, the processing priority of node B is 0.92. Based on the calculation results, all nodes are sorted from high to low by processing priority to generate a fault handling priority list. When constructing the state space, node performance indicators, including response time, throughput, and error rate, are used as state variables. For example, the state of node A can be represented as {response time = 120ms, throughput = 2000QPS, error rate = 0.5%}. When constructing the action space, node resource adjustment operations are used as action variables, including increasing the number of CPU cores, expanding memory capacity, and adjusting I / O priority. For example, the action for node A can be {add 2 CPU cores, add 4GB of memory, and increase I / O priority}.

[0127] When sorting actions in the action space based on the fault handling priority list, the system combines and ranks the possible adjustment actions for each node according to the order of the nodes in the priority list. For node A, which has the highest priority, the possible action sequence is {increase the number of CPU cores, expand memory capacity, and adjust I / O priority}; for node C, the action sequence is {increase memory capacity, adjust network bandwidth, and optimize cache configuration}. The action sequences of each node are sorted according to processing priority to obtain the initial action sequence. When extracting state transition information from historical fault handling data, the impact of various operations on the system state in similar fault scenarios in the past is analyzed. For example, after adding two CPU cores in a state similar to that of node A, the response time decreased from 120ms to 80ms, the throughput increased from 2000QPS to 2800QPS, and the error rate decreased from 0.5% to 0.1%. The system calculates the performance benefits of different action sequences based on the state transition information, and evaluates the improvement in key performance indicators for each operation. For example, the benefit score of increasing the number of CPU cores is (120-80) / 120×0.4+(2800-2000) / 2000×0.4+(0.5-0.1) / 0.5×0.4=0.59.

[0128] When adjusting the initial action sequence based on the resource cost of each operation, consider the resource cost of each operation. For example, adding two CPU cores has a resource cost of 0.3, and adding 4GB of memory has a resource cost of 0.2. The overall benefit of the operation is calculated as performance gain divided by resource cost. For example, the overall benefit of increasing the number of CPU cores is 0.59 / 0.3 = 1.97, and the overall benefit of increasing memory capacity is 0.45 / 0.2 = 2.25. Reorder the action sequence based on the overall benefit to obtain the final reinforcement learning action sequence.

[0129] In this embodiment, by introducing multi-dimensional indicators such as the correlation coefficient of each node in the propagation link, resource occupancy intensity, and downstream impact range, a refined fault handling priority list is constructed, and on this basis, a dynamic optimization action sequence is generated in combination with the reinforcement learning mechanism, which effectively improves the efficiency and accuracy of database fault handling. Based on the propagation chain structure, the influence of the nodes in the system is quantitatively analyzed, and the performance benefit and resource cost relationship of the operation is mined based on the historical state transition information, thereby realizing adaptive optimization and adjustment of the initial action sequence. This improvement aims to improve fault recovery efficiency and rational resource utilization. It not only enhances the pertinence and executability of the strategy, but also provides the database system with intelligent decision-making support with learning and optimization capabilities.

[0130] Figure 3This figure illustrates the simulation results of fault handling priority and operational benefits. The red circle represents the operation of node A (handling priority 1.25), which contains three data points distributed in the upper left area, indicating that node A's operation has high performance benefits and low resource costs. The blue triangle represents the operation of node B (handling priority 0.92), which is mainly concentrated in the low-benefit area. The orange square represents the operation of node C (handling priority 0.98), which is more dispersed. The small gray dots in the figure represent random sample points generated during the Monte Carlo simulation.

[0131] The dotted lines connect the optimal operation sequence paths, indicating that the system no longer strictly executes operations according to node priority (A>C>B). Instead, it reorders operations based on overall benefits (performance gain / resource cost). For example, operations at nodes B or C in the figure may be prioritized due to their higher overall benefits, even though the processing priority of the nodes they are located on is lower.

[0132] This reinforcement learning-based optimization method breaks through the limitations of traditional node ranking based solely on node importance. It can more effectively balance performance improvement and resource consumption, and maximize fault recovery efficiency under limited resource conditions.

[0133] In an optional embodiment, executing a reinforcement learning action sequence and calculating in real time the degree of influence of the executed actions on the node states in the propagation link, and dividing the actions into a main control action set and a regulation action set according to a preset impact threshold based on the degree of influence, includes:

[0134] Execute actions in the reinforcement learning action sequence, collect performance indicator data of nodes in the propagation link before and after the execution of the action in real time, and construct a performance impact evaluation matrix based on the positive change value and negative change value of the performance indicator data;

[0135] Calculating an initial impact vector of an action on a node state in a propagation link based on the performance impact evaluation matrix, and performing time-series weighting on the initial impact vector using a time decay function to obtain a time-series change sequence of the node state;

[0136] Determine the node weight coefficient according to the position relationship of the nodes in the propagation link, perform weighted calculation on the time series change sequence to obtain the degree of influence of the action on the node state, and construct a node state transition probability matrix based on the degree of influence;

[0137] The influence value of the action is calculated by combining the node state transition probability matrix and the state transition benefit, and the influence value is compared with the preset influence threshold. According to the comparison result of the influence value, the executed actions are divided into the main control action set and the adjustment action set.

[0138] In this embodiment, a method for executing a reinforcement learning action sequence and dividing the action sets is provided. When executing the reinforcement learning action sequence, the degree of impact of the executed action on the node state in the propagation link is calculated in real time, and the actions are divided into a main control action set and a regulation action set based on the degree of impact.

[0139] In the process of executing a sequence of reinforcement learning actions, the system first needs to execute the action and collect relevant data. For example, in a network transmission scenario, the action can be to adjust the routing strategy, change the bandwidth allocation, or modify the cache mechanism. For each executed action, the performance indicator data of each node in the propagation link before and after the execution is collected. These indicators may include delay time, throughput, packet loss rate, CPU utilization, etc. Specifically, the system records that the delay of node A before executing the action is 20ms and after execution it is 15ms, so the positive change value is 5ms; the throughput of node B before executing the action is 100Mbps and after execution it is 95Mbps, so the negative change value is 5Mbps. Based on these collected data, the system constructs a performance impact assessment matrix, the rows of which represent different nodes, the columns represent different performance indicators, and the matrix element values ​​are the change values ​​of the corresponding indicators.

[0140] To assess the initial impact of an action on a node's state, an initial impact vector is calculated based on the performance impact evaluation matrix. For each node, the system comprehensively considers changes in multiple performance indicators to form an initial impact value. For example, the changes in each of the node's performance indicators can be weighted and summed according to their importance to obtain the initial impact value of the node. If the latency improvement weight of node A is 0.6 and the throughput improvement weight is 0.4, its initial impact value is calculated as 0.6×5+0.4×(-2)=2.2, indicating that the action has an overall positive impact on node A.

[0141] Considering that the impact of an action decays over time, a time decay function is used to perform temporal weighting on the initial influence vector. This time decay function can be an exponential decay function, whereby the weight of more recent influences increases. For example, if an exponential decay function with a decay coefficient of 0.9 is used, the influence weight at time t is 0.9^t. For data collected at 10 consecutive time points after the action is executed, the influence value at each time point is calculated and the corresponding weight is applied to obtain the temporal change sequence of the node state. For node A, for example, if the initial influence value at time t = 0 is 2.2, at time t = 1 it is 1.8, and at time t = 2 it is 1.5, then the weighted temporal change value is 2.2 × 1 + 1.8 × 0.9 + 1.5 × 0.81 = 5.335.

[0142] In a communication link, different nodes typically have varying importance. Node weight coefficients are determined based on their positional relationships within the communication link. Nodes in key positions (such as entry and sink nodes) have higher weights, while edge nodes have lower weights. For example, in a five-node network, the central node has a weight of 0.3, the two sink nodes each have a weight of 0.25, and the two edge nodes each have a weight of 0.1. These weight coefficients are used to weight the temporal change sequence to determine the final impact of the action on each node's state. For example, if the temporal change values ​​of nodes A, B, C, D, and E are 5.335, 4.221, 3.872, 2.563, and 1.998, respectively, the combined impact is 0.3 × 5.335 + 0.25 × 4.221 + 0.25 × 3.872 + 0.1 × 2.563 + 0.1 × 1.998 = 3.950.

[0143] Based on the calculated impact, the system constructs a node state transition probability matrix. This matrix describes the probability of a node transitioning from one state to another after performing a specific action. For example, categorizing node states as "good," "normal," "warning," and "dangerous," the system calculates that after performing a certain action, the probability of a node transitioning from "warning" to "normal" is 0.75, the probability of transitioning from "warning" to "good" is 0.15, the probability of remaining in "warning" is 0.08, and the probability of transitioning to "dangerous" is 0.02.

[0144] The impact value of an action is a key metric for measuring its importance. The system calculates this value by combining the node state transition probability matrix and the state transition benefit. The state transition benefit reflects the value of different state transitions. For example, the benefit of transitioning from "dangerous" to "good" is 10, and the benefit of transitioning from "warning" to "normal" is 5. The system multiplies the state transition probability with the corresponding state transition benefit and sums them to calculate the action's impact value. The calculated action impact value is then compared with a preset impact threshold. If the impact value is greater than or equal to the preset impact threshold (for example, 4.0), the action is assigned to the master action set; otherwise, it is assigned to the adjustment action set. Actions in the master action set have a significant impact on the system state, while actions in the adjustment action set have a relatively smaller impact. In the above example, the action's impact value of 4.75 exceeds the preset threshold of 4.0 and is therefore assigned to the master action set.

[0145] By performing real-time quantitative analysis of node state changes during the execution of reinforcement learning actions, a dynamic assessment mechanism for the impact of actions on the system state is constructed. This mechanism effectively identifies the scope and priority of key control actions and auxiliary adjustment actions. Existing technologies typically treat all actions equally when executing fault recovery strategies, failing to distinguish the primary and secondary impacts of actions in the actual control process. This leads to inaccurate resource allocation, lengthy execution paths, or redundant repair strategies, which in turn impacts recovery efficiency and system stability. In contrast, this solution constructs a performance impact assessment matrix based on the positive and negative changes in performance indicators. This matrix, combined with time decay and node topology weights, accurately reflects the temporal and structural impact of each action on the system state. Furthermore, through node state transition probability and benefit analysis, the comprehensive impact of each action is calculated. Based on preset thresholds, the set of primary control and adjustment actions is then divided, providing a hierarchical basis for subsequent strategy optimization and action adjustment. This improvement, aimed at improving control accuracy and execution efficiency, enables quantifiable feedback and refined classification of action effects, contributing to a more robust and intelligent fault handling system.

[0146] In an optional embodiment, collecting performance monitoring indicator data to calculate a performance improvement ratio, adjusting the execution order of the master control action set and adjusting the execution parameters of the action set according to the performance improvement ratio to generate an optimized reinforcement learning action sequence, and continuing to execute the optimized reinforcement learning action sequence until fault recovery is complete includes:

[0147] Collecting performance monitoring indicator data, the performance monitoring indicator data including the current time indicator value and the reference time indicator value, assigning weight coefficients to different monitoring indicators based on system resource usage, and multiplying the weight coefficients by the change in the monitoring indicator value to obtain a performance improvement ratio;

[0148] Calculate the performance improvement ratio difference before and after the execution of each action in the master control action set to obtain the performance change amount, and calculate the performance change rate based on the ratio of the performance change amount to the execution time interval;

[0149] Prioritizing the actions in the master control action set based on the performance change rate to obtain an execution order for the master control actions, and simultaneously calculating a correlation between an execution parameter of each action in the adjustment action set and a performance improvement ratio, determining a parameter adjustment range based on the correlation, updating the execution parameters of the actions in the adjustment action set based on the parameter adjustment range, and generating an execution configuration for the adjustment action;

[0150] The sorted execution order of the main control actions is combined with the updated execution configuration of the adjustment action to generate an optimized reinforcement learning action sequence. The optimized reinforcement learning action sequence is executed and the performance improvement ratio is updated in real time. The execution order and execution parameters of the unexecuted actions are adjusted according to the updated performance improvement ratio until the fault recovery is completed.

[0151] In this embodiment, performance monitoring indicator data is first collected. This data includes the current indicator value and the reference indicator value. The reference time can be the state of the system during normal operation or the state before the last fault recovery operation. Performance monitoring indicators may include CPU usage, memory occupancy, network throughput, disk I / O rate, service response time, etc. For example, the current CPU usage is 85%, and the CPU usage at the reference time is 45%; the current memory usage is 70%, and the memory usage at the reference time is 30%; the current network throughput is 20 MB / s, and the network throughput at the reference time is 60 MB / s.

[0152] Assign weights to different monitoring metrics based on resource usage. Under high load, CPU usage and memory utilization may be more important and therefore given higher weights. In network-intensive applications, network throughput may be more critical and therefore deserves a higher weight. For example, CPU usage has a weight of 0.4, memory usage has a weight of 0.3, network throughput has a weight of 0.2, and disk I / O rate has a weight of 0.1. Multiply the weight by the change in the monitoring metric to obtain the performance improvement ratio. For example, if the CPU usage change is -40% (a 40% decrease), multiply it by the weight of 0.4 to get -16%; if the memory usage change is -40%, multiply it by the weight of 0.3 to get -12%; if the network throughput change is -66.7%, multiply it by the weight of 0.2 to get -13.34%; and if the disk I / O change is 10%, multiply it by the weight of 0.1 to get 1%. The total performance improvement ratio is -16% - 12% - 13.34% + 1% = -40.34%, indicating a 40.34% deterioration in system performance.

[0153] For each action in the master action set, calculate the performance improvement ratio difference before and after executing each action to obtain the performance change. Assume that the master action set contains four actions: restart application services, clear cache, release connection pool, and reconfigure load balancing. Before executing the "restart application services" action, the performance improvement ratio was -40.34%, and after executing it, it was -15.20%, for a performance change of 25.14%. Before and after executing the "clear cache" action, the performance improvement ratio changed from -40.34% to -35.10%, for a performance change of 5.24%. Before and after executing the "release connection pool" action, the performance improvement ratio changed from -40.34% to -30.25%, for a performance change of 10.09%. Before and after executing the "reconfigure load balancing" action, the performance improvement ratio changed from -40.34% to -18.65%, for a performance change of 21.69%.

[0154] The performance change rate is calculated based on the ratio of the performance change to the execution interval. Assuming the "Restart Application Service" execution time is 20 seconds, the performance change rate is 25.14% / 20 = 1.257% / second; the "Clean Cache" execution time is 5 seconds, the performance change rate is 5.24% / 5 = 1.048% / second; the "Release Connection Pool" execution time is 8 seconds, the performance change rate is 10.09% / 8 = 1.261% / second; and the "Reconfigure Load Balancing" execution time is 15 seconds, the performance change rate is 21.69% / 15 = 1.446% / second.

[0155] Based on the performance change rate, the actions in the master control action set are prioritized to determine the execution order of the master control actions. Based on the above calculation results, the execution order is: reconfigure load balancing (1.446% / second), release the connection pool (1.261% / second), restart the application service (1.257% / second), and clear the cache (1.048% / second). At the same time, the correlation between the execution parameters of each action in the adjustment action set and the performance improvement ratio is calculated. Assume that the adjustment action set includes: connection pool resizing, thread pool resizing, cache capacity adjustment, and timeout setting. The system changes the parameter values, observes the changes in the performance improvement ratio, and calculates the correlation coefficient. For example, when the connection pool size increases from 50 to 100, the performance improvement ratio changes from -40.34% to -32.15%, with a correlation degree of 0.82; when the thread pool size increases from 20 to 40, the performance improvement ratio changes from -40.34% to -28.70%, with a correlation degree of 0.91; when the cache capacity increases from 200MB to 500MB, the performance improvement ratio changes from -40.34% to -38.20%, with a correlation degree of 0.31; when the timeout period increases from 3 seconds to 5 seconds, the performance improvement ratio changes from -40.34% to -37.50%, with a correlation degree of 0.27.

[0156] The parameter adjustment range is determined based on the correlation level. The higher the correlation level, the larger the adjustment range. For example, the thread pool size has a correlation level of 0.91, which allows a 100% increase; the connection pool size has a correlation level of 0.82, which allows an 80% increase; the cache capacity has a correlation level of 0.31, which allows a 30% increase; and the timeout period has a correlation level of 0.27, which allows a 20% increase. Based on this, the execution parameters of the actions in the adjustment action set are updated: the thread pool size is set to 40, the connection pool size is set to 90, the cache capacity is set to 260MB, and the timeout period is set to 3.6 seconds.

[0157] The sorted execution order of the master control actions is combined with the updated configuration of the adjustment action execution to generate an optimized reinforcement learning action sequence. The optimized action sequence is: reconfigure the load balancer, release the connection pool (connection pool size is set to 90), restart the application service (thread pool size is set to 40), clear the cache (cache capacity is set to 260MB), and set the timeout to 3.6 seconds.

[0158] Execute the optimized reinforcement learning action sequence and update the performance improvement ratio in real time. For example, after executing "Reconfigure Load Balancing", the performance improvement ratio is updated from -40.34% to -18.65%; after executing "Release Connection Pool", the performance improvement ratio is updated from -18.65% to -8.56%; after executing "Restart Application Service", the performance improvement ratio is updated from -8.56% to 2.30%; after executing "Clear Cache", the performance improvement ratio is updated from 2.30% to 7.54%; after executing "Set Timeout", the performance improvement ratio is updated from 7.54% to 9.20%.

[0159] Based on the updated performance improvement ratio, the execution order and parameters of unexecuted actions can also be adjusted. For example, if after executing "Release Connection Pool," the performance improvement ratio only reaches -15.40% instead of the expected -8.56%, the system will recalculate the priorities and parameter settings of the remaining actions. The system continues to execute and adjust the action sequence until the performance improvement ratio reaches the preset threshold, indicating that the fault recovery is complete. In this example, the final performance improvement ratio is 9.20%, indicating that system performance has improved by 9.20% compared to the baseline, indicating that the fault has been successfully recovered.

[0160] By introducing the performance improvement ratio as a dynamic feedback metric and establishing a quantitative correlation between action effects and system performance, this approach achieves adaptive optimization of reinforcement learning action sequences. Existing technologies often rely on static rules or preset strategies to execute repair operations, lacking real-time feedback mechanisms. This makes it difficult to address the dynamic intervention requirements of multiple nodes and actions in complex systems, often leading to redundant actions, illogical execution sequences, and resource waste. In contrast, this solution calculates a performance improvement ratio by weighting performance metric changes and resource usage. The evolution of this ratio over different time windows is then used to evaluate the actual effectiveness of the master control actions, thereby dynamically adjusting the order of action execution. Furthermore, based on the correlation between the adjustment actions and performance improvement, parameter adjustment ranges are set to fine-tune action behavior, improving the flexibility and accuracy of the adjustment response. Driven by real-time performance feedback, this solution establishes a closed-loop optimization mechanism of action, metric, and feedback. This significantly improves the efficiency, adaptability, and intelligence of the fault handling process, driving the system's evolution from static response to a dynamic closed-loop, achieving efficient and reliable automated fault recovery.

[0161] A second aspect of an embodiment of the present invention provides a database fault handling system based on reinforcement learning, the system comprising:

[0162] The first unit is used to collect performance indicator data, execution plan data, and error log data at the time of the database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node of the failure from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node;

[0163] The second unit is used to generate a fault handling priority list based on the correlation coefficient size and resource occupancy of nodes in the propagation link, and construct a reinforcement learning action sequence based on the fault handling priority list;

[0164] The third unit is used to execute the reinforcement learning action sequence and calculate in real time the impact of the executed actions on the node states in the propagation link. According to the impact degree, the actions are divided into a main control action set and a regulation action set according to the preset impact threshold;

[0165] The fourth unit is used to collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

[0166] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including:

[0167] processor;

[0168] a memory for storing processor-executable instructions;

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

[0170] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0171] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements 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 database fault handling method based on reinforcement learning, characterized in that: include: Collect performance indicator data, execution plan data, and error log data at the time of database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node; Based on the correlation coefficients and resource occupancy of nodes in the propagation link, a fault handling priority list is generated, and a reinforcement learning action sequence is constructed based on the fault handling priority list. Execute a sequence of reinforcement learning actions and calculate in real time the degree of impact of the executed actions on the node states in the propagation link. Based on the degree of impact, the actions are divided into a set of master actions and a set of adjustment actions according to a preset impact threshold; wherein the master action set includes at least restarting application services, clearing caches, releasing connection pools, and reconfiguring load balancing, and the adjustment action set includes at least connection pool size adjustment, thread pool size adjustment, cache capacity adjustment, and timeout setting; Collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

2. The method according to claim 1, characterized in that Collect performance indicator data, execution plan data, and error log data at the time of database failure, generate a failure state vector, calculate the time series correlation coefficient matrix based on the failure state vector, and construct a causal decision tree based on the time series correlation coefficient matrix, including: Collect performance indicator data, execution plan data, and error log data at the time of database failure; Periodically sampling the performance indicator data to obtain resource usage, query response time, and data processing volume within each sampling period; extracting query access paths, parallelism, and resource estimates from the execution plan data; and extracting fault type identifiers and associated object identifiers from the error log data; Calculating a deviation degree between the resource usage and the corresponding estimated value, calculating a delay degree between the query response time and the reference time, and performing correlation mapping between the fault type identifier and the associated object identifier; generating a fault state vector based on the deviation degree, delay degree, and correlation mapping result; Perform sliding window processing on the fault state vector, calculate the time series correlation coefficients between the indicators in the window, and construct a time series correlation coefficient matrix according to the indicator correspondence relationship; weight the correlation coefficients in the time series correlation coefficient matrix according to the resource estimate value, and construct a causal decision tree based on the weighted time series correlation coefficient matrix, wherein the indicator pair with the strongest correlation coefficient is determined as the root node of the tree, and child nodes are constructed in sequence according to the strength of the correlation coefficient, and the resource estimate value is used as a constraint condition for the connection between nodes.

3. The method according to claim 1, characterized in that Identifying the fault root cause node from the causal decision tree and generating a propagation link from the fault root cause node to the performance anomaly node includes: Calculate the fault impact of each node in the causal decision tree, and combine the node's out-degree value, correlation coefficient strength, and resource occupancy rate to obtain the node's fault impact value; Traversing backward from the leaf nodes of the causal decision tree, calculating the impact transfer value of each node based on the connection strength between nodes and the fault impact value, and marking the node with a sudden change in the impact transfer value as a candidate root cause node; Taking the candidate root cause node as the starting point, the abnormality value is propagated downward along the causal decision tree based on the fault impact, and the abnormality value is compared with the abnormal value in the performance indicator data. When the comparison result meets the matching condition, the current candidate root cause node is confirmed to be the fault root cause node; Starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction according to the strength of the correlation coefficient between nodes. When the temporal correlation coefficient between nodes is lower than a preset correlation threshold, the propagation link currently searched is pruned to obtain the initial propagation link. The initial propagation link is verified, the link validity is confirmed based on the performance indicator change trend and time sequence relationship between the nodes, and the fault propagation link from the fault root cause node to the performance abnormality node is output.

4. The method according to claim 3, characterized in that Starting from the fault root node, a depth-first search strategy is adopted to determine the propagation direction based on the correlation coefficient strength between nodes. When the temporal correlation coefficient between nodes is lower than the preset correlation threshold, the propagation link currently searched is pruned. The initial propagation link includes: Obtain performance indicator time series data of the fault root node and connected nodes, analyze the performance indicator time series data using a sliding time window, and calculate the time series correlation coefficient between adjacent nodes; Determine the propagation direction between nodes based on the magnitude of the timing correlation coefficient, record all propagation directions of the fault root cause node, and set a preset correlation threshold for propagation link pruning; Starting from the fault root node, a depth-first search strategy is used to traverse the nodes, preferentially selecting the propagation direction with the largest timing correlation coefficient. Adjacent nodes with timing correlation coefficients greater than the preset correlation threshold are sequentially added to the current propagation link, and the search is continued with the newly added node as the current search node until the timing correlation coefficients of all adjacent nodes of the current search node are lower than the preset correlation threshold. From the current search node, trace back to the previous search node in sequence. For the nodes in the previous search node whose propagation direction has not been searched, select the propagation direction with the second largest time correlation coefficient to continue the depth-first search. After completing the search of all propagation directions, merge the retained propagation links to obtain the initial propagation link.

5. The method according to claim 1, characterized in that Based on the correlation coefficients and resource usage of nodes in the propagation link, a fault handling priority list is generated. Based on the fault handling priority list, a reinforcement learning action sequence is constructed, including: Obtain the correlation coefficient between each node in the fault propagation link and the resource occupancy data of each node; Calculating the correlation coefficient weights between the current node and adjacent nodes based on the correlation coefficient, calculating the resource occupancy intensity of the node based on the resource occupancy data, and counting the number of downstream nodes affected by the node and their importance to obtain the downstream influence range of the node; The correlation coefficient weight, resource occupancy intensity, and downstream impact range are weightedly combined to obtain the processing priority of the node, and a fault processing priority list is generated according to the processing priority of the node; A state space is constructed by using the performance indicators of the nodes as state variables, an action space is constructed by using the resource adjustment operations of the nodes as action variables, and the operations in the action space are sorted based on the fault handling priority list to obtain an initial action sequence; State transition information is extracted from fault processing history data, and the performance benefits of different operation sequences are calculated based on the state transition information. The initial action sequence is adjusted in combination with the resource cost of the operation to obtain the final reinforcement learning action sequence.

6. The method according to claim 1, wherein Execute the reinforcement learning action sequence and calculate the impact of the executed action on the node status in the propagation link in real time. According to the impact degree, the action is divided into the main control action set and the adjustment action set according to the preset impact threshold, including: Execute actions in the reinforcement learning action sequence, collect performance indicator data of nodes in the propagation link before and after the execution of the action in real time, and construct a performance impact evaluation matrix based on the positive change value and negative change value of the performance indicator data; Calculating an initial impact vector of an action on a node state in a propagation link based on the performance impact evaluation matrix, and performing time-series weighting on the initial impact vector using a time decay function to obtain a time-series change sequence of the node state; Determine the node weight coefficient according to the position relationship of the nodes in the propagation link, perform weighted calculation on the time series change sequence to obtain the degree of influence of the action on the node state, and construct a node state transition probability matrix based on the degree of influence; The influence value of the action is calculated by combining the node state transition probability matrix and the state transition benefit, and the influence value is compared with the preset influence threshold. According to the comparison result of the influence value, the executed actions are divided into the main control action set and the adjustment action set.

7. The method according to claim 1, characterized in that Collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set based on the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is complete, including: Collecting performance monitoring indicator data, the performance monitoring indicator data including the current time indicator value and the reference time indicator value, assigning weight coefficients to different monitoring indicators based on system resource usage, and multiplying the weight coefficients by the change in the monitoring indicator value to obtain a performance improvement ratio; Calculate the performance improvement ratio difference before and after the execution of each action in the master control action set to obtain the performance change amount, and calculate the performance change rate based on the ratio of the performance change amount to the execution time interval; Prioritizing the actions in the master control action set based on the performance change rate to obtain an execution order for the master control actions, and simultaneously calculating a correlation between an execution parameter of each action in the adjustment action set and a performance improvement ratio, determining a parameter adjustment range based on the correlation, updating the execution parameters of the actions in the adjustment action set based on the parameter adjustment range, and generating an execution configuration for the adjustment action; The sorted execution order of the main control actions is combined with the updated execution configuration of the adjustment action to generate an optimized reinforcement learning action sequence. The optimized reinforcement learning action sequence is executed and the performance improvement ratio is updated in real time. The execution order and execution parameters of the unexecuted actions are adjusted according to the updated performance improvement ratio until the fault recovery is completed.

8. A database fault handling system based on reinforcement learning, used to implement the method according to any one of claims 1 to 7, characterized in that: include: The first unit is used to collect performance indicator data, execution plan data, and error log data at the time of the database failure, generate a fault state vector, calculate a time series correlation coefficient matrix based on the fault state vector, construct a causal decision tree based on the time series correlation coefficient matrix, identify the root cause node of the failure from the causal decision tree, and generate a propagation link from the root cause node to the performance anomaly node; The second unit is used to generate a fault handling priority list based on the correlation coefficient size and resource occupancy of nodes in the propagation link, and construct a reinforcement learning action sequence based on the fault handling priority list; The third unit is used to execute a sequence of reinforcement learning actions and calculate in real time the degree of influence of the executed actions on the node states in the propagation link. According to the degree of influence, the actions are divided into a master action set and a regulation action set according to a preset impact threshold; wherein the master action set at least includes restarting the application service, clearing the cache, releasing the connection pool, and reconfiguring the load balancing, and the regulation action set at least includes connection pool size adjustment, thread pool size adjustment, cache capacity adjustment, and timeout setting; The fourth unit is used to collect performance monitoring indicator data to calculate the performance improvement ratio, adjust the execution order of the main control action set and the execution parameters of the adjustment action set according to the performance improvement ratio, generate an optimized reinforcement learning action sequence, and continue to execute the optimized reinforcement learning action sequence until the fault recovery is completed.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Equipment fault cause tracing method based on reinforcement learning and knowledge graph

    CN112100392A

  • Reinforcement learning-based power grid regulation and control strategy optimization method

    CN113988508A