System anomaly detection method and system based on deep log sequence analysis
Through the deep log sequence analysis method, Bi-LSTM and CRF models are used for log path anomaly detection, and the normal distribution model is combined for parameter anomaly detection, which solves the challenge of log anomaly detection between different systems and improves the accuracy and accuracy of system anomaly detection. Adaptability.
Patent Information
- Application Number
- CN202010613585.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-30
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2040-06-30
AI Technical Summary
Existing technologies cannot effectively solve the problem of anomaly detection between different systems in system log anomaly detection, and traditional data mining methods require a lot of professional knowledge and can only be applied to specific scenarios and cannot be used in diverse log data. Better results.
Using a method based on deep log sequence analysis, the log information is converted into a log sequence through a log parser and feature extractor, and then input into the bidirectional long short-term memory network (Bi-LSTM) and the conditional random field (CRF) model for training, combined with The normal distribution model is used for parameter anomaly detection, and a log path flow model is constructed to feedback anomalies.
It realizes automatic learning of normal log mode, accurately detects log events that deviate from the normal mode, improves the accuracy of anomaly detection in large systems, and can adapt to log mode changes in different systems.
Smart Images

Figure CN111930903B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large-scale system log anomaly detection, and in particular to a system anomaly detection method and system based on deep log sequence analysis. Background Art
[0002] The statements in this section merely provide background information related to the present disclosure and do not necessarily constitute prior art.
[0003] System anomaly detection is an essential and important task for detecting system failures, debugging machine performance, and maintaining system security. As the vulnerabilities encountered in system operation and malicious behaviors such as illegal intrusions become more diverse, the types of log data generated are also increasing; therefore, anomaly detection is also facing more and more challenges. System log files can be extracted from all computer systems, recording the operating status of the system and the events that occurred at different times. They are important data for fault analysis, performance testing, and system anomaly detection.
[0004] Due to the diversity of logs caused by system differences and other reasons, it is very challenging to detect anomalies in the system. In order to overcome this problem, many researchers have designed different log mining tools according to different systems, and used log mining methods to detect anomalies in the system. Although log mining-based methods have a certain degree of accuracy in detecting system anomalies, these methods are limited to specific scenarios, and a lot of professional knowledge is required in the process of log mining. Therefore, traditional data mining methods cannot play a better role in anomaly detection.
[0005] The inventors found that in the prior art, the method for anomaly detection on system logs mainly uses two data processing methods: log parsing and feature extraction. The original log events are converted into time-series log sequences through a log parser. The parameters in each type of log event are extracted and constructed into a parameter vector. The knowledge of natural language processing is used to perform anomaly detection on the system by incorporating the attention mechanism into the RNN language model. Although this method has a certain effect on system anomaly detection, it cannot effectively solve the anomaly detection problem between different systems. Summary of the invention
[0006] In order to solve the above problems, the present disclosure provides a system anomaly detection method and system based on deep log sequence analysis. According to the log information between different systems, the log data is converted and processed by a log parser and a feature extractor to convert the log information into a log sequence; then the log sequence is input into a model composed of a bidirectional long short-term memory network and a conditional random field for training and detection; and the parameters in the log information are input into a Gaussian distribution model for training to obtain a suitable threshold; finally, the detected log sequence is constructed as a log path flow model, so as to feedback the abnormal situation to the user in time.
[0007] According to a first aspect of an embodiment of the present disclosure, a system anomaly detection method based on deep log sequence analysis is provided, comprising:
[0008] Obtaining a log event historical data set, parsing the log events, and dividing the log event data set into a number of log sequences according to the identifiers obtained by the parsing;
[0009] Using the log sequence as input, training the Bi-LSTM-CRF model;
[0010] Use the trained Bi-LSTM-CRF model to perform path anomaly detection on the log sequence to be detected;
[0011] Extract features from the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector, and fit the parameter vector using a normal distribution model;
[0012] Perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0013] The location where the anomaly occurs is determined based on the path anomaly detection and parameter anomaly detection results.
[0014] According to a second aspect of an embodiment of the present disclosure, a system anomaly detection system based on deep log sequence analysis is provided, comprising:
[0015] The data preprocessing module is used to obtain a log event historical data set, parse each log event, and divide the log event data set into a number of log sequences according to the identifiers obtained by the parsing; and perform feature extraction on the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector;
[0016] A model training module, used to train the Bi-LSTM-CRF model using the log sequence as input; and to fit the parameter vector using a normal distribution model;
[0017] The path anomaly detection module is used to perform path anomaly detection on the log sequence to be detected using the trained Bi-LSTM-CRF model;
[0018] A parameter anomaly detection module, used to perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0019] The fault diagnosis module is used to determine the location where the abnormality occurs based on the path abnormality detection and parameter abnormality detection results.
[0020] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored and running on the memory, wherein when the processor executes the program, the system anomaly detection method based on deep log sequence analysis is implemented.
[0021] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the system anomaly detection method based on deep log sequence analysis is implemented.
[0022] Compared with the prior art, the beneficial effects of the present invention are:
[0023] (1) The present invention proposes a system anomaly detection framework (BiLCN) for deep log sequence analysis that combines a bidirectional long short-term memory network (Bi-LSTM), a conditional random field (CRF) and a normal distribution (ND). The framework applies the sequence annotation model Bi-LSTM-CRF to log path anomaly detection and the normal distribution to log parameter anomaly detection, so that BiLCN can automatically learn normal log patterns, including log execution paths and parameters of log events, and can accurately detect log events that deviate from the normal model and mark them as anomalies.
[0024] (2) In addition, the solution disclosed in the present invention improves the accuracy of anomaly detection in large systems by constructing the detected log sequence into a log path flow model and feeding back abnormal situations to users so that users can perform system diagnosis in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings in the specification, which constitute a part of the present application, are used to provide further understanding of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0026] Figure 1 Schematic diagram of the deep log sequence anomaly detection framework BiLCN described in Embodiment 1 of the present disclosure;
[0027] Figure 2It is a schematic diagram of the execution process of the log path detection model Bi-LSTM-CRF described in the first embodiment of the present disclosure;
[0028] Figure 3 It is the log path flow model diagram described in the first embodiment of the present disclosure;
[0029] Figure 4 It is a schematic diagram of the abnormality diagnosis process described in the first embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments.
[0031] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0032] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0033] Embodiment 1:
[0034] The purpose of this embodiment is to provide a system anomaly detection method based on deep log sequence analysis.
[0035] like Figure 1 As shown, in this embodiment, a system anomaly detection method based on deep log sequence analysis is provided, including:
[0036] Obtaining a log event historical data set, parsing the log events, and dividing the log event data set into a number of log sequences according to the identifiers obtained by the parsing;
[0037] Using the log sequence as input, training the Bi-LSTM-CRF model;
[0038] Use the trained Bi-LSTM-CRF model to perform path anomaly detection on the log sequence to be detected;
[0039] Extract features from the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector, and fit the parameter vector using a normal distribution model;
[0040] Perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0041] The location where the anomaly occurs is determined based on the path anomaly detection and parameter anomaly detection results.
[0042] In this embodiment, the method takes the log information generated by the HDFS system as the experimental object, combined with the BiLCN system anomaly detection framework, the framework mainly includes five parts: log parsing, feature extraction, log execution path anomaly detection, log parameter anomaly detection and construction of log path flow model.
[0043] Log parser: A log event is a record of interactions that occur during system operation. It includes a timestamp, the class name of the call executed, and the parameters when executed. The log parser automatically learns event templates from unstructured logs by reading each line of the log file and converts the raw log data into a structured time series.
[0044] Feature extraction: The input of feature extraction is the log event through log parsing, and the output is a log parameter vector, and log events with the same features are marked as unique log tags. A set of features is selected as the relevant attributes of the transformation, and all parameters are extracted from log events with the same tag to construct a parameter vector.
[0045] During the training phase, first, we convert the training log data into a set of log sequences through the log parser and feature extractor, and extract the parameters of each log; secondly, we input all the parameters of each type of log event into the normal distribution for training, find the appropriate threshold, and input the log sequence into the Bi-LSTM-CRF model for training.
[0046] During the testing phase, we input new logs into the BiLCN framework. First, the model will perform log path anomaly detection. As long as any log event in the log sequence is abnormal, the log sequence will be marked as abnormal. Secondly, we extract parameters for each type of log event in the normal log sequence, and input the extracted parameters into the normal distribution model for parameter anomaly detection. Finally, BiLCN constructs a log path flow model for each successfully detected log sequence, so that users can accurately perform fault analysis. It can also update model parameters in time according to user detection and effectively adapt to new log patterns.
[0047] The detection method is explained in detail below:
[0048] Step 1: Obtain the historical data set of log events, parse the log events, normalize the log data with inconsistent structures, use regular expressions to preprocess each log line through a combination of regular expressions and text mining techniques to analyze the structured part of the text, and use text mining techniques to extract the remaining part; according to the identifier id of each type of log event, convert each type of log event (i.e., the same identifier) into a unique log label. For example, assuming that the system contains 20 types of identifiers, use L = {l1, l2, l3, ..., l n} represents the entire log event data set, where the subscript of l is the log event number, n=20, then l1 represents the log event set numbered 1; at the same time, the log event data set is divided into several log event sequences through a sliding window, and the sliding window is composed of a window size and a step size. The specific window size and step size can be set according to actual needs.
[0049] Step 2: Perform feature extraction on the parsed log events. The input of feature extraction is the log events parsed by logs, and the output is a log parameter vector. A set of features is selected as the relevant attributes for transformation, and the parameters of the log events with the same label are extracted to construct a parameter vector. In this example, the time parameters in the HDFS system log are extracted and constructed into a parameter vector.
[0050] Step 3: Log path anomaly detection. Input the log sequence generated in step 1 into the Bi-LSTM-CRF model for log path anomaly detection. In this example, assume that the training log event dataset is {l 11 , l 23 ,l5,l9,l 12 , l 25 , l3}, set the window size h = 4, then the input sequence and output label used to train the model are: {l 11 , l 23 ,l5,l9→l 12},{l 23 ,l5,l9,l 12 → 25},{l5,l9,l 12 , l 25 →l3}.
[0051] Step 4: Repeat the training steps in step 3 100 times. Through training, the value of the threshold k is 0.5, the value of the number of memory units α is 128, and the value of the window w is 10. The training data is bidirectionally propagated in the Bi-LSTM model, and its output is the probability value of the log event occurring at the next moment. At the same time, the training process obtains the threshold k. When the probability value is less than k, it is judged as abnormal; the formula for the forward propagation calculation of the Bi-LSTM network is as follows:
[0052] Input Gate:
[0053]
[0054]
[0055] Forget Gate:
[0056]
[0057]
[0058] Output Gate:
[0059]
[0060]
[0061] where x t is the input at the current moment, is the state of all cells at the last moment, is the output of different LSTM memory blocks in the previous moment. is the state of all cells at the current moment.
[0062] The formula for the Bi-LSTM network back propagation calculation is:
[0063] Input Gate:
[0064]
[0065] Forget Gate:
[0066]
[0067] Output Gate:
[0068]
[0069] In the above formula, α represents the value calculated by the set, b represents the value calculated by the activation function, and w is the parameter of the connection between different nodes. is the input of the current time, is the state of all units at the previous moment, is the output of the last different LSTM memory blocks, is the state of all cells at the current time. Finally, the output result of the Bi-LSTM model is the probability value of the occurrence of the log event at the next moment;
[0070] Step 5: Figure 2 As shown in FIG. 1 , the result obtained in step 4 is used as input to the linear chain conditional random field, and the highest group of CRF results is output as the final result of judging whether the log event at the next moment is abnormal. Specifically, according to the input score sequence (i.e., the probability value sequence of the log event), X = (X1, X2, X3, ..., X n ), calculate the output sequence Y = (Y1, Y2, Y3, ..., Y n ), the conditional probability distribution P(Y|X) of the random variable sequence Y constitutes a conditional random field, then P(Y|X) is called a linear chain conditional random field, and the calculation formula is as follows:
[0071] P(Y i |X,Y1,…,Y I-1 , Y i+1 , …, Y n )=P(Y i |X,Y I-1 , Y i+1 )i=1,2,3,…,n (10)
[0072] The parameterized form of the conditional random field is:
[0073]
[0074] Among them, Z(x) is the normalization factor, and its calculation formula is:
[0075]
[0076] Among them, t k is a characteristic function defined on the edge, called the transfer feature, which depends on the current and previous positions; s l is a characteristic function defined on the node, called state characteristic, which depends on the current position; k , μ l Yes k ,s l Corresponding weight; characteristic function t k ,s l The value of can only be 1 or 0. When the characteristic condition is met, the value is 1, otherwise it is 0;
[0077] Step 6: Take the log parameter vector extracted in step 2 as input and input it into the normal distribution model. The n log parameters (X1, x2, x3, ..., x n ), calculate the mean μ and variance σ of these n parameters; the calculation formula for the mean and variance is:
[0078]
[0079] The log data conforms to the normal distribution, and the area μ±3σ contains 99.7% of the data. If the parameter value of a log event is more than 3σ away from the mean μ of the distribution, then the parameter value is marked as abnormal.
[0080] In addition, if there is a new log parameter We can also calculate the probability And based on the obtained probability value k, it is determined whether the parameter is an abnormal value.
[0081]
[0082] Step 7: Construct a log path flow model, which consists of the labels of the detected log events, and records the locations of the divergence points and the abnormality points and the order of log event execution in detail. Its function is to enable users to understand the location and cause of the abnormality, as well as the cause of the divergence point (whether it is caused by concurrency or new tasks); Figure 3 As shown, the detection results of step 5 and step 6 are statistically analyzed, and a log path flow model is constructed. The log events that cause concurrency or the start of a new task are defined as divergence points. When performing log path anomaly detection, the model will make a judgment based on the threshold k obtained by training. If the probability of the log event after the divergence point is greater than k, it is marked as normal, otherwise it is abnormal. When it is marked as normal, the cause of the divergence point is analyzed according to the execution order of the log sequence, and a log path flow is generated to help users understand the location and cause of the anomaly in a timely manner; then analyze whether it is caused by concurrency or a new task. The log path flow model can be used to help users understand the location and cause of the anomaly in a timely manner.
[0083] In this example, if Figure 3As shown in the figure, the probability that the log sequence {5, 3, 12} predicts the output log {6} is 1, so the log sequence {5, 3, 12, 6} comes from the same task. For a concurrent task sequence {12, 6}, the next step is "14" or "23", and event "6" is the divergence point. The predicted probabilities of events "14" and "23" are 0.7 and 0.3 respectively, which will cause the model to feed back to the sequence {12, 16} to predict the next log as "14". In fact, "14" and "23" are both subsequent tasks of the sequence {12, 16}. In this case, the previously trained model will cause model prediction errors. Therefore, it is necessary to use this log sequence to update the parameters of the Bi-LSTM-CRF model; as shown in the figure, Figure 3 As shown in the figure, if the divergence point is caused by a new task, the predicted log tasks "14" and "23" will not appear one after another, but will continue as two new tasks respectively. If each such log key is merged into the log sequence, the next prediction is the prediction of the log key of a new task, then we stop the working mode of the current task at the divergence point log key "6" and start to build the working mode for the new tasks {14→22} and {23→10}; the new task is a selection branch, and only the current one can be executed, not at the same time.
[0084] Fault diagnosis, such as Figure 4 As shown in the figure, the log path flow model can be used to help users understand the location and cause of the exception in a timely manner. In this example, the log task sequence {5,12,25,6} predicts that the probability of the next log event "18" is 1, but the actual executed log event is 9, at which point an exception occurs. At this point, according to the log path flow model, the log event with the exception in the current log sequence can be easily found by performing exception diagnosis; the abnormal log event occurs after "Received block (.*) src: (.*) dest: (.*) of size (.*)" and before "Starting thread to transfer block (.*) to (.*)", where (.*) represents the parameter.
[0085] Embodiment 2:
[0086] The purpose of this embodiment is to provide a system anomaly detection system based on deep log sequence analysis.
[0087] A system anomaly detection system based on deep log sequence analysis, comprising:
[0088] The data preprocessing module is used to obtain a log event historical data set, parse each log event, and divide the log event data set into a number of log sequences according to the identifiers obtained by the parsing; and perform feature extraction on the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector;
[0089] A model training module, used to train the Bi-LSTM-CRF model using the log sequence as input; and to fit the parameter vector using a normal distribution model;
[0090] The path anomaly detection module is used to perform path anomaly detection on the log sequence to be detected using the trained Bi-LSTM-CRF model;
[0091] A parameter anomaly detection module, used to perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0092] The fault diagnosis module is used to determine the location where the abnormality occurs based on the path abnormality detection and parameter abnormality detection results.
[0093] Embodiment three:
[0094] The purpose of this embodiment is to provide an electronic device.
[0095] An electronic device comprises a memory, a processor and a computer program stored and running on the memory, wherein when the processor executes the program, the following steps are implemented, including:
[0096] Obtaining a log event historical data set, parsing the log events, and dividing the log event data set into a number of log sequences according to the identifiers obtained by the parsing;
[0097] Using the log sequence as input, training the Bi-LSTM-CRF model;
[0098] Use the trained Bi-LSTM-CRF model to perform path anomaly detection on the log sequence to be detected;
[0099] Extract features from the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector, and fit the parameter vector using a normal distribution model;
[0100] Perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0101] The location where the anomaly occurs is determined based on the path anomaly detection and parameter anomaly detection results.
[0102] Embodiment 4:
[0103] The purpose of this embodiment is to provide a computer-readable storage medium.
[0104] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps, including:
[0105] Obtaining a log event historical data set, parsing the log events, and dividing the log event data set into a number of log sequences according to the identifiers obtained by the parsing;
[0106] Using the log sequence as input, training the Bi-LSTM-CRF model;
[0107] Use the trained Bi-LSTM-CRF model to perform path anomaly detection on the log sequence to be detected;
[0108] Extract features from the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector, and fit the parameter vector using a normal distribution model;
[0109] Perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model;
[0110] The location where the anomaly occurs is determined based on the path anomaly detection and parameter anomaly detection results.
[0111] The system anomaly detection method and system based on deep log sequence analysis provided in the above embodiment can be fully implemented and have broad application prospects.
[0112] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
[0113] Although the above describes the specific implementation methods of the present disclosure in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present disclosure. Technical personnel in the relevant field should understand that on the basis of the technical solution of the present disclosure, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present disclosure.
Claims
1. A system anomaly detection method based on deep log sequence analysis, characterized in that: include: Obtaining a log event historical data set, parsing the log events, and dividing the log event data set into a number of log sequences according to the identifiers obtained by the parsing; Using the log sequence as input, training the Bi-LSTM-CRF model; The trained Bi-LSTM-CRF model is used to perform path anomaly detection on the log sequence to be detected. The input of the trained Bi-LSTM-CRF model is the log sequence grouped by the sliding window. The output of the Bi-LSTM model is the probability value of a certain log event occurring at the next moment. The probability value is used as the input of the CRF model. The CRF model outputs the highest group of CRF results as the final result of determining whether the log event at the next moment is abnormal. Specifically, according to the input score sequence, that is, the probability value sequence of the log event occurrence, X = (X1, X2, X3, ..., X n ), calculate the output sequence Y = (Y1, Y2, Y3, ..., Y n ), the conditional probability distribution P(Y|X) of the random variable sequence Y constitutes a conditional random field, then P(Y|X) is called a linear chain conditional random field, and the calculation formula is as follows: P(Y i |X,Y1,…,Y i-1 ,Y i+1 ,…,Y n )=P(Y i |X,Y i-1 ,Y i+1 ) i=1,2,3,…,n The parameterized form of the conditional random field is: Among them, Z(x) is the normalization factor, and its calculation formula is: Among them, t k is a characteristic function defined on the edge, called the transfer feature, which depends on the current and previous positions; s l is a characteristic function defined on the node, called state characteristic, which depends on the current position; k , μ l Yes k ,s l Corresponding weight; characteristic function t k ,s l The value of can only be 1 or 0, and it takes the value of 1 when the characteristic condition is met, otherwise it takes the value of 0; the feature extraction is performed on the parsed log event, and the feature extraction is to use the log event after log parsing, extract all parameters from the log event with the same label according to the relevant attributes to be detected to construct a parameter vector, fit the parameter vector using a normal distribution model, obtain the fitting curve of the parameter vector, input the corresponding parameters of each log event in the log sequence to be tested into the trained normal distribution model, and judge whether the corresponding parameters are abnormal according to the 3σ criterion; the labeling is to uniquely label the log events with the same identifier according to the parsed log event identifier, and group the labeled log event data using a sliding window to obtain a number of groups of log sequences; Perform parameter anomaly detection on log events in the log sequence to be tested by using the normal distribution model; The location where the anomaly occurs is determined based on the path anomaly detection and parameter anomaly detection results.
2. A system anomaly detection method based on deep log sequence analysis as claimed in claim 1, characterized in that: The log events are parsed by using a log parser to read each line of log events, automatically learn event templates from unstructured logs, and convert raw log data into structured time series. The specific parsing process preprocesses each log line through regular expressions, analyzes the structured part of the text, and extracts the remaining part using text mining technology.
3. The system anomaly detection method based on deep log sequence analysis according to claim 1, characterized in that: According to the path anomaly detection and parameter anomaly detection results, the location and cause of the anomaly are intuitively displayed to the user using the log path flow model.
4. A system anomaly detection system based on deep log sequence analysis, characterized in that: include: The data preprocessing module is used to obtain a log event historical data set, parse each log event, and divide the log event data set into a number of log sequences according to the identifiers obtained by the parsing; and perform feature extraction on the parsed log events, extract all parameters from the log events with the same identifier to construct a parameter vector; A model training module, used to train the Bi-LSTM-CRF model using the log sequence as input; and to fit the parameter vector using a normal distribution model; The path anomaly detection module is used to perform path anomaly detection on the log sequence to be detected using the trained Bi-LSTM-CRF model. The input of the trained Bi-LSTM-CRF model is the log sequence grouped by the sliding window. The output of the Bi-LSTM model is the probability value of a certain log event occurring at the next moment. The probability value is used as the input of the CRF model. The CRF model outputs the highest group of CRF results as the final result of determining whether the log event at the next moment is abnormal. Specifically, according to the input score sequence, that is, the probability value sequence of the log event occurrence, X=(X1,X2,X3,…,X n ), calculate the output sequence Y = (Y1, Y2, Y3, ..., Y n ), the conditional probability distribution P(Y|X) of the random variable sequence Y constitutes a conditional random field, then P(Y|X) is called a linear chain conditional random field, and the calculation formula is as follows: P(Y i |X,Y1,…,Y i-1 ,Y i+1 ,…,Y n )=P(Y i |X,Y i-1 ,Y i+1 ) i=1,2,3,…,n The parameterized form of the conditional random field is: Among them, Z(x) is the normalization factor, and its calculation formula is: Among them, t k is a characteristic function defined on the edge, called the transfer feature, which depends on the current and previous positions; s l is a characteristic function defined on the node, called state characteristic, which depends on the current position; k , μ l Yes k ,s l Corresponding weight; characteristic function t k ,s l The value of can only be 1 or 0. When the characteristic condition is met, the value is 1, otherwise it is 0; The parameter anomaly detection module is used to perform parameter anomaly detection on the log events in the log sequence to be tested through the normal distribution model, specifically: feature extraction is performed on the parsed log events, the feature extraction is to use the log events after log parsing, according to the relevant attributes to be detected, extract all parameters from the log events with the same label to construct a parameter vector, use the normal distribution model to fit the parameter vector, obtain the fitting curve of the parameter vector, input the corresponding parameters of each log event in the log sequence to be tested into the trained normal distribution model, and judge whether the corresponding parameters are abnormal according to the 3σ criterion; the labeling is to uniquely label the log events with the same identifier according to the parsed log event identifier, and use the sliding window to group the labeled log event data to obtain a number of groups of log sequences; The fault diagnosis module is used to determine the location where the abnormality occurs based on the path abnormality detection and parameter abnormality detection results.
5. An electronic device, characterized in that: It includes a memory, a processor and a computer program stored and running on the memory, and when the processor executes the program, it implements a system anomaly detection method based on deep log sequence analysis as described in any one of claims 1-2.
6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, a system anomaly detection method based on deep log sequence analysis as described in any one of claims 1-2 is implemented.
Citation Information
Patent Citations
Process activity prediction method based on CRF and LSTM
CN110956309A
Multi-level deep learning log fault detection method for cloud native system
CN111190804A
Log sequence anomaly detection framework based on nLSTM (Non-Log Sequence Transfer Module)-self attention
CN111209168A
