Disaster recovery fault diagnosis and identification method

Extracting error logs through artificial intelligence technology and using machine learning algorithms to identify disaster recovery faults solves the problems of low efficiency and errors caused by manual operations in the existing technology, and achieves more efficient disaster recovery fault diagnosis.

CN118550748AInactive Publication Date: 2024-08-27HANGZHOU QIZHI TECH CO LTD

Patent Information

Application Number
CN202410597254.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, disaster recovery fault diagnosis relies on manual operations, resulting in time waste and human error, low efficiency and high uncertainty.

Method used

Artificial intelligence methods are used to identify disaster recovery faults by extracting keywords from error logs, combined with historical data and machine learning algorithms (such as random forest, xgboost, and Bayesian classification), and build and adjust parameter models to improve diagnosis accuracy.

Benefits of technology

It achieves more convenient and accurate fault diagnosis, significantly saves labor costs and time costs, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550748A
    Figure CN118550748A
Patent Text Reader

Abstract

The invention discloses a disaster recovery fault diagnosis and identification method. The method comprises the following steps: S1, extracting an error log; step S2, acquiring data; s3, cleaning the data; s4, constructing different models; s5, evaluating different models to obtain an optimal model; and S6, after parameter adjustment is carried out on the optimal model, data needing to be predicted are transmitted into the parameter-adjusted optimal model, and a classification prediction result is output. According to the method, judgment can be carried out more conveniently and more accurately, the labor cost and the time cost are greatly saved, batch calculation can be carried out, and the labor cost and the time cost are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a fault identification method, and in particular to a disaster recovery fault diagnosis and identification method. Background Art

[0002] In the prior art, the staff mainly handles the problem based on their past experience. First, the staff checks the log information through the background, extracts the error ERROR information in the log according to the content in the log, and then determines the error type based on the information extracted from the ERROR. For example, a network failure occurs in redis, the kafka connection times out, etc. Then, based on the comparison between the fault type and the processing method, the background selects the processing method, which includes repair, switch, and no processing.

[0003] Since most of the work processes in this method require manual operation and judgment, there are problems such as wasting human time and human errors. In addition, there are many uncertain factors in human operation, so the work efficiency and judgment accuracy are extremely low. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method for disaster recovery fault diagnosis and identification.

[0005] In order to achieve the above object, the present invention is achieved through the following technical solutions:

[0006] A method for diagnosing and identifying disaster recovery faults comprises the following steps:

[0007] Step S1, extracting error log;

[0008] Step S2, obtaining data;

[0009] Step S3, cleaning data;

[0010] Step S4, constructing different models;

[0011] Step S5, evaluating different models to obtain the optimal model;

[0012] Step S6: After adjusting the parameters of the optimal model, the data to be predicted is passed into the optimal model after parameter adjustment, and the classification prediction result is output.

[0013] Preferably, extracting the error log refers to using keywords to extract the text field after ERROR in the text, and then judging the error type and component type of each error log according to the error category and text similarity in the historical data.

[0014] Preferably, the data acquisition refers to providing corresponding data according to demand, and the corresponding data includes cup occupancy, duration, memory occupancy, duration, and whether log failure occurs in each component.

[0015] Preferably, cleaning the data refers to encoding the data into numerical type data.

[0016] Preferably, constructing different models means constructing numerical data through a random forest algorithm model, an xgboost classification algorithm model, and a Bayesian classification algorithm model.

[0017] Preferably, the steps for evaluating different models are as follows:

[0018] Step a1: Make confusion matrices for the random forest algorithm model, the xgboost classification algorithm model, and the Bayesian classification algorithm model, respectively. The confusion matrix refers to the classification of instances, and the classification is true positive class TP, false negative class FN, false positive class FP, and true negative class TN. The true positive class TP is that the instance is a positive class and is predicted to be a positive class, the false negative class FN is that the instance is a positive class but is predicted to be a negative class, the false positive class FP is that the instance is a negative class but is predicted to be a positive class, and the true negative class TN is that the instance is a negative class and is predicted to be a negative class;

[0019] Step a2: Calculate the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), and AUC value, and draw the receiver operating characteristic (ROC) curve at the same time;

[0020] Step a3: Select the optimal model based on the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), AUC value, and ROC curve.

[0021] Preferably, the

[0022]

[0023] The ordinate of the receiver operating characteristic ROC curve is TPR, and the abscissa is FPR;

[0024]

[0025] Predpos refers to the predicted positive sample score, predneg refers to the predicted negative sample score, pos_num refers to the number of positive samples, neg_num refers to the number of negative samples, if predpos>predneg then

[0026] ∑pred pos>pred neg , it is 1. If predpos < predneg, then

[0027] ∑pred pos >pred neg it is 0. If predpos = predneg, then

[0028] ∑pred pos >pred neg it is 0.5.

[0029] Preferably, the parameter tuning uses the grid search method. The grid search is to perform several cross-validations on the optimal model for each combination in the hyperparameter combination list, and use the hyperparameter combination with the highest average score as the best choice, and return the model object. The highest hyperparameter is the parameter corresponding to the highest score obtained by combining different parameters through multiple cross-validations. The average score is the average of the scores obtained through multiple cross-validations.

[0030] Preferably, several times is 5 - 10 times.

[0031] The beneficial effects of the present invention are as follows:

[0032] The present invention is realized by artificial intelligence means. Keyword extraction is used to extract the error text segment in the log text, so as to judge whether there is an error; then based on the historical error text and error category, the text similarity is calculated to obtain the error category. Through this technical solution, it can be judged more conveniently and accurately, and the labor cost and time cost are also greatly saved;

[0033] The present invention combines the historical processing method and machine learning algorithms, and uses some classification algorithms, such as xgboost, random forest, Bayesian, etc. for classification prediction. Through this technical solution, batch calculations can be performed, and the labor and time costs can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 is the step flow chart of the present invention;

[0035] Figure 2 is the schematic diagram of the ROC curve. DETAILED DESCRIPTION OF THE INVENTION

[0036] The technical solution of the present invention will be further described below in conjunction with the drawings in the specification:

[0037] As Figure 1 shown, a disaster recovery fault diagnosis and identification method includes the following steps:

[0038] Step S1, extract error logs;

[0039] Step S2, obtaining data;

[0040] Step S3, cleaning data;

[0041] Step S4, constructing different models;

[0042] Step S5, evaluating different models to obtain the optimal model;

[0043] Step S6: After adjusting the parameters of the optimal model, the data to be predicted is passed into the optimal model after parameter adjustment, and the classification prediction result is output. The classification prediction result is 0 for not processing, 1 for switching, or 2 for repairing.

[0044] Extract the error log:

[0045] Extract log files, use natural language processing technology, and use keyword extraction technology to extract the text field after ERROR in the text. After extraction, determine the error type and component type of each error log based on the error category and text similarity in the historical data.

[0046] Text similarity refers to the similarity between texts calculated according to the algorithm when an error occurs. For example, the error text is error = java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: ioexception

[0047] The similarity between the historical text and the error text is calculated according to the error category corresponding to the historical text, and the text with the highest similarity is selected. Then, the error category and error component can be determined by combining the error category corresponding to the text.

[0048] Get data:

[0049] Provide corresponding data according to the requirements, including cup occupancy rate, duration, memory occupancy rate, duration, and whether each component has log failure. Requirements refer to providing corresponding data according to the requirements of the proposed topic, including cup occupancy rate, duration, memory occupancy rate, duration, and whether each component has log failure.

[0050] Clean data: Encode the data into numerical data.

[0051] Clean the data, fill in missing values, remove duplicate values, and encode variables (the input of the model must be numerical data, so the data must be encoded as variables. For example, if the CPU usage rate is >95%, the time series time exceeds five minutes, which is recorded as 1, otherwise it is 0. If there is no error in redis, kafka, oracle and other components, it is marked as 0, and if there is an error, it is marked as 1.

[0052] Build different models: construct numerical data through random forest algorithm model, xgboost classification algorithm model, and Bayesian classification algorithm model.

[0053] The random forest algorithm model is an algorithm that integrates multiple trees through the idea of ​​ensemble learning. Its basic unit is the decision tree, and its essence belongs to a major branch of machine learning - the ensemble learning method. There are two keywords in the name of random forest, one is "random" and the other is "forest". We can understand "forest" very well. If one tree is called a tree, then hundreds or thousands of trees can be called a forest. This metaphor is still very appropriate. In fact, this is also the main idea of ​​random forest - the embodiment of the idea of ​​integration.

[0054] From an intuitive perspective, each decision tree is a classifier (assuming that the problem is classification), so for an input sample, N trees will have N classification results. Random forest integrates all classification voting results and designates the category with the most votes as the final output. This is the simplest idea of ​​bagging.

[0055] Xgboost classification algorithm model

[0056] XGBoost is a scalable machine learning system developed in 2016 by Professor Tianqi Chen of the University of Washington. Strictly speaking, XGBoost is not a model, but a software package that allows users to easily solve classification, regression or sorting problems. It implements the gradient boosting tree (GBDT) model internally and optimizes the algorithm in the model in many ways. It achieves high accuracy while maintaining extremely fast speed. For a period of time, it has become a weapon of mass destruction in the fields of data mining and machine learning at home and abroad.

[0057] More importantly, XGBoost has taken deep considerations in both system optimization and machine learning principles. It is no exaggeration to say that the scalability, portability, and accuracy provided by XGBoost have pushed the upper limit of machine learning computing limits. The system runs more than ten times faster on a single machine than the popular solutions at the time, and can even process billions of data in a distributed system.

[0058] Bayesian classification algorithm model

[0059] Naive Bayesian is a classification method based on Bayesian theorem and conditional independence assumption of features. It calculates the probability of classification through features and selects the case with high probability for classification. In scikit-learn, there are three naive Bayesian classification algorithm classes, namely GaussianNB, MultinomialNB and BernoulliNB. Among them, GaussianNB is a naive Bayesian with a Gaussian distribution as the prior, MultinomialNB is a naive Bayesian with a multinomial distribution as the prior, and BernoulliNB is a naive Bayesian with a Bernoulli distribution as the prior.

[0060] Evaluate different models to find the optimal model:

[0061] The steps for evaluating different models are as follows;

[0062] Step a1: Make confusion matrices for the random forest algorithm model, the xgboost classification algorithm model, and the Bayesian classification algorithm model, respectively. The confusion matrix refers to the classification of instances, and the classification is true positive class TP, false negative class FN, false positive class FP, and true negative class TN. The true positive class TP is that the instance is a positive class and is predicted to be a positive class, the false negative class FN is that the instance is a positive class but is predicted to be a negative class, the false positive class FP is that the instance is a negative class but is predicted to be a positive class, and the true negative class TN is that the instance is a negative class and is predicted to be a negative class;

[0063] Each row of the confusion matrix is ​​the predicted classification of a sample, and each column is the true classification of the sample (and vice versa).

[0064]

[0065] Step a2: Calculate the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), and AUC value, and draw the receiver operating characteristic (ROC) curve at the same time;

[0066] Accuracy is the percentage of the number of samples that are correctly predicted to be the total number. The specific formula is as follows:

[0067]

[0068] Precision, also known as the precision rate, is an evaluation indicator for prediction results. It is the percentage of positive samples among the results predicted by the model. The specific formula is as follows:

[0069]

[0070] Recall, also known as recall rate, is an evaluation indicator for the original samples. It is the percentage of samples predicted to be positive among the actual positive samples. The specific formula is as follows:

[0071]

[0072] Both precision and recall have their own disadvantages; if the threshold is high, the precision will be high, but a lot of data will be missed; if the threshold is low, the recall rate will be high, but the prediction will be very inaccurate.

[0073] Before introducing ROC and AUC, we need to clarify the following three concepts: True positive rate (TPR), also known as sensitivity, is equivalent to recall rate. It describes the proportion of positive instances correctly classified by the classifier to all positive instances.

[0074]

[0075] The false positive rate (FPR), also known as 1-specificity, calculates the proportion of negative instances that are mistakenly identified as positive by the classifier to all negative instances.

[0076]

[0077] ROC (Receiver Operating Characteristic) curve, also known as the receiver operating characteristic curve. The vertical axis of the curve is TPR, and the horizontal axis is FPR. Figure 2 As shown in the figure, the ideal goal is: TPR = 1, FPR = 0, which is point (0, 1) in the figure. Therefore, the closer the ROC curve is to point (0, 1), that is, the more it deviates from the 45-degree diagonal line, the better. Correspondingly, the larger the TPR, the better, and the smaller the FPR, the better.

[0078] The AUC value C (Area Under Curve) is the area under the ROC curve. The larger the AUC, the better the performance of the model.

[0079] The value of auc is the integral of roc, but it is difficult to find the integral, so it is transformed into another solution. You can see: Wilcoxon-Mann-Witney Test, so the final AUC solution is calculated by the following formula.

[0080]

[0081] Predpos refers to the predicted positive sample score, predneg refers to the predicted negative sample score, pos_num refers to the number of positive samples, neg_num refers to the number of negative samples, if predpos>predneg then ∑pred pos >pred neg It is 1 if predpos=predneg, the score is 0.5, and predpos<predneg, the score is 0.

[0082] Step a3: Select the optimal model based on the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), AUC value, and ROC curve.

[0083] The parameter adjustment adopts the grid search method. The grid search performs several cross-validations on the optimal model for each combination in the hyperparameter combination list, takes the hyperparameter combination with the highest average score as the best choice, and returns the model object. The highest hyperparameter is the parameter corresponding to the highest score obtained by combining different parameters through multiple cross-validations, and the average score is the comprehensive average of the scores obtained through multiple cross-validations.

[0084] The way to obtain the optimal hyperparameters is to draw a validation curve, but the validation curve can only obtain one optimal hyperparameter at a time. If there are many permutations and combinations of multiple hyperparameters, you can use grid search to find the optimal hyperparameter combination. The number of times is 5-10 times.

[0085] The prior art has problems such as wasting manpower time and human errors, and there are many uncertain factors in human operation. In order to ensure work efficiency and judgment accuracy, the present invention can solve the above problems.

[0086] 1. Natural language processing technology can be used to extract error information in the log based on keyword extraction, and then the error information can be classified using text classification based on historical error categories.

[0087] 2. Based on historical fault data and processing methods, use machine learning classification algorithms to perform classification predictions.

[0088] It should be noted that the above is only a specific embodiment of the present invention. Obviously, the present invention is not limited to the above embodiment, and there are many variations. In short, all variations that can be directly derived or associated with the content disclosed by ordinary technicians in this field should be considered as the protection scope of the present invention.

Claims

1. A method for disaster recovery fault diagnosis and identification, characterized in that: The steps include: Step S1, extracting error log; Step S2, obtaining data; Step S3, cleaning data; Step S4, constructing different models; Step S5, evaluating different models to obtain the optimal model; Step S6: After adjusting the parameters of the optimal model, the data to be predicted is passed into the optimal model after the adjustment, and the classification prediction result is output. The classification prediction result is not processed, switched, or repaired.

2. A method for disaster recovery fault diagnosis and identification according to claim 1, characterized in that: The error log extraction refers to extracting the text field after ERROR in the text using keywords, and then determining the error type and component type of each error log according to the error category and text similarity in the historical data.

3. A method for disaster recovery fault diagnosis and identification according to claim 2, characterized in that: The data acquisition refers to providing corresponding data according to demand, and the corresponding data includes cup occupancy, duration, memory occupancy, duration, and whether log failure occurs in each component.

4. A method for disaster recovery fault diagnosis and identification according to claim 3, characterized in that: The data cleaning refers to encoding the data into numerical type data.

5. A method for disaster recovery fault diagnosis and identification according to claim 4, characterized in that: The construction of different models refers to constructing numerical type data through a random forest algorithm model, an xgboost classification algorithm model, and a Bayesian classification algorithm model.

6. A method for disaster recovery fault diagnosis and identification according to claim 5, characterized in that: The steps for evaluating different models are as follows; Step a1: Make confusion matrices for the random forest algorithm model, the xgboost classification algorithm model, and the Bayesian classification algorithm model respectively. The confusion matrix refers to the classification of instances into true positive class TP, false negative class FN, false positive class FP, and true negative class TN. The class TP is that the instance is a positive class and is predicted to be a positive class, the false negative class FN is that the instance is a positive class but is predicted to be a negative class, the false positive class FP is that the instance is a negative class but is predicted to be a positive class, and the true negative class TN is that the instance is a negative class and is predicted to be a negative class; Step a2: Calculate the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), and AUC value, and draw the receiver operating characteristic (ROC) curve at the same time; Step a3: Select the optimal model based on the accuracy, precision, recall, true positive rate (TPR), negative positive rate (FPR), AUC value, and ROC curve.

7. A method for disaster recovery fault diagnosis and identification according to claim 6, characterized in that: Said The ordinate of the receiver operating characteristic ROC curve is TPR, and the abscissa is FPR; Predpos refers to the predicted positive sample score, predneg refers to the predicted negative sample score, pos_num refers to the number of positive samples, neg_num refers to the number of negative samples. If predpos > predneg, then ∑pred pos > pred neg is 1. If predpos < predneg, then ∑pred pos > pred neg is 0. If predpos = predneg, then ∑pred pos > pred neg is 0.

5.

8. A method for disaster recovery fault diagnosis and identification according to claim 7, characterized in that: The parameter adjustment adopts a grid search method. The grid search performs several cross-validations on the optimal model for each combination in the hyperparameter combination list, takes the hyperparameter combination with the highest average score as the best choice, and returns the model object. The highest hyperparameter is the parameter corresponding to the highest score obtained by combining different parameters through multiple cross-validations, and the average score is the comprehensive average of the scores obtained through multiple cross-validations.

9. A method for disaster recovery fault diagnosis and identification according to claim 8, characterized in that: The several times is 5-10 times.

Citation Information

Patent Citations

  • Performance analyzing method and system for damage level model

    CN106066935A

  • Fan fault diagnosis system and method based on image main feature extraction and application

    CN114764867A

  • Construction method, system and equipment of retinopathy onset risk prediction model

    CN115346665A

  • Fault diagnosis method and system for edge calculation

    CN118013442A

Cited By

  • Intelligent fault diagnosis method for digital twin-driven offshore oil well control equipment

    CN121455060A