Power failure protection method for solid state disk data
Through machine learning models, predict the probability of power failure of solid-state drives and dynamically adjust the power output, the problem of data integrity and reliability of solid-state drives in power failure events is solved, and more efficient data protection and system stability is achieved, suitable for modern data center needs.
Patent Information
- Application Number
- CN202411119958.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-08-15
AI Technical Summary
When existing solid-state drives face sudden power outages, there are risks in data integrity and reliability. Traditional power outage protection technology cannot fully meet the comprehensive requirements of modern data centers for data security, system response speed and maintenance costs.
Using machine learning models to predict the probability of power failure, dynamically adjust the priority of write operations and power output, pause non-critical write operations through real-time monitoring and prediction of the probability of power failure, prioritize the writing of key data, and adjust it according to historical power failure data. Power output to maintain data security and system stability.
Improves the security and system stability of data in power-down events, reduces the risk of data loss, and is suitable for application scenarios with strict requirements on data integrity, such as financial services and cloud computing centers, extends the service life of the equipment and reduces the Energy consumption.
Smart Images

Figure CN119026187A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computer data storage, and in particular to a power-off protection method for solid state hard disk data. Background Art
[0002] Solid-state drives (SSDs) are widely used in various computing environments, from personal computers to enterprise-level data centers, due to their high-speed performance, shock resistance, and low power consumption. However, SSDs are at risk of data integrity and reliability when faced with sudden power outages. Power outages can interrupt ongoing data write operations, resulting in data corruption or loss, which is particularly serious for applications that rely on data integrity.
[0003] Traditional SSD power-off protection technologies mainly rely on the following methods:
[0004] Use an uninterruptible power supply (UPS): Provide short-term power support to the system through an external uninterruptible power supply to handle data writing during power outages. However, UPS devices are large in size, expensive, and require regular maintenance and battery replacement, making them unsuitable for all computing environments.
[0005] Data mirroring of write buffers: Data is written to multiple buffers at the same time to increase the probability of data preservation in the event of a power outage. Although this method can improve data security, it increases write latency and occupies more storage resources.
[0006] Supercapacitor and battery backup: Some SSDs use built-in supercapacitors or batteries to provide short-term power support for data writing when power is lost. This approach provides a solution at the device level, but the maintenance cost of supercapacitors and batteries and their own reliability remain challenges.
[0007] Although these technologies have their own advantages, they often cannot fully meet the comprehensive requirements of modern data centers for data security, system response speed and maintenance costs. In addition, with the expansion of data center scale and the globalization of services, the requirements for SSD power failure protection technology are becoming increasingly stringent. Therefore, it has become an urgent need for the industry to develop a new SSD power failure protection method that is more efficient, more economical and can respond to power failure risks in real time. Summary of the invention
[0008] In view of the shortcomings of the prior art, the present invention provides a power-off protection method for solid-state hard disk data, which uses a machine learning model to predict the power-off probability, dynamically adjusts the write operation priority and power output, effectively improves data integrity and system stability, and reduces the risk of data loss caused by power-off events.
[0009] To achieve the above objectives, the present invention is implemented through the following technical solutions: A method for protecting data of a solid state hard disk from power failure, comprising the following steps:
[0010] Collecting operation data of the solid state drive, the operation data including power supply voltage, current, temperature, write request size and timestamp;
[0011] Based on the operating data, predicting the power failure probability using a machine learning model, wherein the machine learning model calculates the power failure probability according to the voltage change rate ΔV / Δt before the power failure and the write density;
[0012] The write operation priority of the solid-state drive is adjusted according to the predicted power failure probability, and the power output is dynamically adjusted to maintain the writing of critical data.
[0013] Preferably, the collection of the operation data also includes operation types and system operation logs.
[0014] Preferably, the machine learning model is a gradient boosting machine, and the model uses a decision tree-based learning algorithm to process and predict nonlinear features and interaction effects, and the model training process includes minimizing the following objective function:
[0015]
[0016] Where N is the number of training samples, y i is the target variable of sample i, indicating whether the power failure event occurs, x i is the eigenvector of sample i.
[0017] Preferably, the power failure probability prediction step includes calculating the current voltage change rate and write density in real time, and using the trained gradient boosting machine model to predict the power failure probability in real time:
[0018] P fail (t) = σ(θ T X t )
[0019] Where σ is the sigmoid function used to convert the model output into a probability value between 0 and 1, and X t is the feature vector at the current moment.
[0020] Preferably, the step of adjusting the write operation priority of the solid state drive according to the predicted power failure probability includes:
[0021] When the power failure probability exceeds the set threshold, all new write operations are suspended and only the currently ongoing critical data write is completed;
[0022] Define critical data as database transaction logs, system status information, and important user documents.
[0023] Preferably, the formula for dynamically adjusting the power output is:
[0024] P out (t) = P norm -α·P fail (t)
[0025] Among them, P norm is the standard power output under normal working conditions, and α is the adjustment coefficient determined based on historical power-off data, which is used to adjust the power output to cope with the predicted power-off risk.
[0026] Preferably, the value of the adjustment coefficient α is dynamically adjusted according to the historical power-off data of the solid-state hard disk, and the adjustment method includes:
[0027] Collect the power failure event records of the solid state drive during its past operation and the power output parameters before each power failure;
[0028] A linear regression model is used to analyze the relationship between the power output before power failure and the occurrence of power failure to determine the adjustment coefficient α;
[0029] The initial α value is set by calculating the average α value of historical power-off events;
[0030] During operation, the α value is continuously updated based on new power-off events and power supply output data.
[0031] The present invention also provides a power-off protection device for solid state hard disk data, comprising:
[0032] a data collection module configured to collect operation data of the solid state drive, including power supply voltage, current, temperature, write request size and timestamp, and operation type and system operation log;
[0033] a data processing module configured to process the collected operation data using a gradient boosting machine model, the model predicting the probability of power failure based on a decision tree learning algorithm, and calculating the probability of power failure based on the voltage change rate and write density before the power failure, the module further configured to adjust the write operation priority of the solid-state drive based on the predicted power failure probability, and when the power failure probability exceeds a set threshold, suspend all new write operations and only complete the currently ongoing critical data write;
[0034] The power management module is configured to dynamically adjust the power output according to the prediction results of the data processing module to maintain the writing of key data. The module uses an adjustment coefficient α, which is dynamically adjusted based on the historical power-off data of the solid-state drive. The adjustment process includes applying a linear regression model to analyze the relationship between the power output before the power-off and the occurrence of the power-off, and updating the adjustment coefficient based on these analysis results.
[0035] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the above method is implemented.
[0036] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described above is implemented.
[0037] The present invention provides a method for protecting data on a solid state hard disk from power failure. It has the following beneficial effects:
[0038] 1. The present invention predicts the probability of power failure by integrating a machine learning model, and dynamically adjusts the power output and data writing priority based on the prediction results, so that the solid-state drive can more effectively cope with power fluctuations and instability. This intelligent power management strategy enables the solid-state drive to maintain efficient and stable operation under different power conditions, reducing system failures and maintenance costs caused by power problems.
[0039] 2. The present invention ensures rapid response and gives priority to saving important data in the event of unstable power supply by real-time monitoring and prediction of power failure probability, in conjunction with the emergency response mechanism. This preventive measure greatly improves the security of data in commercial and industrial environments, and is particularly suitable for application scenarios with strict requirements on data integrity, such as financial services, cloud computing centers, and critical infrastructure.
[0040] 3. The present invention reduces the loss of solid-state hard disks when used in areas with frequent power outages through precise power output management and effective use of supercapacitors, thereby extending the service life of the device. In addition, optimized charging strategies and energy use also help reduce the energy consumption of the system and achieve a more environmentally friendly operating mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0042] Figure 2 It is a schematic diagram of the structure of the device of the present invention;
[0043] Figure 3 It is a schematic diagram of the computer device structure of the present invention.
[0044] Among them, 10, data collection module; 20, data processing module; 30, power management module; 40, computer equipment; 41, processor; 42, memory; 43, storage medium. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the specification 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.
[0046] Please see attached Figure 1 The embodiment of the present invention provides a method for protecting data of a solid state drive from power failure, comprising the following steps:
[0047] S1. Collecting the operation data of the solid state drive
[0048] In this step, the system collects key parameters of the SSD in real time during operation through built-in or external sensors and monitoring software. These parameters include:
[0049] Power supply voltage: monitors the stability and fluctuation of power supply.
[0050] Current: reflects the real-time current consumption of the hard disk operation status.
[0051] Temperature: The operating temperature of the hard disk. High temperature may affect the performance and life of the hard disk.
[0052] Write request size and timestamp: Records the specific size and occurrence time of each write operation to help analyze data write patterns.
[0053] In this embodiment, the collection of SSD operation data is performed in the following manner:
[0054] Power supply voltage and current monitoring: Voltage and current sensors are installed at the power input of the SSD, which monitor the input voltage and current of the power supply in real time. The sensor data is converted into digital signals through an analog-to-digital converter (ADC) and transmitted to the central processing unit (CPU) or controller for processing.
[0055] Temperature monitoring: The SSD has a built-in temperature sensor that records the operating temperature in real time. The temperature data is transmitted to the controller through the sensor interface.
[0056] Write request size and timestamp: The SSD controller records the size and timestamp of each write request when processing it. This data is stored in a dedicated log file for subsequent analysis.
[0057] Operation type and system operation log: The system log records each operation type (such as read, write, erase) of the SSD and the corresponding time information. These logs can help identify and analyze the impact of different operation types on power and performance.
[0058] The above data is summarized by the controller and stored in a database for subsequent processing.
[0059] S2. Predicting the probability of power failure using machine learning models
[0060] In this step, the data collected in step S1 is used to predict the possibility of power failure through a machine learning model. Model training relies on the voltage change rate (ΔV / Δt) before power failure and write density (the frequency and size of write requests per unit time) as key features. This prediction model can be based on a gradient boosting machine (GBM), which can effectively handle nonlinear problems and complex interactions. The model outputs the probability of power failure to help the system decide how to deal with the impending power failure.
[0061] In this embodiment, based on the operating data collected in step S1, the specific technical solution for predicting the power failure probability using a machine learning model is as follows:
[0062] 1. Feature extraction: Extract key features from the collected operating data, including voltage change rate (ΔV / ΔV), write density (the number and size of write requests per unit time), current temperature, operation type frequency, etc.
[0063] 2. Model selection and training: Gradient boosting machine (GBM) is selected as the machine learning model. The training process is as follows:
[0064] Data preprocessing: The collected operating data is divided into training sets and test sets, and the data is normalized to eliminate the impact of different dimensions.
[0065] Model training: Use the training set data to train the model, the goal is to minimize the following objective function:
[0066]
[0067] Where N is the number of training samples, y i is the target variable of sample i, indicating whether the power failure event occurs, x i is the eigenvector of sample i.
[0068] Model optimization: Optimize model parameters through cross-validation technology to prevent overfitting and ensure the generalization ability of the model.
[0069] 3. Real-time prediction: When the system is running, the current feature data (voltage change rate, write density, etc.) is extracted in real time and input into the trained GBM model to predict the power failure probability:
[0070] P fail (t) = σ(θ T X t )
[0071] Among them, σ is the sigmoid function, which converts the model output into a probability value between 0 and 1, and X t is the feature vector at the current moment.
[0072] S3, adjust write operation priority and dynamically adjust power output
[0073] Based on the predicted power failure probability, this step adjusts the priority of the write operation and adjusts the power output accordingly:
[0074] Adjust write operation priority: When the power failure probability exceeds the preset threshold, the system will automatically suspend the writing of non-critical data and give priority to completing the writing of critical data (such as system files, database logs, etc.). This ensures that the most important data is safely saved when a power failure occurs.
[0075] Dynamically adjust power output: The system responds to predicted power outages by increasing power output. Such adjustments help stabilize system power and extend power supply time, thereby reducing data loss.
[0076] In this embodiment, the write operation priority of the solid state drive is adjusted according to the predicted power failure probability, and the power output is dynamically adjusted. The specific technical solution is as follows:
[0077] 1. Adjust the write operation priority: When the power failure probability P predicted by the model fail (t) When the set threshold is exceeded, the system automatically adjusts the write operation priority:
[0078] Suspend non-critical data writing: Newly initiated non-critical write operations are suspended to ensure that system resources are focused on writing critical data.
[0079] Critical data writing: The system identifies and prioritizes the writing of critical data (such as database transaction logs, system status information, and important user documents) to ensure that this data is safely stored before power failure.
[0080] 2. Dynamically adjust power output: The system dynamically adjusts power output according to the probability of power failure to extend power support time and stability:
[0081] P out (t) = P norm -α·P fail (t)
[0082] Among them, P norm is the standard power output under normal working conditions, and α is the adjustment coefficient determined based on historical power-off data, which is used to adjust the power output to cope with the predicted power-off risk. The adjustment coefficient α is dynamically adjusted based on historical power-off data, and the specific steps include:
[0083] 1. Collect historical power-off event records and power output parameters;
[0084] 2. Use linear regression model to analyze the relationship between power output before power failure and power failure occurrence;
[0085] 3. Calculate the average α value of historical power-off events and set the initial α value;
[0086] 4. During operation, the α value is continuously updated according to new power-off events and power output data.
[0087] Through the above technical scheme, the present invention can monitor the operating status of the solid-state hard disk in real time, accurately predict the probability of power failure, and adjust the write priority and power output when the risk of power failure is high, thereby effectively protecting data security, reducing the risk of data loss caused by power failure, and improving the reliability and stability of the system.
[0088] In a preferred embodiment of the present invention, step S1 of the power-off protection method for solid-state hard disk data is further optimized to enhance the comprehensiveness and accuracy of the data. Specifically, in addition to the basic monitoring of power supply voltage, current, temperature, write request size and timestamp, this embodiment also includes the collection of operation type and system operation logs.
[0089] Collection of operation types:
[0090] In this embodiment, the collection of operation types mainly refers to recording the nature of each data access or write request, such as whether it is a read operation, a write operation, or an erase operation. This information is recorded by the firmware or controller of the solid-state drive and automatically marked as each request is processed. Recording operation types helps analyze which types of operations are more frequent before power failure, which may provide more insights into the prediction of power failure risks.
[0091] Collection of system operation logs
[0092] The collection of system operation logs involves a wider range of system-level information, including system startup and shutdown time, system error alarms, hardware failure records, etc. These logs are automatically recorded through the system's standard log management function and can be exported from the operating system or dedicated system monitoring software. Collecting these log data is extremely important for analyzing the system's behavior patterns before and after power failure events and their possible causes.
[0093] Data integration and processing
[0094] The collected operation types and system operation logs are integrated with data such as power supply voltage, current, temperature, write request size and timestamp. All of this data is pre-processed, such as formatting, denoising and synchronization, to ensure data consistency and availability. The integrated data set provides a more comprehensive data foundation for machine learning models to more accurately analyze and predict power outage risks.
[0095] In step S2, with the enhanced dataset, the machine learning model (such as gradient boosting machine) will accept richer input features, including the frequency and type of operation types, the frequency of abnormal events in the system operation log, etc. These additional features can help the model learn and predict the power failure probability in more detail, thereby achieving more effective write operation priority adjustment and power output management in step S3.
[0096] By adding operation types and system operation logs to the SSD operation data collection, the preferred embodiment of the present invention can provide a more detailed and accurate data analysis basis. This not only enhances the accuracy of the prediction model, but also makes the risk management before power failure more targeted and efficient, thereby protecting more critical data in the event of power failure, reducing data loss, and improving the overall stability and reliability of the system. In addition, a deep understanding of operation types and system behavior can also help system administrators optimize the use strategy and maintenance plan of the hard disk.
[0097] In a preferred embodiment of the present invention, a supercapacitor is integrated into a solid-state drive to provide additional power support at the moment of power failure.
[0098] 1. Supercapacitor integration: Supercapacitors are integrated into the power management system of the solid-state drive, which can provide high-intensity power output in a short period of time.
[0099] 2. Power management optimization: The control system controls the charging and discharging of the supercapacitor based on the power failure probability predicted from the machine learning model. When the power failure probability is high, the system ensures that the supercapacitor is fully charged; when a power failure is predicted, power is immediately released from the supercapacitor to ensure that the writing of critical data is completed.
[0100] 3. Power failure emergency response: When a power failure occurs, the supercapacitor immediately provides power to the SSD, ensuring that the hard drive can continue to run long enough to complete all ongoing critical write operations.
[0101] Integrated supercapacitors can greatly improve the data integrity protection of SSDs in the event of power outages. By providing the necessary power at the moment of power outage, supercapacitors ensure that data is safely written, reducing the risk of data loss and system damage. In addition, this solution also increases the system's resilience to sudden power outages, making it particularly suitable for use in environments with unstable power supply.
[0102] Furthermore, in this preferred embodiment, when the machine learning model predicts a high probability of power failure, the system automatically switches to supercapacitor power supply and uses the following formula to manage power output:
[0103] P out (t) = P cap (t)-α·P fail (t)
[0104] Among them, P cap (t) is the maximum power that can be supplied from the supercapacitor, calculated based on the current state of charge of the capacitor.
[0105] When the power failure probability exceeds the set threshold, in addition to providing emergency power from the supercapacitor, it also prioritizes the writing of critical data to ensure that the most important data is safely stored first.
[0106] This method not only improves data security, but also increases the system's resilience to power fluctuations. At the same time, this solution can also reduce the startup recovery time caused by power outages, improving the overall system reliability and user experience.
[0107] The power-off protection device for solid state hard disk data described below and the power-off protection method for solid state hard disk data described above may correspond to each other.
[0108] Please see attached Figure 2 The present invention also provides a power-off protection device for solid state hard disk data, comprising:
[0109] a data collection module configured to collect operation data of the solid state drive, including power supply voltage, current, temperature, write request size and timestamp, and operation type and system operation log;
[0110] a data processing module configured to process the collected operation data using a gradient boosting machine model, the model predicting the probability of power failure based on a decision tree learning algorithm, and calculating the probability of power failure based on the voltage change rate and write density before the power failure, the module further configured to adjust the write operation priority of the solid-state drive based on the predicted power failure probability, and when the power failure probability exceeds a set threshold, suspend all new write operations and only complete the currently ongoing critical data write;
[0111] The power management module is configured to dynamically adjust the power output according to the prediction results of the data processing module to maintain the writing of key data. The module uses an adjustment coefficient α, which is dynamically adjusted based on the historical power-off data of the solid-state drive. The adjustment process includes applying a linear regression model to analyze the relationship between the power output before the power-off and the occurrence of the power-off, and updating the adjustment coefficient based on these analysis results.
[0112] The device of this embodiment can be used to execute the above method embodiment, and its principles and technical effects are similar, which will not be repeated here.
[0113] Please see attached Figure 3 The present invention further provides a computer device 40, comprising: a processor 41 and a memory 42, wherein the memory 42 stores a computer program executable by the processor, and when the computer program is executed by the processor, the above method is executed.
[0114] The present invention further provides a storage medium 43 on which a computer program is stored. When the computer program is run by the processor 41, the above method is executed.
[0115] Among them, the storage medium 43 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0116] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for protecting data on a solid state hard disk from power failure, characterized in that: The following steps are involved: Collecting operation data of the solid state drive, the operation data including power supply voltage, current, temperature, write request size and timestamp; Based on the operating data, predicting the power failure probability using a machine learning model, wherein the machine learning model calculates the power failure probability according to the voltage change rate and the write density before the power failure; The write operation priority of the solid-state drive is adjusted according to the predicted power failure probability, and the power output is dynamically adjusted to maintain the writing of critical data.
2. A method for protecting data from power failure in a solid state drive according to claim 1, characterized in that: The collection of the operation data also includes operation types and system operation logs.
3. The method for protecting data from power failure in a solid state drive according to claim 1, characterized in that: The machine learning model is a gradient boosting machine, and the model uses a decision tree-based learning algorithm to process and predict nonlinear features and interaction effects. The model training process includes minimizing the following objective function: Where N is the number of training samples, y i is the target variable of sample i, indicating whether the power failure event occurs, x i is the eigenvector of sample i.
4. The method for protecting data from power failure in a solid state drive according to claim 1, characterized in that: The power failure probability prediction step includes calculating the current voltage change rate and write density in real time, and using the trained gradient boosting model to predict the power failure probability in real time: P fail (t)=σ(θ T X t ) Where σ is the sigmoid function used to convert the model output into a probability value between 0 and 1, and X t is the feature vector at the current moment.
5. The method for protecting data from power failure in a solid state hard disk according to claim 1, characterized in that: The step of adjusting the write operation priority of the solid state drive according to the predicted power failure probability comprises: When the power failure probability exceeds the set threshold, all new write operations are suspended and only the currently ongoing critical data write is completed; Define critical data as database transaction logs, system status information, and important user documents.
6. The method for protecting data from power failure in a solid state hard disk according to claim 1, characterized in that: The formula for dynamically adjusting the power output is: P out (t)=P norm -α·P fail (t) Among them, P norm is the standard power output under normal working conditions, and α is the adjustment coefficient determined based on historical power-off data, which is used to adjust the power output to cope with the predicted power-off risk.
7. A method for protecting data on a solid state hard disk from power failure according to claim 6, characterized in that: The value of the adjustment coefficient α is dynamically adjusted according to the historical power-off data of the solid-state hard disk, and the adjustment method includes: Collect the power failure event records of the solid state drive during its past operation and the power output parameters before each power failure; A linear regression model is used to analyze the relationship between the power output before power failure and the occurrence of power failure to determine the adjustment coefficient α; The initial α value is set by calculating the average α value of historical power-off events; During operation, the α value is continuously updated based on new power-off events and power supply output data.
8. A power-off protection device for solid state hard disk data, used to implement the method according to any one of claims 1 to 7, characterized in that: include: a data collection module configured to collect operation data of the solid state drive, including power supply voltage, current, temperature, write request size and timestamp, and operation type and system operation log; a data processing module configured to process the collected operation data using a gradient boosting machine model, the model predicting the probability of power failure based on a decision tree learning algorithm, and calculating the probability of power failure based on the voltage change rate and write density before the power failure, the module further configured to adjust the write operation priority of the solid-state drive based on the predicted power failure probability, and when the power failure probability exceeds a set threshold, suspend all new write operations and only complete the currently ongoing critical data write; The power management module is configured to dynamically adjust the power output according to the prediction results of the data processing module to maintain the writing of key data. The module uses an adjustment coefficient α, which is dynamically adjusted based on the historical power-off data of the solid-state drive. The adjustment process includes applying a linear regression model to analyze the relationship between the power output before the power-off and the occurrence of the power-off, and updating the adjustment coefficient based on these analysis results.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for checking data during power failure, storage medium and electronic equipment
CN111897685A
ZNS solid state disk power-down data storage method
CN117573420A
Battery state parameter prediction method and device, electronic equipment and storage medium
CN118362906A
Fire fighting truck battery management system
CN118405025A
Relay protection method and system, computer equipment and storage medium
CN118487247A
