Micro-service fault root cause positioning method and system
Through LSTMs neural network and deep SVDD model, the problems of poor accuracy and long response time in microservice fault diagnosis are solved, and the effective expression of multi-component correlation and rapid fault location are achieved.
Patent Information
- Application Number
- CN202410641070.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-08-27
AI Technical Summary
In the existing technology, microservice fault diagnosis accuracy is poor, fault location response time is long, and the correlation between multiple components is not fully considered.
LSTMs neural network and deep SVDD model are used to model the dynamic relationships of microservices through multi-source heterogeneous data. The LSTM neural network is used to express the dynamic behavior between components, and the deep SVDD model is used for anomaly detection and fault location.
It improves the accuracy and efficiency of fault diagnosis, can quickly locate the specific microservice component where the fault occurred, and solves the problem of insufficient consideration of the correlation of multiple components.
Smart Images

Figure CN118551256A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microservice fault root cause positioning, and in particular to a microservice fault root cause positioning method and system. Background Art
[0002] With the rapid development of microservice architecture, fault diagnosis is crucial to improving the high availability and stability of the system. The numerous and complex interactions between components in the microservice system make it easy for anomalies to spread and cause partial or complete system failures. At this time, operation and maintenance personnel need to find clues from the dynamic and complex associations to locate the root cause. The efficiency and accuracy of manual work are facing uncertainty, so automatic fault location came into being. For example, the existing invention patent application document "A Microservice Fault Prediction System Based on Deep Learning" with publication number CN117743787A, the existing method includes: constructing a microservice system indicator processing module; constructing a deep learning prediction model; the deep learning prediction model continues to learn to obtain the final model result. And the existing invention patent application document "Abnormal root cause acquisition method and system based on indicator data and log data" with publication number CN117149500A, the existing method includes: obtaining indicator data and log data of the microservice system; calculating the indicator anomaly score sequence set MASS of the indicator data through the BIRCH clustering algorithm; calculating the log anomaly score sequence LAS of the log data through the DeepLog algorithm; performing correlation analysis on the clustering results of each indicator data in the indicator anomaly score sequence set MASS and the log anomaly score sequence LAS to obtain the correlation; obtaining the abnormal root cause indicator through correlation sorting. However, the current microservice fault diagnosis based on deep learning focuses on how to establish a dynamic and complex association relationship model, and improve the accuracy of fault root cause location by fully considering more influencing factors. Therefore, with the increase in the types of fault influencing factors, the relationship model will become more complex, and the efficiency and accuracy of positioning will be significantly reduced.
[0003] In summary, the prior art has technical problems such as poor fault diagnosis accuracy, long fault location response time, and failure to fully consider the correlation between multiple components. Summary of the invention
[0004] The technical problem to be solved by the present invention is: how to solve the technical problems in the prior art of poor fault diagnosis accuracy, long fault location response time and failure to fully consider the correlation between multiple components.
[0005] The present invention adopts the following technical solutions to solve the above technical problems: A method for locating the root cause of a microservice failure includes:
[0006] S1. Obtain multi-source heterogeneous data of different components in microservices, and model the dynamic association relationship of microservices based on the LSTMs neural network and the multi-source heterogeneous data to obtain the LSTMs neural network representation; the operations of modeling the dynamic association relationship of microservices include: source data analysis, data serialization, data weight expression, and generation of data vector expression; in the process of source data analysis, use the source data analysis LSTMs-DSVDD model to analyze multi-source heterogeneous data through data parsing, normalization operations, and vectorization operations; combine to obtain the microservice data expression vector; serialize and process multi-source heterogeneous data, and use the LSTM neural network to generate weight expression and form a neural network structure;
[0007] S2. Based on the LSTMs neural network, learn the correlation between microservice source data to extract the potential spatial distribution of data, use the output data of the LSTMs neural network in the training process as the input of the next round of training to update the LSTMs neural network and adaptively separate normal data and abnormal data; among them, the kernel-based support vector data description model SVDD is used to perform a single-class anomaly detection method, construct a hypersphere to surround the corresponding points of normal data, and identify the corresponding points of abnormal data; use the kernel-based support vector data description model SVDD to minimize the calculation of the partition hypersphere of the sample feature space to process high-dimensional sample features; use the LSTMs neural network and the kernel-based support vector data description model SVDD together to model the multi-source heterogeneous data in the preset time series for diagnosing the root cause information of the fault;
[0008] S3. Joint model training & fault location. The source data of the LSTMs neural network is used as input. Based on the kernel-based support vector data description model SVDD, the minimum volume hypersphere containing normal data is approximated to the state including all normal data to train the fault root cause diagnosis model. Based on the new microservice data, the hyperspherical space data distribution of the new microservice data is constructed. In order to learn the useful feature representation of the data, the LSTMs-DSVDD model is used to map the data into the minimum volume hypersphere containing normal data to obtain the feature representation data for processing to obtain the applicable decision function and determine the normal data and the abnormal data. The data point score is calculated using the distribution distance between the data point and the center of the hypersphere to sort and obtain the root cause of the fault.
[0009] The present invention first expresses the multi-source heterogeneous data of microservices into an LSTMs neural network model, and then uses deep SVDD hypersphere joint training and learning based on the neural network expression to achieve fault root cause location. The metadata analysis LSTMs-DSVDD model in the present invention adopts a composite model structure of LSTM neural network and deep SVDD. First, the multi-source heterogeneous data of microservices is expressed as LSTMs neural network structure data. By analyzing the interactions and dependencies between microservice components over time, it helps to more accurately understand the dynamic behaviors between microservice components and improve the accuracy of fault diagnosis.
[0010] In a more specific technical solution, the metadata analysis in S1 includes:
[0011] S11. Use the ELK tool to parse and obtain different field values of multi-source heterogeneous data;
[0012] S12, perform vectorization operations on multi-source heterogeneous data to obtain numerical data, set the maximum value and minimum value of each numerical value in turn to perform data scaling modeling, and obtain microservice data expression vectors of different data values in turn;
[0013] S13, performing vectorization operation on the text data in the multi-source heterogeneous data, counting the word frequency in the text data, and generating a text library file to number the words in the sentence word sequence;
[0014] S14. In the vectorization operation, the multi-source heterogeneous data is converted into a single microservice data expression vector. The metadata analysis LSTMs-DSVDD model is used to analyze each microservice S i , forming a neural network structure Express multi-source heterogeneous data for microservices.
[0015] In a more specific technical solution, S14 also includes:
[0016] S141. Use the LSTMs neural network diagram of the LSTMs neural network to express all microservice data expression vectors, where the subscript is set to represent the time index, a i Represents the i-th vector, and defines the data sequence using the following logic:
[0017]
[0018] For any item X i ={X i,1 ,X i,2 …X i,d},in Where d represents X i The number of columns in .
[0019] S142. Apply the architecture of the LSTMs neural network diagram to each column of data sequence and calculate the average LSTM output of each data sequence. As the weight input of the current column data of SVDD;
[0020] In a more specific technical solution, in S142, the Mean-Pooling mechanism is used to fuse the result information of each neuron node in the LSTMs neural network graph;
[0021] In the i-th data sequence, for the output results of each neuron node in the LSTMs neural network graph, the following logic is used to calculate the equally weighted average value: As the input of SVDD module:
[0022]
[0023] For the input data series For the output space of LSTM, let:
[0024] For x∈X
[0025] After the feature representation of the LSTMs neural network, the corresponding gate control weight set is expressed using the following logic:
[0026] W = {w i ,w f ,w o ,w c}
[0027] In the formula, Represents the output result of each sequence after the LSTM network, setting the weight parameter vector of the LSTMs neural network: w*w T =1, the bias vector of the network unit is 0 vector.
[0028] Since LSTM itself performs well in time series data processing, in order to improve positioning accuracy, the present invention integrates the high-dimensional data computing and classification capabilities of deep SVDD for joint training. The algorithm first constructs the multi-source and heterogeneous data of microservices into complex network structure data, and uses the LSTM neural network to express the dynamic and complex associations between microservice components. Then, based on the neural network structure, deep SVDD is used to effectively calculate sample features and mine complex associations to find the root cause of the fault, making the root cause of the fault more accurate and rapid.
[0029] In a more specific technical solution, S2 includes:
[0030] S21. Using the kernel-based support vector data description model SVDD, within the preset data expression range, find the minimum volume hypersphere containing normal data as the data separation boundary; let c be the center point of the minimum volume hypersphere containing normal data, and R be the radius of the hypersphere, so as to summarize the kernel-based support vector data description model SVDD using the following logic:
[0031]
[0032] Among them, the kernel-based support vector data description model SVDD satisfies: ||φ(x i )-c||≤R 2 +ξ i , where ξ i ≥0; i=1,…,l. C is the penalty parameter.
[0033] S22. Use the following logic to perform the corresponding dual problem optimization operation:
[0034]
[0035] Among them, the above formula satisfies: 0≤α i ≤C,e T α=1,i=1,……,l, where α is the Lagrange multiplier, Q ij =φ(x i ) T ·φ(x j ).
[0036] In a more specific technical solution, step S3 includes:
[0037] S31. Use the alternating training method to tune the network parameters of the LSTMs neural network and the radius R parameter of the kernel-based support vector data description model SVDD;
[0038] S32. Generate training data vector expression based on the newly generated data of microservices. Based on the fault root cause diagnosis model, for the test sample point, define the anomaly score of the data point as the distance from the center of the hypersphere, wherein the anomaly score is expressed using the following logic:
[0039]
[0040] Where c is the center of the hypersphere, R is the final radius of the learned hypersphere, and W * Represents the weight parameters of the trained neural network. Specifically, if the observation point x i If the abnormal score value is greater than 0, the point is considered to be an abnormal point, otherwise it is a normal point.
[0041] The present invention uses deep SVDD to mine the association relationship model to quickly locate the specific microservice component where the fault occurs, rather than just identifying the existence of anomalies. This is a huge convenience for fault diagnosis research, and the fault can be responded to and resolved quickly based on the positioning results.
[0042] In view of the problem that LSTM itself is affected by the network structure and is limited to learning the time correlation of time series and ignoring the relationship between different component sequences, the present invention proposes a dynamic weight expression of LSTMs multi-source data to express the component correlation. The output sequence can not only learn the time series characteristics of a single component, but also learn the correlation between multiple components.
[0043] In a more specific technical solution, S31 includes:
[0044] S311, based on the kernel-based support vector data description model SVDD, using the following logic, minimize the volume of the hypersphere enclosing the neural network mapping result:
[0045]
[0046] Where W is the neural network parameter, φ(x i ,w) represents the mapping result of the input under the current neural network parameters, and λ is a hyperparameter;
[0047] S312. Through training, the following logic is used to minimize the average distance between the data points and the center of the hypersphere:
[0048]
[0049] S313. Using the LSTMs-DSVDD model, assuming that the radius of the hypersphere R>0 of the minimum volume hypersphere containing normal data, and the center point c∈F, the optimization goal of the LSTMs-DSVDD model is expressed using the logic of the following SVDD kernel function:
[0050]
[0051] In the formula, min R,W R 2 represents minimizing the volume of the hypersphere; represents the deviation penalty for outlier data, Represents network weight regularization to prevent overfitting.
[0052] S314. According to the SVDD kernel function, the optimization objective function is simplified to obtain:
[0053]
[0054] In the formula, To use quadratic loss representation The distance to the center of the sphere c; is a regular term, decomposing and optimizing the objective function, and narrowing down the LSTMs neural network The distance from the observation point to the center of the sphere c. In the iterative process of LSTMs-DSVDD model training, the stochastic gradient descent method SGD is used to train the parameters of the optimization objective function, so as to control the training operation and obtain the fault root cause diagnosis model according to the convergence of the parameter loss function in the optimization objective function;
[0055] S315. Set the variable k; k∈N. During the iteration process, fix the radius R parameter of the support vector data description model SVDD, train and adjust the network parameters of the LSTMs neural network to obtain applicable LSTM network parameters; use the applicable LSTM network parameters to train the radius R parameter of the support vector data description model SVDD until the loss function meets the preset requirements, and end the iteration process.
[0056] In a more specific technical solution, in S315, during the iteration process, the optimization objective equation is solved, wherein the slack variable is defined as: formula:
[0057]
[0058] In the formula, The function is an approximate function.
[0059] In a more specific technical solution, in S315, using a differentiable function Instead of approximate function Adjust the distribution of the smoothing parameter t to achieve convergence:
[0060]
[0061] In the formula, t>0.
[0062] Through the scaling operation, we get:
[0063]
[0064] at the same time The smoothing parameter t is monotonically decreasing; the following formula is derived:
[0065]
[0066] Let the loss function be L t :
[0067]
[0068] To tune the radius R parameter and weight parameter of the support vector data description model SVDD: c, R 2 ,W;
[0069] Among them, the following logic is used to solve the gradient of parameter c:
[0070]
[0071] According to the following logic, c is calculated according to the gradient k+1 :
[0072]
[0073] In the formula, k represents the number of iterations. The radius R of the objective function is obtained by using the following logic: 2 , weight parameter W:
[0074]
[0075]
[0076] Through the aforementioned iterative training operation of the loss function, the model convergence operation is completed and the fault root cause diagnosis model is obtained.
[0077] In a more specific technical solution, a microservice fault root cause location system includes:
[0078] The LSTMs neural network representation module is used to obtain multi-source heterogeneous data of different components in microservices. Based on the LSTMs neural network, the dynamic association relationship modeling of microservices is carried out according to the multi-source heterogeneous data to obtain the LSTMs neural network representation. The operations of the dynamic association relationship modeling of microservices include: source data analysis, data serialization, data weight expression, and generation of data vector expression. In the process of source data analysis, the source data analysis LSTMs-DSVDD model is used to analyze multi-source heterogeneous data through data parsing, normalization operations, and vectorization operations. The microservice data expression vector is obtained by combination. The multi-source heterogeneous data is serialized and processed, and the weight expression is generated by fusion of the LSTM neural network to form a neural network structure.
[0079] The normal data and abnormal data separation module is used to learn the correlation between microservice source data based on the LSTMs neural network to extract the potential spatial distribution of the data, and use the output data of the LSTMs neural network in the training process as the input of the next round of training to update the LSTMs neural network and adaptively separate normal data and abnormal data; among them, the kernel-based support vector data description model SVDD is used to perform a single-classification anomaly detection method to construct a hypersphere to surround the corresponding points of normal data and identify the corresponding points of abnormal data; the kernel-based support vector data description model SVDD is used to minimize the calculation of the partition hypersphere of the sample feature space to process high-dimensional sample features; the LSTMs neural network and the kernel-based support vector data description model SVDD are used together to model the multi-source heterogeneous data in the preset time series for diagnosing the root cause information of the fault, and the normal data and abnormal data separation module is connected to the LSTMs neural network representation module;
[0080] The joint model training and fault location module is used to take the source data of the LSTMs neural network as input, and based on the kernel-based support vector data description model SVDD, make the minimum volume hypersphere containing normal data approximate the state including all normal data, so as to train and obtain the fault root cause diagnosis model; based on the new microservice data, construct the hyperspherical space data distribution of the new microservice data, and use the LSTMs-DSVDD model to map the data into the minimum volume hypersphere containing normal data in order to learn the useful feature representation of the data, and obtain the feature representation data to process and obtain the applicable decision function, and determine the normal data and the abnormal data; use the distribution distance between the data point and the center of the hypersphere to calculate the score of the data point, and sort to obtain the root cause of the fault. The joint model training and fault location module is connected with the normal data and abnormal data separation module.
[0081] Compared with the prior art, the present invention has the following advantages:
[0082] The present invention first expresses the multi-source heterogeneous data of microservices into an LSTMs neural network model, and then uses deep SVDD hypersphere joint training and learning based on the neural network expression to achieve fault root cause location. The metadata analysis LSTMs-DSVDD model in the present invention adopts a composite model structure of LSTM neural network and deep SVDD. First, the multi-source heterogeneous data of microservices is expressed as LSTMs neural network structure data. By analyzing the interactions and dependencies between microservice components over time, it helps to more accurately understand the dynamic behaviors between microservice components and improve the accuracy of fault diagnosis.
[0083] Since LSTM itself performs well in time series data processing, in order to improve positioning accuracy, the present invention integrates the high-dimensional data computing and classification capabilities of deep SVDD for joint training. The algorithm first constructs the multi-source and heterogeneous data of microservices into complex network structure data, and uses the LSTM neural network to express the dynamic and complex associations between microservice components. Then, based on the neural network structure, deep SVDD is used to effectively calculate sample features and mine complex associations to find the root cause of the fault, making the root cause of the fault more accurate and rapid.
[0084] The present invention uses deep SVDD to mine the association relationship model to quickly locate the specific microservice component where the fault occurs, rather than just identifying the existence of anomalies. This is a huge convenience for fault diagnosis research, and the fault can be responded to and resolved quickly based on the positioning results.
[0085] In view of the problem that LSTM itself is affected by the network structure and is limited to learning the time correlation of time series and ignoring the relationship between different component sequences, the present invention proposes a dynamic weight expression of LSTMs multi-source data to express the component correlation. The output sequence can not only learn the time series characteristics of a single component, but also learn the correlation between multiple components.
[0086] The present invention solves the technical problems existing in the prior art of poor fault diagnosis accuracy, long fault location response time and insufficient consideration of the correlation between multi-components. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] Figure 1 This is a schematic diagram of the basic steps of a method for locating the root cause of a microservice failure in Example 1 of the present invention;
[0088] Figure 2 A schematic diagram of the overall structure of a microservice fault root cause location method model design according to Embodiment 1 of the present invention;
[0089] Figure 3 This is a schematic diagram of specific steps of metadata analysis in Example 1 of the present invention;
[0090] Figure 4 Schematic diagram of weight expression of LSTMs multi-source heterogeneous time series data in Example 1 of the present invention. DETAILED DESCRIPTION
[0091] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0092] Example 1
[0093] like Figure 1 and Figure 2 As shown, a method for locating the root cause of a microservice fault provided by the present invention includes the following basic steps:
[0094] Step S1, LSTMs neural network representation, modeling the dynamic and complex association relationship of microservices based on LSTMs neural network;
[0095] In this embodiment, the dynamic and complex association relationship of microservices is modeled based on LSTMs neural network. The purpose of this step is to learn and analyze the multi-source and heterogeneous data of different components of microservices through neural network technology LSTM, better establish the association relationship of data, adapt to dynamically changing microservices, and improve the applicability and accuracy of fault location.
[0096] In this embodiment, the process of modeling the dynamic and complex association relationship of microservices includes: source data analysis, data serialization, data weight expression, and generating data vector expression;
[0097] In this embodiment, in the source data analysis stage, the model uses data parsing tools and normalized vectorization algorithms to analyze the original data; combine to obtain the data expression vector of the microservice; serialize the original data according to certain rules, generate the corresponding weight expression according to LSTM data fusion, and form a neural network structure;
[0098] In this embodiment, the source data analysis LSTMs-DSVDD model uses data parsing tools and normalized vectorization algorithms to analyze the original data; the data expression vector of the microservice is obtained by combination;
[0099] like Figure 3 As shown, in this embodiment, the specific steps of metadata analysis include:
[0100] S11. Use the ELK tool to parse the different field values of microservice data;
[0101] S12. In the process of vectorizing the numerical data, the maximum value and the minimum value of each numerical value are sequentially set for data scaling modeling, and vector representations of different data values are sequentially obtained;
[0102] S13. In the process of vectorizing text data, word frequencies are counted, a text library file is generated, and words in a sentence word sequence are numbered according to the text box file.
[0103] In this embodiment, the generated text library file cannot contain all words. The present invention covers more than 95% of the words according to the word frequency from high to low. The larger the text library, the larger the coverage scenario, and the greater the calculation overhead. The TOP N of the generated vector is used to integrate the microservice data expression.
[0104] In this embodiment, in the data serialization operation, the original data is serialized according to certain rules. The present invention serializes the data in a manner of first index and then log.
[0105] In this embodiment, in the data weight expression operation, the corresponding weight value is generated by the data at the above moment according to the LSTM data fusion generation. Right now
[0106] In this embodiment, in the vector expression operation of generating data, after generating a single vector from the corresponding data, LSTMs-DSVDD needs to generate a vector for each microservice S i , and finally form a neural network structure E si Used to express microservice data.
[0107] like Figure 4 As shown, this embodiment uses the long short-term memory network LSTM to process time series data. The algorithm enriches the microservice data type from the source, better expresses the relationship between the multi-source heterogeneous time series data of microservices, increases the feature expression of microservice data, and improves the accuracy and scope of diagnosis. In terms of specific data processing, the dynamic weight expression between microservice data from different sources and structures is realized through the neural network LSTM model, which better reflects the dependency relationship of microservices and improves the accuracy and applicability of fault diagnosis.
[0108] In this embodiment, for data from multiple different sources and different structures, the present invention adopts a dynamic weight mechanism to learn the relationship between data, and thus constructs a learning model based on an LSTM neural network. Referring to the foregoing, the neural network LSTMs (Networks) is a recurrent neural network model suitable for processing sequence data. The LSTM neural network learning model takes into account the long-term dependency of the information sequence, models the data in the time series, and captures features that change over time. Therefore, LSTM can be used to analyze and learn the dependencies between sequences to extract potential key information, thereby improving the accuracy of anomaly detection. At the same time, in order to enable the model to learn effective features, the dimension of the hidden layer is limited during the training process, so that the output dimension is lower than the input dimension, so that the model can better capture the significant features of the training data to assist SVDD learning classification.
[0109] In this embodiment, all vectors in the LSTMs neural network graph expression are column vectors, and the time index is represented by a subscript, a i Represents the i-th vector, first define a data sequence That is, X={X1,X2,X3…X N}, for any item X i ={X i,1 ,X i,2 …X i,d},in Where d represents X i The number of columns in the dataset is assumed to be mostly normal and only a small amount of data is abnormal.
[0110] After applying the LSTM architecture to each column of data, the average LSTM output for each sequence of data can be calculated. As the weighted input of the column of data in SVDD, that is, the Mean-Pooling mechanism is used to fuse the result information of each LSTM node. In the i-th group of data sequences, the output results of each neuron node of LSTM are calculated to obtain the equal-weighted average value. As the input of the SVDD module, see the formula:
[0111]
[0112] In this embodiment, for the input data sequence For the output space of LSTM, let:
[0113] For x∈X
[0114] The feature representation of the LSTM network and the corresponding gate control weight set are:
[0115] W = {wi ,w f ,w o ,w c}.
[0116] in, Represents the output result of each sequence passing through the LSTM network.
[0117] In this embodiment, in order to prevent the collapse of the SVDD hypersphere in the subsequent training process, the weight parameter vector of the LSTM network module is set to w*w T =1, the bias vector of the network unit is 0 vector.
[0118] Step S2, Deep SVDD uses kernel function to adaptively separate normal data and abnormal data;
[0119] In this embodiment, step S2 extracts the potential spatial distribution of data based on the deep neural network LSTM learning relationship between microservice source data, and uses the output data of the neural network during the training process as input, so that the neural network is continuously updated during the training process, giving full play to the representation learning ability of the neural network;
[0120] In this embodiment, an unsupervised composite framework is proposed to locate the root cause of microservice failures under an unsupervised framework: LSTMs-DSVDD. Among them, SVDD (Support Vector Data Description) is a single-classification anomaly detection method, which identifies anomalies by constructing a hypersphere to surround normal data points. Deep SVDD (Deep Support Vector Data Description) is an optimization of traditional SVDD. It combines support vector data description (SVDD) and deep neural networks to minimize the calculation of the partitioned hypersphere of the sample feature space, which can more effectively process high-dimensional sample features and improve computing efficiency. By jointly using LSTM, deep SVDD can model data in time series, give full play to the advantages of data classification, and find the root cause of the failure.
[0121] In this embodiment, the support vector data description model is to find a hypersphere with the smallest volume that can contain normal data within the data expression range as the data separation boundary. The green data inside the hypersphere is normal data, and the data outside the hypersphere is abnormal data, where c is the center point of the hypersphere and R is the radius of the hypersphere. The model can be summarized as:
[0122]
[0123] In this embodiment, limited by ||φ(x i )-c||≤R 2 +ξ iwhere ξ i ≥0; i=1,…,l. C is the penalty parameter. The optimization formula for the corresponding dual problem is as follows:
[0124]
[0125] Restricted to 0≤α i ≤C,e T α=1,i=1,……,l, where α is the Lagrange multiplier, Q ij =φ(x i ) T ·φ(x j ).
[0126] Step S3, joint model training & fault location: Using the LSTM neural network source data as input, based on the kernel-based support data deep description SVDD, with the goal of minimizing the loss function and making the hypersphere contain as much normal data as possible, training is performed to obtain a diagnostic model;
[0127] In this embodiment, in the diagnosis phase, based on the new microservice data, the same operations as the training phase are followed to construct the data distribution of the hypersphere space of the new data, and the distribution distance between the data point and the center of the hypersphere is used to calculate the score of the data point, and the root cause of the fault is obtained by sorting.
[0128] In this embodiment, during the training process, since the LSTM neural network gating parameters and the R of the SVDD model belong to two concepts with different meanings, if a common optimization target is used for training, the soft margin LSTM-SVDD algorithm optimization may become ineffective. Therefore, in this embodiment, an alternating training method is used to optimize the LSTM network parameters and the SVDD radius R parameters. The process idea is to set a variable k; during the continuous iteration of k and N, the SVDD radius R is first fixed, and the LSTM network parameters are trained and adjusted; then the adjusted LSTM network parameters are used to train the R parameters of the SVDD hypersphere until the loss function meets the requirements and the training ends.
[0129] The LSTMs-DSVDD model in this embodiment represents the multi-source heterogeneous data of microservices as network structure data as the data feature expression of microservices. The model collects and pre-processes various source data and roughly divides them into numerical data and text data.
[0130] In this embodiment, numerical class mapping generates corresponding vector expressions. Text data is usually represented as corresponding vectors using the TF-IDF vector representation method. The purpose of the model expression is to generate network structure data from vectorized data from multiple sources. It is generally divided into source data analysis, data serialization, data weight expression and vector expression of generated data.
[0131] In this embodiment, the model first considers minimizing the volume of the hypersphere that wraps the neural network mapping result from the perspective of supporting vector data description, and the expression is as follows:
[0132]
[0133] Among them, W is the neural network parameter, φ(x i ,w) represents the mapping result of the input under the current neural network parameters, and λ is a hyperparameter used to adjust the importance of the neural network in the optimization target. The training goal is to minimize the average distance from the data to the hypersphere. That is:
[0134]
[0135] In this embodiment, in order to learn useful feature representations of the data, a jointly trained LSTM network is introduced to map the data into a hypersphere of minimum volume; based on the described data, a suitable decision function is found to determine whether the sequence data is abnormal, the abnormal data is isolated outside the hypersphere, the normal data is isolated inside the hypersphere, and the abnormal score TOP K is considered to be faulty data.
[0136] In this embodiment, for the LSTMs-DSVDD model, the goal of the model is to determine a minimum hypersphere that only contains normal data distribution. Therefore, in order to better express the potential representation of microservices, the LSTM neural network is introduced to learn the dependencies between time series data through memory neurons and extract the potential spatial data distribution of time series data. In general, the model uses kernel-based support vector data to describe SVDD, and uses the output of the LSTM network as the input of the deep SVDD model. Through the training of the deep SVDD part, the volume of the hypersphere is made as small as possible, while being able to contain all the real distributed data. For these two modules, the model jointly trains the LSTM and deep SVDD architectures and optimizes their parameters by defining a clear objective function, so that abnormal data is as far away from the hypersphere as possible, thereby diagnosing the root cause of the fault.
[0137] The model in this embodiment is adjusted to maximize the diagnostic performance by jointly training the LSTM neural network structure and the SVDD parameter model. The model assumes that the radius of the hypersphere R>0 and the center point c∈F, so the optimization target of the LSTMs-DSVDD model is as follows:
[0138]
[0139] In the above SVDD kernel function, the radius of the hypersphere is minimized to converge normal data as much as possible, while the abnormal data is diverged. In this paradigm, the training data can contain both normal samples and negative samples. The first term of the above formula represents minimizing the volume of the hypersphere; the second term is a penalty term for deviation from the normal data. For example, the second term is a penalty term for deviation from the normal data. Data that is much larger than R needs to be penalized, where the penalty parameter takes the value (0,1] and is used to balance the boundary. The third term represents the regularization of the network weights to prevent overfitting.
[0140] In this embodiment, the goal of optimizing the above formula is to enable the neural network to better learn and capture the microservice data representation, so that the data points in the space are distributed as much as possible inside the hypersphere, so that the normal data samples are closely mapped to the vicinity of the center of the hypersphere, and the abnormal data samples are isolated outside the hypersphere data. Since most of the data in the training data is normal data, the above formula can be simplified to the following formula:
[0141]
[0142] The first term of the optimization objective function is expressed using quadratic loss The distance to the center c of the sphere; the second term is a regular term to prevent overfitting. Different from the above function, the function reduces the volume of the hypersphere by jointly constraining the hypersphere R and the outliers that deviate from the normal object, while the simplified function aims to reduce the volume of the hypersphere after the LSTM neural network. The distance from the observation point to the center c of the sphere. This simplified function is based on the premise that most of the data in the objective function are normal.
[0143] In this embodiment, the SGD (Stochastic Gradient Descent) method is used to train the parameters of the objective function during the iterative process of model training. The goal of the training iteration is to determine whether to stop training and achieve the optimal model by optimizing the parameters in the objective function and the convergence of the loss function.
[0144] In this embodiment, SGD only uses one sample or a small batch of samples to calculate the gradient, which is relatively more efficient and has less memory overhead. This is very important in the training of large-scale data sets or deep neural networks, which improves the training speed of the model and increases the generalization ability of the model. At the same time, since the LSTM neural network gating parameters and the R of the SVDD model belong to two concepts with different meanings, if a common optimization target is used for training, the soft interval LSTM-SVDD algorithm optimization may lose its effect. Therefore, the present invention adopts an alternating training method to optimize the LSTM network parameters and the SVDD radius R parameters. The process idea is to set a variable k; k∈N in the continuous iteration process, first fix the SVDD radius R, train and adjust the LSTM network parameters, and then use the adjusted LSTM network parameters to train the R parameters of the SVDD hypersphere until the loss function meets the requirements and the training ends.
[0145] In this embodiment, the optimization objective formula is solved during the training process, and the slack variable is defined as Formula, see the following formula, where and The function is an approximation:
[0146]
[0147] If the objective function cannot be directly used to derive the gradient, the invented model considers using a differentiable function replace By adjusting the distribution of t, it converges to:
[0148]
[0149] Among them, t>0 is the smoothing parameter.
[0150] In this embodiment, due to Always greater than or equal to 0; and scaling to get at the same time It is monotonically decreasing with respect to t; hence
[0151] Let the loss function be L t ; As shown in the following formula; for c, R 2 ,W reaches partial or complete optimality.
[0152]
[0153] First solve the gradient of parameter c
[0154]
[0155] Calculate c according to the gradient k+1 , where k represents the number of iterations
[0156]
[0157] Similarly, we can get the radius R of the objective function. 2 and weight parameter W
[0158]
[0159]
[0160] Through iterative training of the above loss function, the model reaches convergence.
[0161] In this embodiment, based on the newly generated data of the microservice, the model follows the same steps as the training phase to generate a vector representation of the training data. Based on the trained model, for the test sample point, the anomaly score of the data point is defined as the distance from the center of the hypersphere, and the anomaly score is expressed by the following formula:
[0162]
[0163] Where c is the center of the hypersphere, R is the final radius of the learned hypersphere, and W * represents the weight parameter of the trained neural network. In this embodiment, if the observation point x i If the abnormal score value is greater than 0, the point is considered to be an abnormal point, otherwise it is a normal point.
[0164] In this embodiment, the overall anomaly score is obtained by weighted summation of the indicator anomaly labels. This chapter defines the anomaly score as the distance that the actual observation value deviates from the hypersphere. Through top K sorting, the data points that may have anomalies can be obtained and are considered to be the root causes of the fault.
[0165] Example 2
[0166] In this embodiment, referring to the experimental results presented in the table below, the diagnostic ability of LSTMs-DSVDD is superior to all baseline methods compared with the present invention. For example, in terms of F1 value, the effect of LSTMs-DSVDD on all comparison methods is 3.85% and 7.89% higher than that of the comparison methods on the T dataset, 13.1% and 18.48% higher on the H dataset, and 10% and 15% higher on the X dataset.
[0167] Table LSTMs-DSVDD detection effect comparison with baseline methods on different data sets
[0168]
[0169] In summary, the present invention first expresses the multi-source heterogeneous data of microservices into an LSTMs neural network model, and then uses deep SVDD hypersphere joint training and learning based on the neural network expression to achieve fault root cause location. The metadata analysis LSTMs-DSVDD model in the present invention adopts a composite model structure of LSTM neural network and deep SVDD. First, the multi-source heterogeneous data of microservices is expressed as LSTMs neural network structure data. By analyzing the interactions and dependencies between microservice components over time, it helps to more accurately understand the dynamic behaviors between microservice components and improve the accuracy of fault diagnosis.
[0170] Since LSTM itself performs well in time series data processing, in order to improve positioning accuracy, the present invention integrates the high-dimensional data computing and classification capabilities of deep SVDD for joint training. The algorithm first constructs the multi-source and heterogeneous data of microservices into complex network structure data, and uses the LSTM neural network to express the dynamic and complex associations between microservice components. Then, based on the neural network structure, deep SVDD is used to effectively calculate sample features and mine complex associations to find the root cause of the fault, making the root cause of the fault more accurate and rapid.
[0171] The present invention uses deep SVDD to mine the association relationship model to quickly locate the specific microservice component where the fault occurs, rather than just identifying the existence of anomalies. This is a huge convenience for fault diagnosis research, and the fault can be responded to and resolved quickly based on the positioning results.
[0172] In view of the problem that LSTM itself is affected by the network structure and is limited to learning the time correlation of time series and ignoring the relationship between different component sequences, the present invention proposes a dynamic weight expression of LSTMs multi-source data to express the component correlation. The output sequence can not only learn the time series characteristics of a single component, but also learn the correlation between multiple components.
[0173] The present invention solves the technical problems existing in the prior art of poor fault diagnosis accuracy, long fault location response time and insufficient consideration of the correlation between multi-components.
[0174] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for locating the root cause of a microservice failure, characterized in that: The method comprises: S1. Obtain multi-source heterogeneous data of different components in the microservice, and based on the LSTMs neural network, perform microservice dynamic association modeling according to the multi-source heterogeneous data to obtain an LSTMs neural network representation; wherein the operation of the microservice dynamic association modeling includes: source data analysis, data serialization, data weight expression, and generation of data vector expression; in the process of the source data analysis, use the source data analysis LSTMs-DSVDD model to analyze the multi-source heterogeneous data through data parsing, normalization operations, and vectorization operations; combine to obtain a microservice data expression vector; serialize the multi-source heterogeneous data, and use the LSTM neural network to generate weight expression to form a neural network structure; S2. Based on the LSTMs neural network, learn the association between microservice source data to extract the potential spatial distribution of data, and use the output data of the LSTMs neural network in the training process as the input of the next round of training to update the LSTMs neural network and adaptively separate normal data and abnormal data; wherein, a single-classification anomaly detection method is performed based on the kernel-based support vector data description model SVDD to construct a hypersphere to surround the corresponding points of the normal data and identify the corresponding points of the abnormal data; the kernel-based support vector data description model SVDD is used to minimize the calculation of the division hypersphere of the sample feature space to process high-dimensional sample features; the LSTMs neural network and the kernel-based support vector data description model SVDD are used together to perform modeling operations on the multi-source heterogeneous data in the preset time series for diagnosing the root cause information of the fault; S3. Joint model training & fault location: Using the source data of the LSTMs neural network as input, based on the kernel-based support vector data description model SVDD, the minimum volume hypersphere containing normal data is made to approximate the state including all normal data, so as to train a fault root cause diagnosis model; based on the new microservice data, the hyperspherical space data distribution of the new microservice data is constructed, and in order to learn the useful feature representation of the data, the LSTMs-DSVDD model is used to map the data into the minimum volume hypersphere containing normal data, and the feature representation data is obtained to process and obtain the applicable decision function, and determine the normal data and the abnormal data; the data point score is calculated using the distribution distance between the data point and the center of the hypersphere, so as to sort and obtain the fault root cause.
2. A method for locating the root cause of a microservice failure according to claim 1, characterized in that: The metadata analysis in S1 includes: S11. Analyze and obtain different field values of the multi-source heterogeneous data using the ELK tool; S12, performing vectorization operation on the multi-source heterogeneous data to obtain numerical data, setting the maximum value and the minimum value of each numerical value in turn to perform data scaling modeling, and obtaining the microservice data expression vectors of different data values in turn; S13, performing vectorization operation on the text data in the multi-source heterogeneous data, counting the word frequency in the text data, and generating a text library file to number the words in the sentence word sequence; S14, in the vectorization operation, the multi-source heterogeneous data is used to generate a single microservice data expression vector, and the metadata is used to analyze the LSTMs-DSVDD model for each microservice S i , forming the neural network structure E si , expressing the multi-source heterogeneous data of the microservice.
3. A method for locating the root cause of a microservice failure according to claim 2, characterized in that: The S14 further includes: S141. Using the LSTMs neural network graph of the LSTMs neural network, all the microservice data expression vectors are expressed, wherein a subscript is set to represent a time index, a i Represents the i-th vector, and defines the data sequence using the following logic: For any item X i ={X i,1 ,X i,2 …X i,d },in Where d represents X i The number of columns in . S142, applying the architecture of the LSTMs neural network diagram to each column of the data sequence, and obtaining the average LSTM output of each data sequence As the weight input of the current column data of SVDD.
4. A method for locating the root cause of a microservice failure according to claim 3, characterized in that: In S142, the Mean-Pooling mechanism is used to fuse the result information of each neuron node in the LSTMs neural network graph; In the data sequence of the i-th group, the output result of each neuron node of the LSTMs neural network diagram is calculated using the following logic to obtain the equally weighted average value: As the input of SVDD module: For the input data sequence For the output space of LSTM, let: For x∈X After the feature representation of the LSTMs neural network, the corresponding gate control weight set is expressed using the following logic: In={in i ,In f ,In o ,In c } In the formula, Represents the output result of each sequence after the LSTM network, and sets the weight parameter vector of the LSTMs neural network: w*w T =1, the bias vector of the network unit is 0 vector.
5. A method for locating the root cause of a microservice failure according to claim 1, characterized in that: The S2 includes: S21, using the kernel-based support vector data description model SVDD, within the preset data expression range, find a hypersphere with the minimum volume containing normal data as a data separation boundary; let c be the center point of the hypersphere with the minimum volume containing normal data, and R be the radius of the hypersphere, so as to summarize the kernel-based support vector data description model SVDD using the following logic: The kernel-based support vector data description model SVDD satisfies: ||φ(x i )-c||≤R 2 +ξ i , where ξ i ≥0; i=1,…,l. C is the penalty parameter. S22. Use the following logic to perform the corresponding dual problem optimization operation: Among them, the above formula satisfies: 0≤α i ≤C,e T α=1,i=1,……,l, where α is the Lagrange multiplier, Q ij =φ(x i ) T ·φ(x j ).
6. A method for locating the root cause of a microservice failure according to claim 1, characterized in that: The step S3 comprises: S31, using an alternating training method to tune the network parameters of the LSTMs neural network and the radius R parameter of the kernel-based support vector data description model SVDD; S32. Generate a training data vector expression based on the newly generated data of the microservice. Based on the fault root cause diagnosis model, define the abnormal score of the data point as the distance from the center of the hypersphere for the test sample point. The abnormal score is expressed by the following logic: Where c is the center of the hypersphere, R is the final radius of the learned hypersphere, and W * represents the weight parameter of the trained neural network. In this embodiment, if the observation point x i If the abnormal score value is greater than 0, the point is considered to be an abnormal point, otherwise it is a normal point.
7. A method for locating the root cause of a microservice failure according to claim 6, characterized in that: The S31 includes: S311, based on the kernel-based support vector data description model SVDD, using the following logic, minimize the volume of the hypersphere enclosing the neural network mapping result: Where W is the neural network parameter, φ(x i ,w) represents the mapping result of the input under the current neural network parameters, and λ is a hyperparameter; S312. Through training, the following logic is used to minimize the average distance between the data points and the center of the hypersphere: S313. Using the LSTMs-DSVDD model, assuming that the radius of the hypersphere R>0 of the hypersphere containing the minimum volume of normal data, and the center point c∈F, the optimization goal of the LSTMs-DSVDD model is expressed using the logic of the following SVDD kernel function: In the formula, min R,W R 2 represents minimizing the volume of the hypersphere; represents the deviation penalty for outlier data, Represents network weight regularization to prevent overfitting. S314. According to the SVDD kernel function, simplify and obtain the optimization objective function: In the formula, To use quadratic loss representation The distance to the center of the sphere c; is a regular term, decomposing the optimization objective function and narrowing the number of cells passing through the LSTMs neural network. The distance from the observation point to the center c of the sphere, in the iterative process of training the LSTMs-DSVDD model, the stochastic gradient descent method SGD is used to perform parameter training on the optimization objective function, so as to control the training operation according to the convergence of the parameter loss function in the optimization objective function, and obtain the fault root cause diagnosis model; S315. Set the variable k; k∈N. During the iteration process, fix the radius R parameter of the support vector data description model SVDD, train and adjust the network parameters of the LSTMs neural network to obtain applicable LSTM network parameters; use the applicable LSTM network parameters to train the radius R parameter of the support vector data description model SVDD until the loss function meets the preset requirements, and end the iteration process.
8. A method for locating the root cause of a microservice failure according to claim 7, characterized in that: In S315, during the iteration process, the optimization objective formula is solved, wherein the slack variable is defined as: formula: In the formula, The function is an approximate function.
9. A method for locating the root cause of a microservice failure according to claim 1, characterized in that: In S315, a differentiable function is used Instead of the approximate function Adjust the distribution of the smoothing parameter t to achieve convergence: In the formula, t>0. Through the scaling operation, we get: at the same time Regarding the monotonically decreasing smoothing parameter t, the following formula is derived: Let the loss function be L t : To tune the radius R parameter and weight parameter of the support vector data description model SVDD: c, R 2 ,W; Among them, the following logic is used to solve the gradient of parameter c: According to the following logic, c is calculated according to the gradient k+1 : In the formula, k represents the number of iterations. The radius R of the objective function is obtained by using the following logic: 2 , the weight parameter W: Through the aforementioned loss function iterative training operation, the model convergence operation is completed to obtain the fault root cause diagnosis model.
10. A microservice fault root cause location system, characterized in that: The system comprises: The LSTMs neural network representation module is used to obtain multi-source heterogeneous data of different components in the microservice, and based on the LSTMs neural network, the microservice dynamic association relationship modeling is performed according to the multi-source heterogeneous data to obtain the LSTMs neural network representation; wherein, the operation of the microservice dynamic association relationship modeling includes: source data analysis, data serialization, data weight expression and generation of data vector expression; in the process of the source data analysis, the source data analysis LSTMs-DSVDD model is used to analyze the multi-source heterogeneous data through data parsing, normalization operation and vectorization operation; the microservice data expression vector is obtained by combination; the multi-source heterogeneous data is serialized and processed, and the weight expression is generated by fusion of the LSTM neural network to form a neural network structure; A normal data and abnormal data separation module is used to learn the correlation between microservice source data based on the LSTMs neural network to extract the potential spatial distribution of data, and use the output data of the LSTMs neural network in the training process as the input of the next round of training to update the LSTMs neural network and adaptively separate normal data and abnormal data; wherein, a single-classification anomaly detection method is performed based on the kernel-based support vector data description model SVDD to construct a hypersphere to surround the corresponding points of the normal data and identify the corresponding points of the abnormal data; the kernel-based support vector data description model SVDD is used to minimize the calculation of the division hypersphere of the sample feature space to process high-dimensional sample features; the LSTMs neural network and the kernel-based support vector data description model SVDD are jointly used to model the multi-source heterogeneous data in the preset time series for diagnosing the root cause information of the fault, and the normal data and abnormal data separation module is connected to the LSTMs neural network representation module; The joint model training and fault location module is used to take the source data of the LSTMs neural network as input, and based on the kernel-based support vector data description model SVDD, make the minimum volume hypersphere containing normal data approximate the state including all normal data, so as to train and obtain a fault root cause diagnosis model; based on the new microservice data, construct the hyperspherical space data distribution of the new microservice data, and in order to learn the useful characteristic representation of the data, use the LSTMs-DSVDD model to map the data into the minimum volume hypersphere containing normal data, obtain the characteristic representation data, and process it to obtain the applicable decision function, and determine the normal data and the abnormal data; use the distribution distance between the data point and the center of the hypersphere to calculate the data point score, so as to sort and obtain the fault root cause, and the joint model training and fault location module is connected to the normal data and abnormal data separation module.
Citation Information
Patent Citations
Abnormal root cause obtaining method and system based on index data and log data
CN117149500A
Micro-service fault prediction system based on deep learning
CN117743787A
