Method and device for predicting SSD fault based on machine learning, equipment and medium
Through machine learning-based methods, utilizing SSD fault SMART information and random forest classifiers, combined with Bayesian optimizer, the challenge of SSD fault prediction is solved, accurate prediction and early warning of SSD faults are achieved, and the storage system efficiency is improved. Reliability and performance stability.
Patent Information
- Application Number
- CN202411258957.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-10-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In large-scale storage systems, SSD failures will affect the performance and stability of the storage system, and existing monitoring solutions cannot effectively predict all SSD failures, resulting in additional maintenance costs and reliability challenges.
Using a machine learning-based method, by collecting SSD fault SMART information, performing data cleaning and correlation analysis, using a random forest classifier to establish an SSD fault model, and optimizing the model parameters through a Bayesian optimizer to predict and predict SSD faults. Be forewarned.
Effectively predict SSD faults, identify potential problems in advance, reduce maintenance costs, and improve system performance stability. Through years of SMART information collected and supervised learning algorithms, the accuracy of fault prediction is improved.
Smart Images

Figure CN118779762A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method, device, equipment and medium for predicting SSD failure based on machine learning, and belongs to the technical field of distributed storage. Background Art
[0002] System reliability is one of the most important aspects of storage systems, so there is a lot of work on the reliability of storage devices. Many earlier works focused on hard disk drives (HDDs), but as more and more data is stored on solid-state drives (SSDs), the focus has shifted to the reliability of SSDs. Compared with HDDs, NAND flash-based SSDs have higher performance and lower power consumption, so they are becoming more and more popular in enterprise storage systems and large data centers. However, in order to reduce costs, the storage density of SSDs continues to increase, which reduces the durability and reliability of SSDs. Large data centers typically have hundreds of thousands or even millions of SSDs. Such large-scale SSD deployments pose challenges to the reliability of data centers.
[0003] Although redundancy mechanisms such as replication and RAID have been used to protect data from loss, SSD failures still cause two major problems. First, even if the data center adopts a redundant protection scheme. In the Ceph system design that prioritizes consistency, SSD failures will still greatly affect the performance of the storage system and the stability of online services. Second, when SSD fails, measures such as fault location and fault recovery are required, resulting in additional maintenance costs. Therefore, SSD failure prediction, as an active fault tolerance mechanism, has received increasing attention in recent years. Compared with passive redundancy mechanisms, it can identify and actively handle potential SSD failures in advance, thereby improving the reliability of the storage system and reducing the cost of fault location and recovery. In large-scale storage systems, it is of great significance to monitor the symptoms of SSD failures and predict failures in advance.
[0004] A common monitoring solution for modern storage devices such as HDDs and SSDs is SMART information, which monitors and records the internal reliability-related attributes of the drive. SMART information is usually collected periodically, for example, one or more SMART information is collected per device every day. SMART attribute values are generated and recorded under the hard disk's self-monitoring, analysis and reporting technology monitoring system, which detects and reports various indicators of drive reliability. However, the number of available SMART attributes exceeds 50, and not all disks always record all attributes, making it impossible to perform SSD failure prediction for all disks. Therefore, the present invention proposes a method for predicting SSD failures based on machine learning. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a method, device, equipment and medium for predicting SSD failures based on machine learning, which can more effectively predict SSD failures.
[0006] The technical solution adopted by the present invention to solve the technical problem is: In a first aspect, an embodiment of the present invention provides a method for predicting SSD failures based on machine learning, comprising the following steps: Step S1, collecting SSD failure SMART information and building a data set; Step S2, cleaning the data set, and dividing the cleaned data set into a training set and a test set; Step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection based on the correlation coefficient; Step S4, establishing an SSD fault model using a random forest classifier based on default parameters; Step S5, performing CV cross validation to obtain the F1-Score of the SSD fault model; Step S6, performing iterative selection of random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and performing CV cross-validation calculation to obtain the optimized F1-Score; Step S7, collect SSD SMART information of each host node, and use the SSD fault optimization model to predict faults of all SSD disks.
[0007] As a possible implementation of this embodiment, the step S1, collecting SSD fault SMART information and constructing a data set, includes: Define the field information of SSD failure SMART information; Call smartctl -a / dev / sdx to obtain smartinfo, parse the values of the corresponding fields, and build a data set based on the generated information.
[0008] As a possible implementation of this embodiment, the data cleaning of the data set includes: Load CSV via pandas in jupyter; Load the returned object and call describe to describe the data; Call dropna to filter and delete the default values.
[0009] As a possible implementation of this embodiment, step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection according to the correlation coefficient, includes: Filter out the numerical columns and build a data frame based on the numerical columns, and calculate a correlation coefficient matrix according to the Pearson correlation coefficient calculation formula: , in, Representation variables x and y The correlation coefficient between and Respectively represent variables x and y The mean of and Respectively represent variables x and y No. i observations; each element in the correlation coefficient matrix represents the correlation between the corresponding two numerical columns; Extract the correlation coefficient between the target variable ISFAULT and other numerical columns, and sort them from large to small according to their absolute values; Draw a heat map based on the correlation coefficient matrix to obtain a visual correlation coefficient matrix; Through correlation coefficient analysis, relevant features are selected as model building features.
[0010] As a possible implementation of this embodiment, in step S4, a SSD fault model is established using a random forest classifier based on default parameters; The SSD fault model was established using the default random forest classifier parameters, pre-trained using the training set data, and predicted on the test set data; Precision, recall, and F1-Score are used to evaluate the accuracy of the prediction results.
[0011] As a possible implementation of this embodiment, step S6, performing iterative selection of random forest parameter optimization based on a Bayesian optimizer to obtain an SSD fault optimization model, and performing CV cross-validation calculation to obtain an optimized F1-Score, includes: Define a random forest evaluation function that accepts four hyperparameters [n_estimators, min_samples_split, max_features, max_depth] and returns the average F1-Score of these parameters after 5-fold cross validation; Create a Bayesian optimization object and define the iteration range of hyperparameters: n_estimators:(10,250),min_samples_split:(2,25),max_features:(0.1,0.999),max_depth:(5,15); The maximum F1-Score and the corresponding hyperparameter combination are found by calling maximize(), and the optimal random forest classifier model is constructed based on the optimal hyperparameter combination to obtain the SSD fault optimization model.
[0012] As a possible implementation of this embodiment, step S7, collecting SSD SMART information of each host node and using the SSD fault optimization model to predict faults of all SSD disks, includes: Collect SMART information of all SSDs on the host node every 1 minute and aggregate them into a complete SSD table; The SSD fault optimization model is used to predict faults of all SSD disks and send fault alarm information.
[0013] In a second aspect, an embodiment of the present invention provides a device for predicting SSD failure based on machine learning, including: Data collection module, used to collect SSD failure SMART information and build a data set; A data cleaning module is used to clean the data set and divide the cleaned data set into a training set and a test set; The correlation analysis module is used to perform correlation analysis on the numerical columns in the data set, calculate the correlation coefficient, and perform feature selection based on the correlation coefficient; Fault model building module, used to build SSD fault model using random forest classifier based on default parameters; CV cross-validation module, used to perform CV cross-validation to obtain the F1-Score of the SSD fault model; The fault model optimization module is used to perform iterative random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and perform CV cross-validation calculation to obtain the optimized F1-Score; The fault prediction module is used to collect SSD SMART information of each host node and use the SSD fault optimization model to predict faults of all SSD disks.
[0014] In a third aspect, an embodiment of the present invention provides a computer device, comprising a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform any of the steps of the above-mentioned method for predicting SSD failures based on machine learning.
[0015] In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for predicting SSD failures based on machine learning are executed.
[0016] The beneficial effects of the technical solution of the embodiment of the present invention are as follows: The technical solution of the embodiment of the present invention is a method for predicting SSD failures based on machine learning, which distinguishes the prediction of SSD failures in a coarse-grained manner, identifies the failure problem in advance, and issues an alarm to prompt the second-line engineer to intervene, greatly improving the stability of system performance. The present invention uses the faulty SSD SMART information collected over many years and selects multiple SMART attributes as features of the training model through correlation analysis. Based on these fault-related features and effectively combined with supervised learning algorithms, SSD failures can be more effectively predicted.
[0017] A device for predicting SSD failures based on machine learning in the technical solution of an embodiment of the present invention has the same beneficial effects as a method for predicting SSD failures based on machine learning in the technical solution of an embodiment of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flow chart of a method for predicting SSD failure based on machine learning according to an exemplary embodiment; Figure 2 is a structural schematic diagram of a device for predicting SSD failure based on machine learning according to an exemplary embodiment; Figure 3 is an overview diagram of a system for implementing the present invention according to an exemplary embodiment; Figure 4 is a correlation coefficient heat map distribution diagram shown according to an exemplary embodiment; Figure 5 The figure is a schematic diagram of a Bayesian iterative optimization process according to an exemplary embodiment. DETAILED DESCRIPTION
[0019] In order to more clearly illustrate the technical features of the solution of the present invention, the present invention is described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0020] like Figure 1 As shown, a method for predicting SSD failure based on machine learning provided by an embodiment of the present invention includes the following steps: Step S1, collecting SSD failure SMART information and building a data set; Step S2, cleaning the data set, and dividing the cleaned data set into a training set and a test set; Step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection based on the correlation coefficient; Step S4, establishing an SSD fault model using a random forest classifier based on default parameters; Step S5, performing CV cross validation to obtain the F1-Score of the SSD fault model; Step S6, performing iterative selection of random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and performing CV cross-validation calculation to obtain the optimized F1-Score; Step S7, collect SSD SMART information of each host node, and use the SSD fault optimization model to predict faults of all SSD disks.
[0021] As a possible implementation of this embodiment, the step S1, collecting SSD fault SMART information and constructing a data set, includes: Define the field information of SSD failure SMART information; Call smartctl -a / dev / sdx to obtain smartinfo, parse the values of the corresponding fields, and build a data set based on the generated information.
[0022] As a possible implementation of this embodiment, the data cleaning of the data set includes: Load CSV via pandas in jupyter; Load the returned object and call describe to describe the data; Call dropna to filter and delete the default values.
[0023] As a possible implementation of this embodiment, step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection according to the correlation coefficient, includes: Filter out the numerical columns and build a data frame based on the numerical columns, and calculate a correlation coefficient matrix according to the Pearson correlation coefficient calculation formula: , in, Representation variables x and y The correlation coefficient between and Respectively represent variables x and y The mean of and Respectively represent variables x and y No. iobservations; each element in the correlation coefficient matrix represents the correlation between the corresponding two numerical columns; Extract the correlation coefficient between the target variable ISFAULT and other numerical columns, and sort them from large to small according to their absolute values; Draw a heat map based on the correlation coefficient matrix to obtain a visual correlation coefficient matrix; Through correlation coefficient analysis, relevant features are selected as model building features.
[0024] As a possible implementation of this embodiment, in step S4, a SSD fault model is established using a random forest classifier based on default parameters; The SSD fault model was established using the default random forest classifier parameters, pre-trained using the training set data, and predicted on the test set data; Precision, recall, and F1-Score are used to evaluate the accuracy of the prediction results.
[0025] As a possible implementation of this embodiment, step S6, performing iterative selection of random forest parameter optimization based on a Bayesian optimizer to obtain an SSD fault optimization model, and performing CV cross-validation calculation to obtain an optimized F1-Score, includes: Define a random forest evaluation function that accepts four hyperparameters [n_estimators, min_samples_split, max_features, max_depth] and returns the average F1-Score of these parameters after 5-fold cross validation; Create a Bayesian optimization object and define the iteration range of hyperparameters: n_estimators:(10,250),min_samples_split:(2,25),max_features:(0.1,0.999),max_depth:(5,15); The maximum F1-Score and the corresponding hyperparameter combination are found by calling maximize(), and the optimal random forest classifier model is constructed based on the optimal hyperparameter combination to obtain the SSD fault optimization model.
[0026] As a possible implementation of this embodiment, step S7, collecting SSD SMART information of each host node and using the SSD fault optimization model to predict faults of all SSD disks, includes: Collect SMART information of all SSDs on the host node every 1 minute and aggregate them into a complete SSD table; The SSD fault optimization model is used to predict faults of all SSD disks and send fault alarm information.
[0027] like Figure 2 As shown, an embodiment of the present invention provides a device for predicting SSD failure based on machine learning, including: Data collection module, used to collect SSD failure SMART information and build a data set; A data cleaning module is used to clean the data set and divide the cleaned data set into a training set and a test set; The correlation analysis module is used to perform correlation analysis on the numerical columns in the data set, calculate the correlation coefficient, and perform feature selection based on the correlation coefficient; Fault model building module, used to build SSD fault model using random forest classifier based on default parameters; CV cross-validation module, used to perform CV cross-validation to obtain the F1-Score of the SSD fault model; The fault model optimization module is used to perform iterative random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and perform CV cross-validation calculation to obtain the optimized F1-Score; The fault prediction module is used to collect SSD SMART information of each host node and use the SSD fault optimization model to predict faults of all SSD disks.
[0028] In order to solve the problem of the stability of Inspur Cloud SSD performance and reduce the business impact caused by system recovery when SSD disk fails, the present invention proposes a prediction method based on random forest, which distinguishes the prediction of SSD failure in a coarse-grained manner. Random forest is an integrated machine learning model for classification, which operates by building a large number of decision trees. The present invention involves two parts in the specific implementation process, offline prediction and online prediction, such as Figure 3 As shown in the figure, offline prediction is completed offline through: 1) data cleaning; 2) feature correlation analysis and feature selection; 3) modeling using random forest classifier; 4) CV cross validation; 5) random forest parameter tuning based on Bayesian optimization; 6) CV cross validation after tuning, a total of 6 steps to build the optimal random forest model. Online prediction is to collect SSD SMART information from each host node to the Mgr node, which predicts the failure of all SSD disks and issues an alarm, prompting the second-line engineering to intervene in advance.
[0029] Offline prediction is mainly divided into the following steps: 1. First, we rely on the years of SSD failure SMART information collection, which currently has more than 20,000 items.
[0030] 1.1 Define the collection field information, as shown in Table 1.
[0031] Table 1 Field information of SMART information
[0032] Only some fields are listed in Table 1. All fields will be collected and data cleaning will be performed later.
[0033] 1.2 For each cluster, develop a script to ssh to the server where the bad SSD is located and call smartctl-a / dev / sdx to obtain smartinfo, parse the values of the corresponding fields, and then output the generated information to CSV to prepare for subsequent jupyter experiments.
[0034] 2. By combining a small amount of normal SMART information into training sets and test sets, invalid SMART information is cleaned and deleted.
[0035] 2.1 In order to ensure the quality of input data, enable the model to better learn the potential patterns of the data, perform more robustly on new data, enable the model to more accurately capture the relationship between features, and improve the generalization ability of the model, it is necessary to process missing values and outliers and remove redundant features. Therefore, first load CSV through pandas in jupyter.
[0036] 2.2 Load the returned object and call describe to describe the data. You can see many columns such as N_THROUGHPUT_PERFORMANCE, R_THROUGHPUT_PERFORMANCE, N_SPIN_UP_TIME, R_SPIN_UP_TIME, etc.<mean,std,min> The data is displayed as NaN.
[0037] 2.3 In data analysis and machine learning tasks, missing values often affect the performance and results of the model, so the default value is required to call dropna for filtering and deletion.
[0038] 2.4 There are 106 columns of data before processing. After cleaning, there are 44 columns of valid data left, which will be used as input for the next step.
[0039] 3. Perform correlation analysis on the numerical columns through heat maps, calculate the correlation coefficient, and then perform feature selection based on the correlation coefficient.
[0040] 3.1 Pearson correlation coefficient is a statistic used to measure the strength and direction of the linear relationship between two continuous variables. It is one of the commonly used correlation indicators and is usually represented by the symbol r. The value range of Pearson correlation coefficient is between -1 and 1, and its meaning is as follows: When r is close to 1, it means that the two variables have a strong positive correlation, that is, when one variable increases, the other variable also increases; When r is close to -1, it means that the two variables are strongly negatively correlated, that is, when one variable increases, the other variable decreases; When r is close to 0, it means there is no linear relationship between the two variables.
[0041] The calculation formula of Pearson correlation coefficient is as follows: , in, Representation variables x and y The correlation coefficient between and Respectively represent variables x and y The mean of and Respectively represent variables x and y No. i The Pearson correlation coefficient measures the strength and direction of the linear relationship between two variables. It has strict requirements on data, requiring the relationship between the two variables to be linear, and is sensitive to outliers. Therefore, before using the Pearson correlation coefficient, the data needs to be checked and preprocessed to ensure that the prerequisites for correlation analysis are met.
[0042] 3.2 First, filter out the data columns and build a data frame based on the numerical columns. Then, calculate a correlation coefficient matrix based on the above Pearson correlation coefficient, where each element of the matrix represents the correlation between the corresponding two numerical columns.
[0043] 3.3 Extract the correlation coefficient between the target variable ISFAULT and other numerical columns, and sort them from large to small according to the absolute value. The output results are shown in Table 2.
[0044] Table 2 Correlation coefficient table
[0045] 3.4 Draw a heat map based on the correlation coefficient matrix to obtain a visual correlation coefficient matrix, such as Figure 4 shown. Figure 4 The vertical coordinates from top to bottom and the horizontal coordinates from left to right are DISK_ID, 1, 2, ..., 28, ISFAULT, where 1, 2, ..., 28 are: 1-R_READ_ERROR_RATE, 2-N_REALLOCATED_SECTORS_COUNT, 3-R_REALLOCATED_SECTORS_COUNT, 4-R_POWER_ON_HOURS, 5-R_POWER_CYCLE_COUNT, 6-N_PROGRAM_FAIL_COUNT, 7-R_PROGRAM_FAIL_COUNT, 8-N_ERASE_FAIL_COUNT, 9-R_ERASE_FAIL_COUNT, 10-N_WEAR_LEVELING_COUNT, 11-R_N_UNEXPECTED_POWER_LOSS, 12-N_UNUSED_BLOCK_COUNT, 13-R_UNUSED_BLOCK_COUNT, 14-N_END_TO_END_ERROR, 15-R_END_TO_END_ERROR, 16-R_UNCORR_ERRORS, 17-R_COMMAND_TIMEOUT, 18-N_TEMP_DIFFERENCE, 19-R_TEMP_DIFFERENCE, 20-R_TEMP_CELSIUS, 21-R_ECC_RECOVERED, 22-N_EVENT_COUNT, 23-R_EVENT_COUNT, 24-R_PENDING_SECTOR_COUNT, 25-R_UNCORR_SECTOR_COUNT, 26-R_CRC_ERROR, 27-N_POWER_LOSS_FAILURE, 28-R_POWER_LOSS_FAILURE.
[0046] In order to improve model performance, reduce the risk of overfitting, improve training efficiency and simplify the model, the present invention analyzes the correlation coefficient and finally selects the following features as model construction features: ['R_READ_ERROR_RATE','N_REALLOCATED_SECTORS_COUNT','R_REALLOCATED_SECTORS_COUNT','R_POWER_ON_HOURS','R_POWER_CYCLE_COUNT','N_PROGRAM_FAIL_COUNT','R_PRO GRAM_FAIL_COUNT','N_ERASE_FAIL_COUNT','R_ERASE_FAIL_COUNT','N_WEAR_LEVELING_COUNT','R_N_UNEXPECTED_POWER_LOSS','N_UNUSED_BLOCK_COUNT','R_UNUSED_BLOCK_C OUNT','N_END_TO_END_ERROR','R_END_TO_END_ERROR','R_UNCORR_ERRORS','R_COMMAND_TIMEOUT','N_TEMP_DIFFERENCE','R_TEMP_DIFFERENCE','R_TEMP_CELSIUS','R_ECC_R ECOVERED','N_EVENT_COUNT','R_EVENT_COUNT','R_PENDING_SECTOR_COUNT','R_UNCORR_SECTOR_COUNT','R_CRC_ERROR','N_POWER_LOSS_FAILURE','R_POWER_LOSS_FAILURE'].
[0047] 4. Build a random forest classifier model using default parameters.
[0048] 4.1 Random Forest is an ensemble learning method that builds multiple decision trees for classification or regression. It combines the easy interpretability of decision trees with the high performance of ensemble learning, and has strong predictive ability and robustness.
[0049] Random Sampling: Randomly extract a certain number of samples from the training set and use these samples to build a decision tree.
[0050] Random Feature Selection: At each decision tree node, a portion of features are randomly selected from all features for splitting. This helps increase the diversity of the model and reduce overfitting.
[0051] Multiple Decision Trees: Build multiple decision trees, and each tree is built based on random sampling and random feature selection.
[0052] Voting Mechanism: For classification problems, each decision tree in the random forest will give a classification result, and the final classification result is determined by the votes of all decision trees; for regression problems, the average of the prediction results of all decision trees is taken as the final prediction result.
[0053] The specific process of random forest is as follows: A. Input sample set .
[0054] B. For t=1,2,3,...T: a) Perform the tth random sampling on the training set, sampling m times in total, and obtain a sampling sample containing m samples. ; b) Using sampling set Train the Tth decision tree model When training the nodes of the decision tree model, select a part of the sample features from all the sample features on the node, and select the best feature from these randomly selected sample features to divide the decision tree into left and right subtrees; c) In classification scenarios, the category with the most votes from the T base models (decision trees) is the final category.
[0055] 4.2 We use the random forest classifier for modeling. First, we divide the data set into a training set and a test set, with the test set accounting for 20% of the size. Then we use the default random forest classifier parameters for modeling, and then use the training data for pre-training and predict the test set.
[0056] 4.3 After prediction, we use precision, recall, and F1-Score to evaluate the prediction accuracy; Precision: the ratio of correctly predicted faulty SSDs to all predicted faulty SSDs (true alarms and false alarms); Recall: The ratio of correctly predicted faulty SSDs to all actual faulty SSDs, also known as the true positive rate (TPR); F1-Score: It is the harmonic mean of precision and recall, and is designed to comprehensively evaluate the balance between precision and recall of the model. The calculation formula is as follows: .
[0057] 5. Perform CV cross validation to obtain the F1-Score of the basic classification model; 5.1 Cross-validation is a statistical method for evaluating model performance. Its principle and purpose is to divide the data set into multiple mutually exclusive subsets, then train the model multiple times, and use different subsets for validation, so as to evaluate the performance and generalization ability of the model.
[0058] 5.2 Use the F1 value to perform 5-fold cross validation on the test set, and the current F1 value is 0.9949121820769777 as the cross validation result of the unoptimized model.
[0059] 6. Based on the Bayesian optimizer, iteratively select random forest parameter optimization, and after multiple rounds of iterations, obtain the parameter combination with the highest score, and then build a random forest classifier model based on the obtained parameters again. Finally, CV cross-validation is performed to calculate the optimized F1-Score.
[0060] 6.1 The key optimization parameters of the random forest classifier are as follows: (1) The number of features max_features when generating a single decision tree. Increasing max_features generally improves the performance of a single decision tree model, but reduces the differences between trees and may slow down the algorithm. Too small max_features will affect the performance of a single tree, and thus the overall ensemble effect. It is necessary to properly balance and select the appropriate max_features.
[0061] (2) The number of decision trees n_estimators. More subtrees can make the model more stable and generalizable, but at the same time slow down the learning speed of the model. The present invention will select slightly larger subtrees n_estimators if the computing resources can support it.
[0062] (3) Tree depth max_depth. If the tree depth is too large, each subtree will be over-learned, which may cause overfitting. If the model has a large number of samples and features, the maximum tree depth will be limited to improve the generalization ability of the model.
[0063] 6.2 Bayesian Optimization Parameter Tuning.
[0064] Bayesian optimization is a sequential modeling method for optimizing black box functions. It infers the probability distribution of the target function by using information from already observed points, and then uses this probability distribution to select the next point to evaluate. The following are the basic principles of Bayesian optimization: A. Gaussian Process Modeling: The core of Bayesian optimization is to use the Gaussian process model to model the objective function. The Gaussian process is a probability distribution that represents the function value in the input space. For black box functions (whose specific form cannot be directly observed), the Gaussian process provides a flexible method that can infer uncertainty.
[0065] B. Prior probability distribution: In the initial stage, Bayesian optimization models the objective function based on prior information. This prior probability distribution represents the initial estimate of the objective function and is usually assumed to be a smooth Gaussian distribution.
[0066] C. Select the next point: In each iteration, Bayesian optimization uses the current Gaussian process model to calculate the posterior distribution of the objective function over the entire input space. Based on this posterior distribution, the algorithm selects the next point, usually the point that maximizes the expected improvement (maximizing conditional expectation, Expected Improvement).
[0067] D. Evaluate the objective function: After selecting the next point, Bayesian optimization evaluates the value of the objective function at this point and obtains the observed value.
[0068] E. Update the Gaussian process model: Use the new observations to update the Gaussian process model. This process can be done using Bayes’ theorem to obtain the posterior probability distribution of the target function.
[0069] F. Iteration: Repeat the above steps, such as Figure 5 As shown in Figure 1, each iteration selects a new point for evaluation, observes the value of the objective function, and then updates the Gaussian process model. As the number of iterations increases, the model will get closer and closer to the true objective function.
[0070] Figure 5 It shows that after 30 iterations, Bayesian optimization has obtained the optimal hyperparameter combination: {'target':0.9954954155435951,'params':{'max_depth':14.664741191789169,'max_features':0.9 632751084601282,'min_samples_split':5.84758375392577,'n_estimators':228.68138006046016}}, Set the above hyperparameters to the random forest classifier and build the optimal model.
[0071] The main advantage of Bayesian optimization is that it can find the global optimal solution in fewer iterations and can more intelligently choose the next exploration point in the search space, thus optimizing more efficiently. This makes it particularly suitable for situations where the evaluation of the objective function is expensive, such as in practical experiments or optimization problems with high computational costs.
[0072] 6.3 First, define a random forest evaluation function, which receives four hyperparameters [n_estimators, min_samples_split, max_features, max_depth], and returns the average F1-Score of these parameters after 5-fold cross-validation. Then create a Bayesian optimization object and define the iteration range of the hyperparameters: n_estimators: (10, 250), min_samples_split: (2, 25), max_features: (0.1, 0.999), max_depth: (5, 15). Find the maximum F1-Score and the corresponding hyperparameter combination through the maximize() call, and build the optimal random forest classifier model based on the optimal hyperparameter combination. Among them, max_features is the number of features to be considered when finding the optimal split, min_samples_split is the minimum number of samples required to split the internal nodes, n_estimators is the number of decision trees in the forest, and max_depth is the maximum depth of the tree.
[0073] After the offline model is built, the management node Mgr service is notified to load the offline model. The storage node collector collects the SMART information of all SSDs on the node every 1 minute and sends it to the management node Mgr service. The Mgr service organizes it into a full set of SSD tables, and then uses the loaded model to predict faults. It issues alarms for SSD disks that are predicted to have faults and notifies second-line engineers to intervene.
[0074] The present invention utilizes the faulty SSDSMART information collected over the years and selects 28 SMART attributes as features of the training model through correlation analysis. Based on these fault-related features and effectively combined with the supervised learning algorithm, SSD failures can be predicted more effectively.
[0075] The present invention distinguishes the prediction of SSD failures in a coarse-grained manner, identifies failure problems in advance, and issues alarms to prompt second-line engineers to intervene, greatly improving the stability of system performance.
[0076] A computer device provided by an embodiment of the present invention includes a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform any step of the above-mentioned method for predicting SSD failure based on machine learning.
[0077] Specifically, the above-mentioned memory and processor can be general-purpose memory and processor, which are not specifically limited here. When the processor runs the computer program stored in the memory, the above-mentioned method of predicting SSD failure based on machine learning can be executed.
[0078] Those skilled in the art will appreciate that the structure of the computer device does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
[0079] In some embodiments, the computer device may also include a touch screen that can be used to display a graphical user interface (e.g., a startup interface of an application) and receive user operations on the graphical user interface (e.g., startup operations on an application). The specific touch screen may include a display panel and a touch panel. The display panel may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. The touch panel may collect the user's contact or non-contact operations on or near it, and generate pre-set operation instructions, for example, the user uses any suitable object such as a finger or stylus to operate on or near the touch panel. In addition, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and posture, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into information that the processor can process, and then sends it to the processor, and can receive and execute commands sent by the processor. In addition, the touch panel can be implemented by various types such as resistive, capacitive, infrared and surface acoustic wave, and any technology developed in the future can also be used to implement the touch panel. Further, the touch panel can cover the display panel, and the user can operate on or near the touch panel covered on the display panel according to the graphical user interface displayed on the display panel. After the touch panel detects the operation on or near it, it is transmitted to the processor to determine the user input, and then the processor provides corresponding visual output on the display panel in response to the user input. In addition, the touch panel and the display panel can be implemented as two independent components or integrated.
[0080] Corresponding to the method for starting the above-mentioned application, an embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods for predicting SSD failures based on machine learning are executed.
[0081] The application startup device provided in the embodiment of the present application can be specific hardware on the device or software or firmware installed on the device. The device provided in the embodiment of the present application, its implementation principle and the technical effect produced are the same as those in the aforementioned method embodiment. For the sake of brief description, the parts not mentioned in the device embodiment can refer to the corresponding contents in the aforementioned method embodiment. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment, and will not be repeated here.
[0082] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0083] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or modules can be electrical, mechanical or other forms.
[0084] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0085] In addition, each functional module in the embodiments provided in the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0086] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0087] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0088] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0089] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for predicting SSD failure based on machine learning, characterized in that: The steps include: Step S1, collecting SSD failure SMART information and building a data set; Step S2, cleaning the data set, and dividing the cleaned data set into a training set and a test set; Step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection based on the correlation coefficient; Step S4, establishing an SSD fault model using a random forest classifier based on default parameters; Step S5, performing CV cross validation to obtain the F1-Score of the SSD fault model; Step S6, performing iterative selection of random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and performing CV cross-validation calculation to obtain the optimized F1-Score; Step S7, collect SSD SMART information of each host node, and use the SSD fault optimization model to predict faults of all SSD disks.
2. The method for predicting SSD failure based on machine learning according to claim 1, characterized in that: The step S1, collecting SSD fault SMART information and constructing a data set, includes: Define the field information of SSD failure SMART information; Call smartctl -a / dev / sdx to obtain smartinfo, parse the values of the corresponding fields, and build a data set based on the generated information.
3. The method for predicting SSD failure based on machine learning according to claim 1, characterized in that: The data cleaning of the data set includes: Load CSV via pandas in jupyter; Load the returned object and call describe to describe the data; Call dropna to filter and delete the default values.
4. The method for predicting SSD failure based on machine learning according to claim 1, characterized in that: The step S3, performing correlation analysis on the numerical columns in the data set, calculating the correlation coefficient, and performing feature selection based on the correlation coefficient, includes: Filter out the numerical columns and build a data frame based on the numerical columns, and calculate a correlation coefficient matrix according to the Pearson correlation coefficient calculation formula: , in, Representation variables x and y The correlation coefficient between and Respectively represent variables x and y The mean of and Respectively represent variables x and y No. i observations; each element in the correlation coefficient matrix represents the correlation between the corresponding two numerical columns; Extract the correlation coefficient between the target variable ISFAULT and other numerical columns, and sort them from large to small according to their absolute values; Draw a heat map based on the correlation coefficient matrix to obtain a visual correlation coefficient matrix; Through correlation coefficient analysis, relevant features are selected as model building features.
5. The method for predicting SSD failure based on machine learning according to claim 4, characterized in that: In step S4, a SSD fault model is established using a random forest classifier based on default parameters; The SSD fault model was established using the default random forest classifier parameters, pre-trained using the training set data, and predicted using the test set data; Precision, recall, and F1-Score are used to evaluate the accuracy of the prediction results.
6. The method for predicting SSD failure based on machine learning according to claim 1, characterized in that: The step S6, based on the Bayesian optimizer, performs iterative selection of random forest parameter optimization to obtain the SSD fault optimization model, and performs CV cross-validation calculation to obtain the optimized F1-Score, including: Define a random forest evaluation function that accepts four hyperparameters [n_estimators, min_samples_split, max_features, max_depth] and returns the average F1-Score of these parameters after 5-fold cross validation; Create a Bayesian optimization object and define the iteration range of hyperparameters: n_estimators:(10,250),min_samples_split:(2,25),max_features:(0.1,0.999),max_depth:(5,15); The maximum F1-Score and the corresponding hyperparameter combination are found by calling maximize(), and the optimal random forest classifier model is constructed based on the optimal hyperparameter combination to obtain the SSD fault optimization model.
7. The method for predicting SSD failure based on machine learning according to any one of claims 1 to 6, characterized in that: The step S7 collects SSD SMART information of each host node and uses the SSD fault optimization model to predict faults of all SSD disks, including: Collect SMART information of all SSDs on the host node every 1 minute and aggregate them into a complete SSD table; The SSD fault optimization model is used to predict faults of all SSD disks and send fault alarm information.
8. A device for predicting SSD failure based on machine learning, characterized in that: include: Data collection module, used to collect SSD failure SMART information and build a data set; A data cleaning module is used to clean the data set and divide the cleaned data set into a training set and a test set; The correlation analysis module is used to perform correlation analysis on the numerical columns in the data set, calculate the correlation coefficient, and perform feature selection based on the correlation coefficient; Fault model building module, used to build SSD fault model using random forest classifier based on default parameters; CV cross-validation module, used to perform CV cross-validation to obtain the F1-Score of the SSD fault model; The fault model optimization module is used to perform iterative random forest parameter optimization based on the Bayesian optimizer to obtain the SSD fault optimization model, and perform CV cross-validation calculation to obtain the optimized F1-Score; The fault prediction module is used to collect SSD SMART information of each host node and use the SSD fault optimization model to predict the faults of all SSD disks.
9. A computer device, characterized in that: It includes a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, when the computer device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the method for predicting SSD failure based on machine learning as described in any one of claims 1-7.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for predicting SSD failure based on machine learning as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Small molecule metabolite biomarker for diagnosing acute diseases as well as screening method and application of small molecule metabolite biomarker
CN112748191A
Defect report severity prediction method based on optimized random forest
CN114186644A
Bayesian optimization RF and Light GBM disease prediction method
CN115050477A
Establishment method and prediction method of chemical subchronic toxicity prediction model
CN116153432A
Sub-health management and fault prediction method for SSD (Solid State Disk)
CN118567902A
Cited By
Method for comprehensively verifying data integrity of solid state disk
CN121237188A
