Micro-service fault identification method based on deep learning

By applying deep learning technology in microservice systems, combining semi-supervised learning and domain adaptive methods, training a combined model of CNN and RNN, solving the problems of fault detection and diagnosis in microservice environments, and achieving efficient and intelligent fault identification and processing.

CN119577505APending Publication Date: 2025-03-07STATE GRID ANHUI ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411445154.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-16
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In complex microservice environments, traditional fault detection and processing methods are difficult to accurately and promptly detect and diagnose faults. As the system scale increases, manual fault detection is time-consuming and labor-intensive, and misjudgment or misjudgment is prone to occur.

Method used

The microservice fault identification method based on deep learning is adopted, and the historical fault data of the microservice system is analyzed and modeled, and text preprocessing and feature extraction is used using Word2Vec. Combined with semi-supervised learning and domain adaptive methods, a combined model of convolutional neural network (CNN) and recurrent neural network (RNN) is trained to realize the automated identification, diagnosis and prediction of microservice faults.

Benefits of technology

It significantly improves the efficiency of microservice systems in fault detection and diagnosis, can identify complex fault patterns and predict potential fault types, shorten troubleshooting time, and improve system stability and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577505A_ABST
    Figure CN119577505A_ABST
Patent Text Reader

Abstract

The invention discloses a micro-service fault recognition method based on deep learning, and relates to the technical field of micro-services, training data related to micro-service fault recognition are collected, the training data comprise labeled samples, the collected data are preprocessed, the preprocessing mode is text cleaning, and the training data are stored in a database; comprising the steps that irrelevant characters, punctuation marks and stop words are removed, a preprocessed text is converted into a model acceptable feature representation form, and Word2Vec is selected as a word embedding model and used for capturing the semantic relation between words. According to the micro-service fault identification method based on deep learning, the fault detection and diagnosis efficiency of the micro-service system can be effectively improved. Through deep learning of historical fault data, the system can identify complex and potential fault modes and predict possible fault types, so that system managers are helped to quickly position fault root causes, and troubleshooting time is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microservice technology, and in particular to a microservice fault identification method based on deep learning. Background Art

[0002] With the rapid development of cloud computing and distributed systems, microservice architecture has gradually become the mainstream of modern software system design. Microservices decompose a single application into multiple independent small services, each of which can be independently deployed, upgraded and expanded, thereby improving the flexibility and scalability of the system. However, with the widespread application of microservices, their complexity has also increased. There are a large number of interdependencies between microservices, which makes the system prone to various failures during operation, such as service timeouts, network delays, resource bottlenecks, etc. These failures are often hidden and complex, which brings great challenges to fault location and handling.

[0003] Traditional fault detection and processing methods mainly rely on predefined rules or monitoring thresholds, but it is difficult to accurately and timely detect and diagnose faults in complex microservice environments. In addition, as the scale of the system increases, manual troubleshooting is not only time-consuming and laborious, but also prone to misjudgment or missed judgments. Therefore, how to achieve efficient and intelligent fault identification and processing in a complex microservice environment has become an important research topic in the current technology field.

[0004] In recent years, deep learning technology has made significant progress in natural language processing, image recognition and other fields. It performs well in processing large-scale data and capturing complex patterns. Therefore, applying deep learning to microservice fault identification and utilizing its powerful feature learning capabilities can effectively improve the accuracy and real-time performance of fault detection. This intelligent fault identification method can automatically learn from historical data, continuously optimize the model, and adapt to changes in the system environment, so as to better cope with faults in complex and changeable microservice systems.

[0005] This patent proposes a microservice fault identification method based on deep learning. By analyzing and modeling the historical fault data of the microservice system, it can automatically identify, diagnose and predict potential faults in the system, effectively improving the stability and reliability of the system. Summary of the invention

[0006] The purpose of the present invention is to provide a microservice fault identification method based on deep learning to solve the problems raised in the above background technology.

[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: The microservice fault identification method based on deep learning includes the following steps: Step 1: Collect training data related to the microservice fault identification task. The training data includes labeled samples to obtain diverse and representative data to improve the generalization ability of the model. Step 2: Preprocess the collected data by text cleaning, including removing irrelevant characters, punctuation marks, and stop words; Step 3: Convert the preprocessed text into a feature representation acceptable to the model, and select Word2Vec as the word embedding model to capture the semantic relationship between words; Step 4: Use semi-supervised learning technology to train the model using a small amount of existing labeled data and a large amount of unlabeled data to improve the generalization ability of the model; Step 5: Use domain adaptation methods to improve the generalization ability of microservice fault identification tasks in different domains; Step 6: Select a deep learning model suitable for the microservice identification task, use the converted features to train the deep learning model, and perform the microservice fault identification task. The model is any one of the convolutional neural network (CNN) and the recurrent neural network (RNN) or a combination of the two. According to the requirements of the task, select a single model or combine multiple models to build. Use the test set to evaluate the trained model and optimize and improve the model based on the evaluation results. The evaluation indicators include accuracy, recall rate, and F1 value to evaluate the performance of the model in the microservice fault identification task; Step 7: Deploy the trained model to actual applications through API interfaces, Web services or embedded systems.

[0008] A further improvement of the technical solution of the present invention is that: the implementation process of step 1 is: The collected fault data is labeled for training deep learning models. The labeling method depends on the task requirements and can be one or more of binary classification, multi-classification or entity recognition.

[0009] A further improvement of the technical solution of the present invention is that the implementation process of step three is: Prepare a pre-trained Word2Vec model, download a pre-trained Word2Vec model, use the Google News Word2Vec model, or use an open source library (Gensim) to train the required Word2Vec model. The model is trained on a large corpus and represents words as vectors. Load the pre-trained Word2Vec model and use the corresponding library to load the pre-trained Word2Vec model; Convert the text into word embedding representation. For each text sample, replace the words with the corresponding word embedding vector. Since the length of each text sample may be different, in order to maintain the consistency of the input, a sequence padding operation is performed to set a fixed sequence length and pad or truncate in shorter texts. The numpy library is used to convert the word embedding representation into an array representation for input into the model.

[0010] A further improvement of the technical solution of the present invention is that the application process of step 4 is: The self-training algorithm in semi-supervised learning technology is used to train the model using a small amount of labeled data and a large amount of unlabeled data to improve the performance of the model; Use labeled data for initial model training; Use the trained model to predict unlabeled data and select prediction samples with high confidence; Add the selected prediction samples with high confidence to the labeled data set; The model is retrained using the expanded labeled dataset and the training steps are repeated until the model converges or the preset number of iterations is reached.

[0011] A further improvement of the technical solution of the present invention is that the implementation process of step 5 is: Using the domain adversarial neural network (DANN) in the domain adaptation method, the existing domain knowledge is transferred to the target domain to improve the generalization ability of the model; Use the pre-trained model to train on the source domain and extract shared features; Add a domain classifier to the model to distinguish the features of the source domain and the target domain; Introducing a domain-adversarial loss function makes the features generated by the model indistinguishable from the domain classifier, thus forcing feature learning to be domain-independent. By optimizing the overall loss function, the model is trained so that the performance in both the source domain and the target domain is optimized.

[0012] A further improvement of the technical solution of the present invention is that the implementation process of step six is: Use a combination of a CNN layer and an RNN layer to prepare annotated official document datasets, pair text samples with corresponding job identification labels, and preprocess the text. The preprocessing methods include word segmentation, stop word removal, and stemming. Convert the preprocessed text into a feature representation form acceptable to the model, which is a word embedding representation; Build the model using Keras; Use the prepared training set to train the model. After the training is completed, use the validation set to evaluate the model and calculate the accuracy, precision, and recall indicators. Use the trained model to make predictions on the test set or on new unlabeled data.

[0013] A further improvement of the technical solution of the present invention is that the implementation process of step seven is as follows: Save the trained model in HDF5 model format; Load saved models in deployed applications for prediction and inference; Before making predictions, the input data is preprocessed in the same way as when the model is trained, including tokenization, segmentation, and vectorization text processing steps to convert the input data into a form that the model can understand; Perform feature engineering (text dimension reduction or key feature selection) on the preprocessed data according to specific tasks and requirements; Use the loaded model to perform inference on the preprocessed data; Interpret the model results and take appropriate action based on the needs of the specific application.

[0014] Due to the adoption of the above technical solution, the present invention has the following technical advances compared with the prior art: 1. The present invention adopts a microservice fault identification method using deep learning technology, which can significantly improve the efficiency of microservice systems in fault detection and diagnosis. By analyzing historical fault data, the deep learning model can identify complex fault patterns and predict potential fault types. This enables system administrators to quickly identify the source of faults and effectively shorten the time for troubleshooting.

[0015] 2. The present invention provides a microservice fault identification method based on deep learning. Through semi-supervised learning technology, a small amount of existing labeled data and a large amount of unlabeled data are used to train the model, thereby improving the generalization ability of the model. The combination of CNN and RNN is used to capture more semantic and contextual information in the text. The domain adaptation method is adopted to further improve the performance in specific fields, thereby improving the performance and robustness of the model as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0017] Figure 1 The present invention is a flowchart for constructing and implementing the deep learning-based microservice fault identification method. DETAILED DESCRIPTION

[0018] 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 conjunction with the drawings in 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.

[0019] Embodiment 1, as Figure 1 As shown, the present invention provides a microservice fault identification method based on deep learning, comprising the following steps: Step 1: Collect training data related to the microservice fault identification task. The training data includes labeled samples to obtain diverse and representative data to improve the generalization ability of the model. Step 2: Preprocess the collected data by text cleaning, including removing irrelevant characters, punctuation marks, and stop words; Step 3: Convert the preprocessed text into a feature representation acceptable to the model, and select Word2Vec as the word embedding model to capture the semantic relationship between words; Step 4: Use semi-supervised learning technology to train the model using a small amount of existing labeled data and a large amount of unlabeled data to improve the generalization ability of the model; Step 5: Use domain adaptation methods to improve the generalization ability of microservice fault identification tasks in different domains; Step 6: Select a deep learning model suitable for the microservice fault identification task, use the converted features to train the deep learning model, and perform the microservice fault identification task. The model is any one of the convolutional neural network (CNN) and the recurrent neural network (RNN) or a combination of the two. According to the requirements of the task, select a single model or combine multiple models to build. Use the test set to evaluate the trained model and optimize and improve the model based on the evaluation results. The evaluation indicators include accuracy, recall rate, and F1 value to evaluate the performance of the model in the microservice fault identification task; Step 7: Deploy the trained model to actual applications.

[0020] Embodiment 2, as Figure 1 As shown, based on Example 1, the present invention provides a technical solution: Preferably, the implementation process of step 1 is: Label the collected data for training deep learning models. The labeling method depends on the task requirements and can be one or more of binary classification, multi-classification, or entity recognition. The implementation process of step three is: Prepare a pre-trained Word2Vec model, download a pre-trained Word2Vec model, use the Google News Word2Vec model, or use an open source library (Gensim) to train the required Word2Vec model. The model is trained on a large corpus and represents words as vectors. Load the pre-trained Word2Vec model. Use the corresponding library to load the pre-trained Word2Vec model. The example of using the Gensim library to load the Google News Word2Vec model is as follows: from gensim.models import KeyedVectors # Load the pre-trained Word2Vec model word2vec_model = KeyedVectors.load_word2vec_format('path_to_model.bin', binary=True); Convert the text into word embedding representation. For each text sample, replace the words with the corresponding word embedding vector, which can be achieved through the following example: def text_to_embedding(text): embedding=[] for word in text: #Determine whether the word is in the vocabulary of the word embedding model if word in word2vec_model.vocab: #Get the word embedding vector of the word word_embedding=word2vec_model[word] embedding.append(word_embedding) return embedding In the above examples, text represents the preprocessed text, word2vec_model.vocab can get the vocabulary of the word embedding model, and word2vec_model[word] gets the word embedding vector of the word; Since the length of each text sample may be different, in order to maintain the consistency of the input, a sequence padding operation is performed to set a fixed sequence length and pad or truncate in shorter texts. The word embedding representation is converted into an array representation using the numpy library for input into the model. The specific implementation example is as follows: import numpy as np def pad_sequences(embeddings,max_length): padded_embeddings=np.zeros((max_length,embedding_size)) for i,embedding in enumerate(embeddings[:max_length]): padded_embeddings[i]=embedding return padded_embeddings In the above example, embeddings is the transformed word embedding representation, max_length is the maximum sequence length set, and embedding_size indicates the dimension of a single word embedding vector.

[0021] Embodiment 3, as Figure 1 As shown, based on Example 1-2, the present invention provides a technical solution: Preferably, the application process of step 4 is, The self-training algorithm in semi-supervised learning technology is used to train the model using a small amount of labeled data and a large amount of unlabeled data to improve the performance of the model; Use labeled data for initial model training; Use the trained model to predict unlabeled data and select prediction samples with high confidence; Add the selected prediction samples with high confidence to the labeled data set; Retrain the model using the expanded labeled dataset and repeat the training steps until the model converges or reaches the preset number of iterations. The specific example steps are as follows: A1. Collect a small amount of labeled data, which includes resumes and corresponding job descriptions. The labeled data includes the suitable positions for each resume. Collect a large amount of unlabeled data. The data does not need to be associated with the job description. A2. Use a small amount of labeled data to train an initial model, which is a text classification model. A3. Use the initial model to predict a large amount of unlabeled data and generate prediction results for each unlabeled sample. A4. According to the confidence criteria in the prediction results, select a portion of unlabeled samples with higher confidence as pseudo-label data; A5. Merge pseudo-labeled data with a small amount of annotated data to form an expanded semi-supervised dataset. A6. Retrain the model using an augmented semi-supervised dataset, where the pseudo-labeled data is treated as formal labels for training; A7. Perform multiple iterations to gradually improve the performance of the model. A8. Use the trained model to predict new resumes and determine the most suitable positions; The implementation process of step five is: Using the domain adversarial neural network (DANN) in the domain adaptation method, the existing domain knowledge is transferred to the target domain to improve the generalization ability of the model; Use the pre-trained model to train on the source domain and extract shared features; Add a domain classifier to the model to distinguish the features of the source domain and the target domain; Introducing a domain-adversarial loss function makes the features generated by the model indistinguishable from the domain classifier, thus forcing feature learning to be domain-independent. By optimizing the overall loss function, the training model optimizes the performance in both the source and target domains. The specific example steps are as follows: B1. Models that are pre-trained on large-scale data in the target domain using domain-specific pre-trained models; B2. Use domain-specific corpora or datasets to perform unsupervised or semi-supervised learning on the target domain to learn domain-specific representations; B3. Use autoencoders, language models, or adversarial generative network methods during pre-training; B4. In the specific microservice fault identification task, pre-training is performed on the official document data in the target field; B5. In the fine-tuning stage, use labeled data in the target domain to further train and adjust the model.

[0022] Embodiment 4, as Figure 1 As shown, based on embodiments 1-3, the present invention provides a technical solution: preferably, the implementation process of step six is: Use a combination of a CNN layer and an RNN layer to prepare annotated official document datasets, pair text samples with corresponding job identification labels, and preprocess the text. The preprocessing methods include word segmentation, stop word removal, and stemming. Convert the preprocessed text into a feature representation form acceptable to the model, which is a word embedding representation; Use Keras to build a model. The following is an example of its model structure: from keras.models import Sequential from keras.layers import Embedding,Conv1D,MaxPooling1D,LSTM, Dense embedding_size=100 max_length=100 model=Sequential() model.add(Embedding(vocabulary_size,embedding_size,input_length=max_length)) model.add(Conv1D(filters=64,kernel_size=3,activation='relu')) model.add(MaxPooling1D(pool_size=2)) model.add(LSTM(100)) model.add(Dense(1,activation='sigmoid')) model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['accuracy']) In the above example, we first add an Embedding layer to input the word embedding representation into the model, then use a convolutional layer (Conv1D) and a pooling layer (MaxPooling1D) to extract features, and then use a recurrent neural network layer (LSTM) to capture contextual information in the text sequence. Finally, we add a fully connected layer (Dense) as the output layer and use the sigmoid activation function for binary classification prediction. Use the prepared training set to train the model. After the training is completed, use the validation set to evaluate the model and calculate the accuracy, precision, and recall indicators. The training and evaluation examples are as follows: model.fit(X_train,y_train,validation_data=(X_val,y_val),epochs=10,batch_size=32) Among them, X_train and y_train are the features and labels of the training set, and X_val and y_val are the features and labels of the validation set; Use the trained model to predict the test set or new unlabeled data. The prediction model instance is as follows: predictions = model.predict(X_test); The implementation process of step seven is: Save the trained model in HDF5 model format; Load saved models in deployed applications for prediction and inference; Before making predictions, the input data is preprocessed in the same way as when the model is trained, including tokenization, segmentation, and vectorization text processing steps to convert the input data into a form that the model can understand; Perform feature engineering (text dimension reduction or key feature selection) on the preprocessed data according to specific tasks and requirements; Use the loaded model to perform inference on the preprocessed data; Interpret the model results and take appropriate action based on the needs of the specific application.

[0023] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A microservice fault identification method based on deep learning, characterized by: The following steps are involved: Step 1: Collect training data related to microservice fault identification. The training data includes labeled samples. Step 2: Preprocess the collected data by text cleaning, including removing irrelevant characters, punctuation marks, and stop words; Step 3: Convert the preprocessed text into a feature representation acceptable to the model, and select Word2Vec as the word embedding model to capture the semantic relationship between words; Step 4: Use semi-supervised learning technology to train the model using a small amount of existing labeled data and a large amount of unlabeled data; Step 5: Use domain adaptation methods to improve the generalization ability of microservice fault identification in different domains; Step 6: Select a deep learning model suitable for microservice fault identification, use the converted features to train the deep learning model, and perform the microservice fault identification task. The model is any one of the convolutional neural network (CNN) and the recurrent neural network (RNN) or a combination of the two. According to the requirements of the task, select a single model or combine multiple models to build. Use the test set to evaluate the trained model and optimize and improve the model based on the evaluation results. The evaluation indicators include accuracy, recall rate, and F1 value to evaluate the performance of the model in the microservice fault identification task; Step 7: Deploy the trained model to actual applications.

2. The microservice fault identification method based on deep learning according to claim 1 is characterized in that: The implementation process of step 1 is as follows: The collected microservice fault data is labeled for training deep learning models. The labeling method depends on the task requirements and can be one or more of binary classification, multi-classification, or entity recognition.

3. The microservice fault identification method based on deep learning according to claim 1 is characterized in that: The implementation process of step three is as follows: Prepare a pre-trained Word2Vec model, download a pre-trained Word2Vec model, use the Google News Word2Vec model, or use an open source library (Gensim) to train the required Word2Vec model. The model is trained on a large corpus and represents words as vectors. Load the pre-trained Word2Vec model and use the corresponding library to load the pre-trained Word2Vec model; Convert the text into word embedding representation. For each text sample, replace the words with the corresponding word embedding vector. Since the length of each text sample may be different, in order to maintain the consistency of the input, a sequence padding operation is performed to set a fixed sequence length and pad or truncate in shorter texts. The numpy library is used to convert the word embedding representation into an array representation for input into the model.

4. The microservice fault identification method based on deep learning according to claim 1 is characterized in that: The application process of step 4 is: The self-training algorithm in semi-supervised learning technology is used to train the model using a small amount of labeled data and a large amount of unlabeled data; Use labeled data for initial model training; Use the trained model to predict unlabeled data and select prediction samples with high confidence; Add the selected prediction samples with high confidence to the labeled data set; The model is retrained using the expanded labeled dataset and the training steps are repeated until the model converges or the preset number of iterations is reached.

5. The microservice fault identification method based on deep learning according to claim 1, characterized in that: The implementation process of step five is as follows: Use the domain adversarial neural network (DANN) in the domain adaptation method to transfer existing domain knowledge to the target domain; Use the pre-trained model to train on the source domain and extract shared features; Add a domain classifier to the model to distinguish the features of the source domain and the target domain; Introducing a domain-adversarial loss function makes the features generated by the model indistinguishable from the domain classifier, thus forcing feature learning to be domain-independent. By optimizing the overall loss function, the model is trained so that the performance in both the source domain and the target domain is optimized.

6. The microservice fault identification method based on deep learning according to claim 1, characterized in that: The implementation process of step six is ​​as follows: Use a combination of a CNN layer and an RNN layer to prepare annotated fault datasets, pair microservice samples with corresponding fault identification labels, and preprocess the text. The preprocessing methods include word segmentation, stop word removal, and stemming. Convert the preprocessed data into a feature representation form acceptable to the model, which is a word embedding representation; Build the model using Keras; Use the prepared training set to train the model. After the training is completed, use the validation set to evaluate the model and calculate the accuracy, precision, and recall indicators. Use the trained model to make predictions on the test set or on new unlabeled data.

7. The microservice fault identification method based on deep learning according to claim 1 is characterized in that: The implementation process of step seven is as follows: Save the trained model in HDF5 model format; Load the saved model in the deployed application; Before making predictions, the input data is preprocessed in the same way as when the model is trained, including tokenization, segmentation, and vectorization text processing steps to convert the input data into a form that the model can understand; Perform feature engineering (text dimension reduction or key feature selection) on the preprocessed data according to specific tasks and requirements; Use the loaded model to perform inference on the preprocessed data; Interpret the model results and take appropriate action based on the needs of the specific application.