A hard disk failure prediction method, device, electronic device and storage medium
Through machine learning models based on sample working status data, the problem of low accuracy of hard disk failure prediction is solved, and more efficient hard disk failure prediction and data backup prompts are achieved, reducing the risk of data loss.
Patent Information
- Application Number
- CN202210370064.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-04-08
AI Technical Summary
In the prior art, the accuracy of hard disk failure prediction is not high, especially because the false alarm rate and false alarm rate caused by unreasonable security value settings in SMART technology are high, so it is impossible to effectively predict predictable faults of hard disks.
The machine learning model based on sample working state data is used to train the fault prediction model. By obtaining the SMART information and other working state data of the hard disk, the machine learning model is used to process the working state data of the hard disk at the current moment, and the fault conditions within the future preset time are predicted.
It improves the accuracy of hard disk failure prediction, reduces the false alarm rate caused by unreasonable security value settings, can more accurately predict the failure time of hard disk, and reduces the risk of data loss.
Smart Images

Figure CN114758714B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a hard disk failure prediction method, apparatus, electronic device, and storage medium. Background Art
[0002] Since there are a large number of hard disks in a subway station, and a large amount of valuable data is stored in the hard disks, it is of extremely important significance to predict the failures of the hard disks in the subway station server, timely discover the hard disks that may fail, and perform data backup to ensure the data security of the subway station.
[0003] Generally, the failures of hard disks are divided into two types: predictable and unpredictable. The latter occurs occasionally and there is no way to prevent it, such as sudden chip failure, mechanical impact, etc. However, situations such as wear of motor bearings and degradation of the magnetic medium performance of the disk platter belong to predictable cases, and such abnormal phenomena can be discovered several days or even several weeks in advance. How to accurately predict the failures of hard disks has always attracted much attention. Summary of the Invention
[0004] To solve the existing technical problems, embodiments of the present disclosure provide a hard disk failure prediction method, apparatus, electronic device, and storage medium.
[0005] To achieve the above object, the technical solution of the embodiments of the present disclosure is realized as follows:
[0006] Embodiments of the present disclosure provide a hard disk failure prediction method, the method including:
[0007] Obtain the working state data of the hard disk at the current moment;
[0008] Process the working state data by using a preset failure prediction model to obtain a failure prediction result of the hard disk within a preset time period in the future; wherein, the preset failure prediction model is trained by using a machine learning model based on sample working state data.
[0009] In the above solution, the method further includes:
[0010] According to the working state data identified by the first label corresponding to the first historical moment, select the working state data within the first preset time period before the first historical moment, and determine the working state data at the first historical moment and the working state data within the first preset time period as the sample data identified by the first label;
[0011] Select the sample data identified by the second label within the historical time period;
[0012] Train the failure prediction model by using the machine learning model based on the sample data identified by the first label and the sample data identified by the second label.
[0013] In the above solution, the selection of the sample data identified by the second label within the historical duration includes:
[0014] According to the working status data identified by the second label corresponding to the second historical moment, select the working status data within the second preset duration before the second historical moment, and determine the working status data at the second historical moment and the working status data within the second preset duration as the sample data identified by the second label.
[0015] In the above solution, the amounts of data of the sample data identified by the first label and the sample data identified by the second label are the same.
[0016] In the above solution, the method further includes:
[0017] Determine the attributes of the hard disk according to the identifier of the hard disk;
[0018] The processing of the working status data by using a preset fault prediction model to obtain a fault prediction result of the hard disk within a future preset duration includes:
[0019] Process the working status data by using the preset fault prediction model corresponding to the attributes of the hard disk to obtain a fault prediction result of the hard disk within a future preset duration;
[0020] Wherein, the attributes of the hard disk include at least one of the following:
[0021] The type of the hard disk;
[0022] The manufacturer to which the hard disk belongs.
[0023] In the above solution, the obtaining of the working status data of the hard disk at the current moment includes:
[0024] Obtain the working status data of the hard disk at the current moment based on the SMART information of the hard disk; wherein, the working status data includes at least one of the following:
[0025] Reallocated sector count, uncorrectable errors, command timeouts, current pending sector count, or offline uncorrectable sector count.
[0026] In the above solution, the method further includes:
[0027] When the fault prediction result of the hard disk indicates that the hard disk will fail within the future preset duration, output a data backup prompt message.
[0028] An embodiment of the present disclosure further provides a hard disk fault prediction device, which is characterized in that the device includes:
[0029] An acquisition module, configured to acquire the working state data of the hard disk at the current moment;
[0030] A prediction module, configured to process the working state data by using a preset fault prediction model to obtain a fault prediction result of the hard disk in a preset duration in the future; wherein, the preset fault prediction model is trained by using a machine learning model based on sample working state data.
[0031] In the above solution, the device further includes:
[0032] A first selection module, configured to select the working state data within a first preset duration before the first historical moment according to the working state data identified by the first label corresponding to the first historical moment, and determine the working state data of the first historical moment and the working state data within the first preset duration as the sample data identified by the first label;
[0033] A second selection module, configured to select the sample data identified by the second label within a historical duration;
[0034] A training module, configured to train and obtain the fault prediction model by using the machine learning model based on the sample data identified by the first label and the sample data identified by the second label.
[0035] In the above solution, the second selection module is further configured to select the working state data within a second preset duration before the second historical moment according to the working state data identified by the second label corresponding to the second historical moment, and determine the working state data of the second historical moment and the working state data within the second preset duration as the sample data identified by the second label.
[0036] In the above solution, the device further includes:
[0037] A determination module, configured to determine the attribute of the hard disk according to the identifier of the hard disk;
[0038] The prediction module is further configured to process the working state data by using the preset fault prediction model corresponding to the attribute of the hard disk to obtain the fault prediction result of the hard disk;
[0039] Wherein, the attribute of the hard disk includes at least one of the following:
[0040] The type of the hard disk;
[0041] The manufacturer to which the hard disk belongs.
[0042] In the above solution, the acquisition module is further configured to acquire the working state data of the hard disk based on the SMART information of the hard disk; wherein, the working state data includes at least one of the following:
[0043] Reallocated Sector Count, Uncorrectable Errors, Command Timeout, Current Pending Sector Count or Offline Uncorrectable Sector Count.
[0044] In the above solution, the device further includes:
[0045] An output module, configured to output a data backup prompt message when the hard disk failure prediction result indicates that the hard disk will fail within the preset duration in the future.
[0046] An embodiment of the present disclosure further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the steps of the hard disk failure prediction method described in the foregoing embodiment are implemented.
[0047] An embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, wherein when the program is executed by a processor, the steps of the hard disk failure prediction method described in the foregoing embodiment are implemented.
[0048] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects:
[0049] The present disclosure uses a failure prediction model trained by a machine learning model based on sample working state data to process the working state data of the hard disk at the current moment, and obtains a hard disk failure prediction result for a preset duration in the future. Since the failure prediction model is trained based on sample working state data, the present disclosure predicts the hard disk failure based on this model, rather than based on the method of comparing with safety values in SMART technology, which can reduce the problem of low accuracy caused by unreasonable safety value settings. Therefore, the solution of the present disclosure can improve the accuracy of hard disk failure prediction. Description of the Drawings
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0051] Figure 1 A flowchart of a hard disk failure prediction method provided by an embodiment of the present disclosure;
[0052] Figure 2 A schematic diagram of the training process of a hard disk failure prediction model provided by an embodiment of the present disclosure;
[0053] Figure 3Schematic flowchart of another hard disk failure prediction method provided by an embodiment of the present disclosure;
[0054] Figure 4 Schematic structural diagram of a hard disk failure prediction device provided by an embodiment of the present disclosure;
[0055] Figure 5 Schematic diagram of the hardware composition structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following will further describe the specific technical solutions of the present disclosure in detail with reference to the accompanying drawings in the embodiments of the present disclosure. The following embodiments are used to illustrate the present disclosure but are not intended to limit the scope of the present disclosure.
[0057] Currently, the vast majority of hard disk manufacturers generally apply the Self-Monitoring Analysis and Reporting Technology (SMART) of hard disks when predicting hard disk failures. In fact, the accuracy rate of using SMART technology for failure prediction is not high. Analyzing from the principle, it is because the failure prediction method based on safety values adopted by SMART technology is too rough. Moreover, in order to reduce the false alarm rate of prediction and make their products look more stable, hard disk manufacturers generally set the safety values relatively low, and such a practice has led to an even lower accuracy rate of failure prediction. Research shows that when the false alarm rate of failure prediction is 0.1%, the accuracy rate of failure prediction is only between 3% and 10%. That is to say, by predicting the hard disk failure in this way, the accuracy rate is low and the prediction effect is poor.
[0058] In response to this, the present disclosure provides a hard disk failure prediction method, Figure 1 Schematic flowchart of a hard disk failure prediction method provided by an embodiment of the present disclosure; As Figure 1 shown, the method includes:
[0059] Step 101: Obtain the working state data of the hard disk at the current moment;
[0060] Step 102: Process the working state data by using a preset failure prediction model to obtain a failure prediction result of the hard disk in a preset duration in the future; wherein, the preset failure prediction model is trained by using a machine learning model based on sample working state data.
[0061] In the embodiments of the present disclosure, the working state data of the hard disk may include the SMART information of the hard disk, the memory occupancy, the working duration, etc. Among them, the SMART technology is an automatic hard disk state detection technology. Through the detection instructions in the hard disk hardware, the operation conditions of the hard disk hardware such as the head, disk, motor, and circuit are monitored, recorded, and compared with the preset safety values set by the manufacturer. If the monitoring results indicate that the operation data of the hard disk is about to exceed or has exceeded the range of the preset safety values, a warning can be automatically sent to the user through the monitoring hardware or software of the host and minor automatic repairs can be performed to ensure the safety of the hard disk data in advance. The hard disk has its own hardware detection module, which is called SMART, and the hard disk state read from this module is the SMART information.
[0062] In this embodiment, when performing fault prediction, the working state data of the hard disk at the current moment can be obtained. It should be noted that the quantity of the working state data can be set according to the actual usage scenario of the fault prediction model, and no limitation is made here. Within a certain range, the prediction accuracy may increase with the increase in the quantity of the obtained working state data.
[0063] In this embodiment, by using the trained fault prediction model to process the working state data of the hard disk at the current moment, the fault prediction result of the hard disk within a preset future duration can be obtained.
[0064] In this embodiment, the preset fault prediction model is trained by using a machine learning model based on the sample working state data. Among them, the machine learning model can be a random forest model, a support vector machine (Support Vector Machine, SVM) model, a naive Bayes model, a logistic regression model, etc. It should be noted that the sample working state data may include fault working state data and non-fault working state data, and the sample working state data may include the working state data of hard disks from multiple different manufacturers, or may only include the working state data of hard disks from the same manufacturer. At the same time, the sample working state data may include the working state data of hard disks of different models, or may only include the working state data of hard disks of the same model. In this embodiment, after inputting the working state data of the hard disk into the fault prediction model, the fault prediction result of the hard disk can be output. The prediction result output by the fault prediction model may include that the hard disk may fail, the specific time when the hard disk may fail, or that the hard disk will not fail, etc.
[0065] It can be understood that by adopting the technical solution of the embodiment of the present disclosure, using the fault prediction model trained by a machine learning model based on the sample working state data to process the working state data of the hard disk at the current moment, and obtaining the fault prediction result of the hard disk in a preset duration in the future. Since the fault prediction model is trained based on the sample working state data, the present disclosure predicts the hard disk fault based on this model, rather than based on the method of comparing with the safety value in the SMART technology, which can reduce the problem of low accuracy caused by unreasonable safety value settings. Therefore, the solution of the present disclosure can improve the accuracy of hard disk fault prediction.
[0066] In some alternative embodiments, the method further includes:
[0067] According to the working state data of the first label identifier corresponding to the first historical moment, select the working state data within the first preset duration before the first historical moment, and determine the working state data of the first historical moment and the working state data within the first preset duration as the sample data of the first label identifier;
[0068] Select the sample data of the second label identifier within the historical duration;
[0069] Based on the sample data of the first label identifier and the sample data of the second label identifier, train the fault prediction model by using the machine learning model.
[0070] It should be noted that in this embodiment, the first label identifier can be an identifier indicating a fault; the second label identifier can be an identifier indicating no fault; the first historical moment can be any moment before the current moment; the first preset duration is the preset duration for obtaining the sample data of the first label identifier, and the historical duration is the preset duration for obtaining the sample data of the second label identifier. The durations of the first preset duration and the historical duration can be the same or different, and the embodiments of the present disclosure do not limit this. Exemplarily, the first preset duration can be half a month, 1 month, or half a year, etc., and the historical duration can be fourteen days, half a month, or one month, etc.
[0071] In this embodiment, exemplarily, when the first preset duration is half a month, according to the fault working state data of the first historical moment, select the working state data within half a month before the first historical moment. The selected working state data can include fault working state data and non-fault working state data. All the non-fault working state data are marked with the first label identifier indicating a fault, so as to determine the working state data of the first historical moment and the marked working state data within the previous half month as the fault sample data.
[0072] In this embodiment, when the historical duration is 14 days, non-fault working state data within 14 days is selected from the historical working state data of the hard disk to obtain non-fault sample data.
[0073] It should be noted that the more the number of selected non-fault working state data is, the more accurate the prediction result of the fault prediction model obtained by training with the machine model is. For example, when the hard disk fault prediction of the present disclosure is used in the subway scenario, since there are a large number of hard disks in the subway station, the historical working state data of a large number of hard disks can be used to train the fault prediction model, thereby improving the accuracy of model prediction.
[0074] In this embodiment, the fault sample data and the non-fault sample data are combined to obtain a sample data set, and then a machine learning algorithm is sampled to train the sample data set to obtain a hard disk fault prediction model.
[0075] In some alternative embodiments, the hard disk fault prediction model is trained using the normalized sample data set. Normalizing the sample data set, for example, scales the values of the sample data so that its final range falls between 0 and 1. Normalization can unify the data measurement scale, thereby helping to improve the accuracy of model training.
[0076] In some alternative embodiments, when training the hard disk fault prediction model, it is necessary to optimize the parameters of the hard disk fault prediction model to determine whether there is an overfitting problem or an underfitting problem. For example, methods such as learning curves, receiver operating characteristic curves (ROC), cross-validation, or backpropagation can be used to guide parameter tuning.
[0077] In some other alternative embodiments, the hard disk after being predicted by the fault prediction model can be monitored to obtain the actual operation result of the hard disk, such as a fault or normal result, and it can also include actual operation parameters. After professionals combine the actual operation result and the prediction result, the parameters of the fault prediction model are manually optimized to further improve the fault prediction model.
[0078] Figure 2 This is a schematic diagram of the training process of a hard disk fault prediction model provided by an embodiment of the present disclosure; as Figure 2 shown, the training process of the hard disk fault prediction model mainly includes: based on the hard disk sample data, a machine learning model is used to train to obtain a hard disk fault prediction model, and then the prediction result of the hard disk fault prediction model is verified. When the result of model verification indicates that the prediction result of the hard disk fault prediction model does not reach the preset effect, it is necessary to adjust the parameters of the hard disk fault prediction model and perform model training again until the prediction result of the hard disk fault prediction model reaches the preset effect.
[0079] It can be understood that by adopting the technical solution of the embodiment of the present disclosure, based on the working state data of the first tag identifier corresponding to the first historical moment, the working state data within the first preset duration before the first historical moment is selected, and the working state data of the first historical moment, the working state data within the first preset duration, and the working state data within the first preset duration are determined as the sample data of the first tag identifier. By tracing back the working state data within the first preset duration before the working state data of the first tag identifier, the change situation of the working state data of the first tag identifier within a previous period of time can be understood, and the data is identified based on the first tag identifier at the first moment, that is, the working state data within the first preset duration before the first historical moment is regarded as a whole, so that the state of the hard disk in a certain future duration can be predicted based on the current working state data of the hard disk, and thus whether the hard disk will fail in the future can be predicted more accurately.
[0080] In some alternative embodiments, the selection of the sample data of the second tag identifier within the historical duration includes:
[0081] Based on the working state data of the second tag identifier corresponding to the second historical moment, the working state data within the second preset duration before the second historical moment is selected, and the working state data of the second historical moment and the working state data within the second preset duration are determined as the sample data of the second tag identifier.
[0082] It should be noted that the second historical moment can be any moment before the current moment.
[0083] Exemplarily, when the second preset duration is ten days, based on the non-fault working state data of the second historical moment, the working state data within ten days before the second historical moment is selected, and the working state data of the second historical moment and the working state data within the previous ten days are determined as the non-fault sample data.
[0084] It can be understood that by adopting the technical solution of the embodiment of the present disclosure, by using the non-fault data at the second moment and the working state data within a period of time between the second moments as the non-fault sample data, by tracing back the working state data within the second preset duration before the working state data of the second tag identifier, the change situation of the working state data of the second tag identifier within a previous period of time can be understood, and the data is identified based on the second tag identifier at the second moment, thereby further improving the accuracy of hard disk failure prediction and achieving a better prediction effect.
[0085] In some alternative embodiments, the amount of data of the sample data of the first tag identifier is the same as that of the sample data of the second tag identifier.
[0086] In this embodiment, the amounts of sample data identified by the first label and the sample data identified by the second label are the same, so that a better balancing effect between the sample data identified by the first label and the sample data identified by the second label can be obtained, thereby avoiding the situation that the performance of the fault prediction model after training is poor due to the poor balancing effect between the sample data identified by the first label and the sample data identified by the second label.
[0087] In some alternative embodiments, the method further includes:
[0088] Determine the attributes of the hard disk according to the identifier of the hard disk;
[0089] The processing of the working state data by using the preset fault prediction model to obtain the fault prediction result of the hard disk within a preset time period in the future includes:
[0090] Process the working state data by using the preset fault prediction model corresponding to the attributes of the hard disk to obtain the fault prediction result of the hard disk within a preset time period in the future;
[0091] Wherein, the attributes of the hard disk include at least one of the following:
[0092] The type of the hard disk;
[0093] The manufacturer to which the hard disk belongs.
[0094] It should be noted that the identifier of the hard disk may include one or a combination of a manufacturer identifier, a product identifier (Manufactor ID), a hard disk serial number, and a firmware version number. The attributes of the hard disk may include the type of the hard disk. According to the different structures of the hard disk, the type of the hard disk can be divided into a solid-state drive and a mechanical hard disk. In addition, it may also include the model of the hard disk. The model of the hard disk includes the size, capacity, identifier, and interface type of the hard disk. For example, for a hard disk with the model ST116002AG, the size is 3.5 inches, the memory is 160 gigabytes (GB), it uses two disk platters, and it has an Advanced Technology Attachment (ATA) interface. In addition, the manufacturer to which the hard disk belongs is, for example, Seagate Corporation, etc.
[0095] In this embodiment, the working status indicators of the hard disks that each supplier is concerned about may be different, and the measurement methods of the working status data by each supplier may also be different. Therefore, based on the attributes of different hard disks, the present disclosure trains a failure prediction model corresponding to the attributes. When it is necessary to predict the failure of a hard disk, before making the prediction, first, the attributes of the hard disk can be determined according to the identifier of the hard disk, and then the working status data of the hard disk is processed using the failure prediction model corresponding to the attributes of the hard disk to obtain the failure prediction result of the hard disk within a preset duration in the future.
[0096] It can be understood that by adopting the technical solution of the embodiment of the present disclosure, processing the working status data using the preset failure prediction model corresponding to the attributes of the hard disk is more time-saving and labor-saving compared to the hard disk failure prediction model applicable to multiple hard disk models, and the accuracy of the obtained failure prediction result is also higher.
[0097] In some alternative embodiments, the obtaining of the working status data of the hard disk at the current moment includes:
[0098] Obtaining the working status data of the hard disk at the current moment based on the SMART information of the hard disk; wherein, the working status data includes at least one of the following:
[0099] Reallocated sector count, uncorrectable errors, command timeouts, current pending sector count, or offline uncorrectable sector count.
[0100] It should be noted that in this embodiment, the data value of the reallocated sector count represents the number of sectors that have been remapped. When it is found that the data value of this item is not zero, close attention should be paid to its development trend. If it can remain stable for a long time, the hard disk can still operate normally; if the data value continues to rise, it indicates that the number of bad sectors is increasing and the hard disk is in an unstable state. Uncorrectable errors represent the errors that cannot be corrected by the hardware and are reported to the operating system. If the data value is not zero, the data on the hard disk should be backed up. Command timeouts represent the number of times the operation is terminated due to hard disk timeouts. If the data value is much greater than zero, the most likely problems are power supply issues or poor contact caused by oxidized data cables, or serious problems with the hard disk. The current pending sector count represents the number of unstable sectors, that is, the number of sectors waiting to be remapped. The offline uncorrectable sector count accumulates the total number of uncorrectable errors that occur when reading and writing sectors.
[0101] In this embodiment, the preset fault prediction model first obtains various original historical working state data from the hard disk's working state database. Since the data in the hard disk's working state database contains irrelevant features and redundant features, when there are many features in the data set, the established model is prone to overfitting, which affects the learning effect of the training model. Therefore, in this embodiment, features closely related to faults are extracted from the SMART information of more than one hundred dimensions as basic data. Thus, in this embodiment, the working state data at the current moment obtained based on the SMART information of the hard disk includes at least one of the remapped sector count, uncorrectable errors, command timeouts, current pending sector count, or offline uncorrectable sector count.
[0102] In some alternative embodiments, the method further includes:
[0103] When the fault prediction result of the hard disk indicates that the hard disk will fail within the preset future duration, output a data backup prompt message.
[0104] It should be noted that, in the embodiments of the present disclosure, the data backup prompt message can be output through dialog boxes, bullet screens, voices, etc., and is not limited herein.
[0105] In this embodiment, when the fault prediction result of the hard disk indicates that the hard disk will fail within the preset future duration, output the data backup prompt message corresponding to the hard disk that will fail within the preset future duration and the specific time when the hard disk may fail, and timely remind the user to back up the data of the hard disk that will fail within the preset future duration, greatly reducing the risk of data loss.
[0106] The following describes in detail the hard disk fault prediction method according to the embodiments of the present disclosure with a specific example. Figure 3 It is a schematic flowchart of another hard disk fault prediction method provided by the embodiments of the present disclosure; as Figure 3 shown, the method includes:
[0107] Step 201: Obtain the real-time SMART data of the hard disk.
[0108] In this embodiment, the real-time SMART data may be the working state data at the current moment.
[0109] Step 202: Input the real-time SMART data of the hard disk into the hard disk fault diagnosis model.
[0110] In this embodiment, the hard disk fault diagnosis model may be a fault prediction model trained by a machine learning model based on sample working state data.
[0111] Step 203: Perform a fault prediction on the hard disk to obtain a hard disk fault prediction result.
[0112] In this embodiment, a hard disk is subjected to fault prediction to obtain a hard disk fault prediction result, that is, a preset fault prediction model is used to process the working state data to obtain a fault prediction result of the hard disk for a preset duration in the future.
[0113] Here, steps 201 to 203 can refer to the detailed description in the foregoing embodiment and will not be elaborated here. It can be understood that by adopting the technical solution of the embodiment of the present disclosure, a fault prediction model trained by a machine learning model based on sample working state data is used to process the working state data of the hard disk at the current moment to obtain a fault prediction result of the hard disk for a preset duration in the future. Since the fault prediction model is trained based on sample working state data, the present disclosure predicts the hard disk fault based on this model, rather than based on the method of comparing with the safety value in the SMART technology, which can reduce the problem of low accuracy caused by unreasonable safety value settings. Therefore, the solution of the present disclosure can improve the accuracy of hard disk fault prediction.
[0114] Based on the foregoing embodiment, the embodiment of the present disclosure further provides a hard disk fault prediction device. Figure 4 The following is a schematic structural diagram of a hard disk fault prediction device provided by the embodiment of the present disclosure. As Figure 4 shown, the device includes:
[0115] An acquisition module 301, configured to acquire the working state data of the hard disk at the current moment;
[0116] A prediction module 302, configured to use a preset fault prediction model to process the working state data to obtain a fault prediction result of the hard disk for a preset duration in the future; wherein, the preset fault prediction model is trained by a machine learning model based on sample working state data.
[0117] In some optional embodiments of the present disclosure, the device further includes:
[0118] A first selection module 303, configured to select the working state data within a first preset duration before the first historical moment according to the working state data with the first label identifier corresponding to the first historical moment, and determine the working state data of the first historical moment and the working state data within the first preset duration as the sample data with the first label identifier;
[0119] A second selection module 304, configured to select the sample data with the second label identifier within the historical duration;
[0120] A training module 305, configured to train the fault prediction model by using the machine learning model based on the sample data with the first label identifier and the sample data with the second label identifier;
[0121] In some alternative embodiments of the present disclosure, the second selection module 304 is further configured to select the working state data within a second preset time period before the second historical moment according to the working state data of the second tag identifier corresponding to the second historical moment, and determine the working state data of the second historical moment and the working state data within the second preset time period as the sample data of the second tag identifier.
[0122] In some alternative embodiments of the present disclosure, the apparatus further includes: a determination module 306, further configured to determine the attribute of the hard disk according to the identifier of the hard disk;
[0123] The prediction module 302 is further configured to process the working state data by using a preset fault prediction model corresponding to the attribute of the hard disk to obtain a fault prediction result of the hard disk;
[0124] Wherein, the attribute of the hard disk includes at least one of the following:
[0125] The type of the hard disk;
[0126] The manufacturer to which the hard disk belongs.
[0127] In some alternative embodiments of the present disclosure, the acquisition module 301 is further configured to acquire the working state data of the hard disk based on the SMART information of the hard disk; wherein, the working state data includes at least one of the following:
[0128] Reallocated sector count, uncorrectable errors, command timeout, current pending sector count or offline uncorrectable sector count.
[0129] In some alternative embodiments of the present disclosure, the apparatus further includes:
[0130] An output module 307, configured to output a data backup prompt message when the fault prediction result of the hard disk indicates that the hard disk will fail within the future preset time period.
[0131] In the embodiments of the present disclosure, the apparatus can be applied to an electronic device. The acquisition module 301, the prediction module 302, the first selection module 303, the second selection module 304, the training module 305, the determination module 306, and the output module 307 in the apparatus can all be implemented by a central processing unit (CPU, Central Processing Unit), a digital signal processor (DSP, Digital Signal Processor), a microcontroller unit (MCU, Microcontroller Unit), or a field-programmable gate array (FPGA, Field-Programmable Gate Array) in practical applications.
[0132] An embodiment of the present disclosure also provides an electronic device. Figure 5 It is a schematic diagram of the hardware composition structure of the electronic device provided by the embodiment of the present disclosure. As Figure 5 shown, the electronic device 400 includes a processor 401 and a memory 402 for storing a computer program that can run on the processor 401. Among them, when the processor 401 is used to run the computer program, it executes the steps of the processing method of the cloud database described in the embodiment of the present disclosure.
[0133] Optionally, the electronic device 400 may further include at least one network interface 403. Each component in the electronic device 400 is coupled together through a bus system 404. It can be understood that the bus system 404 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 404 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 5 all kinds of buses are labeled as the bus system 404.
[0134] It will be appreciated that the memory 402 can be a volatile memory, a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), sync link dynamic random access memory (SLDRAM), direct rambus random access memory (DRRAM).The memory 402 described in the embodiments of the present disclosure is intended to include, but is not limited to, these and any other suitable types of memories.
[0135] The memory 402 in the embodiments of the present disclosure is used to store various types of data to support the operation of the electronic device 400.
[0136] The methods disclosed in the above embodiments of the present disclosure can be applied to or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above methods can be completed by the integrated logic circuit in the hardware of the processor 401 or by instructions in software form. The above-mentioned processor 401 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 401 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the methods disclosed in the embodiments of the present disclosure, it can be directly embodied as being executed and completed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, and this storage medium is located in the memory 402. The processor 401 reads the information in the memory 402 and combines its hardware to complete the steps of the foregoing methods.
[0137] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components, and is used to execute the foregoing methods.
[0138] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. The computer program, when executed by a processor, implements the steps of the processing method of the cloud database in the embodiments of the present disclosure.
[0139] The methods disclosed in several method embodiments provided by this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0140] The features disclosed in several product embodiments provided by this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0141] The features disclosed in several method or device embodiments provided by this application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
[0142] In several embodiments provided by this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the couplings, direct couplings, or communication connections between the components shown or discussed with each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be electrical, mechanical, or other forms.
[0143] The units described as separate components above may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in the embodiments of the present disclosure can be all integrated in a processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in one unit; the above integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0145] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments; and the foregoing storage medium includes: various media such as removable storage devices, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0146] Alternatively, if the above integrated units of the present disclosure are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present disclosure, in essence or the parts that contribute to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes: various media such as removable storage devices, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0147] As described above, the foregoing are only specific implementation manners of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present disclosure can easily think of changes or substitutions, which should all be covered by the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. A hard disk failure prediction method, characterized in that, The method includes: Obtaining the working state data of the hard disk at the current moment; Processing the working state data by using a preset fault prediction model to obtain a fault prediction result of the hard disk in a preset duration in the future; wherein, the preset fault prediction model is trained by using a machine learning model based on sample working state data; The method further includes: According to the working state data identified by the first label corresponding to the first historical moment, selecting the working state data within a first preset duration before the first historical moment, and determining the working state data at the first historical moment and the working state data within the first preset duration as the sample data identified by the first label; Selecting the sample data identified by the second label within the historical duration; Training the fault prediction model by using the machine learning model based on the sample data identified by the first label and the sample data identified by the second label; The amounts of data of the sample data identified by the first label and the sample data identified by the second label are the same.
2. The method according to claim 1, wherein The selecting the sample data identified by the second label within the historical duration includes: According to the working state data identified by the second label corresponding to the second historical moment, selecting the working state data within a second preset duration before the second historical moment, and determining the working state data at the second historical moment and the working state data within the second preset duration as the sample data identified by the second label.
3. The method according to claim 1, characterized in that, The method further includes: Determining the attribute of the hard disk according to the identifier of the hard disk; The processing the working state data by using a preset fault prediction model to obtain a fault prediction result of the hard disk in a preset duration in the future includes: Processing the working state data by using the preset fault prediction model corresponding to the attribute of the hard disk to obtain a fault prediction result of the hard disk in a preset duration in the future; Wherein, the attribute of the hard disk includes at least one of the following: The type of the hard disk; The manufacturer to which the hard disk belongs.
4. The method according to claim 1, wherein The obtaining the working state data of the hard disk at the current moment includes: Obtaining the working state data of the hard disk at the current moment based on the SMART information of the hard disk; wherein, the working state data includes at least one of the following: Remapped sector count, uncorrectable errors, command timeout, current pending sector count or offline uncorrectable sector count.
5. The method according to claim 1, characterized in that The method further includes: When the fault prediction result of the hard disk indicates that the hard disk will fail in the preset duration in the future, outputting a data backup prompt message.
6. A hard disk failure prediction device, characterized in that, The device includes: An obtaining module, configured to obtain the working state data of the hard disk at the current moment; A predicting module, configured to process the working state data by using a preset fault prediction model to obtain a fault prediction result of the hard disk in a preset duration in the future; wherein, the preset fault prediction model is trained by using a machine learning model based on sample working state data; The device further includes: The first selection module is configured to select the working state data within a first preset duration before the first historical moment according to the working state data identified by the first label corresponding to the first historical moment, and determine the working state data at the first historical moment and the working state data within the first preset duration as the sample data of the first label identification; The second selection module is configured to select the sample data of the second label identification within the historical duration; The training module is configured to obtain the fault prediction model by training using the machine learning model based on the sample data of the first label identification and the sample data of the second label identification; The data volumes of the sample data of the first label identification and the sample data of the second label identification are the same.
7. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Disk fault detection method and device, computer equipment and storage medium
CN113656228A