Root cause diagnosis method, and root cause diagnosis model training method and device
By using the root cause diagnosis model of the multi-head attention mechanism in smart device fault diagnosis, and using weakly supervised learning to identify the root cause of faults from log data, the problems of low fault diagnosis efficiency and high cost in the existing technology are solved, and high efficiency is achieved. , accurate fault location.
Patent Information
- Application Number
- CN202310363570.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
AI Technical Summary
In smart device fault diagnosis, existing technology is difficult to efficiently identify the root cause of the fault, resulting in high manual participation costs and low diagnostic efficiency. Especially in a large number of devices and complex systems, fault tracking becomes cumbersome and time-consuming.
A root cause diagnosis model based on a multi-head attention mechanism is used to identify the root cause of faults from log data through weakly supervised learning. The annotated fault time window is used as a weak label for model training, which reduces manual annotation costs and improves diagnosis efficiency.
It achieves efficient identification of fault root causes in intelligent equipment fault diagnosis, reduces manual participation costs and diagnosis time, improves the accuracy and efficiency of fault location, and can quickly locate fault causes in complex systems.
Smart Images

Figure CN118734060A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fault diagnosis, and in particular to a root cause diagnosis method, a root cause diagnosis model training method and a device. Background Art
[0002] As smart devices such as mobile phones and computers become more and more advanced, more and more services need to be controlled by smart devices. As the number of devices increases and the complexity of the devices increases, how to maintain a large number of devices in a timely manner is a new challenge. When a system fails, untimely or inappropriate handling may cause serious reputation damage to the manufacturer. Generally speaking, system failures can be traced back to a root cause, which will propagate until an observable failure occurs. Developers need to determine the root cause of the failure and then determine the corresponding handling method.
[0003] Usually, when a device fails, developers can locate the problem through tools such as logs and traces. However, in actual work, a single module failure may affect many related components, resulting in a large number of alarm logs. Therefore, how to efficiently determine the root cause of the failure has become an urgent problem to be solved. Summary of the invention
[0004] The present application provides a root cause diagnosis method for performing root cause diagnosis based on a root cause diagnosis model trained with training data of annotated fault time windows, thereby reducing the cost of manual participation, reducing the cost of root cause diagnosis, and improving the efficiency of root cause diagnosis.
[0005] In view of this, on the first aspect, the present application provides a root cause diagnosis method, comprising: first, obtaining current log data, that is, the log recorded by the faulty device during operation, including the log generated during the faulty device's fault process; then, using the current log data as the input of a root cause diagnosis model to obtain predicted log data, which can be used to indicate data in a fault time window, which covers the time range when the faulty device generates a fault, such as the predicted log data may include log lines representing the fault time window or indications of log lines in the fault time window, etc.
[0006] In the implementation manner of the present application, the root cause diagnosis model can identify the time window corresponding to the root cause of the fault. Therefore, the root cause diagnosis model can be used to identify the time window in which the log line representing the root cause of the fault is located from the log data of the device, thereby achieving efficient root cause diagnosis, allowing the user to more accurately determine the root cause of the device's fault based on the time window corresponding to the root cause of the fault.
[0007] In a possible implementation, the method may further include: iteratively training an initial model using historical log data to obtain a root cause diagnosis model, wherein the root cause diagnosis model is obtained by training using historical log data, wherein the historical log data includes log data with at least one time window marked, and each time window covers a time range in which at least one device fails; wherein any training process of training the root cause diagnosis model using historical log data may include: using the historical log data as the input of the root cause diagnosis model obtained by the previous training, and outputting the current output log data; calculating the loss value based on the current log data, the time window corresponding to the current log data, and the loss function; and updating the root cause diagnosis model obtained by the previous training based on the loss value to obtain the root cause diagnosis model obtained by the current training.
[0008] In the implementation manner of the present application, marking the time window in which the fault occurs in the log data is equivalent to providing a weak label, and using the log data marked with the fault time window to train the root cause diagnosis model, the model training can be achieved by simply dividing the training data by the fault time window, thereby efficiently outputting the fault root cause log line, without the need for manual participation, reducing the cost of manual participation, reducing the cost of root cause diagnosis, and improving the efficiency of root cause diagnosis. Therefore, in the implementation manner of the present application, in the process of training the root cause diagnosis model, after collecting the log data of the device, the fault time window can be marked in the log data as a weak label for training, thereby eliminating the need to manually mark the fault log line, reducing the cost of manual marking.
[0009] In a possible implementation, the root cause diagnosis model is a model obtained based on a multi-head attention mechanism. Therefore, in the implementation of the present application, the root cause diagnosis model based on the multi-head attention mechanism can learn the semantic features of each log line in the training set through weakly supervised learning, so that the log line representing the root cause of the fault can be accurately identified when performing root cause diagnosis.
[0010] In one possible implementation, the root cause diagnosis model can be divided into multiple modules, such as a multi-head attention layer and a perception layer. The multi-head attention layer is used to extract semantic features from the input data, and the perception layer can be used to identify the log data corresponding to the root cause of the fault based on the extracted semantic features.
[0011] In a possible implementation, the aforementioned historical log data may be divided into root cause log data and irrelevant log data, the root cause log data including log data of at least one time window, and the irrelevant log data being data within a time range in which the faulty device does not cause a fault; the aforementioned loss function may include a first part and a second part, the first part being used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part being used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0012] In the implementation mode of the present application, different loss function parts are set for different input data in model training, so that the features in the input samples can be adaptively learned, such as learning the features included in the potential root cause log lines and irrelevant log data, so that the model can output data of the log lines including the root cause of the fault.
[0013] In one possible implementation, when the input of the root cause diagnosis model is root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0014] In an implementation manner of the present application, the weights corresponding to the parts of the loss function for different types of input data can be dynamically determined based on the different types of input data, so that the adapted loss value can be adaptively calculated based on the type of input data, and the model can be reversely updated based on the adapted loss value to improve the accuracy of the model output.
[0015] In a possible implementation, the ratio between the root cause log data and the irrelevant log data in the training data includes 1: 4. In the implementation of the present application, the ratio between the root cause log data and the irrelevant log data can be preset to 1: 4, so that the features corresponding to the root cause log and the irrelevant log can be learned accurately.
[0016] In a possible implementation, in any of the aforementioned iterations, using historical log data as the input of the root cause diagnosis model obtained in the previous training, and outputting the current output log data, can include: obtaining multiple representations of multiple characters in the historical log data and corresponding position codes, the position codes are used to indicate the positions of the corresponding characters in the historical log data; using the multiple representations and the corresponding position codes as the input of the root cause diagnosis model obtained in the previous training, and outputting the current predicted log data, the current predicted log data including the log data corresponding to the predicted root cause of the equipment failure.
[0017] In the implementation mode of the present application, when the character representation in the log data is used as the model input, the position code can also be input at the same time. Generally, when the root cause diagnosis model is a model built based on a multi-head attention mechanism, it may not have the function of identifying the position of the character in the log, so the representation of each character and the corresponding position code can be used as the model input, so that the model has the function of identifying the position of the fault log line in the log data.
[0018] In a possible implementation, the aforementioned method may further include: mapping the predicted log data to the same space, obtaining the distance between each log line in the predicted log data and the origin in the space, where the origin may be the 0 point set when constructing the space; filtering according to the distance between each log line and the origin, obtaining filtered predicted log data, and the filtered predicted log data is used to indicate the root cause of the faulty device failure.
[0019] It can be understood that the root cause diagnosis model can be used to predict the log lines that may represent the root cause of the equipment failure, and the distance between each log line and the origin in the predicted log data can be used to indicate the possibility that each log line represents the root cause of the failure. Therefore, in the implementation mode of the present application, after obtaining the prediction result based on the root cause diagnosis model, the prediction result can be further filtered based on the spatial distance between each log line and the origin to filter out irrelevant log lines, thereby obtaining a more accurate log line representing the root cause of the failure, achieving a more accurate positioning of the log line of the root cause of the failure, and improving the prediction accuracy.
[0020] In a possible implementation, the aforementioned filtering based on the distance between each log line and the origin to obtain filtered predicted log data may include: screening at least one log line in the predicted log data whose distance from the origin is greater than a threshold to obtain filtered predicted log data.
[0021] Therefore, in the implementation manner of the present application, log lines whose distance from the origin in the predicted log data is greater than a threshold can be filtered out, thereby filtering out log lines that are irrelevant to the root cause of the fault, thereby achieving more accurate positioning of the log line of the root cause of the fault.
[0022] In a possible implementation, the aforementioned method may further include: clustering the log data of each time window in the predicted log data to obtain at least one group, each group including log data representing at least one type of root cause of the fault; and determining the log line corresponding to the root cause of the fault of the faulty device based on the log lines included in at least one group.
[0023] In the implementation manner of the present application, the log lines in the prediction results can also be classified by clustering, so that the root cause of the fault can be identified according to the clustering results. That is, further filtering is performed by clustering to filter out log lines in the prediction log data that are less related to the root cause of the fault.
[0024] In a possible implementation, the aforementioned clustering of the log data of each time window in the predicted log data to obtain at least one group may include: iteratively clustering the log data of each time window in the predicted log data to obtain at least one clustering result, each clustering result including at least one log component; removing log lines in each clustering result that do not belong to the log component to obtain at least one group.
[0025] In the implementation manner of the present application, the root cause diagnosis model can be used to predict the log line representing the root cause of the device failure. Different log lines may correspond to different types of services or components, etc. Therefore, discrete log lines can be filtered out by clustering, thereby achieving more accurate positioning of the root cause of the failure.
[0026] In a possible implementation, the aforementioned method may further include: acquiring log data of at least one device; marking at least one time window in the log data of at least one device to obtain historical log data.
[0027] In the implementation manner of the present application, when collecting training data, weak labels can be formed by marking the time windows corresponding to the root causes of faults in the log data, so that weak supervision training can be achieved through the marked weak labels, which can reduce manual maintenance costs and increase training costs.
[0028] In a possible implementation, the aforementioned marking of at least one time window in the log data of at least one device to obtain historical log data may include: marking at least one time window in the log data of at least one device according to the time when at least one device reports a fault to obtain historical log data; or identifying preset keywords in the log data of at least one device, and marking at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword to obtain historical log data.
[0029] In the implementation manner of the present application, when marking the fault time window, the time window that may include the root cause of the fault can be determined by fault reporting time or keyword recognition, so that the log line including the root cause of the fault can be determined, thereby realizing weak labeling.
[0030] In a second aspect, the present application provides a root cause diagnosis model training method, comprising: first, obtaining historical log data, the historical log data including log data with at least one time window marked, each time window covering the time range in which at least one device fails; using the historical log data to iteratively train the initial model to obtain a root cause diagnosis model, the root cause diagnosis model being a model obtained based on a multi-head attention mechanism, the root cause diagnosis model being used to identify the log data corresponding to the root cause of the device failure from the input log data.
[0031] Therefore, in the implementation manner of the present application, marking the time window in which the fault occurs in the log data is equivalent to providing a weak label, and using the log data marked with the fault time window to train the root cause diagnosis model. The model training can be achieved by simply dividing the training data according to the fault time window, thereby efficiently outputting the fault root cause log lines without the need for manual participation, reducing the cost of manual participation, reducing the cost of root cause diagnosis, and improving the efficiency of root cause diagnosis.
[0032] In a possible implementation, any of the aforementioned training processes for training the root cause diagnosis model using historical log data may include: using the historical log data as the input of the root cause diagnosis model obtained in the previous training, and outputting the current output log data; calculating the loss value based on the current log data, the time window corresponding to the current log data, and the loss function; updating the root cause diagnosis model obtained in the previous training based on the loss value, and obtaining the root cause diagnosis model obtained in the current training.
[0033] Therefore, in the implementation manner of the present application, in the process of training the root cause diagnosis model, after collecting the log data of the device, the fault time window can be marked in the log data as a weak label for training, thereby eliminating the need to manually label the fault log lines and reducing the manual labeling cost.
[0034] In a possible implementation, the aforementioned historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of at least one time window, and the irrelevant log data is data within a time range when the faulty device does not fail; the loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0035] In the implementation mode of the present application, different loss function parts are set for different input data in model training, so that the features in the input samples can be adaptively learned, such as learning the features included in the potential root cause log lines and irrelevant log data, so that the model can output data of the log lines including the root cause of the fault.
[0036] In a possible implementation, when the input of the root cause diagnosis model is the root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0037] In an implementation manner of the present application, the weights corresponding to the parts of the loss function for different types of input data can be dynamically determined based on the different types of input data, so that the adapted loss value can be adaptively calculated based on the type of input data, and the model can be reversely updated based on the adapted loss value to improve the accuracy of the model output.
[0038] In a possible implementation, the ratio between the aforementioned root cause log data and irrelevant log data is 1:4, so that features corresponding to the root cause log and irrelevant log can be accurately learned respectively.
[0039] In a possible implementation, the aforementioned use of historical log data as input to the root cause diagnosis model obtained from the previous training and output of current output log data may include: obtaining multiple representations of multiple characters in the historical log data and corresponding position codes, the position codes being used to indicate the positions of the corresponding characters in the historical log data; using the multiple representations and corresponding position codes as input to the root cause diagnosis model obtained from the previous training and outputting current predicted log data, the current predicted log data including log data corresponding to the predicted faulty equipment fault.
[0040] In the implementation mode of the present application, when the character representation in the log data is used as the model input, the position code can also be input at the same time. Generally, when the root cause diagnosis model is a model built based on a multi-head attention mechanism, it may not have the function of identifying the position of the character in the log, so the representation of each character and the corresponding position code can be used as the model input, so that the model has the function of identifying the position of the fault log line in the log data.
[0041] In a possible implementation, the aforementioned acquisition of historical log data may include: acquiring log data of at least one device; and marking at least one time window in the log data of at least one device to obtain the historical log data.
[0042] In the implementation manner of the present application, when collecting training data, weak labels can be formed by marking the time windows corresponding to the root causes of faults in the log data, so that weak supervision training can be achieved through the marked weak labels, which can reduce manual maintenance costs and increase training costs.
[0043] In a possible implementation, the aforementioned marking of at least one time window in the log data of at least one device to obtain historical log data may include: marking at least one time window in the log data of at least one device according to the time when at least one device reports a fault to obtain historical log data; or identifying preset keywords in the log data of at least one device, and marking at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword to obtain historical log data.
[0044] In the implementation manner of the present application, when marking the fault time window, the time window that may include the root cause of the fault can be determined by fault reporting time or keyword recognition, so that the log line including the root cause of the fault can be determined, thereby realizing weak labeling.
[0045] In a third aspect, the present application provides a root cause diagnosis device, comprising:
[0046] An acquisition module is used to acquire current log data, where the current log data includes logs generated during the process of the faulty device generating the fault;
[0047] A processing module is used to use the current log data as the input of the root cause diagnosis model to obtain predicted log data, which can be used to indicate the data in the fault time window, and the fault time window covers the time range when the faulty device fails. For example, the predicted log data includes a log line representing the fault time window or an indication of the log line in the fault time window.
[0048] Among them, the effects achieved by the third aspect and any optional implementation of the third aspect can be found in the description of the first aspect or any optional implementation of the first aspect, and will not be repeated here.
[0049] In a possible implementation, the device may further include: a training module, used to: iteratively train the initial model using historical log data to obtain a root cause diagnosis model, the root cause diagnosis model is obtained by training using historical log data, the historical log data includes log data with at least one time window marked, each time window covers the time range of at least one device failure, and the root cause diagnosis model is a model obtained based on a multi-head attention mechanism; wherein, any training process of training the root cause diagnosis model using historical log data includes: using the historical log data as the input of the root cause diagnosis model obtained by the previous training, and outputting the current output log data; calculating the loss value according to the current log data, the time window corresponding to the current log data, and the loss function; updating the root cause diagnosis model obtained by the previous training according to the loss value to obtain the root cause diagnosis model obtained by the current training.
[0050] In one possible implementation, the root cause diagnosis model is a model based on a multi-head attention mechanism.
[0051] In a possible implementation, historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of at least one time window, and the irrelevant log data is data within a time range when the faulty device does not fail; the loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0052] In one possible implementation, when the input of the root cause diagnosis model is root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0053] In a possible implementation, the ratio between the root cause log data and the irrelevant log data is 1:4.
[0054] In one possible implementation, the training module can be specifically used to: obtain multiple representations of multiple characters in historical log data and corresponding position codes, where the position codes are used to indicate the positions of the corresponding characters in the historical log data; use the multiple representations and corresponding position codes as inputs to a root cause diagnosis model obtained in the previous training, and output current predicted log data, where the current predicted log data includes log data corresponding to the predicted root cause of the equipment failure.
[0055] In a possible implementation, the above-mentioned device may also include: a filtering module, used to: map the predicted log data to the same space to obtain the distance between each log line in the predicted log data and the origin in the space; filter according to the distance between each log line and the origin to obtain filtered predicted log data, and the filtered predicted log data is used to indicate the root cause of the faulty equipment failure.
[0056] In a possible implementation, the filtering module is used to filter at least one log line in the predicted log data whose distance from the origin is greater than a threshold, to obtain filtered predicted log data.
[0057] In a possible implementation, the filtering module is further used to: cluster the log data of each time window in the predicted log data to obtain at least one group, each group including log data representing at least one type of root cause of the fault; and determine the log line corresponding to the root cause of the fault of the faulty device based on the log lines included in at least one group.
[0058] The filtering module is specifically used to: iteratively cluster the log data of each time window in the predicted log data to obtain at least one clustering result, each clustering result includes at least one log component; remove the log lines that do not belong to the log component in each clustering result to obtain at least one group.
[0059] In a possible implementation, the device further includes: a collection module, configured to: obtain log data of at least one device; and mark at least one time window in the log data of at least one device to obtain historical log data.
[0060] In a possible implementation, the collection module is further used to: mark at least one time window in the log data of at least one device according to the time when at least one device reports a fault to obtain historical log data; or identify preset keywords in the log data of at least one device, and mark at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword to obtain historical log data.
[0061] In a fourth aspect, the present application provides a training device, comprising:
[0062] An acquisition module, used to acquire historical log data, wherein the historical log data includes log data marked with at least one time window, and each time window covers a time range in which a fault occurs in at least one device;
[0063] The training module is used to iteratively train the initial model using historical log data to obtain a root cause diagnosis model. The root cause diagnosis model is a model based on a multi-head attention mechanism. The root cause diagnosis model is used to identify the log data corresponding to the root cause of the equipment failure from the input log data.
[0064] The effects achieved by the fourth aspect and any optional implementation manner of the fourth aspect can be found in the description of the aforementioned second aspect or any optional implementation manner of the second aspect, and will not be repeated here.
[0065] In one possible implementation, any training process performed by the training module may include: using historical log data as the input of the root cause diagnosis model obtained in the previous training, and outputting the current output log data; calculating the loss value based on the current log data, the time window corresponding to the current log data, and the loss function; updating the root cause diagnosis model obtained in the previous training based on the loss value, and obtaining the root cause diagnosis model obtained in the current training.
[0066] In a possible implementation, historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of at least one time window, and the irrelevant log data is data within a time range when the faulty device does not fail; the loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0067] In one possible implementation, when the input of the root cause diagnosis model is root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0068] In a possible implementation, the ratio between the root cause log data and the irrelevant log data is 1:4.
[0069] In a possible implementation, the aforementioned training module is specifically used to: obtain multiple representations of multiple characters in historical log data and corresponding position codes, the position codes are used to indicate the positions of the corresponding characters in the historical log data; use the multiple representations and corresponding position codes as inputs to the root cause diagnosis model obtained in the previous training, and output the current predicted log data, the current predicted log data including the log data corresponding to the predicted faulty equipment fault.
[0070] In a possible implementation, the acquisition module is specifically used to: acquire log data of at least one device; and mark at least one time window in the log data of at least one device to obtain historical log data.
[0071] The acquisition module is specifically used to: mark at least one time window in the log data of at least one device according to the time when at least one device reports a fault to obtain historical log data; or identify preset keywords in the log data of at least one device, and mark at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword to obtain historical log data.
[0072] In a fifth aspect, an embodiment of the present application provides a root cause diagnosis device, comprising: a processor and a memory, wherein the processor and the memory are interconnected via a line, and the processor calls a program code in the memory to execute the processing-related functions in the root cause diagnosis method shown in any one of the first aspects above. Optionally, the root cause diagnosis device can be a chip.
[0073] In the sixth aspect, an embodiment of the present application provides a root cause diagnosis device, which may also be referred to as a digital processing chip or chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface. The program instructions are executed by the processing unit. The processing unit is used to perform functions related to processing as described in the first aspect or any optional embodiment of the first aspect.
[0074] In a seventh aspect, an embodiment of the present application provides a training device, comprising: a processor and a memory, wherein the processor and the memory are interconnected via a line, and the processor calls a program code in the memory to execute the processing-related functions in the root cause diagnosis model training method shown in any one of the second aspects above. Optionally, the training device can be a chip.
[0075] In the eighth aspect, an embodiment of the present application provides a training device, which can also be called a digital processing chip or chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface, and the program instructions are executed by the processing unit. The processing unit is used to perform functions related to processing as described in the second aspect or any optional embodiment of the second aspect.
[0076] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enables the computer to execute a method in any optional implementation of the first or second aspect above.
[0077] In the tenth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute a method in any optional implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] Figure 1 A schematic diagram of a system architecture provided for this application;
[0079] Figure 2 Another system architecture diagram provided for this application;
[0080] Figure 3 A schematic diagram of an application scenario provided for this application;
[0081] Figure 4 A flowchart of a root cause diagnosis model training method provided in this application;
[0082] Figure 5 A schematic diagram of the structure of a root cause diagnosis model provided in this application;
[0083] Figure 6 A schematic diagram of the structure of another root cause diagnosis model provided for this application;
[0084] Figure 7 A flowchart of another root cause diagnosis model training method provided in this application;
[0085] Figure 8 A schematic diagram of a root cause diagnosis method provided in this application;
[0086] Fig. 9 A schematic diagram of filtering results in a root cause diagnosis method provided in this application;
[0087] Fig.10 A schematic diagram of filtering results in another root cause diagnosis method provided by the present application;
[0088] Fig.11 A schematic diagram of filtering results in another root cause diagnosis method provided by the present application;
[0089] Fig.12 A schematic diagram of filtering results in another root cause diagnosis method provided by the present application;
[0090] Fig.13 A schematic diagram of filtering results in another root cause diagnosis method provided by the present application;
[0091] Fig.14 A schematic diagram of another root cause diagnosis method provided in this application;
[0092] Fig.15 A schematic diagram of a process flow of a root cause diagnosis device provided in this application;
[0093] Fig.16 A flow chart of a training device provided in this application;
[0094] Fig.17 A schematic diagram of another root cause diagnosis device provided by the present application;
[0095] Fig.18 A schematic diagram of another training device provided for this application;
[0096] Fig.19 A schematic diagram of the structure of a chip provided in this application. DETAILED DESCRIPTION
[0097] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0098] First, the overall workflow of the artificial intelligence system is described. The following is an explanation of the above artificial intelligence theme framework from the two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis). Among them, the "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has undergone a condensed process of "data-information-knowledge-wisdom". The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecological process of the system.
[0099] (1) Infrastructure
[0100] Infrastructure provides computing power support for artificial intelligence systems, enables communication with the outside world, and supports it through the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips, such as central processing units (CPU), neural-network processing units (NPU), graphics processing units (GPU), application specific integrated circuits (ASIC) or field programmable gate arrays (FPGA) and other hardware acceleration chips; the basic platform includes distributed computing frameworks and networks and other related platform guarantees and support, which can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
[0101] (2) Data
[0102] The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data of traditional devices, including business data of existing systems and perception data such as force, displacement, liquid level, temperature, and humidity.
[0103] (3) Data processing
[0104] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0105] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0106] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0107] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0108] (4) General ability
[0109] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0110] (5) Smart products and industry applications
[0111] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical applications. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, smart cities, etc.
[0112] The embodiments of the present application involve related applications of neural networks and data conversion (natural language processing, NLP). In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts of the neural networks that may be involved in the embodiments of the present application are first introduced below.
[0113] (1) Neural machine translation
[0114] Neural machine translation is a typical task of data conversion. Given a sentence in a source language, the task is to output the corresponding sentence in the target language. In the commonly used neural machine translation model, the words in the sentences of the source language and the target language are encoded into vector representations, and the associations between words and sentences are calculated in the vector space to perform the translation task.
[0115] (2) Self-attention model
[0116] It means to effectively encode a sequence of data (such as the natural language "Your phone is great.") into several multi-dimensional vectors for easy numerical calculations. The multi-dimensional vectors incorporate the similarity information between each element in the sequence, which is called self-attention. The self-attention model can be understood as a mapping from a query to a series of value pairs (i.e. key-value pairs).
[0117] (3) Multi-headed Self-attention
[0118] When given the same set of queries, keys, and values, the model is expected to learn different behaviors based on the same attention mechanism, and then combine the different behaviors as knowledge, such as capturing dependencies of various ranges within the sequence (e.g., short-distance dependencies and long-distance dependencies). Therefore, the attention mechanism combines the use of different subspace representations of queries, keys, and values. Compared with the self-attention model, the multi-head attention model increases the number of heads. Query, Key, and Value are first transformed linearly, and then input into the scaled dot product attention, which is repeated h times, that is, multi-head. Each time is counted as a head, and the parameters between the heads are not shared. The parameters W of the linear transformation of Q, K, and V are different each time. Then the results of the scaled dot product attention h times are concatenated, and the value obtained by linear transformation is used as the result of the multi-head attention.
[0119] (4) Feedforward neural network (FNN)
[0120] It is a type of artificial neural network. Feedforward neural network adopts a unidirectional multi-layer structure. Each layer contains several neurons. In this kind of neural network, each neuron can receive signals from the neurons in the previous layer and generate outputs to the next layer. The 0th layer is called the input layer, the last layer is called the output layer, and the other intermediate layers are called hidden layers (or hidden layers, hidden layers). The hidden layer can be one layer or multiple layers. For example, Deep Neural Network (DNN), Convolutional Neuron Network (CNN), etc. can be neural networks based on FNN.
[0121] (5) Log
[0122] When a device, system or service program is operating, it will generate a log event record; each line of the log records the date, time, user and action and other related operation descriptions. For example, the system log records the information of hardware, software and system problems in the system, and can also monitor the events that occur in the system. Users can use the log to check the cause of the error or find traces left by the attacker when attacked. For example, the logs of common devices can include system logs, application logs and security logs.
[0123] (6) Embedding: refers to the feature representation of samples.
[0124] (7) Loss function
[0125] It can also be called a cost function, a measure of the difference between the predicted output of a machine learning model for a sample and the true value of the sample (also called a supervised value), that is, it is used to measure the difference between the predicted output of a machine learning model for a sample and the true value of the sample. The loss function can usually include error square mean square, cross entropy, logarithm, exponential and other loss functions. For example, the error square mean square can be used as a loss function, defined as The specific loss function can be selected according to the actual application scenario.
[0126] (8) Back propagation (BP)
[0127] An algorithm that calculates the gradient of model parameters based on the loss function and updates the model parameters. The neural network can use the error back propagation (BP) algorithm to correct the size of the parameters in the initial neural network model during the training process, so that the reconstruction error loss of the neural network model becomes smaller and smaller. Specifically, the forward transmission of the input signal to the output will generate error loss, and the parameters in the initial neural network model are updated by back propagating the error loss information, so that the error loss converges. The back propagation algorithm is a back propagation movement dominated by error loss, which aims to obtain the optimal parameters of the neural network model, such as the weight matrix.
[0128] (9) Gradient: The derivative vector of the loss function with respect to the parameters.
[0129] (10) Corpus: Also known as free text, it can be words, phrases, sentences, fragments, articles, or any combination thereof. For example, “Today’s weather is really nice” is a piece of corpus.
[0130] The method provided in the embodiment of the present application can be executed on a server or on a terminal device. The server may include a local server, an integrated server or a distributed server, etc. The terminal device may include a mobile phone, a tablet personal computer (TPC), a media player, a smart TV, a laptop computer (LC), a personal digital assistant (PDA), a personal computer (PC), a camera, a video camera, a smart watch, a wearable device (WD) or an autonomous driving vehicle, etc., which is not limited in the embodiment of the present application.
[0131] The following introduces the system architecture provided by the embodiments of the present application.
[0132] See also Figure 1 , the embodiment of the present application provides a system architecture 200. As shown in the system architecture 200, the data acquisition device 260 can be used to collect training data, such as the historical log data used in the training phase of the present application. After the data acquisition device 260 collects the training data, the training data is stored in the database 230, and the training device 220 trains the root cause diagnosis model 201 based on the training data maintained in the database 230.
[0133] The following describes how the training device 220 obtains the root cause diagnosis model 201 based on the training data. Exemplarily, the training device 220 constructs an initial root cause diagnosis model and updates the parameters of the root cause diagnosis model, thereby completing the training of the root cause diagnosis model 201. For a detailed description, see the training method below.
[0134] The root cause diagnosis model 201 in the embodiment of the present application may specifically be a neural network. It should be noted that in actual applications, the training data maintained in the database 230 may not all come from the data acquisition device 260, but may also be received from other devices. It should also be noted that the training device 220 may not necessarily train the root cause diagnosis model 201 entirely based on the training data maintained by the database 230, but may also obtain training data from the cloud or other places for model training. The above description should not be used as a limitation on the embodiments of the present application.
[0135] The root cause diagnosis model 201 obtained by training the training device 220 can be applied to different systems or devices, such as Figure 1The execution device 210 shown in the figure may be a terminal, such as a mobile phone terminal, a tablet computer, a laptop computer, an augmented reality (AR) / virtual reality (VR), a vehicle terminal, a television, etc., or a server or a cloud. Figure 1 In the embodiment, the execution device 210 is configured with a transceiver 212, which may include an input / output (I / O) interface or other wireless or wired communication interface, etc., for interacting with external devices. Taking the I / O interface as an example, a user may input data to the I / O interface through the client device 240.
[0136] When the execution device 210 preprocesses the input data, or when the computing module 211 of the execution device 210 performs calculations and other related processing, the execution device 210 can call the data, code, etc. in the data storage system 250 for corresponding processing, and can also store the data, instructions, etc. obtained from the corresponding processing into the data storage system 250.
[0137] Finally, the I / O interface returns the processing result to the client device 240 for providing to the user.
[0138] In the attached Figure 1 In the case shown in the figure, the user can manually give the input data, and the manual giving can be operated through the interface provided by the transceiver 212. In another case, the client device 240 can automatically send the input data to the transceiver 212. If the client device 240 is required to automatically send the input data, it is necessary to obtain the user's authorization, and the user can set the corresponding authority in the client device 240. The user can view the results output by the execution device 210 on the client device 240, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 240 can also be used as a data acquisition terminal to collect the input data of the input transceiver 212 and the output result of the output transceiver 212 as shown in the figure as new sample data, and store them in the database 230. Of course, it is also possible not to collect through the client device 240, but the transceiver 212 directly stores the input data of the input transceiver 212 and the output result of the output transceiver 212 as new sample data in the database 230.
[0139] It is worth noting that Figure 1 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 1 In the embodiment, the data storage system 250 is an external memory relative to the execution device 210. In other cases, the data storage system 250 can also be placed in the execution device 210.
[0140] Exemplarily, the system architecture of the application of the root cause diagnosis model construction method provided in the present application can be as follows: Figure 2 In the system architecture 300, the server cluster 310 is implemented by one or more servers, and optionally, cooperates with other computing devices, such as data storage, routers, load balancers, etc. The server cluster 310 can use the data in the data storage system 250, or call the program code in the data storage system 250 to implement the steps of the root cause diagnosis model construction method provided in the present application.
[0141] Users can operate their respective user devices (e.g., local devices 301) to interact with the server cluster 310. Each local device can represent any computing device, such as a personal computer, a computer workstation, a smart phone, a tablet computer, a smart camera, a smart car or other type of cellular phone, a media consumption device, a wearable device, a set-top box, a game console, etc.
[0142] The local device of each user can interact with the server cluster 310 through a communication network of any communication mechanism / communication standard, and the communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof. Specifically, the communication network may include a wireless network, a wired network, or a combination of a wireless network and a wired network. The wireless network includes, but is not limited to: a fifth generation mobile communication technology (5th-Generation, 5G) system, a long term evolution (long termevolution, LTE) system, a global system for mobile communication (global system for mobile communication, GSM) or a code division multiple access (code division multiple access, CDMA) network, a wideband code division multiple access (wideband code division multiple access, WCDMA) network, wireless fidelity (wireless fidelity, WiFi), Bluetooth (bluetooth), Zigbee protocol (Zigbee), radio frequency identification technology (radio frequency identification, RFID), long range (Lora) wireless communication, near field communication (near field communication, NFC) in any one or more combinations. The wired network may include a fiber optic communication network or a network composed of a coaxial cable, etc.
[0143] In another implementation, one or more aspects of the execution device 210 may be implemented by each local device. For example, the local device 301 may provide local data or feedback calculation results to the execution device 210 .
[0144] It should be noted that all functions of the execution device 210 may also be implemented by a local device. For example, the local device 301 implements the functions of the execution device 210 and provides services to its own users, or provides services to users of other local devices.
[0145] More specifically, the training method of the root cause diagnosis model provided in the present application can be deployed on a local server, on the cloud, or on a local terminal. The trained root cause diagnosis model can be deployed on a terminal, a local server, or a cloud server, etc. For example, the training phase provided in the present application can be deployed in a server, and the server trains the root cause diagnosis model to obtain a trained root cause diagnosis model. The trained model can be deployed on a cloud platform, and the user can obtain the required data through the cloud platform by inputting operations on the client. Alternatively, the model trained in the server can also be deployed locally on the terminal, and the user can directly perform root cause diagnosis through the terminal when the terminal fails.
[0146] Exemplarily, the root cause diagnosis model training method provided by the present application can be deployed and executed by a server, and the root cause diagnosis model obtained by training can be deployed on a cloud platform, and can be called by users for a fee in the form of an application program interface (API). For example, the method provided by the present application can be deployed on a cloud platform as a service for users, and an API for calling the service can be provided to users. Users can call the service through the API, input log data for root cause diagnosis of faults, and perform root cause diagnosis for users through the service, thereby improving user experience.
[0147] For example, as smart devices such as mobile phones and computers become more and more advanced, more and more services need to be controlled by smart devices. As the number of devices increases and the complexity of the devices increases, how to maintain a large number of devices in a timely manner is a new challenge for manufacturers and developers. When a system fails, untimely or inappropriate handling may cause serious reputation damage to the manufacturer. Generally speaking, system failures can be traced back to a root cause, which will propagate until an observable failure occurs. Developers need to determine the root cause of the failure and then determine the corresponding handling method.
[0148] When a device's software or hardware fails, developers can use tools such as logs and traces to locate the problem. However, in actual work, a single module failure may affect many related components, resulting in a large number of alarm logs. In order to find the root cause, developers often need to filter useful information from a large number of logs or snapshots, a process that often takes hours or even days. For example, in a distributed screen projection scenario, the disconnection of the screen projection may be caused by a variety of reasons. In order to determine the possible causes, it is usually necessary to clarify the screen projection process. Figure 3 It shows multiple ways to cast a smartphone to a TV: either the devices are required to be connected to the same WIFI, or to the same router, or to be connected via a cable. If the casting connection is interrupted, you first need to diagnose the device's connection method, and then determine the possible causes of the failure corresponding to the connection method, such as a weak WIFI signal or an incorrectly inserted cable. On the other hand, the smartphone itself or the casting application may also fail. Similarly, the casting disconnection may also be caused by a failure in the TV's operating system.
[0149] These possible root causes all lead to the same observable failure: such as the disconnection between a smartphone and a TV. However, since users cannot access the entire system and can only access Huawei products to perform root cause analysis, such systems can be called partially observable systems. Root cause identification for partially observable systems brings new challenges to developers, especially when the root cause occurs in an inaccessible component.
[0150] For example, in some existing root cause diagnosis methods, a causal relationship model between different activities can be built through logs, and the activities in the logs and real alarms can be mapped to the model, thereby generating alarms with semantics similar to the operation process of system components. Next, fault location experts are required to extract subgraphs from the causal relationship model to determine the root cause of the potential threat. Finally, the score of each candidate root cause is calculated, and the most likely cause is given based on the predefined threshold filtering. However, for logs in different fields, this technology requires domain expert rules to extract subgraphs from causal relationships. The actual cloud-side platform operation and maintenance often involves multiple fields, such as stability, performance, power consumption, etc. Each field requires corresponding expert maintenance, which has high labor costs.
[0151] For another example, in some existing root cause diagnosis methods, a directed acyclic graph (DAG) can be used to represent causal relationships. First, the method generates a log template. Then, regularly repeated events are deleted to filter the data. The algorithm creates a directed acyclic graph DAG on the remaining log templates. Through the causal inference of DAG, the number of related events can be minimized, thereby giving a more reasonable causal relationship to support root cause inference. However, the analysis based on the log sequence template does not take into account the semantic information of the log. When the version is updated and iterated, slight text differences may cause the analysis performance of the model to decrease and the maintenance cost to be high.
[0152] Therefore, the present application provides a root cause diagnosis model training method and a root cause diagnosis method, which trains the root cause diagnosis model through weak supervised learning, so that a model that can perform root cause diagnosis can be trained without human participation, thereby reducing the cost of root cause diagnosis and improving the efficiency of root cause diagnosis.
[0153] The method provided in the present application can be divided into a training phase and a reasoning phase. The training phase is the steps of the root cause diagnosis model training method provided in the present application, and the reasoning phase is the steps of the root cause diagnosis method provided in the basic application. Among them, the training phase and the reasoning phase can be deployed in the same device or in different devices. For example, the training phase can be deployed in a server, and the root cause diagnosis model obtained by training can be deployed in a terminal, that is, the reasoning phase can be executed by the terminal; or, both the training phase and the reasoning phase can be deployed in a server, and the server can use historical log data to train to obtain a root cause diagnosis model. When root cause diagnosis is required, such as after receiving a root cause diagnosis request from a client, the trained root cause diagnosis model can be used to perform root cause diagnosis; or, both the training phase and the reasoning phase can be deployed in a terminal, and the training of the root cause diagnosis model and the use of the root cause diagnosis model for root cause diagnosis can be implemented simultaneously in the terminal.
[0154] The following introduces the processes of the inference phase and the training phase respectively.
[0155] 1. Training Phase
[0156] See also Figure 4 , a training method for a root cause diagnosis model provided in this application is described as follows.
[0157] 401. Get historical log data with weak tags added.
[0158] The historical log data may include logs collected when a fault occurs in at least one device, wherein at least one time window has been marked in the historical log data, and the log data corresponding to each time window covers the time range when the fault occurs in the at least one device.
[0159] For example, log data generated by at least one device may be collected, and a time window may be marked based on the time when the device reports a fault, or based on a keyword in the identified log. The log data corresponding to the marked time window may include a log line describing the root cause of the device fault.
[0160] Usually, during the operation of a device, the device can record information such as events, calling components, time, process ID (pid) and other information generated during the operation of the device, such as adding log lines to the log when a process is started, stopped or terminated. Therefore, when a device fails, such as in scenarios such as network connection interruption or hardware damage, it can be reflected in the log.
[0161] 402. Use historical log data to iteratively train the initial model to obtain a root cause diagnosis model.
[0162] After obtaining the historical log data, the initial model can be iteratively trained using the historical log data to obtain a root cause diagnosis model.
[0163] During the training process, at least one time window marked in the historical log data can be used as weak supervision, so that the trained root cause diagnosis model can accurately identify the time window corresponding to the log line where the root cause of the equipment failure is located, thereby accurately identifying the root cause of the failure. And there is no need to manually mark the training data, which can reduce labor costs.
[0164] Specifically, the root cause diagnosis model can be a model based on a multi-head attention mechanism. The root cause diagnosis model can be divided into multiple modules, such as a multi-head attention layer and a perception layer. The multi-head attention layer is used to extract semantic features from input data, and the perception layer can be used to identify the log data corresponding to the root cause of the fault based on the extracted semantic features.
[0165] In one possible implementation, any iterative process in iterative training may include: using historical log data as input to a root cause diagnosis model obtained in the previous training, and outputting current output log data; calculating a loss value based on the current log data, a time window corresponding to the current log data, and a loss function; and updating the root cause diagnosis model obtained in the previous training based on the loss value to obtain a root cause diagnosis model obtained in the current training.
[0166] Optionally, the historical log data can be divided into units of words, radicals or characters, and the division results are converted into representations to obtain multiple representations, and the position of each unit obtained after the division is encoded in the historical log data to obtain the position code of each representation. The multiple representations and the corresponding position codes are used as the input of the root cause diagnosis model obtained in the previous iteration, and the current predicted log data is output. The current predicted log data may include the log data corresponding to the predicted root cause of the equipment failure, such as the log line corresponding to the root cause of the equipment failure or the position of the log line in the log data, so that the loss value can be calculated based on the output result of the root cause diagnosis model and the marked time window.
[0167] Historical log data can be divided into root cause log data and irrelevant log data. Root cause log data is log data with marked time windows, which indicates log data corresponding to the potential root cause of equipment failure, and irrelevant log data is log data irrelevant to the root cause of equipment failure. The aforementioned loss function can be divided into at least two parts, which can be called the first part and the second part. The first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data. Therefore, for different input data, corresponding loss functions are set to calculate the loss value, so that the root cause diagnosis model can realize root cause diagnosis through learning.
[0168] Optionally, the weights of the first part and the second part in the loss function can be determined according to the type of input data of the root cause diagnosis model. For example, when the input of the root cause diagnosis model is the root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function. For example, when the input of the root cause diagnosis model is the root cause log data, the weight of the first part in the loss function can be 1 or other numerical values, and the weight of the second part in the loss function can be 0 or a lower numerical value; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function can be 0 or other lower proportion numerical values, and the weight of the second part in the loss function can be 1 or a higher proportion numerical value. Therefore, in the embodiment of the present application, different types of loss functions are set for different input data, so that the model can learn the required features for different input data types.
[0169] Generally, the ratio between the root cause log data and the irrelevant log data used in the training set may be a preset ratio, and the ratios used in different scenarios may be different, for example, the ratio between the root cause log data and the irrelevant log data may be 1:4.
[0170] Therefore, in the implementation mode of the present application, the root cause diagnosis model is trained by a weakly supervised learning method with imprecise annotation, so that the root cause of the fault can be inferred by the root cause diagnosis model obtained by weakly supervised training, without providing a data set labeled with the real root cause, and only the data set needs to be divided by the fault time window. The fault time window can be obtained by the automatically reported fault time or the fault log line detected by the expert keyword, which can reduce the cost of manual annotation.
[0171] The following is a detailed introduction to the process of the root cause diagnosis model training method provided by this application in conjunction with specific application scenarios.
[0172] First, the structure of the root cause diagnosis model provided in the present application can be constructed or obtained based on an existing model.
[0173] For example, the structure of the root cause diagnosis model provided in this application can be as follows: Figure 5 As shown, the root cause diagnosis model can specifically include a multi-head attention layer 501 and a perception layer 502. The multi-head attention layer 501 can be used to extract semantic features from input data based on the multi-head attention mechanism, and the perception layer 502 can be used to identify the semantic features corresponding to the root cause of the fault based on the semantic features extracted by the multi-head attention layer 501 and output the corresponding log data.
[0174] Furthermore, the specific structure of the root cause diagnosis model provided in this application can be as follows: Figure 6 As shown in the figure, first, the embedding layer 503, the multi-head attention layer 501, and the perception layer 502.
[0175] The embedding layer can be used to convert the input data into the corresponding representation embedding and serve as the input of the multi-head attention layer. The input of the multi-head attention layer can be divided into key, value and query, etc. The input data is divided into multiple heads and input into the multi-head attention layer respectively. Through one or more self-attention modules set in the multi-head attention layer, the semantic features are extracted and output from the input representation, and the extracted semantic features are normalized through the set layer normalization algorithm (LayerNormalization), and then input into the perception layer after normalization.
[0176] The perception layer can identify the features and locations corresponding to the root cause of the fault based on the input semantic features, thereby outputting the corresponding log line or the location of the log line where the root cause of the fault is located. The perception layer can be a constructed network structure or an existing model structure. For example, the perception layer can use an FNN network such as a DNN or CNN. This application exemplarily introduces the perception layer as an FNN.
[0177] Therefore, in the implementation of the present application, structured data is used as the input of the neural network, and a Transformer model based on a multi-head attention mechanism is used for training. The introduction of the multi-head attention mechanism can capture the rich features in the log corpus and summarize the log information from different dimensions, thereby making the model more robust.
[0178] For example, combining the above Figure 6 The root cause diagnosis model architecture shown in the figure, the application architecture of the root cause diagnosis model training method provided by the present application can be as follows Figure 7 shown.
[0179] The input data set is a large amount of unlabeled log data in a certain type of fault scenario. In order to find the root cause log line, the log data can be roughly divided according to the time when the fault occurred. The fault occurrence time can be the time automatically reported by the system or the approximate time determined by the abnormal log line obtained by expert keyword matching.
[0180] The training of the root cause fault model usually requires the determination of a fault time window, which is used to represent the time range of the root cause and the fault log line. It can be understood that the root cause usually occurs somewhere within the fault time window. For some fault scenarios, if the specific time of the fault is uncertain, the size of the fault time window can be expanded so that the window covers the real root cause, but correspondingly more normal flow logs can be added for training to improve the accuracy of the model output. For example, for crash problems automatically reported by the system, generally speaking, the time interval between the root cause log line and the fault report does not exceed 1s. In this case, the fault time window can be set to 1s before and after the fault report time.
[0181] In the implementation of the present application, there is no need to manually inject labels, that is, there is no need to know in advance whether each log line is a root cause log line. In order to train the model, annotations can be provided for neural network training in the following manner: First, all log lines within the fault time window are regarded as potentially interesting logs, called potential root causes, so that the training data set is divided into two types of inputs: potential root cause log lines and irrelevant log lines. The algorithm will perform semi-supervised learning according to the initially divided data set, so as to identify the log lines that truly reflect the root cause of the fault from the potential root causes.
[0182] Then, you can use the log data with marked time windows to train the root cause diagnosis model. For ease of understanding, the root cause diagnosis model is referred to as the Transformer model or the Transformer model based on the multi-head attention mechanism.
[0183] Specifically, after obtaining the historical log data, the log data can be preprocessed. For example, the text content in the log is first segmented: the text is divided into words, word roots or characters. Usually, the attention mechanism model used does not need to set a module for analyzing the position information of the segmented words, so each segmented word can be positionally encoded, and the position encoding and segmented words are used as the input of the embedding layer.
[0184] The data in the fault time window is the potential root cause, that is, it contains the real root cause and irrelevant log lines. The task of the Transformer model is to filter out the real root cause from these potential root cause log lines. First, assign preliminary anomaly labels to all log lines in the fault time window. Assign preliminary healthy labels to log lines outside the failure time window The two types of samples are denoted as U and P. In order to distinguish abnormal and normal log lines, the loss function provided in this application can be divided into two parts, as shown below:
[0185] in,
[0186] in, is the weak label of each sample, is a preliminary abnormal sample. is the initial normal sample, and zi is the output of the model. If the sample comes from U, the first term of the loss function is 0, and the model will learn in the direction of making b(zi) as small as possible, which will make z i As large as possible; when the sample comes from P, the second term of the loss function is 0, and the model will move to a(z i ) as small as possible, which will make the corresponding z i As small as possible. The factor q in the loss function represents the ratio of positive samples to all samples. A large ratio means there are more positive samples. In this case, the proportion of U can be increased to ensure that the model learns the characteristics of negative samples.
[0187] Through the above loss function, the model can learn the vector representation of each word segmentation, so that the norm of the root cause log line (such as the Euclidean distance of the log line vector embedding to 0) is as large as possible, and the norm of the log line of no interest is as small as possible.
[0188] In the implementation of the present application, the fault time window can be added to the historical log data as a weak label to obtain a training set. No manual labeling is required, which can greatly improve the model training efficiency and reduce the model training cost, thereby reducing the root cause diagnosis cost of the faulty equipment.
[0189] 2. Reasoning Stage
[0190] See also Figure 8, a flow chart of a root cause diagnosis method provided in the present application.
[0191] 801. Obtain current log data of the faulty device.
[0192] The faulty device refers to the device that has a fault. When a device has a fault, log data can be read from the data saved by the faulty device. For easy distinction, the read log data is referred to as current log data.
[0193] Generally, when a device is running, it can record logs in real time. When a device fails, the log recorded by the device may include a log line reflecting the root cause of the device failure.
[0194] 802. Use current log data as input of a root cause diagnosis model to obtain predicted log data.
[0195] After obtaining the current log data, the current log data can be used as the input of the root cause diagnosis model to obtain the predicted log data. The predicted log data can be used to indicate the data in the fault time window, which covers the time range when the faulty device fails, such as the predicted log data may include log lines representing the fault time window or indications of log lines in the fault time window.
[0196] Specifically, the root cause diagnosis model can be used to identify the log line corresponding to the root cause of the fault based on the input log data, and output the log line corresponding to the root cause of the fault or the position corresponding to the log line, so as to obtain the predicted log data. The training process of the root cause diagnosis model can refer to the relevant introduction of the training stage mentioned above, which will not be repeated here.
[0197] Therefore, in the implementation manner of the present application, the log data of the faulty device can be used as the input of the root cause diagnosis model, and the root cause diagnosis of the faulty device can be achieved without manually labeling and collecting training sets, thereby reducing the diagnostic cost of the root cause diagnosis.
[0198] 803. Filter the prediction log data to obtain filtered prediction log data.
[0199] Among them, step 803 in this application is an optional step.
[0200] In the implementation manner of the present application, the prediction results of the root cause diagnosis model can be further filtered, such as filtering based on spatial distance, and filtering can also be performed by clustering, etc., which are introduced below.
[0201] 1. Filtering based on spatial distance
[0202] In a possible implementation, the predicted log data can also be mapped to the same space to obtain the distance between each log line in the predicted log data and the origin in the space; filtering is performed according to the distance between each log line and the origin to obtain filtered predicted log data, and the filtered predicted log data is used to represent the root cause of the fault of the faulty device. Therefore, in the implementation of the present application, the output result of the root cause diagnosis model can be further filtered to more accurately obtain the log line representing the root cause of the fault.
[0203] Specifically, in the process of filtering the prediction results, at least one log line in the prediction log data whose clustering with the spatial origin is greater than a threshold can be screened out, thereby obtaining updated prediction log data. Therefore, in the implementation of the present application, filtering can be performed based on the distance between logs, thereby filtering out log lines that are not related to the root cause and improving the prediction accuracy.
[0204] In addition, a preset proportion of log lines with the largest distance values or a preset number of log lines with the largest distance values may be screened from the filtered predicted log data, thereby achieving further filtering.
[0205] For example, the neural network will map the root cause log line to a space far from 0, and map the irrelevant log line to a space near 0. That is, each log line is assigned a distance to 0 in this process, and the greater the distance, the more likely it is to be a log reflecting the root cause. Next, filter the log lines based on the distance:
[0206] like Fig. 9 As shown, the distance value of the log line within a failure time window is shown. Fig. 9 As shown in the figure, the mutation occurs near line 3100. To calculate the mutation threshold, we can calculate the mean of the 1st percentile and 99th percentile of each failure time window, find the first log line above the mean as the beginning of the root cause, and we can get the following: Fig.10 The distance values of the log lines shown in . You can keep only the log lines corresponding to the highest 10% distance values to get the following Fig.11 Furthermore, we can filter out the 100 log lines with the highest distance values, such as Fig.12 shown.
[0207] Therefore, in the implementation manner of the present application, the predicted log data can be further filtered based on the score of each log line to filter out the noise in the predicted log data, thereby improving the accuracy of the prediction result.
[0208] 2. Filtering based on clustering algorithm
[0209] The input of the filtering process based on the clustering algorithm may be the output result of the root cause diagnosis model, or may be the data filtered based on the spatial distance, which are collectively referred to as predicted log data and will not be described in detail.
[0210] Specifically, the predicted log data can be clustered, and the prediction results can be further filtered by clustering to obtain more accurate prediction results. Specifically, the log data of each time window in the predicted log data can be clustered to obtain at least one group, and each group includes log data representing at least one type of root cause of the fault; the log line corresponding to the root cause of the fault of the faulty device is determined according to the log lines included in at least one group. Therefore, in the embodiment of the present application, the data in the predicted time window can be further filtered by clustering, so as to obtain more accurate root cause log lines after further filtering.
[0211] Optionally, the specific clustering method can select a comprehensive hierarchical clustering algorithm (balanced iterative reducing and clustering using hierarchies, BIRCH), K-MEANS clustering algorithm, mean shift clustering algorithm, etc., which can be selected according to the actual application scenario, and this application does not limit this. In the following implementation, the clustering method is taken as an example of the BIRCH algorithm. The BIRCH clustering algorithm mentioned below can also be replaced by other clustering algorithms, which will not be repeated below.
[0212] Optionally, the log data of each time window in the predicted log data can be iteratively clustered to obtain at least one clustering result, each clustering result includes at least one log component; the log lines that do not belong to the log component in each clustering result are removed to obtain at least one group. In the implementation mode of the present application, the predicted log data can be clustered, so that the log data of each component can be distinguished, the log data can be divided into one or more log components, and the log lines in the log data that are not divided into the log components can be removed for further filtering.
[0213] Usually, the same type of failure may have multiple root causes. Log lines can be clustered to filter out different root cause groups, so as to further filter the logs. For example, the BIRCH algorithm is first used to cluster the services (components) of all failure time windows. In order to make the results stable, the BIRCH algorithm can be iterated continuously until the groups remain unchanged. The service (component) topology of each group, that is, the public service (component), can be obtained. And the log lines that are not outside the public service (component) in each group are removed to further filter the prediction results.
[0214] For example, Fig.13 As shown in the figure, clustering three fault time windows yields two groups: fault time windows 1 and 3 both contain log components ServiceA and ServiceB, and thus are classified into the same group: group 1; the public services of the group are ServiceA and ServiceB; the log lines corresponding to the service (Service C) other than ServiceA and ServiceB in group 1 are removed. In this example, the root cause call chain corresponding to group 1 is ServiceA->ServiceB. Assuming that the root causes of faults in the same group are the same, the log corresponding to ServiceC that is filtered out should be an irrelevant log (e.g. Fig.13 The hollow box indicates that most of the remaining log lines corresponding to ServiceA and ServiceB are the real root causes (such as Fig.13 (indicated by the solid box in the middle).
[0215] Therefore, in the implementation mode of the present application, when a fault occurs, the fault scenario model to which it belongs is called in the model library to obtain the score of each log line in the fault time window, and the log line is further screened according to the above process to obtain the corresponding root cause recommendation list.
[0216] The above introduces the root cause model training method and the root cause diagnosis method provided by the present application. In order to facilitate the introduction of the effects achieved in the training stage and the reasoning stage provided by the present application, the following introduces the effects achieved by the method provided by the present application using some specific application scenarios as examples.
[0217] For example, after the root cause diagnosis model is trained, 11 samples can be extracted from 143 training samples for evaluation. The recommendation lists of all 11 samples contain key log lines, and the recommendation lists of 10 of them contain key log line machine context. This result further confirms that the model provides effective information for developers to locate.
[0218] In addition, 8 samples outside the training set were extracted, and the model gave valid log lines, which means that the model has the ability to handle new faults in the same scenario.
[0219] Existing fault diagnosis methods are usually based on keyword search or regular expression search, which makes it difficult to predict new faults. Especially when the log line structure changes but the semantics remain unchanged, such as when the root cause log line changes from "Successfully killed process" to "process was successfully killed", it cannot be captured. The method provided in this application can identify the same semantics of two log lines through a large amount of historical data, and give the log line as a root cause candidate in the final recommendation list.
[0220] For another example, the process of the root cause diagnosis method provided in this application can be referred to as Fig.14 As shown in the figure, it can be mainly divided into fault root cause prediction, root cause filtering, and output log lines. After taking logs as the input of the root cause diagnosis model and outputting the predicted logs, the predicted logs are mapped to the same space, that is, the predicted logs are vectorized and filtered to obtain the filtered log lines. Then, the filtered log lines are clustered to obtain multiple components, and grouped to obtain one or more groups, thereby filtering out the log lines that do not belong to the components and obtaining the output log lines.
[0221] Taking the disconnection scenario of the distributed projection scene as an example, the root cause diagnosis model uses the log line "CASTPLUSDISCONNECT" to find the time when the fault occurred and uses the 1 second before and after it as the fault time window. The information of the training set can include the following:
[0222] Number of log lines: 44Million
[0223] Number of failure scenarios: 80
[0224] Fault log line identified: 97
[0225] Number of word segments: 167,252
[0226] The method provided in this application can be used to train the above training set to obtain an offline model, and score prediction and filtering can be performed on a given data set to obtain recommended log lines for each fault.
[0227] For comparison, we can obtain the real root cause of each fault from experts in the field of distributed screen projection, and compare the recommended log lines with the real root cause:
[0228] In 100 fault scenarios, the real root cause appears in 90% of the top 5 candidate log lines; the probability of the root cause appearing in the top 100 candidate log lines is 100%. That is to say, in the test data, the top 100 recommended root causes given by the method provided in this application can basically cover the real root causes. In actual engineering, you only need to pay attention to these 100 log lines without searching for the root cause of the fault from a large number of log packages.
[0229] Usually, in the existing root cause diagnosis methods, users need to find the root cause log line from a large number of log lines for a period of time before and after the fault occurs. The method provided in this application can filter out irrelevant information from the log, and ultimately recommend no more than 100 log lines to developers for positioning, which can greatly save the cost of manual positioning. For example, in distributed screen projection scenarios, multiple devices are often involved, and there is a lot of log noise. It is difficult for manual positioning to find the real and effective root cause from a large number of irrelevant log lines. The method provided in this application can continuously enhance the performance of the model through the accumulation of a large amount of historical data, so as to more intelligently recommend the root cause log line that is most likely to cause the current fault.
[0230] The above is an introduction to the method flow provided by the present application. The following is an introduction to the device provided by the present application in combination with the steps in the above method.
[0231] See also Fig.15 The present application provides a schematic diagram of the structure of a root cause diagnosis device, which may include:
[0232] The acquisition module 1501 is used to acquire current log data, where the current log data includes logs generated during the fault process of the faulty device;
[0233] Processing module 1502 is used to use current log data as input of a root cause diagnosis model to obtain predicted log data, which can be used to indicate data in a fault time window, which covers the time range when the faulty device fails, such as the predicted log data includes log lines representing the fault time window or indications of log lines in the fault time window, etc.
[0234] In a possible implementation, the device may further include: a training module 1503, used to: iteratively train the initial model using historical log data to obtain a root cause diagnosis model, the root cause diagnosis model is obtained by training using historical log data, the historical log data includes log data with at least one time window marked, and each time window covers the time range in which at least one device fails; wherein, any training process of training the root cause diagnosis model using historical log data includes: using the historical log data as the input of the root cause diagnosis model obtained by the previous training, and outputting the current output log data; calculating the loss value according to the current log data, the time window corresponding to the current log data, and the loss function; updating the root cause diagnosis model obtained by the previous training according to the loss value, to obtain the root cause diagnosis model obtained by the current training.
[0235] In one possible implementation, the root cause diagnosis model is a model based on a multi-head attention mechanism.
[0236] In one possible implementation, the root cause diagnosis model can be divided into multiple modules, such as a multi-head attention layer and a perception layer. The multi-head attention layer is used to extract semantic features from the input data, and the perception layer can be used to identify the log data corresponding to the root cause of the fault based on the extracted semantic features.
[0237] In a possible implementation, historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of at least one time window, and the irrelevant log data is data within a time range when the faulty device does not fail; the loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0238] In one possible implementation, when the input of the root cause diagnosis model is root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0239] In a possible implementation, the ratio between the root cause log data and the irrelevant log data is 1:4.
[0240] In one possible implementation, the training module 1503 can be specifically used to: obtain multiple representations of multiple characters in historical log data and corresponding position codes, where the position codes are used to indicate the positions of the corresponding characters in the historical log data; use the multiple representations and corresponding position codes as inputs to the root cause diagnosis model obtained in the previous training, and output current predicted log data, where the current predicted log data includes log data corresponding to the predicted root cause of the equipment failure.
[0241] In a possible implementation, the above-mentioned device may also include: a filtering module 1504, which is used to: map the predicted log data to the same space to obtain the distance between each log line in the predicted log data and the origin in the space; filter according to the distance between each log line and the origin to obtain filtered predicted log data, and the filtered predicted log data is used to indicate the root cause of the faulty equipment failure.
[0242] In a possible implementation, the filtering module 1504 is used to filter at least one log line in the predicted log data whose distance from the origin is greater than a threshold, to obtain filtered predicted log data.
[0243] In a possible implementation, the filtering module 1504 is further used to: cluster the log data of each time window in the predicted log data to obtain at least one group, each group including log data representing at least one type of root cause of the fault; and determine the log line corresponding to the root cause of the fault of the faulty device based on the log lines included in at least one group.
[0244] In one possible implementation, the filtering module 1504 is specifically used to: iteratively cluster the log data of each time window in the predicted log data to obtain at least one clustering result, each clustering result including at least one log component; remove the log lines that do not belong to the log component in each clustering result to obtain at least one group.
[0245] In a possible implementation, the apparatus further includes: a collection module 1505, configured to: obtain log data of at least one device; and mark at least one time window in the log data of at least one device to obtain historical log data.
[0246] In a possible implementation, the collection module 1505 is further used to: mark at least one time window in the log data of at least one device according to the time when at least one device reports a fault to obtain historical log data; or identify preset keywords in the log data of at least one device, and mark at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword to obtain historical log data.
[0247] See also Fig.16 , the present application provides a structural schematic diagram of a training device, which may include:
[0248] The acquisition module 1601 is used to acquire historical log data, where the historical log data includes log data marked with at least one time window, and each time window covers a time range in which a fault occurs in at least one device;
[0249] The training module 1602 is used to iteratively train the initial model using historical log data to obtain a root cause diagnosis model. The root cause diagnosis model is a model obtained based on a multi-head attention mechanism. The root cause diagnosis model is used to identify the log data corresponding to the root cause of the equipment failure from the input log data.
[0250] In one possible implementation, any training process performed by the training module 1602 may include: using historical log data as the input of the root cause diagnosis model obtained in the previous training, and outputting the current output log data; calculating the loss value based on the current log data, the time window corresponding to the current log data, and the loss function; updating the root cause diagnosis model obtained in the previous training based on the loss value, and obtaining the root cause diagnosis model obtained in the current training.
[0251] In a possible implementation, historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of at least one time window, and the irrelevant log data is data within a time range when the faulty device does not fail; the loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
[0252] In one possible implementation, when the input of the root cause diagnosis model is root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; when the input of the root cause diagnosis model is irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
[0253] In a possible implementation, the ratio between the root cause log data and the irrelevant log data is 1:4.
[0254] In a possible implementation, the aforementioned training module 1602 is specifically used to: obtain multiple representations of multiple characters in historical log data and corresponding position codes, where the position codes are used to indicate the positions of the corresponding characters in the historical log data; use the multiple representations and corresponding position codes as inputs to the root cause diagnosis model obtained in the previous training, and output current predicted log data, where the current predicted log data includes log data corresponding to the predicted faulty equipment fault.
[0255] In a possible implementation, the acquisition module 1601 is specifically configured to: acquire log data of at least one device; and mark at least one time window in the log data of at least one device to obtain historical log data.
[0256] The acquisition module 1601 is specifically used to: mark at least one time window in the log data of at least one device according to the time when at least one device reports a fault, so as to obtain historical log data; or, identify preset keywords in the log data of at least one device, and mark at least one time window in the log data of at least one device according to the time window corresponding to the identified keyword, so as to obtain historical log data.
[0257] See also Fig.17 , a structural schematic diagram of another root cause diagnosis device provided by the present application is described as follows.
[0258] The root cause diagnosis device may include a processor 1701 and a memory 1702. The processor 1701 and the memory 1702 are interconnected via a line. The memory 1702 stores program instructions and data.
[0259] The memory 1702 stores the aforementioned Figure 4-Figure 14 The program instructions and data corresponding to the steps in .
[0260] Processor 1701 is used to execute the above Figure 4-Figure 14 The method steps are performed by the root cause diagnosis device shown in any embodiment.
[0261] Optionally, the root cause diagnosis apparatus may further include a transceiver 1703 for receiving or sending data.
[0262] Optionally, the aforementioned Fig.17 The root cause diagnosis device shown in FIG. 1 is a chip.
[0263] The present application also provides a root cause diagnosis device, which can also be called a digital processing chip or chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface. The program instructions are executed by the processing unit. The processing unit is used to execute the aforementioned Figure 4-Figure 14 The method steps are performed by the root cause diagnosis device shown in any embodiment.
[0264] See also Fig.18 , a structural schematic diagram of another root cause diagnosis model training device provided by the present application is described as follows.
[0265] The root cause diagnosis model training device may include a processor 1801 and a memory 1802. The processor 1801 and the memory 1802 are interconnected via a line. The memory 1802 stores program instructions and data.
[0266] The memory 1802 stores the aforementioned Figure 4-Figure 14 The program instructions and data corresponding to the steps in .
[0267] Processor 1801 is used to execute the above Figure 4-Figure 14 The method steps performed by the root cause diagnosis model training device shown in any embodiment.
[0268] Optionally, the root cause diagnosis model training device may further include a transceiver 1803 for receiving or sending data.
[0269] Optionally, the aforementioned Fig.18 The root cause diagnosis model training device shown in is a chip.
[0270] The present application also provides a root cause diagnosis model training device, which can also be called a digital processing chip or chip. The chip includes a processing unit and a communication interface. The processing unit obtains program instructions through the communication interface. The program instructions are executed by the processing unit. The processing unit is used to execute the aforementioned Figure 4-Figure 14 The method steps performed by the root cause diagnosis model training device shown in any embodiment.
[0271] In an embodiment of the present application, a computer-readable storage medium is also provided, in which a program for generating a vehicle speed is stored. When the program is run on a computer, the computer executes the above-mentioned Figure 4-Figure 14 The illustrated embodiments describe steps in a method.
[0272] The embodiment of the present application also provides a digital processing chip. The digital processing chip integrates a circuit and one or more interfaces for implementing the above-mentioned processor 1701 / 1801, or the function of the processor 1701 / 1801. When the digital processing chip integrates a memory, the digital processing chip can complete the method steps of any one or more of the above-mentioned embodiments. When the digital processing chip does not integrate a memory, it can be connected to an external memory through a communication interface. The digital processing chip implements the steps in the above-mentioned embodiments according to the program code stored in the external memory.
[0273] The present application also provides a computer program product which, when executed on a computer, enables the computer to execute the above Figure 4-Figure 14 The illustrated embodiment describes the steps in the method performed by the diagnostic device.
[0274] Optionally, the aforementioned memory or storage unit may be a storage unit within a chip, such as a register, a cache, etc., and the memory or storage unit may also be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0275] Specifically, the aforementioned processing unit or processor may be a central processing unit (CPU), a neural-network processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0276] For example, see Fig.19 , Fig.19 A schematic diagram of the structure of a chip provided in an embodiment of the present application, the chip can be expressed as a neural network processor NPU 190, NPU 190 is mounted on the host CPU (Host CPU) as a coprocessor, and the Host CPU assigns tasks. The core part of the NPU is the operation circuit 1903, which is controlled by the controller 1904 to extract matrix data from the memory and perform multiplication operations.
[0277] In some implementations, the operation circuit 1903 includes multiple processing units (process engines, PEs) inside. In some implementations, the operation circuit 1903 is a two-dimensional systolic array. The operation circuit 1903 can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the operation circuit 1903 is a general-purpose matrix processor.
[0278] For example, assume there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of matrix B from the weight memory 1902 and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory 1901 and performs matrix operations with matrix B. The partial results or final results of the obtained matrix are stored in the accumulator 1908.
[0279] The unified memory 1906 is used to store input data and output data. The weight data is directly transferred to the weight memory 1902 through the direct memory access controller (DMAC) 1905. The input data is also transferred to the unified memory 1906 through the DMAC.
[0280] The bus interface unit (BIU) 1910 is used for the interaction between the AXI bus and the DMAC and instruction fetch buffer (IFB) 1909 .
[0281] The bus interface unit 1910 (BIU) is used for the instruction fetch memory 1909 to obtain instructions from the external memory, and is also used for the storage unit access controller 1905 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0282] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1906 or to transfer weight data to the weight memory 1902 or to transfer input data to the input memory 1901.
[0283] The vector calculation unit 1907 includes multiple operation processing units, which further process the output of the operation circuit when necessary, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, upsampling of feature planes, etc.
[0284] In some implementations, the vector calculation unit 1907 can store the processed output vector to the unified memory 1906. For example, the vector calculation unit 1907 can apply a linear function and / or a nonlinear function to the output of the operation circuit 1903, such as linear interpolation of the feature plane extracted by the convolution layer, and then, for example, a vector of accumulated values to generate an activation value. In some implementations, the vector calculation unit 1907 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 1903, for example, for use in a subsequent layer in a neural network.
[0285] An instruction fetch buffer 1909 connected to the controller 1904 is used to store instructions used by the controller 1904;
[0286] Unified memory 1906, input memory 1901, weight memory 1902 and instruction fetch memory 1909 are all on-chip memories. External memories are private to the NPU hardware architecture.
[0287] Among them, the operations of each layer in the recurrent neural network can be performed by the operation circuit 1903 or the vector calculation unit 1907.
[0288] The processor mentioned in any of the above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more processors for controlling the above Figure 4-Figure 14 The method is performed by a program of an integrated circuit.
[0289] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0290] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0291] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0292] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
[0293] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0294] Finally, it should be noted that the above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A root cause diagnosis method, characterized in that: include: Acquire current log data, where the current log data includes logs generated during a fault of the faulty device; The current log data is used as an input of a root cause diagnosis model to obtain predicted log data, where the predicted log data is used to indicate data in a fault time window, where the fault time window includes a time range in which the faulty device fails.
2. The method according to claim 1, characterized in that The method further comprises: Iteratively training the initial model using the historical log data to obtain the root cause diagnosis model, wherein the historical log data includes log data with at least one time window marked, and each time window covers a time range in which the at least one device fails; Wherein, any one training process of training the root cause diagnosis model using the historical log data includes: Using the historical log data as the input of the root cause diagnosis model obtained by the last training, and outputting the current output log data; Calculate the loss value according to the current log data, the time window corresponding to the current log data, and the loss function; The root cause diagnosis model obtained from the previous training is updated according to the loss value to obtain the root cause diagnosis model obtained from the current training.
3. The method according to claim 2, characterized in that The historical log data is divided into root cause log data and irrelevant log data, the root cause log data includes log data of the at least one time window, and the irrelevant log data is data within a time range when the faulty device does not cause a fault; The loss function includes a first part and a second part, the first part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the root cause log data, and the second part is used to calculate the loss value corresponding to the output of the root cause diagnosis model for the irrelevant log data.
4. The method according to claim 3, characterized in that When the input of the root cause diagnosis model is the root cause log data, the weight of the first part in the loss function is higher than the weight of the second part in the loss function; When the input of the root cause diagnosis model is the irrelevant log data, the weight of the first part in the loss function is lower than the weight of the second part in the loss function.
5. The method according to claim 3 or 4, characterized in that: The ratio between the root cause log data and the irrelevant log data comprises 1:
4.
6. The method according to any one of claims 2 to 5, characterized in that: The step of using the historical log data as the input of the root cause diagnosis model obtained by the last training and outputting the current output log data includes: Acquire multiple representations of multiple characters in the historical log data and corresponding position codes, where the position codes are used to indicate positions of corresponding characters in the historical log data; The multiple representations and the corresponding position codes are used as inputs of the root cause diagnosis model obtained by the previous training, and the current prediction log data is output, where the current prediction log data includes log data corresponding to the predicted root cause of the equipment failure.
7. The method according to any one of claims 1 to 6, characterized in that The root cause diagnosis model is a model based on a multi-head attention mechanism.
8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Mapping the predicted log data to the same space to obtain the distance between each log line in the predicted log data and the origin in the space; Filtering is performed according to the distance between each log line and the origin to obtain filtered prediction log data, and the filtered prediction log data is used to indicate the root cause of the fault of the faulty device.
9. The method according to claim 8, characterized in that The filtering according to the distance between each log line and the origin to obtain filtered predicted log data includes: At least one log line in the predicted log data whose distance from the origin is greater than a threshold is filtered to obtain the filtered predicted log data.
10. The method according to claim 8 or 9, characterized in that: The method further comprises: Clustering the log data of each time window in the prediction log data to obtain at least one group, each group including log data representing at least one type of fault root cause; A log line corresponding to a root cause of a fault of the faulty device is determined according to the log lines included in the at least one group.
11. The method according to claim 10, characterized in that The clustering of the log data of each time window in the predicted log data to obtain at least one group includes: Iteratively clustering the log data of each time window in the predicted log data to obtain at least one clustering result, each clustering result including at least one log component; Log lines that do not belong to the log component in each clustering result are removed to obtain the at least one group.
12. The method according to any one of claims 1 to 11, characterized in that The method further comprises: Obtaining log data of the at least one device; The at least one time window in the log data of the at least one device is marked to obtain the historical log data.
13. The method according to claim 12, characterized in that The marking the at least one time window in the log data of the at least one device to obtain the historical log data includes: Marking the at least one time window in the log data of the at least one device according to the time when the at least one device reports a fault, to obtain the historical log data; Alternatively, a preset keyword in the log data of the at least one device is identified, and the at least one time window in the log data of the at least one device is marked according to the time window corresponding to the identified keyword to obtain the historical log data.
14. A root cause diagnosis model training method, characterized in that: include: Acquire historical log data, wherein the historical log data includes log data marked with at least one time window, each time window covering a time range in which a failure of at least one device occurs; The initial model is iteratively trained using the historical log data to obtain a root cause diagnosis model, wherein the root cause diagnosis model is a model based on a multi-head attention mechanism, and the root cause diagnosis model is used to identify log data corresponding to the root cause of the equipment failure from the input log data.
15. A root cause diagnosis device, characterized in that: include: An acquisition module, used to acquire current log data, wherein the current log data includes logs generated during a fault of a faulty device; The processing module is used to use the current log data as an input of a root cause diagnosis model to obtain predicted log data, wherein the predicted log data is used to indicate data in a fault time window, and the fault time window includes a time range in which the faulty device fails.
16. A training device, characterized in that: include: An acquisition module, used to acquire historical log data, wherein the historical log data includes log data marked with at least one time window, each time window covering a time range in which a fault occurs in at least one device; A training module is used to iteratively train the initial model using the historical log data to obtain a root cause diagnosis model, wherein the root cause diagnosis model is a model obtained based on a multi-head attention mechanism, and the root cause diagnosis model is used to identify log data corresponding to the root cause of the equipment failure from the input log data.
17. A root cause diagnosis device, characterized in that: The method comprises a processor, wherein the processor is coupled to a memory, wherein the memory stores a program, and when the program instructions stored in the memory are executed by the processor, the method according to any one of claims 1 to 13 is implemented.
18. A training device, characterized in that: The invention comprises a processor, the processor is coupled to a memory, the memory stores a program, and when the program instructions stored in the memory are executed by the processor, the method according to claim 14 is implemented.
19. A computer-readable storage medium comprising a program, which, when executed by a processing unit, performs the method according to any one of claims 1 to 14.
20. A device, characterized in that: The method comprises a processing unit and a communication interface, wherein the processing unit obtains program instructions through the communication interface, and when the program instructions are executed by the processing unit, the method according to any one of claims 1 to 14 is implemented.
