Hard disk fault prediction method and system based on improved GRU and storage medium
By incorporating a dual attention mechanism into the GRU model, the hard disk failure prediction method addresses the limitations of existing methods, achieving improved accuracy and reliability in predicting hard disk failures.
Patent Information
- Application Number
- CN202411228078.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-27
AI Technical Summary
Existing hard disk failure prediction methods, such as SMART technology and GRU-based models, suffer from low accuracy due to the inability to effectively utilize SMART state information and ignore the impact of characteristic factors, leading to poor prediction results, especially in long time series scenarios.
A dual attention mechanism is introduced into the GRU model, comprising a feature attention mechanism and a temporal attention mechanism, to enhance the prediction performance by quantifying the weights between input data and capturing remote dependency information.
The dual attention mechanism improves the hard disk failure prediction accuracy by making input information more reasonable, reducing the depth of hierarchy, and enhancing the GRU network's ability to capture relevant features and temporal dependencies.
Smart Images

Figure CN119201565A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage management, and more particularly to a hard disk failure prediction method, system and storage medium based on an improved GRU. Background Art
[0002] Continuous data transmission, large-scale access to application systems, and busy calculations in scientific research cause hard disks to be in a high-intensity read and write state for a long time, which accelerates the damage process of its internal mechanical structure and causes hard disk failure. Hard disk failure will affect the normal operation of business and even cause data loss. Effective hard disk failure prediction and hard disk replacement before failure can avoid huge losses caused by failure.
[0003] SMART technology is widely used in hard disk failure prediction. It monitors the attribute indicators of the hard disk and defines the critical value. If the monitoring indicator is found to be higher than the critical value, it is determined that the hard disk is about to fail. At present, almost all hard disks have integrated SMART technology functions, but when the false alarm rate is 0.1%, only a 3%-10% fault detection rate can be achieved. It can be seen that it is difficult to achieve accurate fault prediction using only SMART technology. Therefore, researchers use statistics, machine learning or deep learning to predict faults based on SMART attributes. Since the usage of hard disks such as reading, writing, and erasing is unknown, SMART state information is difficult to obey the probability statistical distribution model, resulting in low accuracy of the statistical-based fault prediction model. When predicting hard disk failures, only using GRU to mine the time series characteristics of SMART state information, ignoring the impact of characteristic factors on SMART state information; and when predicting long time series, the hidden state of GRU at the past moment acts indiscriminately on the hidden state at the current moment, which will lead to poor prediction results.
[0004] Therefore, how to improve the prediction effect of hard disk failure prediction is a problem that technical personnel in this field need to solve urgently. Summary of the invention
[0005] In view of this, the present invention provides a hard disk fault prediction method based on improved GRU, which uses the first GRU prediction model and the second GRU prediction model to introduce a feature attention mechanism and a temporal attention mechanism respectively, thereby improving the performance of hard disk fault prediction.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A hard disk failure prediction method based on improved GRU includes the following steps:
[0008] Obtain hard disk SMART status information and input it into the first GRU prediction model, the first GRU prediction model calculates the feature attention weight coefficient according to the output information at the previous moment and the input information at the current moment, and calculates the output information at the current moment according to the calculated weighted feature parameter;
[0009] The output information of the first GRU prediction model is input into the second GRU prediction model, and the second GRU prediction model calculates the temporal attention weight coefficient according to the output information of the first GRU prediction model and the previous hidden state containing the temporal history information, and calculates the output value at the current moment according to the weighted sum of the temporal comprehensive information;
[0010] The output value at the next moment is obtained through dimensional transformation to perform fault prediction.
[0011] Preferably, the step of obtaining the hard disk SMART status information and inputting it into the first GRU prediction model specifically includes:
[0012] Obtain important characteristic parameters of SMART status information in T historical moments to form a status information sequence;
[0013] The state information sequence is input into the first GRU prediction model.
[0014] Preferably, the step of determining the important feature parameters is: using a feature selection method based on random forest to calculate the importance score of each feature, and extracting N features with the highest scores as the important feature parameters.
[0015] Preferably, the important characteristic parameters include one or more of a remapped sector count, a bottom layer data read error rate, a Celsius temperature, a startup time, and a current to-be-mapped sector count.
[0016] Preferably, the formula for calculating the feature attention weight coefficient of the first GRU prediction model is:
[0017]
[0018] in, represents the characteristic attention weight coefficient of parameter k at time t, V e , W e , U e is the weight parameter, b e is the bias parameter and tanh is the activation function.
[0019] Preferably, the step of calculating the weighted feature parameter includes:
[0020] The calculated attention weight coefficients are normalized, and the original input information is weighted respectively, and the obtained sequence is used as the weighted feature parameter.
[0021] Preferably, the formula for calculating the temporal attention weight coefficient of the second GRU prediction model is:
[0022]
[0023] in, represents the temporal attention weight coefficient of parameter k at time t, V L , W L , U L are weight parameters, b L is the bias parameter and tanh is the activation function.
[0024] Preferably, when the GRU decoder is used for T iterations, the predicted value y T+1 and actual value The predicted mean square error (MSE) is used as the loss function for each iteration, and the gradient descent method is used to calculate and update the parameters in the proposed fault prediction model.
[0025] A hard disk fault prediction system based on improved GRU includes a computer system, wherein the computer system is used to execute the hard disk fault prediction method described above.
[0026] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the hard disk failure prediction method described above is implemented.
[0027] Beneficial effects of the present invention:
[0028] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a hard disk fault prediction method, system and storage medium based on improved GRU. By adding attention mechanism from the two aspects of features and timing, the input information is more reasonable, which can effectively solve the problem of poor balance of hard disk SMART status data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0030] Figure 1 A schematic diagram of a hard disk failure prediction method based on an improved GRU provided by the present invention;
[0031] Figure 2 Schematic diagram of the GRU model structure in an embodiment of the present invention;
[0032] Figure 3 This is a basic network architecture diagram of the attention mechanism in an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of random forest classification in an embodiment of the present invention;
[0034] Figure 5 Schematic diagram of the structure of the first GRU prediction model in an embodiment of the present invention;
[0035] Figure 6 Schematic diagram of the structure of the second GRU prediction model in an embodiment of the present invention;
[0036] Figure 7 Schematic diagram of prediction effects of various prediction models in an embodiment of the present invention. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0038] When predicting hard disk failure, only GRU is used to mine the temporal features of SMART status information, ignoring the influence of characteristic factors on SMART status information; and when predicting long time series, the hidden state of GRU at the past moment acts indiscriminately on the hidden state at the current moment, which will lead to poor prediction results. The attention mechanism can quantify the weights between input data, further enhance the ability of GRU network to capture remote dependency information, and effectively improve the prediction effect while reducing the depth of the hierarchy. Therefore, the present invention improves GRU by introducing feature and temporal attention mechanisms, and realizes hard disk failure prediction based on the GRU prediction model (Dual Attention base on GRU, DA-GRU) of the dual attention mechanism.
[0039] Embodiment 1
[0040] like Figure 1 The embodiment of the present invention discloses a hard disk failure prediction method based on an improved GRU, comprising the following steps:
[0041] The hard disk SMART status information is input into the first GRU prediction model. The first GRU prediction model calculates the feature attention weight coefficient according to the output information at the previous moment and the input information at the current moment, and calculates the output information at the current moment according to the calculated weighted feature parameters.
[0042] The output information of the first GRU prediction model is input into the second GRU prediction model. The second GRU prediction model calculates the temporal attention weight coefficient according to the output information of the first GRU prediction model and the previous hidden state containing temporal history information, and calculates the output value at the current moment according to the weighted sum of the temporal comprehensive information.
[0043] The output value at the next moment is obtained through dimensional transformation to perform fault prediction.
[0044] In this embodiment, the first GRU prediction model is a GRU model that introduces feature attention, and the second GRU prediction model is a GRU model that introduces temporal attention. Figure 2 As shown, GRU contains two gating units, where the update gate z t Used to limit the influence of the previous moment information on the current moment, reset the gate r t It is used to set the degree of forgetting of the information of the previous moment at the current moment. GRU has fewer parameters and faster calculation speed than LSTM. Its prediction effect is equivalent to or even better than LSTM.
[0045] According to the GRU model structure diagram, the forward propagation calculation formula of the neural network can be obtained:
[0046] r t =sigmoid(W r ·[h t-1 , x t ])
[0047] z t =sigmoid(W z ·[h t-1 x t ])
[0048]
[0049]
[0050] y t =sigmoid(W o ·h t )
[0051] Among them, h t-1 Indicates the output information of the previous moment, x tIndicates the input information at the current moment. represents the candidate set, h t Represents the output information at the current moment, y t Represents the final output, W r , W z , W o They represent weights, sigmoid and tanh are activation functions.
[0052] The attention mechanism in neural networks is a method that mimics human perception of attention and is used to achieve reasonable and efficient resource allocation in the process of information processing. The attention mechanism uses high weights to process information that is of particular concern, and low weights to process information that is less relevant. It can also dynamically adjust weights to adapt to different situations, thereby enhancing the scalability and robustness of the model. The basic network architecture of the attention mechanism is as follows: Figure 3 shown.
[0053] The advantage of the attention mechanism is that it pays attention to relevant information and ignores minor information, avoids complex cycles and directly establishes the corresponding relationship between input and output, enhances parallelization capabilities, and improves computing speed. The attention mechanism can overcome some defects of neural networks such as LSTM and GRU, such as the decline in model performance as the input length increases, the low model calculation efficiency caused by poor input order, and the poor feature extraction and enhancement capabilities of the model. In response to problems such as poor balance of hard disk SMART status data, the attention mechanism shortens the data processing time and retains key information by simplifying the processing of data features, making the input information more reasonable. Therefore, the combination of the attention mechanism and the GRU neural network can improve the performance of hard disk fault prediction.
[0054] In order to further implement the above technical solution, the data input to the first GRU prediction model is data at multiple historical moments, and the specific steps include: obtaining SMART state information at T historical moments to form a state information sequence; obtaining important feature parameters of the SMART state information at T historical moments to form a second state information sequence; merging the state information sequence and the second state sequence, and inputting them into the first GRU prediction model; an example is as follows:
[0055] Taking time t (1≤t≤T) as an example, suppose that after feature selection, the time series of important feature parameters of hard disk SMART status information at T historical moments is X k , after expansion:
[0056]
[0057] The steps for determining the important feature parameters are: using a feature selection method based on random forest to calculate the importance score of each feature, and extracting the top N features as the important feature parameters. Random forest is an algorithm with high classification accuracy and computational efficiency, and performs well in many practical classification tasks. The constituent unit of random forest is a series of decision tree classification models {h(X,θ k ),k=1,…}, where the random variable {θ k} are independent of each other and have the same distribution function. After clarifying the dependent variable X, use one vote to obtain the best results of all decision tree classification models. The key steps of random forest are: the first step is to use bootstrap sampling to select k samples with constant capacity from the original data set; the second step is to create k decision tree models accordingly; the third step is to vote according to the k classification results to determine the final classification. Figure 4 Schematic diagram of random forest classification.
[0058] Random forests enhance the inconsistency between decision tree classification models by creating different training sets, thereby improving the selection and judgment ability of the combined classification model. After k rounds of training, a single classification model sequence {h1(X), h2(X), …, h k (X)}, and they are combined to obtain a multi-classification model system, whose final classification result is determined by the majority voting method, and the calculation formula is as follows:
[0059]
[0060] Among them, H(x) is the combined classification model, h i is a single classification model, Y represents the output scalar, and I(·) is the indicative function.
[0061] Furthermore, after obtaining the set X k Based on this, it is processed by the first GRU prediction model, and the process is as follows:
[0062] X k and the hidden state output h of GRU t-1 At the same time, it is used as the input of the multi-layer perceptron to carry out FA weight calculation. Its structure is as follows Figure 5 shown.
[0063] The calculation formula of the feature attention multi-layer perceptron is as follows:
[0064]
[0065] Among them, V e , W e , U e is the weight parameter, b eis the bias parameter, and tanh is the activation function. To ensure the consistency of the prominence and suppression ratio of each feature parameter, the softmax function is used to normalize the above formula to obtain the weighted feature parameter at time t The encoder hidden state h t Will continue to iterate and generate, where f GRU () is the GRU function.
[0066]
[0067]
[0068]
[0069] Furthermore, the output hidden state of FA-GRU is used as input, and the temporal attention mechanism (TA) is used to assign weights again to further enhance the performance of the hidden state at high weight moments and reduce the role of the hidden state at low weight moments, which can more accurately predict long time series. Its structure is as follows: Figure 6 shown.
[0070] The hidden state set h output by FA-GRU t The previous hidden state h' containing temporal history information in TA-GRU t-1 As input, the weight coefficient of the temporal attention mechanism is calculated by the multi-layer perceptron:
[0071]
[0072] Among them, V L , W L , U L are weight parameters, b L is the bias parameter, and tanh is the activation function. Use the softmax function to normalize the above formula to get the effect of different hidden states on the current hidden state:
[0073]
[0074] Where j is the counting parameter of the summation formula, satisfying 1≤j≤T; t represents a specific moment t among T historical moments; k represents k characteristic parameters; With h t The weighted summation can obtain the characteristic time series comprehensive information parameters that can not only represent the correlation between different characteristic parameters but also reflect the time series information:
[0075]
[0076] c tThe above hard disk SMART status information time series m t After merging through the feedforward neural network, the output value of TA-GRU at time t is obtained:
[0077] y t =w[m t ,c t ]+b
[0078] Among them, w and b are the weight and bias of the feedforward neural network respectively.
[0079] The final hidden state output by TA-GRU:
[0080] h′ t =f GRU (h′ t-1 ,y t-1 )
[0081] Will h' T With c T After being merged through a feedforward neural network and then transformed in dimension, the predicted value at time T+1 is finally obtained:
[0082] y T+1 =V y (W u [h′ T , c T ]+b u )+b y
[0083] Among them, W u , b u is the weight and bias of the GRU network, V y , b y is the weight and bias of the feedforward neural network during dimension transformation. When the GRU decoder is used for T iterations, the predicted value y T+1 and actual value The mean square error (MSE) is used as the loss function for each iteration, and the gradient descent method is used to calculate and update the parameters in the proposed fault prediction model.
[0084] In order to further implement the above technical solutions, the training phase of the model includes the following steps:
[0085] 1. Get training data.
[0086] The SMART dataset obtained contains data from 14,232 hard disks, including 13,985 normal hard disks and 247 faulty hard disks. The data is collected twice a day using smartmontools. Before a hard disk fails, it will first enter a near-failure state, which can be detected 15 days in advance. Therefore, to ensure that the hard disk provides uninterrupted storage services, we choose to retain 15 consecutive days of hard disk data.
[0087] 2. Data preprocessing.
[0088] The SMART dataset collects a total of 23 attribute features. Considering the redundancy between the features in fault prediction and the computational complexity of generating a fault prediction model, the present invention uses a feature selection method based on random forests to calculate the importance score of each feature and select 10 attributes that are meaningful for fault prediction as important features, as shown in Table 1. These 10 important features will be used to calculate the above-mentioned feature attention mechanism.
[0089] Table 1 Input characteristics
[0090]
[0091]
[0092] The eigenvalues are normalized and mapped to [-1,1]. This not only reduces the computational complexity of the deep learning algorithm and speeds up the training, but also allows for fair comparison of the contributions of the eigenvalues and enhances the prediction capability. The present invention uses a linear conversion function to normalize the input features, and the formula is as follows:
[0093]
[0094] Among them, x is the original input feature value, x max 、x min are the maximum and minimum values of the feature, respectively, x normal is the normalized eigenvalue. The processed data set is randomly divided into two parts, 70% of which is used as a training set to train multiple hard disk failure prediction models, and 30% is used as a test set to test the generated model.
[0095] 3. Evaluation indicators.
[0096] In order to verify the hard disk fault prediction model, the present invention uses the commonly used evaluation indicators in the field of fault prediction, namely, the fault detection rate (FDR), the fault false alarm rate (FAR), the ROC curve and the AUC value. Table 2 is a confusion matrix.
[0097] Table 2 Confusion matrix
[0098]
[0099] Fault Detection Rate (FDR):
[0100] Fault False Alarm Rate (FAR):
[0101] ROC curve and AUC value: The closer the ROC curve is to the upper left corner of the rectangular graph, the better the classification effect of the model; the AUC value is the area formed by the ROC curve.
[0102] 4. Result analysis.
[0103] To verify the effectiveness of the proposed algorithm, experimental comparisons are made on the GRU improved model that only introduces the feature attention mechanism (FeatureAttention base on GRU, FA-GRU), the GRU improved model that only introduces the temporal attention mechanism (TemporalAttentionbase on GRU, TA-GRU), the GRU improved model based on the dual attention mechanism of feature and temporal (DA-GRU), and the LSTM model. In the hard disk failure prediction, the FDR, FAR, and AUC of different models are shown in Table 3, and the ROC curve is shown in Figure 7 shown.
[0104] Table 3 Comparison of hard disk failure prediction performance of different models
[0105]
[0106] It can be seen from Table 3 that from the perspective of FDR, FAR and AUC, the overall prediction effect of GRU is better than LSTM; by introducing the feature attention mechanism or the temporal attention mechanism alone, the prediction performance of GRU is improved, that is, FA-GRU and TA-GRU are better than GRU; introducing the feature attention mechanism and the temporal attention mechanism at the same time can greatly improve the prediction ability of GRU, that is, the DA-GRU proposed in the present invention is significantly better than GRU. Table 3 and Figure 7 It is intuitively demonstrated that the hard disk failure prediction algorithm based on improved GRU proposed in the present invention has the best effect.
[0107] Example 2
[0108] Based on the same inventive concept, an embodiment of the present invention discloses a hard disk failure prediction system based on an improved GRU, including a computer system. The computer system is used for the hard disk failure prediction method in Embodiment 1.
[0109] Example 3
[0110] Based on the same inventive concept, an embodiment of the present invention discloses a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the hard disk failure prediction method in Embodiment 1 can be implemented.
[0111] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0112] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A hard disk failure prediction method based on improved GRU, characterized in that: The following steps are involved: Obtain hard disk SMART status information and input it into the first GRU prediction model, the first GRU prediction model calculates the feature attention weight coefficient according to the output information at the previous moment and the input information at the current moment, and calculates the output information at the current moment according to the calculated weighted feature parameter; The output information of the first GRU prediction model is input into the second GRU prediction model, and the second GRU prediction model calculates the temporal attention weight coefficient according to the output information of the first GRU prediction model and the previous hidden state containing the temporal history information, and calculates the output value at the current moment according to the weighted sum of the temporal comprehensive information; The output value at the next moment is obtained through dimensional transformation to perform fault prediction.
2. According to the hard disk failure prediction method based on improved GRU according to claim 1, it is characterized in that: The step of obtaining the hard disk SMART status information and inputting it into the first GRU prediction model specifically includes: Obtain important characteristic parameters of SMART status information in T historical moments to form a status information sequence; The state information sequence is input into the first GRU prediction model.
3. The hard disk failure prediction method based on improved GRU according to claim 2 is characterized in that: The step of determining the important feature parameters is: using a feature selection method based on random forest to calculate the importance score of each feature, and extracting N features with the highest scores as the important feature parameters.
4. A hard disk failure prediction method based on improved GRU according to claim 2 or 3, characterized in that: The important characteristic parameters include one or more of a remapped sector count, a bottom layer data read error rate, a Celsius temperature, a startup time, and a current to-be-mapped sector count.
5. The hard disk failure prediction method based on improved GRU according to claim 1 is characterized in that: The formula for calculating the feature attention weight coefficient of the first GRU prediction model is: in, represents the characteristic attention weight coefficient of parameter k at time t, V e , W e , U e is the weight parameter, b e is the bias parameter and tanh is the activation function.
6. The hard disk failure prediction method based on improved GRU according to claim 5 is characterized in that: The step of calculating the weighted characteristic parameter comprises: The calculated attention weight coefficients are normalized, and the original input information is weighted respectively, and the obtained sequence is used as the weighted feature parameter.
7. The hard disk failure prediction method based on improved GRU according to claim 1 is characterized in that: The formula for calculating the temporal attention weight coefficient of the second GRU prediction model is: in, represents the temporal attention weight coefficient of parameter k at time t, V L , W L , U L are weight parameters, b L is the bias parameter and tanh is the activation function.
8. The hard disk failure prediction method based on improved GRU according to claim 1 is characterized in that: When the GRU decoder is used for T iterations, the predicted value y T+1 and actual value The mean square error (MSE) is used as the loss function for each iteration, and the gradient descent method is used to calculate and update the parameters in the proposed fault prediction model.
9. A hard disk failure prediction system based on improved GRU, characterized in that: It comprises a computer system, and the computer system is used to execute the hard disk failure prediction method according to any one of claims 1-8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the hard disk failure prediction method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
SO2 concentration prediction method based on double-stage attention and double-flow memory adjustment GRU
CN120126601A
