A distributed system fault root cause tracing method based on knowledge graph technology
By constructing a fault knowledge graph and using relationship classifiers and graph convolutional neural networks, the root cause of distributed system faults is automatically determined, which solves the problems of low efficiency and poor accuracy of fault root cause analysis in the existing technology, and achieves efficient and accurate analysis. Bug fixes.
Patent Information
- Application Number
- CN202110722163.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-28
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2041-06-28
AI Technical Summary
In distributed systems, it is difficult for existing technologies to use explicit knowledge in historical data to guide fault root cause analysis, and cannot fully explain the fault triggering path at the event level, resulting in low fault repair efficiency and poor accuracy.
By constructing a fault knowledge graph, using historical fault data to generate event features to train a relationship classifier, mining historical event relationships, constructing a fault propagation graph, and automatically determining faults when a fault occurs by calculating the similarity between the real-time fault propagation graph and the fault knowledge graph. root cause.
It greatly reduces the time for tracing the fault root cause, improves the accuracy of fault analysis and the operation and maintenance personnel's understanding of the fault propagation process, and ensures the stability and security of the system.
Smart Images

Figure CN113377567B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of knowledge graphs, and specifically relates to a distributed system fault root cause tracing method based on knowledge graph technology. Background Art
[0002] With the rapid development of virtualization technology, distributed systems are becoming increasingly large and complex. Due to the complex network topology of distributed systems, the urgent time for fault repair, and the scarcity of high-level distributed system operation and maintenance personnel, when a system fails, it is difficult for operation and maintenance personnel to find the root cause in a short time, and the system will be in an unstable state. Finding the root cause of large-scale distributed system failures in a timely manner to ensure the safe and stable operation of the system is an urgent problem to be solved. In recent years, more and more researchers have begun to pay attention to these issues. Dependency graph-based methods and causal graph-based methods have achieved some good results in dealing with the root cause analysis of complex system failures. However, these methods have two limitations: 1. They have not yet studied how to use the explicit knowledge hidden in historical data to guide the current root cause analysis; 2. They cannot fully explain the fault triggering path at the event level.
[0003] The propagation path of a fault contains a lot of fault information. Different devices and different propagation orders on the propagation path will lead to different faults. The knowledge graph is a structured semantic knowledge base that can be used to save the fault propagation path, a directed acyclic graph with a limited structure. Precipitating the explicit knowledge of the fault propagation path into a fault knowledge graph and then introducing fault root cause analysis can not only improve the accuracy of root cause analysis, but also help operation and maintenance personnel understand the fault propagation process, so as to repair the fault in a targeted manner.
[0004] Based on the limitations of existing methods, the present invention constructs a fault knowledge graph for each type of fault in a distributed system and proposes a fault root cause tracing method based on knowledge graph technology. Summary of the invention
[0005] To solve the above problems, the present invention discloses a distributed system fault root cause tracing method based on knowledge graph technology. The method avoids a large amount of repetitive manual abnormality troubleshooting and fault diagnosis work, greatly reduces the time for fault root cause tracing, and can automatically, frequently and efficiently trace the faults in the distributed system. While ensuring a shorter fault tracing time, the quality of fault tracing is also guaranteed.
[0006] The present invention takes the historical fault data of the distributed system as the starting point and generates events from the historical metric data and log data. Then, the relational classifier is trained using the features of the event, and the relationship between historical events is mined using the relational classifier to construct a historical fault propagation graph. Then, similar structures are extracted from the historical fault propagation graphs of the same fault to construct a fault knowledge graph. When a fault occurs in the distributed system, real-time fault data is collected to construct a real-time fault propagation graph. By calculating the similarity between the real-time fault propagation graph and the fault knowledge graph, the fault knowledge graph that is most similar to the real-time fault propagation graph is obtained, thereby judging the root cause of the real-time fault based on the root cause of the fault marked by the fault knowledge graph.
[0007] To achieve the above object, the technical solution of the present invention is as follows:
[0008] A distributed system fault root cause tracing method based on knowledge graph technology includes the following steps:
[0009] 1) Collect historical fault data of distributed systems and generate events using anomaly detection algorithms and template methods;
[0010] 2) Extract event features to train a relational classifier, then use the relational classifier to mine the relationship between historical events and construct a historical fault propagation graph;
[0011] 3) Extract similar structures from the fault propagation graphs of the same fault and construct a fault knowledge graph. A fault knowledge graph represents a fault, its propagation path, and its root cause.
[0012] 4) Collecting real-time fault data of the distributed system and constructing a real-time fault propagation graph using the method in step 2);
[0013] 5) Calculate the similarity between the real-time fault propagation graph and the fault knowledge graph to obtain the fault knowledge graph that is most similar to the real-time fault propagation graph, so as to determine the root cause of the real-time fault based on the root cause of the fault marked by the fault knowledge graph.
[0014] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, the operation and maintenance events, abstract operation and maintenance events, fault propagation graphs, and fault knowledge graphs in the above steps are defined as follows:
[0015] Definition 1: Operation and maintenance event. Operation and maintenance event e=(E,t,l), where E∈ε is the event type, ε={E1,E2,…,E m} is a finite set of m event types, t represents the timestamp of the operation and maintenance event, and l represents the location where the event occurs].
[0016] Definition 2: Abstract operation and maintenance event. Abstract operation and maintenance event e′=(E,L), where E∈ε is the event type, ε={E1,E2,…,Em} is a finite set of m event types, and L∈γ is a location type, γ={L1,L2,…,L n} is a finite set of n place types.
[0017] Definition 3: Fault Propagation Graph (FPG). FPG is a set of triples (e1, r, e2), where e1 and e2 are events, r is the relationship between events e1 and e2, and r is a sequential relationship or a causal relationship.
[0018] Definition 4: Fault Knowledge Graph (FKG). Fault Knowledge Graph FKG is a set of triples (e1′, r, e2′), where e1′ and e2′ are abstract events, and r is the relationship between abstract events e1′ and e2′. r is a sequential relationship or a causal relationship.
[0019] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, in step 1), an event is generated in the following manner (the generation method is shown in the following figure):
[0020] 1-a) For the metric data (time series data, such as CPU usage curve) in the system, use the anomaly detection algorithm to detect the abnormal points in the metric curve, and then generate events through the template;
[0021] 1-b) For the log data in the system, use the clustering algorithm to obtain the main log types, and then generate events through templates.
[0022] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, in step 2), the relationship classifier is trained according to the following features:
[0023] 2-1) Pearson correlation coefficient: The higher the Pearson correlation coefficient between two events, the more related the two events are, and the more likely they are causally related;
[0024] 2-2) Event co-occurrence frequency: The more frequently two events occur together, the more likely they are to be causally related;
[0025] 2-3) Distance between the locations of events: The closer the locations of the events, the more likely it is that there is a causal relationship;
[0026] 2-4) Time difference between events: The closer the events are to each other, the more likely they are causally related;
[0027] 2-5) Event Criticality: The criticality of an event refers to the importance of the event to a certain fault. The higher the criticality of two events, the smaller the difference in criticality, and the more likely they are to be causally related;
[0028] 2-6) Event periodicity: Periodic events are likely to be white noise. Such periodic events will occur periodically regardless of whether a fault occurs or not. Therefore, the higher the event periodicity, the weaker its causal relationship with other nodes.
[0029] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, in step 2), a fault propagation graph is generated in the following manner:
[0030] 2-a) Use event features to train a relation classifier;
[0031] 2-b) Use relational classifiers to determine the relationship between events;
[0032] 2-c) Use events as nodes and the relationships between events as edges to construct a fault propagation graph.
[0033] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, in step 3), the fault knowledge graph is generated in the following manner:
[0034] 3-a) Collect fault propagation graphs of the same fault;
[0035] 3-b) Use the intersection method to obtain the similar structure of the fault propagation graph of the same fault and obtain the fault knowledge graph;
[0036] 3-c) Through the auxiliary labeling algorithm, the labeled fault knowledge graph is labeled to mark the root cause of the fault and its fault propagation path.
[0037] In the distributed system fault root cause tracing method based on knowledge graph technology of the present invention, in step 5), the fault root cause tracing is performed in the following manner:
[0038] 5-a) Use the relational graph convolutional neural network (RGCN) to extract the features of the fault propagation graph and the fault knowledge graph, so as to calculate the similarity between the real-time fault propagation graph and the fault knowledge graph; first, the online fault propagation graph and the fault knowledge graph are embedded into the vector space through the embedding layer, and then the graph features are extracted through the relational graph convolutional neural network, followed by vector splicing after the pooling layer, and finally input into the multi-layer perceptron to obtain the graph similarity.
[0039] 5-b) Find the fault knowledge graph that is most similar to the real-time fault propagation graph;
[0040] 5-c) Obtain the root cause event type of the real-time fault according to the fault root cause event type marked in the fault knowledge graph;
[0041] 5-d) Use the following formula to map the root cause event type of the real-time fault to the specific root cause event. root is a specific root cause event, and S is a set of all events of this event type in real-time data based on the root cause event type.
[0042] N t (s) function returns the ranking of event s in set S in the order of the time difference between s and f. d (s) The function returns the ranking of event s in the set S according to the distance between s and the device where f occurred. W1 and W2 are two hyperparameter weights respectively.
[0043] s root =argmin s∈s (W1*N t (s)+W2*N d (s))
[0044] The beneficial effects of the present invention are:
[0045] Compared with most of the current root cause tracing methods, the present invention more accurately completes the root cause tracing of distributed system faults. Existing methods ignore the explicit knowledge or patterns in historical data and cannot fully explain the fault triggering path at the event level. The present invention saves the explicit knowledge in the historical data by constructing a fault knowledge graph, records the complete event-level fault triggering path, and can more accurately find the root cause of distributed system failures. And because the fault triggering path is saved, operation and maintenance personnel can understand the fault propagation process more clearly, so as to repair the fault in a targeted manner and ensure system stability and security.
[0046] Experimental analysis proves that the root cause tracing method for distributed system faults based on knowledge graph technology proposed in the present invention can complete the root cause tracing work in the distributed system. The present invention shows good results in terms of precision, recall rate and F1 value. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the overall framework of the present invention;
[0048] Figure 2 It is a schematic diagram of the fault root cause tracing method in the present invention.
[0049] Figure 3 It is a schematic diagram of event generation and template construction in the present invention;
[0050] Figure 4It is a schematic diagram of constructing a fault knowledge graph in the present invention;
[0051] Figure 5 It is a schematic diagram of the graph similarity calculation model in the present invention. DETAILED DESCRIPTION
[0052] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0053] The present invention is a distributed system root cause tracing method based on knowledge graph, which includes the following five steps:
[0054] Step 1): Start by collecting historical failure data of the large-scale distributed system Kubernetes and generate events from these historical failure data. The events discovered in this process will be used to build the failure propagation graph later. The detailed steps are as follows:
[0055] (1) Generate events from log data;
[0056] For log data, on the one hand, clustering algorithms are used to discover common templates in logs, and then the newly discovered templates are added to the template library. On the other hand, templates in the template library are used to match logs to generate corresponding events, such as Figure 3 shown.
[0057] (2) Generate events from metric data.
[0058] For metric data, anomaly detection algorithms are used to detect anomalies. For example, if some indicators start out smooth and then suddenly jitter after a certain point, then this turning point is an anomaly. Anomalies are generally caused by anomalies in the system. After finding the anomaly, template matching can be used to obtain an abnormal event. Assuming that the indicator in the above example is CPU usage, if it starts out smooth and then suddenly jitters and increases, then this point is an anomaly. According to the template, it can be concluded that the event type of this anomaly point is a sudden increase in CPU usage. The following is an example of a specific event.
[0059] {
[0060] Time: 1576078184 (timestamp)
[0061] Location: Container-6b6fc4869d
[0062] Event Type: Container Memory 100%
[0063] }
[0064] Event types are mainly divided into normal events, abnormal events, and fault events. Normal events refer to events generated by some successful operations of components within the system. Note that normal events do not mean that they cannot cause faults. For example, a server restart event, although this event is an event generated by the normal restart of the server, if other servers access it when this server is restarted, an access failure event will be generated, which may cause a fault. Abnormal events refer to events generated by some failed operations of system components, or events that are abnormal to the system detected by the operation and maintenance personnel using anomaly detection algorithms, but the components can still operate normally when this event occurs. Fault events refer to events that describe component failures. When a fault event occurs, the component can no longer operate normally. It can be further subdivided into hardware failures and software failures. The specific operation and maintenance event type classification and its examples are shown in the table below.
[0065]
[0066] Step 2): Extract event features to train a relational classifier, then use the relational classifier to mine the relationships between historical events and construct a historical fault propagation graph. The detailed steps are as follows:
[0067] (1) Training a relation classifier;
[0068] Using the events generated in step 1), extract the features of the events, and use the relationships between the events as label values to construct a training data set. Based on the training data, use machine learning methods to build a classification model as a relationship classifier.
[0069] In this embodiment, tens of thousands of events are generated from the historical fault data of the distributed system, and the following features are extracted from them:
[0070] Feature 1: Pearson correlation coefficient: The higher the Pearson correlation coefficient between two events, the more related the two events are, and the more likely they are causally related;
[0071] Feature 2: Event co-occurrence frequency: The more frequently two events occur together, the more likely they are to be causally related;
[0072] Feature 3: Distance between the locations where events occurred: The closer the locations where the events occurred, the more likely it is that there is a causal relationship;
[0073] Feature 4: Time difference between events: The closer the events are to each other, the more likely they are causally related;
[0074] Feature 5: Event Criticality: The criticality of an event refers to the importance of the event to a certain fault. The higher the criticality of two events, the smaller the difference in criticality, and the more likely they are to be causally related;
[0075] Feature 6: Event periodicity: Periodic events are likely to be white noise. Such periodic events will occur periodically regardless of whether a fault occurs or not. Therefore, the higher the event periodicity, the weaker its causal relationship with other nodes.
[0076] In this embodiment, the effectiveness of feature engineering is tested by the following method:
[0077] Replace the label value in the training sample with the classification category: Specifically, if two events are causally related, y(e)>0, it is a positive example; if two events are sequentially related, y(e)=0, it is a negative example. Then calculate the chi-square value (χ 2 ) and information gain (IG). The chi-square value can be used to determine the correlation between the feature and the category label. The smaller the value, the lower the correlation and the less useful the feature. Information gain indicates the degree to which the information uncertainty of the category label is reduced by knowing the information of feature X. The more useful the feature, the greater the information gain value. The test results of this embodiment meet the expected assumptions.
[0078] The classification model in machine learning is used as the prediction model. The predictor in this embodiment uses classic machine learning models such as SVM, Xgboost, random forest, and logistic regression as the classification model of the classifier, and experiments show that SVM relationship classification has the best effect.
[0079] (2) Construct a historical fault propagation graph.
[0080] The relationship between historical events is mined using a relational classifier, with events as nodes and the relationships between events as edges to construct a fault propagation graph.
[0081] Step 3): Extract similar structures from the fault propagation graphs of the same fault and construct a fault knowledge graph. The detailed steps are as follows:
[0082] (1) Collect fault propagation diagrams of the same fault;
[0083] The same faults often occur in large distributed systems. In this embodiment, 27 types and 973 faults are collected to construct fault propagation graphs. Excluding the problem of data loss of some faults, 27 types and 967 fault propagation graphs are actually constructed.
[0084] (2) Constructing a fault knowledge graph;
[0085] 967 fault propagation graphs were used to construct a fault knowledge graph. This embodiment uses the intersection method to obtain similar structures of fault propagation graphs of the same fault, and a total of 27 fault knowledge graphs are obtained. Figure 4This is a schematic diagram of this process. First, the fault propagation graph construction method is used to construct the fault propagation graph of these N faults. The combiner will ignore the specific time and location of the event nodes in the fault propagation graph, find out the common structure of all fault propagation graphs, precipitate fault knowledge, and abstract the common structure to generate the fault knowledge graph of fault A.
[0086] (3) Label the fault knowledge graph.
[0087] After obtaining the fault knowledge graph, it is necessary to manually annotate the root cause events of each fault knowledge graph. Since direct manual annotation is time-consuming, this embodiment uses an auxiliary root cause annotation algorithm to assist experts in root cause annotation. Through the auxiliary annotation algorithm, the annotated fault knowledge graph is annotated to annotate the root cause of the fault and its fault propagation path. The algorithm uses depth-first traversal. Every time a node is traversed, it is necessary to determine whether the node is the root cause node. For each node, if the node is a root node, or the node is in a causal relationship with the previous node and has a sequential relationship with a subsequent node, then it may be a root cause node and needs to be manually annotated.
[0088] Step 4): Collect real-time fault data of the distributed system and construct a real-time fault propagation graph using the method of step 2);
[0089] Step 5): Calculate the similarity between the real-time fault propagation graph and the fault knowledge graph, and obtain the fault knowledge graph that is most similar to the real-time fault propagation graph, such as Figure 5 As shown, the root cause of the real-time fault is determined based on the root cause of the fault marked by the fault knowledge graph.
[0090] This embodiment uses a relational graph convolutional neural network to extract the features of the fault propagation graph and the fault knowledge graph, thereby calculating the similarity between the real-time fault propagation graph and the fault knowledge graph, and finding the fault knowledge graph that is most similar to the real-time fault propagation graph. This real-time fault propagation graph and the fault knowledge graph have the same logical relationship between events, so they should have the highest similarity, so they are more likely to be the same fault with similar root causes. Therefore, the root cause event type marked by this fault knowledge graph is selected as the root cause event type of this fault.
[0091] Since the root cause event type is returned here, it needs to be mapped to a specific root cause event. Use the following formula to map the root cause event type of the real-time fault to a specific root cause event. root is a specific root cause event, and S is a set of all events of this event type in the real-time data based on this root cause event type. t (s) function returns the ranking of event s in set S in the order of the time difference between s and f. d(s) The function returns the ranking of event s in the set S according to the distance between s and f. W1 and W2 are two hyperparameter weights.
[0092]
[0093] This example finally returns the top 3 root cause events as the fault root cause tracing result. The following indicators are used for evaluation:
[0094] Precision@n: The top n root cause events returned are actually the proportion of the root causes of this fault.
[0095] Recall@n: The root cause events of the actual fault, which are ranked in the top n.
[0096] F1@n: The harmonic mean of Precision and Recall, giving more importance to smaller values.
[0097] AUC: The area under the Precision-Recall curve. A larger AUC represents a better effect.
Claims
1. A distributed system fault root cause tracing method based on knowledge graph technology, characterized in that: The method comprises the following steps: 1) Collect historical fault data of distributed systems and generate events using anomaly detection algorithms and template methods; 2) Extract event features to train a relational classifier, then use the relational classifier to mine the relationship between historical events and construct a historical fault propagation graph; 3) Extract similar structures composed of abstract events from the fault propagation graph of the same fault and construct a fault knowledge graph. A fault knowledge graph represents a fault, its propagation path and root cause; 4) Collect real-time fault data of the distributed system and construct a real-time fault propagation graph using the method in step 2); 5) Calculate the similarity between the real-time fault propagation graph and the fault knowledge graph to obtain the fault knowledge graph that is most similar to the real-time fault propagation graph, so as to determine the root cause of the real-time fault according to the root cause of the fault marked by the fault knowledge graph; The events, abstract events, fault propagation graphs, and fault knowledge graphs are defined as follows: Definition 1: Event: Event e = (E, t, l), where E∈ε is the event type, ε = [E1, E2, ..., E m } is a finite set of m event types, t represents the timestamp of the event, l represents the location where the event occurs, Definition 2: Abstract event: An abstract event e′=(E, L), where E∈ε is the event type, e=[E1,E2,...,E m } is a finite set of m event types, and L∈γ is a location type, γ=[L1,L2,...,L n } is a finite set of n place types, Definition 3: Fault Propagation Graph: A fault propagation graph (FPG) is a set of triples (e1, r, e2), where e1 and e2 are events, r is the relationship between events e1 and e2, and r is a sequential relationship or a causal relationship. Definition 4: Fault knowledge graph: Fault knowledge graph FKG is a set of triples (e′1, r, e′2), where e′1 and e′2 are abstract events, r is the relationship between abstract events e′1 and e′2, and r is a sequential relationship or a causal relationship; In step 5), the root cause of the fault is traced as follows: 5-a) Use the relational graph convolutional neural network to extract the features of the fault propagation graph and the fault knowledge graph, so as to calculate the similarity between the real-time fault propagation graph and the fault knowledge graph; 5-b) Find the fault knowledge graph that is most similar to the real-time fault propagation graph; 5-c) Obtain the root cause event type of the real-time fault according to the fault root cause event type marked in the fault knowledge graph; 5-d) The root cause event type of the real-time fault is mapped to the specific root cause event through the following formula, where s root is a specific root cause event, S is the set of all events of this event type in the real-time data based on this root cause event type, and N t (s) function returns the ranking of event s in set S in the order of the time difference between s and f. d (s) function returns the ranking of event s in the set S according to the distance between s and f. W1 and W2 are two hyperparameter weights, 2. According to claim 1, the method for tracing the root cause of a distributed system failure based on knowledge graph technology is characterized in that: In the step 1), an event is generated as follows: 1-a) For the metric data in the system, use the anomaly detection algorithm to detect the abnormal points in the metric curve, and then generate events through the template; 1-b) For the log data in the system, use the clustering algorithm to obtain the main log types, and then generate events through templates.
3. The distributed system fault root cause tracing method based on knowledge graph technology according to claim 1 is characterized in that: In step 2), the relationship classifier is trained according to the following features: 2-1) Pearson correlation coefficient: The higher the Pearson correlation coefficient between two events, the more related the two events are, and the more likely they are causally related; 2-2) Event co-occurrence frequency: The more frequently two events occur together, the more likely they are to be causally related; 2-3) Distance between the locations of events: The closer the locations of the events, the more likely it is that there is a causal relationship; 2-4) Time difference between events: The closer the events are to each other, the more likely they are causally related; 2-5) Event criticality: The criticality of an event refers to the importance of the event to a certain fault. The higher the criticality of two events, the smaller the difference in criticality, and the more likely they are to be causally related; 2-6) Event periodicity: Periodic events are very likely to be white noise. Such periodic events will occur periodically regardless of whether a fault occurs or not. Therefore, the higher the event periodicity, the weaker its causal relationship with other nodes.
4. The method for tracing the root cause of a distributed system failure based on knowledge graph technology according to claim 1 is characterized in that: In the step 2), a fault propagation graph is generated in the following manner: 2-a) Use event features to train a relation classifier; 2-b) Use relational classifiers to determine the relationship between events; 2-c) Use events as nodes and the relationships between events as edges to construct a fault propagation graph.
5. The method for tracing the root cause of a distributed system failure based on knowledge graph technology according to claim 1 is characterized in that: In step 3), the fault knowledge graph is generated in the following manner: 3-a) Collect fault propagation graphs of the same fault; 3-b) Use the intersection method to obtain the similar structure of the fault propagation graph of the same fault and obtain the fault knowledge graph; 3-c) Through the auxiliary labeling algorithm, the labeled fault knowledge graph is labeled to mark the root cause of the fault and its fault propagation path.
