Abnormal power failure processing method and device for solid state disk, equipment, medium and product
By using small capacitors in solid-state drives to provide temporary power supply and perform data flush operations, the problem of untimely data storage during abnormal power outages is solved, system reliability is improved, and the cost and volume of solid-state drives are reduced.
Patent Information
- Application Number
- CN202411374044.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-29
AI Technical Summary
When existing solid-state drives fail to save data in time when power is abnormal, resulting in data loss or path blockage, affecting system reliability. At the same time, large-capacity capacitors take up a lot of space, high cost, and inflexible design.
Small capacitors are used instead of large-capacitor capacitors, providing temporary power supply, and when the power management module detects abnormal power outage, control the solid-state hard disk to stop reading and writing operations, perform data flush operations, and flush data to the master device interface or slave device interface.
It realizes timely saving data in an abnormal power outage, improves system reliability, and reduces the cost and volume of solid-state drives, adapts to the needs of lightweight and miniaturized designs.
Smart Images

Figure CN119415022A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment, medium and product for processing abnormal power failure of a solid state hard disk. Background Art
[0002] Solid State Disk (SSD), also known as solid state drive, is a hard disk made of solid-state electronic storage chip array. SSD is a data storage device that uses NAND Flash as storage medium. It is widely used in electronic devices such as personal computers, servers, and mobile devices.
[0003] At present, solid-state drives on the market usually use large-capacity capacitors (such as 1000uF or more) as power buffers to ensure that the system can maintain power supply and complete data preservation when power is abnormally interrupted. However, large-capacity capacitors are large in size, which is not conducive to the overall design of solid-state drives, especially under the trend of lightweight and miniaturized design. This defect is particularly obvious.
[0004] Existing technical solutions mainly rely on high-capacity capacitors to extend the power supply time to ensure data integrity and consistency in the event of a sudden power outage. However, this design has problems such as large size, high cost, inflexible design, and reliability. In addition, in the event of an extreme power outage, the system may not be able to save data in time, resulting in data loss or path blockage, affecting the normal operation of the system.
[0005] Therefore, how to save the cost of solid-state drives, ensure timely preservation of data when the solid-state drives lose power abnormally, and improve system reliability has become a problem that needs to be solved urgently. Summary of the invention
[0006] The present invention provides a method, device, equipment, medium and product for processing abnormal power failure of a solid-state hard disk, which are used to solve the defects of high cost and poor system reliability of solid-state hard disks in the prior art, save the cost of solid-state hard disks, and ensure timely preservation of data when the solid-state hard disk loses power abnormally, thereby improving the reliability of the system.
[0007] The present invention provides a method for processing abnormal power failure of a solid state hard disk. The solid state hard disk comprises a power control module and a small capacitor, and the small capacitor is arranged near the power control module. The method comprises the following steps.
[0008] Acquire the power state of the solid state drive detected by the power control module.
[0009] After the power management module detects abnormal power failure of the solid state hard disk, a small capacitor is used to provide temporary power supply and control the solid state hard disk to stop reading and writing operations.
[0010] Execute the data flush operation to flush the data being transmitted on the path between the SSD and the host to the master device interface or the slave device interface.
[0011] According to a method for processing abnormal power failure of a solid state hard disk provided by the present invention, the method further comprises: after the power management module detects abnormal power failure of the solid state hard disk, performing sleep processing on the physical layer of the peripheral component interconnection interface.
[0012] According to a method for processing abnormal power failure of a solid-state hard disk provided by the present invention, the data flush operation is performed to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface, including: flushing the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface in order of the priority of the data from high to low.
[0013] According to a method for processing abnormal power failure of a solid state hard disk provided by the present invention, the method further comprises: during the execution of a data flush operation, returning new data on the path between the solid state hard disk and the host to the slave device interface.
[0014] According to a method for processing abnormal power failure of a solid state hard disk provided by the present invention, the method further comprises: after the power management module detects that the power of the solid state hard disk is restored, performing data integrity verification and system recovery.
[0015] According to a method for processing abnormal power failure of a solid-state hard disk provided by the present invention, after executing a data flush operation and flushing the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface, the method also includes: performing integrity and consistency verification on the data flushed to the master device interface or the slave device interface.
[0016] The present invention also provides a device for processing abnormal power failure of a solid state hard disk, wherein the solid state hard disk comprises a power control module and a small capacitor, wherein the small capacitor is arranged near the power control module; the device comprises the following modules.
[0017] The acquisition module is used to acquire the power state of the solid state hard disk detected by the power control module.
[0018] The control module is used to provide temporary power supply through a small capacitor and control the solid-state hard disk to stop reading and writing operations after the power management module detects that the solid-state hard disk is abnormally powered off.
[0019] The flush module is used to perform data flush operations to flush the data being transmitted on the path between the solid-state drive and the host to the master device interface or the slave device interface.
[0020] The present invention also provides an electronic 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, any of the above-mentioned methods for handling abnormal power failure of a solid state hard disk is implemented.
[0021] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned methods for handling abnormal power failure of a solid-state hard disk is implemented.
[0022] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for handling abnormal power failure of a solid state hard disk.
[0023] The method, device, equipment, medium and product for processing abnormal power failure of a solid-state hard disk provided by the present invention are as follows: the power state of the solid-state hard disk detected by the power control module is obtained; after the power management module detects abnormal power failure of the solid-state hard disk, a small capacitor is used to provide temporary power supply and control the solid-state hard disk to stop reading and writing operations; a data flush operation is performed to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface. In the scheme of the present invention, a small capacitor can provide temporary power supply when the power is abnormal, saving the cost and volume of the solid-state hard disk; and, when the power is abnormally lost, the temporary power supply provided by the small capacitor can realize the data being transmitted on the path between the solid-state hard disk and the host to be flushed to the master device interface or the slave device interface, avoiding the loss of path data or data blocking the path, and improving the reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 The present invention is a flowchart of a method for processing abnormal power failure of a solid state hard disk.
[0026] Figure 2 It is a schematic diagram of the architecture of the flush framework provided by the present invention.
[0027] Figure 3 It is a structural schematic diagram of the device for processing abnormal power failure of a solid state hard disk provided by the present invention.
[0028] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0030] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following describes the abnormal power failure processing method of the solid state drive of the present invention in conjunction with the accompanying drawings.
[0031] In practical applications, the execution subject of the SSD abnormal power failure processing method can be a SSD abnormal power failure processing device, and there are many ways to implement the SSD abnormal power failure processing device, for example, it can be implemented by a computer program, such as application software, etc.; or, for example, a chip, etc. It can also be implemented as a medium storing relevant computer programs, such as a U disk, a cloud disk, etc.; or, it can also be implemented by a physical device integrated or installed with relevant computer programs, such as a server, etc.
[0032] Figure 1 FIG. 1 is a flow chart of a method for processing abnormal power failure of a solid state hard disk provided by the present invention. Figure 1 As shown, the method includes steps 101 to 103.
[0033] Step 101: Acquire the power state of the solid state drive detected by the power control module.
[0034] In the present invention, the solid-state hard disk includes a power control module and a small capacitor, and the small capacitor is arranged near the power control module. Among them, the power control module is used to detect the power state of the solid-state hard disk. As an example, the power control module adopts a high-precision ADC (analog-to-digital converter) to collect the sampled voltage value at the sampling point in real time. The sampled voltage value is compared with the reference voltage value. If the sampled voltage is lower than the reference voltage value, it is determined that the solid-state hard disk is abnormally powered off; if the sampled voltage is not lower than the reference voltage value, it is determined that the power state of the solid-state hard disk is normal. Optionally, the reference voltage value can be set according to actual working requirements and the working conditions of the solid-state hard disk.
[0035] Optionally, when it is determined that the solid state drive is abnormally powered off, an interrupt signal may be triggered to prompt the solid state drive abnormal power-off processing device to perform abnormal power-off processing.
[0036] In practical applications, the power control module can collect the sampled voltage value at the sampling point in real time or periodically. For example, the power control module can include a sampling unit and an ADC conversion unit, the sampling unit is connected to the sampling point, and the sampling unit collects the analog voltage signal at the sampling point. The ADC conversion unit is connected to the sampling unit, and the ADC conversion unit converts the analog voltage signal into a sampled voltage value, so as to facilitate the subsequent determination of the power state of the solid state hard disk according to the sampled voltage value.
[0037] Step 102: After the power management module detects that the solid state drive loses power abnormally, a small capacitor is used to provide temporary power and control the solid state drive to stop reading and writing operations.
[0038] In practical applications, the selection of small capacitors is based on their discharge capacity and volume limitations, ensuring that they can provide enough power to complete the data flush operation when the power is off. It is understandable that small-capacity capacitors can provide enough power to complete the data flush operation without taking up too much PCB space. Generally, small capacitors with a capacity of 100uF to 500uF are selected. Small capacitors are arranged near the power management module of the solid-state drive to minimize resistance losses, ensure minimum resistance losses and the fastest response time.
[0039] Specifically, after the power management module detects that the solid state drive has abnormally lost power, the solid state drive abnormal power failure processing device controls the small capacitor to provide temporary power supply. Optionally, after the solid state drive abnormal power failure processing device receives an interrupt signal, it controls the small capacitor to provide temporary power supply. It can be understood that by providing temporary power supply through a small capacitor, sufficient power can be provided to complete the data flush operation, thereby improving the reliability of the system.
[0040] In the prior art, high-capacity capacitors are mainly relied on to extend the power supply time to ensure the integrity and consistency of data in the event of a sudden power outage. However, this solution has the following problems: The physical size of large-capacity capacitors is large, occupying valuable printed circuit board (PCB) board space, limiting the flexibility of the design. The cost of large-capacity capacitors is high, increasing the cost of the overall product. The durability and reliability of large-capacity capacitors may degrade in performance under high temperature or long-term use. Therefore, the prior art has problems with large size, high cost, inflexible design, and reliability.
[0041] Compared with the prior art, the use of small capacitors to provide temporary power supply has the following technical effects: on the one hand, by using small-capacity capacitors instead of traditional large-capacity capacitors, the overall size of the solid-state hard disk is significantly reduced. This enables the present invention to better adapt to the needs of lightweight and miniaturized design. Small capacitors have low costs, which reduces the production cost of the overall product without affecting data protection and system stability. On the other hand, the small size and flexible layout of small capacitors help optimize the layout and circuit design of the PCB and avoid the occupation of board space by large-capacity capacitors. This flexibility allows the design of the solid-state hard disk to better adapt to different application scenarios and structural requirements. On the other hand, since small capacitors have good adaptability to high temperatures or long-term use, the solution of the present invention effectively extends the service life of the solid-state hard disk and reduces system failures caused by aging or failure of large-capacity capacitors.
[0042] Furthermore, after the power management module detects that the SSD has abnormally lost power, the SSD abnormally lost power processing device controls the SSD to stop reading and writing operations to ensure data consistency. At the same time, this step can further reduce power consumption and buy time for subsequent flush operations. For example, after the SSD abnormally lost power processing device receives an interrupt signal, it responds to the interrupt signal and controls the SSD to stop reading and writing operations.
[0043] In this embodiment, there is no specific limitation on the method of controlling the SSD to stop reading and writing operations. For example, the SSD firmware contains logic for controlling read and write operations. After the power management module detects that the SSD has abnormally lost power, the SSD abnormal power failure processing device can trigger the SSD firmware to stop data transmission. For another example, the SSD abnormal power failure processing device sends a specific command to the SSD through an interface to notify it to stop all ongoing read and write operations. For another example, the interface protocol supported by the SSD (such as SATA, PCIe, NVMe, etc.) may contain commands or signals for instructing the SSD to stop read and write operations.
[0044] Step 103: perform a data flush operation to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface.
[0045] A flush operation generally refers to the process of writing data from volatile storage (such as RAM cache) to non-volatile storage (such as hard disk, solid-state drive, or other types of persistent storage media). A flush operation more specifically refers to ensuring that data is physically written and persisted on non-volatile storage, rather than just copied to non-volatile storage.
[0046] It should be noted that the flush operation ensures that data is moved from volatile storage (where data will be lost after power failure) to non-volatile storage (where data is retained even after power failure), ensuring data persistence. The flush operation can accurately and quickly write data to the storage medium when a small capacitor provides temporary power.
[0047] In practical applications, flushing data to a master or slave interface usually means copying the data to a non-volatile storage medium. Non-volatile storage media can keep data intact after the power is disconnected. As an example, a master port usually refers to the interface of a host or host controller, which controls the initiation and termination of data transmission. The host sends read and write commands to the SSD through the master port, including data read requests and write instructions. The SSD responds to the commands of the master port, reads data from its storage medium and transmits it to the host, or receives data from the host for storage.
[0048] As an example, the master port usually refers to the interface of the main controller or host, such as the CPU or the main memory controller of the system. Transmitting data to the master port means that the data is sent back to the main control unit of the system, which may be further processed or temporarily stored. Therefore, flushing the data being transmitted on the path between the SSD and the host to the master port can ensure that the data is accurately and quickly saved to the non-volatile storage medium of the host.
[0049] As an example, a slave port usually refers to an interface of a slave device or storage medium, such as a hard disk, solid-state drive, memory stick, or other type of storage device. Data is transmitted to the slave port, which means that the data is written to the slave device, such as the NAND Flash storage medium of an SSD. Therefore, flushing the data being transmitted on the path between the solid-state drive and the host to the slave port can ensure that the data is accurately and quickly saved to the non-volatile storage medium of the solid-state drive.
[0050] In actual applications, the data being transmitted on the path between the SSD and the host may come from the host (master end). In the case of abnormal power failure of the SSD, the SSD abnormal power failure processing device may flush the unprocessed data back to the designated cache area or memory of the host. The data being transmitted on the path between the SSD and the host may need to be written to the SSD (slave end). In the case of abnormal power failure of the SSD, the SSD abnormal power failure processing device may flush the unprocessed data to the storage medium of the SSD to ensure data persistence.
[0051] In practical applications, the flush operation can be implemented through the flush module, which is located between the peripheral component interconnect interface (PCIE) and the master path. Its main function is to flush all the data on the path to the master port or slave port when an abnormal power failure is detected to ensure the integrity of the data and the normality of the path. Specifically, the flush module is designed as a high-speed cache and data transmission unit, which can transfer the data on the path to the target storage unit in a very short time.
[0052] Figure 2 is a schematic diagram of the architecture of the flush framework provided by the present invention, such as Figure 2 As shown, the flush framework includes a solid-state drive chip, a flush module and a host, wherein the solid-state drive chip includes a data export. Among them, the solid-state drive chip (SSD chip) includes a power control module and a small capacitor, and the small capacitor is arranged near the power control module. Among them, the power control module is used to detect the power state of the solid-state drive, and trigger an interrupt signal when the solid-state drive loses power abnormally. The small capacitor responds to the interrupt signal and the small capacitor provides temporary power supply. The solid-state drive chip includes a data export for transferring data to other components. The flush module responds to the interrupt signal, triggers the data protection mechanism, performs the data flush operation, and flushes the data being transmitted on the path between the solid-state drive and the host to the master device interface or the slave device interface. The host is usually the CPU or main controller of the computer, which is responsible for sending read and write instructions. In the event of abnormal power failure, it receives a notification from the flush module and may execute the upper-level data protection strategy. Through this collaborative work, the flush framework can protect data from loss in the event of abnormal power failure and ensure that the storage device can be reliably restored after power is restored. This mechanism is crucial for protecting critical data and maintaining system reliability.
[0053] In addition, in a possible implementation, the above step 103 includes: flushing the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface in order of data priority from high to low.
[0054] Specifically, the priority of data can be set according to actual application needs and application scenarios. The flush module has a built-in high-priority data transmission mechanism to ensure that in the event of a power outage, the data being transmitted on the path between the SSD and the host is flushed to the master device interface or the slave device interface in order of data priority from high to low, thereby ensuring the security of critical data. In addition, by giving priority to writing important data, the risk of data corruption can be reduced and the overall data integrity can be improved.
[0055] In practical applications, sorting data by priority can optimize the performance of SSDs, allowing system resources (such as cache and bandwidth) to be more effectively allocated to critical tasks, which can optimize system performance. By giving priority to high-priority data, delays and blockages in the data transmission path can be reduced, ensuring smooth data transmission. Through priority management, SSDs can better support complex storage scenarios that require processing a large amount of data with different priorities.
[0056] It can be understood that when power is abnormally lost, the data being transmitted on the path between the solid-state drive and the host is flushed to the master device interface or the slave device interface in order of data priority from high to low, which can avoid path data loss or data blocking the path and improve system reliability.
[0057] In the scheme of this embodiment, the small capacitor can provide temporary power supply when the power is abnormal, saving the cost and volume of the solid-state hard disk; and when the power is abnormally cut off, the temporary power supply provided by the small capacitor can flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface, avoiding path data loss or data blocking the path, and improving the reliability of the system.
[0058] Furthermore, in a possible implementation, the above-mentioned method for processing abnormal power failure of a solid state drive further includes: after the power management module detects abnormal power failure of the solid state drive, performing a sleep process on the physical layer of the peripheral component interconnection interface.
[0059] Among them, Peripheral Component Interconnect Express (PCIE) is a high-speed serial computer expansion bus standard used to connect various peripherals and expansion cards inside the computer. It supports point-to-point connections, and each device has a dedicated connection to the processor. This topology makes communication between devices more efficient because it eliminates the need for devices to wait for access to the bus. The working principle of PCIE includes the physical layer, data link layer, and transport layer. The physical layer is responsible for the physical signals and electrical characteristics of transmitted data, the data link layer handles the flow control and error detection of data transmission, and the transport layer manages the distribution and routing of data packets. PCIE devices need to be initialized and configured when connected to the host so that the system can recognize and configure the device.
[0060] The physical layer (PHY) refers to the lowest level protocol in data communication, which is used for signal transmission and reception between physical media. In the present invention, the physical layer of the peripheral component interconnect interface (PCIE PHY) refers to the physical layer of the PCIE interface, which is responsible for the physical transmission of PCIE signals.
[0061] In actual applications, PCIE PHY is usually the part with the largest power consumption in the system. It is understandable that after the power management module detects abnormal power loss of the solid-state drive, the physical layer (PCIE PHY) of the peripheral component interconnect interface is put into sleep mode, so that the system can significantly reduce energy consumption, thereby using the remaining power for data flush operations, avoiding data loss due to insufficient power, and improving the overall reliability and data protection capabilities of the system.
[0062] Furthermore, in a possible implementation manner, the above-mentioned method for handling abnormal power failure of a solid state drive further includes: during the execution of a data flush operation, returning new data on the path between the solid state drive and the host to the slave device interface.
[0063] Here, the newly arrived data usually refers to the data just received during the data flush operation. For example, the newly arrived data may be the new input data that the system attempts to receive during the flush operation. For another example, there may be an instruction queue in the system, and new write instructions are still added to the queue even when the flush operation is in progress. For another example, in the asynchronous transmission mode, the sending and receiving of data are performed independently, so new data may still arrive during the flush operation.
[0064] In this embodiment, during the data flush operation, the new data on the path between the solid state drive and the host is returned to the slave device interface to ensure the integrity and consistency of the data, ensure the smooth operation of the entire path, avoid data congestion, and improve the reliability of the system.
[0065] In addition, in order to further improve the reliability of the system and the integrity and consistency of the data, in a possible implementation, after the above step 103, the above solid state drive abnormal power failure processing method also includes: performing integrity and consistency verification on the data flushed to the master device interface or the slave device interface.
[0066] Specifically, there is no specific limitation on the integrity and consistency check of data. As an example, the integrity check can be implemented by hash functions (such as SHA-256), checksums (CRC32), digital signatures, redundant coding, etc. As an example, the consistency check can be implemented by data backup verification, data comparison, etc.
[0067] In actual applications, if the data integrity and consistency check fails, the data can be repaired to ensure the integrity and consistency of the data.
[0068] In this implementation, after the data flush operation is performed, integrity and consistency checks are performed on the data flushed to the master device interface or the slave device interface, which can ensure the integrity and consistency of the data and improve the reliability of the system.
[0069] In addition, in a possible implementation manner, the above-mentioned method for handling abnormal power failure of the solid-state hard disk further includes: after the power management module detects that the power of the solid-state hard disk is restored, performing data integrity verification and system recovery.
[0070] For example, for the data integrity check process, after the power management module detects that the power of the solid-state drive has been restored, it runs the built-in self-test program to check the hardware status and system log. Verify whether the data on the storage medium is complete and check whether there are incomplete data blocks written due to power failure. Perform consistency checks on the data on the storage medium, such as comparing the checksum or hash value of the data. If data errors or inconsistencies are found, use error correction code (ECC) or other mechanisms to repair them. Analyze the system log to determine the operating status before the power failure and the data that needs to be restored.
[0071] For example, for the system recovery process, after the power management module detects that the power of the SSD has been restored, the data in the cache before the power failure is restored to the system to ensure data continuity. Restore the data transmission on the path between the SSD and the host, and control the SSD to start read and write operations. Record the process and results of system recovery for future reference. Test the various functions of the system to ensure that all services work as expected.
[0072] In this embodiment, after the power management module detects that the power of the solid-state hard disk has been restored, data integrity verification and system recovery are performed. The system can quickly return to normal working state after the power is restored, reducing the risk of business interruption and data loss caused by power failure events, and improving the reliability of the system.
[0073] The method for handling abnormal power failure of a solid-state hard disk provided in this embodiment is to obtain the power status of the solid-state hard disk detected by the power control module; after the power management module detects that the solid-state hard disk has abnormal power failure, a small capacitor is used to provide temporary power supply and control the solid-state hard disk to stop reading and writing operations; a data flush operation is performed to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface. In the scheme of this embodiment, the small capacitor can provide temporary power supply when the power is abnormal, saving the cost and volume of the solid-state hard disk; and, when the power is abnormally lost, the temporary power supply provided by the small capacitor can realize the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface, avoiding the loss of path data or data blocking the path, and improving the reliability of the system.
[0074] The abnormal power failure processing device for a solid state hard disk provided by the present invention is described below. The abnormal power failure processing device for a solid state hard disk described below and the abnormal power failure processing method for a solid state hard disk described above can be referred to each other.
[0075] Figure 3 Schematic diagram of the structure of the device for processing abnormal power failure of a solid state hard disk provided by the present invention. Figure 3 As shown, the above-mentioned device for processing abnormal power failure of a solid state hard disk includes an acquisition module 31, a control module 32 and a flush module.
[0076] The acquisition module 31 is used to acquire the power state of the solid state drive detected by the power control module.
[0077] In the present invention, the solid-state hard disk includes a power control module and a small capacitor, and the small capacitor is arranged near the power control module. Among them, the power control module is used to detect the power state of the solid-state hard disk. As an example, the power control module adopts a high-precision ADC (analog-to-digital converter) to collect the sampled voltage value at the sampling point in real time. The sampled voltage value is compared with the reference voltage value. If the sampled voltage is lower than the reference voltage value, it is determined that the solid-state hard disk is abnormally powered off; if the sampled voltage is not lower than the reference voltage value, it is determined that the power state of the solid-state hard disk is normal. Optionally, the reference voltage value can be set according to actual working requirements and the working conditions of the solid-state hard disk.
[0078] Optionally, when it is determined that the solid state drive is abnormally powered off, an interrupt signal may be triggered to prompt the solid state drive abnormal power-off processing device to perform abnormal power-off processing.
[0079] In practical applications, the power control module can collect the sampled voltage value at the sampling point in real time or periodically. For example, the power control module can include a sampling unit and an ADC conversion unit, the sampling unit is connected to the sampling point, and the sampling unit collects the analog voltage signal at the sampling point. The ADC conversion unit is connected to the sampling unit, and the ADC conversion unit converts the analog voltage signal into a sampled voltage value, so as to facilitate the subsequent determination of the power state of the solid state hard disk according to the sampled voltage value.
[0080] The control module 32 is used to provide temporary power supply through a small capacitor and control the solid-state hard disk to stop reading and writing operations after the power management module detects that the solid-state hard disk has abnormally lost power.
[0081] In practical applications, the selection of small capacitors is based on their discharge capacity and volume limitations, ensuring that they can provide enough power to complete the data flush operation when the power is off. It is understandable that small-capacity capacitors can provide enough power to complete the data flush operation without taking up too much PCB space. Generally, small capacitors with a capacity of 100uF to 500uF are selected. Small capacitors are arranged near the power management module of the solid-state drive to minimize resistance losses, ensure minimum resistance losses and the fastest response time.
[0082] Specifically, after the power management module detects that the solid state drive is abnormally powered off, the control module 32 controls the small capacitor to provide temporary power supply. Optionally, after receiving the interrupt signal, the control module 32 controls the small capacitor to provide temporary power supply. It can be understood that by providing temporary power supply through the small capacitor, sufficient power can be provided to complete the data flush operation, thereby improving the reliability of the system.
[0083] In the prior art, high-capacity capacitors are mainly relied on to extend the power supply time to ensure the integrity and consistency of data in the event of a sudden power outage. However, this solution has the following problems: The physical size of large-capacity capacitors is large, occupying valuable printed circuit board (PCB) board space, limiting the flexibility of the design. The cost of large-capacity capacitors is high, increasing the cost of the overall product. The durability and reliability of large-capacity capacitors may degrade in performance under high temperature or long-term use. Therefore, the prior art has problems with large size, high cost, inflexible design, and reliability.
[0084] Compared with the prior art, the use of small capacitors to provide temporary power supply has the following technical effects: on the one hand, by using small-capacity capacitors instead of traditional large-capacity capacitors, the overall size of the solid-state hard disk is significantly reduced. This enables the present invention to better adapt to the needs of lightweight and miniaturized design. Small capacitors have low costs, which reduces the production cost of the overall product without affecting data protection and system stability. On the other hand, the small size and flexible layout of small capacitors help optimize the layout and circuit design of the PCB and avoid the occupation of board space by large-capacity capacitors. This flexibility allows the design of the solid-state hard disk to better adapt to different application scenarios and structural requirements. On the other hand, since small capacitors have good adaptability to high temperatures or long-term use, the solution of the present invention effectively extends the service life of the solid-state hard disk and reduces system failures caused by aging or failure of large-capacity capacitors.
[0085] Furthermore, after the power management module detects that the solid state drive is abnormally powered off, the control module 32 controls the solid state drive to stop reading and writing operations to ensure data consistency. At the same time, this step can further reduce power consumption and buy time for subsequent flush operations. For example, after the control module 32 receives the interrupt signal, it responds to the interrupt signal and controls the solid state drive to stop reading and writing operations.
[0086] In this embodiment, there is no specific limitation on the method of controlling the SSD to stop read and write operations. For example, the SSD firmware includes logic for controlling read and write operations. After the power management module detects that the SSD has abnormally lost power, the control module 32 can trigger the SSD firmware to stop data transmission. For another example, the control module 32 sends a specific command to the SSD through the interface to notify it to stop all ongoing read and write operations. For another example, the interface protocol supported by the SSD (such as SATA, PCIe, NVMe, etc.) may include commands or signals for instructing the SSD to stop read and write operations.
[0087] The flush module 33 is used to perform a data flush operation to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface.
[0088] A flush operation generally refers to the process of writing data from volatile storage (such as RAM cache) to non-volatile storage (such as hard disk, solid-state drive, or other types of persistent storage media). A flush operation more specifically refers to ensuring that data is physically written and persisted on non-volatile storage, rather than just copied to non-volatile storage.
[0089] It should be noted that the flush operation ensures that data is moved from volatile storage (where data will be lost after power failure) to non-volatile storage (where data is retained even after power failure), ensuring data persistence. The flush operation can accurately and quickly write data to the storage medium when a small capacitor provides temporary power.
[0090] In practical applications, flushing the data to the master device interface (master) or the slave device interface (slave) by the flush module 33 usually means copying the data to a non-volatile storage medium. The non-volatile storage medium can keep the data from being lost even after the power is disconnected. As an example, the master port usually refers to the interface of the host or the main controller, which controls the initiation and termination of data transmission. The host sends read and write commands to the solid-state drive through the master port, including data read requests and write instructions. The solid-state drive responds to the command of the master port, reads the data from its storage medium and transmits it to the host, or receives data from the host for storage.
[0091] As an example, the master port generally refers to the interface of the main controller or host, such as the CPU or the main memory controller of the system. Transmitting data to the master port means that the data is sent back to the main control unit of the system, which may be further processed or temporarily stored. Therefore, the flush module 33 flushes the data being transmitted on the path between the solid state drive and the host to the master port, which can ensure that the data is accurately and quickly saved to the non-volatile storage medium of the host.
[0092] As an example, a slave port generally refers to an interface of a slave device or storage medium, such as a hard disk, a solid-state drive, a memory stick, or other types of storage devices. Data is transmitted to the slave port, which means that the data is written to the slave device, such as the NAND Flash storage medium of the SSD. Therefore, the flush module 33 flushes the data being transmitted on the path between the solid-state drive and the host to the slave port, which can ensure that the data is accurately and quickly saved in the non-volatile storage medium of the solid-state drive.
[0093] In actual applications, the data being transmitted on the path between the SSD and the host may come from the host (master end). In the case of abnormal power failure of the SSD, the flush module 33 may flush the unprocessed data back to the designated cache area or memory of the host. The data being transmitted on the path between the SSD and the host may need to be written to the SSD (slave end). In the case of abnormal power failure of the SSD, the flush module 33 may flush the unprocessed data to the storage medium of the SSD to ensure data persistence.
[0094] In practical applications, the flush operation can be implemented by the flush module 33, which is located between the peripheral component interconnect interface (PCIE) and the master path. Its main function is to flush all the data on the path to the master port or the slave port when an abnormal power failure is detected, to ensure the integrity of the data and the normality of the path. Specifically, the flush module 33 is designed as a high-speed cache and data transmission unit, which can transfer the data on the path to the target storage unit in a very short time.
[0095] like Figure 2As shown, the flush framework includes a solid-state drive chip, a flush module and a host, wherein the solid-state drive chip includes a data export. Among them, the solid-state drive chip (SSD chip) includes a power control module and a small capacitor, and the small capacitor is arranged near the power control module. Among them, the power control module is used to detect the power state of the solid-state drive, and trigger an interrupt signal when the solid-state drive loses power abnormally. The small capacitor responds to the interrupt signal and the small capacitor provides temporary power supply. The solid-state drive chip includes a data export for transferring data to other components. The flush module responds to the interrupt signal, triggers the data protection mechanism, performs the data flush operation, and flushes the data being transmitted on the path between the solid-state drive and the host to the master device interface or the slave device interface. The host is usually the CPU or main controller of the computer, which is responsible for sending read and write instructions. In the event of abnormal power failure, it receives a notification from the flush module and may execute the upper-level data protection strategy. Through this collaborative work, the flush framework can protect data from loss in the event of abnormal power failure and ensure that the storage device can be reliably restored after power is restored. This mechanism is crucial for protecting critical data and maintaining system reliability.
[0096] In addition, in a possible implementation, the flush module 33 is specifically used to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface in order of data priority from high to low.
[0097] Specifically, the priority of data can be set according to actual application needs and application scenarios. The flush module 33 has a built-in high-priority data transmission mechanism to ensure that in the event of a power outage, the data being transmitted on the path between the solid-state drive and the host is flushed to the master device interface or the slave device interface in order of data priority from high to low, thereby ensuring the security of critical data. In addition, by giving priority to writing important data, the risk of data corruption can be reduced and the integrity of the overall data can be improved.
[0098] In practical applications, sorting data by priority can optimize the performance of SSDs, allowing system resources (such as cache and bandwidth) to be more effectively allocated to critical tasks, which can optimize system performance. By giving priority to high-priority data, delays and blockages in the data transmission path can be reduced, ensuring smooth data transmission. Through priority management, SSDs can better support complex storage scenarios that require processing a large amount of data with different priorities.
[0099] It can be understood that when power is abnormally lost, the data being transmitted on the path between the solid-state drive and the host is flushed to the master device interface or the slave device interface in order of data priority from high to low, which can avoid path data loss or data blocking the path and improve system reliability.
[0100] In the scheme of this embodiment, the small capacitor can provide temporary power supply when the power is abnormal, saving the cost and volume of the solid-state hard disk; and when the power is abnormally cut off, the temporary power supply provided by the small capacitor can flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface, avoiding path data loss or data blocking the path, and improving the reliability of the system.
[0101] In addition, in a possible implementation manner, the above-mentioned device for processing abnormal power failure of a solid state drive further includes: a sleep control module.
[0102] The sleep control module is used to perform sleep processing on the physical layer of the peripheral component interconnection interface after the power management module detects abnormal power failure of the solid state drive.
[0103] Among them, Peripheral Component Interconnect Express (PCIE) is a high-speed serial computer expansion bus standard used to connect various peripherals and expansion cards inside the computer. It supports point-to-point connections, and each device has a dedicated connection to the processor. This topology makes communication between devices more efficient because it eliminates the need for devices to wait for access to the bus. The working principle of PCIE includes the physical layer, data link layer, and transport layer. The physical layer is responsible for the physical signals and electrical characteristics of transmitted data, the data link layer handles the flow control and error detection of data transmission, and the transport layer manages the distribution and routing of data packets. PCIE devices need to be initialized and configured when connected to the host so that the system can recognize and configure the device.
[0104] The physical layer (PHY) refers to the lowest level protocol in data communication, which is used for signal transmission and reception between physical media. In the present invention, the physical layer of the peripheral component interconnect interface (PCIE PHY) refers to the physical layer of the PCIE interface, which is responsible for the physical transmission of PCIE signals.
[0105] In actual applications, PCIE PHY is usually the part with the largest power consumption in the system. It is understandable that after the power management module detects abnormal power loss of the solid-state drive, the physical layer (PCIE PHY) of the peripheral component interconnect interface is put into sleep mode, so that the system can significantly reduce energy consumption, thereby using the remaining power for data flush operations, avoiding data loss due to insufficient power, and improving the overall reliability and data protection capabilities of the system.
[0106] In addition, in a possible implementation manner, the flush module 33 is further used to return new data on the path between the solid state drive and the host to the slave device interface during the data flush operation.
[0107] Here, the newly arrived data usually refers to the data just received during the data flush operation. For example, the newly arrived data may be the new input data that the system attempts to receive during the flush operation. For another example, there may be an instruction queue in the system, and new write instructions are still added to the queue even when the flush operation is in progress. For another example, in the asynchronous transmission mode, the sending and receiving of data are performed independently, so new data may still arrive during the flush operation.
[0108] In this embodiment, during the data flush operation, the flush module 33 returns the new data on the path between the solid state drive and the host to the slave device interface, ensuring the integrity and consistency of the data, ensuring the smooth operation of the entire path, avoiding data congestion, and improving the reliability of the system.
[0109] In addition, in order to further improve the reliability of the system and the integrity and consistency of the data, in a possible implementation manner, the above-mentioned device for processing abnormal power failure of a solid state drive further includes: a data verification module.
[0110] The data verification module is used to perform integrity and consistency verification on the data flushed to the master device interface or the slave device interface.
[0111] Specifically, there is no specific limitation on the integrity and consistency check of data. As an example, the integrity check can be implemented by hash functions (such as SHA-256), checksums (CRC32), digital signatures, redundant coding, etc. As an example, the consistency check can be implemented by data backup verification, data comparison, etc.
[0112] In actual applications, if the data integrity and consistency check fails, the data can be repaired to ensure the integrity and consistency of the data.
[0113] In this implementation, after executing the data flush operation, the data verification module performs integrity and consistency verification on the data flushed to the master device interface or the slave device interface, which can ensure the integrity and consistency of the data and improve the reliability of the system.
[0114] In addition, in a possible implementation manner, the above-mentioned device for processing abnormal power failure of a solid state drive further includes: a system recovery module.
[0115] The system recovery module is used to perform data integrity verification and system recovery after the power management module detects that the power of the solid state drive has been restored.
[0116] For example, for the data integrity check process, after the power management module detects that the power of the solid-state drive has been restored, it runs the built-in self-test program to check the hardware status and system log. Verify whether the data on the storage medium is complete and check whether there are incomplete data blocks written due to power failure. Perform consistency checks on the data on the storage medium, such as comparing the checksum or hash value of the data. If data errors or inconsistencies are found, use error correction code (ECC) or other mechanisms to repair them. Analyze the system log to determine the operating status before the power failure and the data that needs to be restored.
[0117] For example, for the system recovery process, after the power management module detects that the power of the SSD has been restored, the data in the cache before the power failure is restored to the system to ensure data continuity. Restore the data transmission on the path between the SSD and the host, and control the SSD to start read and write operations. Record the process and results of system recovery for future reference. Test the various functions of the system to ensure that all services work as expected.
[0118] In this embodiment, after the power management module detects that the power of the solid-state hard disk has been restored, data integrity verification and system recovery are performed. The system can quickly return to normal working state after the power is restored, reducing the risk of business interruption and data loss caused by power failure events, and improving the reliability of the system.
[0119] The device for processing abnormal power failure of a solid-state hard disk provided by the present invention has an acquisition module that obtains the power state of the solid-state hard disk detected by the power control module; after the power management module detects that the solid-state hard disk has abnormal power failure, the control module provides temporary power supply through a small capacitor and controls the solid-state hard disk to stop reading and writing operations; the flush module performs a data flush operation to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface. In the scheme of this embodiment, the small capacitor can provide temporary power supply when the power is abnormal, saving the cost and volume of the solid-state hard disk; and, when the power is abnormally lost, the temporary power supply provided by the small capacitor can realize the data being transmitted on the path between the solid-state hard disk and the host to be flushed to the master device interface or the slave device interface, avoiding the loss of path data or data blocking the path, and improving the reliability of the system.
[0120] Figure 4 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the method for handling abnormal power failure of the solid state drive, the method comprising: obtaining the power state of the solid state drive detected by the power control module; after the power management module detects that the solid state drive is abnormally powered off, providing temporary power supply through a small capacitor and controlling the solid state drive to stop reading and writing operations; and executing a data flush operation to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface.
[0121] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0122] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the solid-state hard disk abnormal power failure processing method provided by the above-mentioned methods, and the method includes: obtaining the power status of the solid-state hard disk detected by the power control module; after the power management module detects the abnormal power failure of the solid-state hard disk, providing temporary power supply through a small capacitor and controlling the solid-state hard disk to stop reading and writing operations; performing a data flush operation to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface.
[0123] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the solid-state hard disk abnormal power failure processing method provided by the above-mentioned methods, and the method includes: obtaining the power state of the solid-state hard disk detected by the power control module; after the power management module detects the abnormal power failure of the solid-state hard disk, providing temporary power supply through a small capacitor and controlling the solid-state hard disk to stop reading and writing operations; performing a data flush operation to flush the data being transmitted on the path between the solid-state hard disk and the host to the master device interface or the slave device interface.
[0124] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0125] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for handling abnormal power failure of a solid state hard disk, characterized in that: The solid state hard disk comprises a power control module and a small capacitor, wherein the small capacitor is arranged near the power control module; the method comprises: Acquiring the power state of the solid state hard disk detected by the power control module; After the power management module detects that the solid state hard disk is abnormally powered off, a small capacitor is used to provide temporary power supply and control the solid state hard disk to stop reading and writing operations; Execute the data flush operation to flush the data being transmitted on the path between the SSD and the host to the master device interface or the slave device interface.
2. The method for handling abnormal power failure of a solid state drive according to claim 1, characterized in that: The method further comprises: After the power management module detects abnormal power failure of the solid state drive, a sleep process is performed on the physical layer of the peripheral component interconnection interface.
3. The method for handling abnormal power failure of a solid state drive according to claim 1, characterized in that: The data flush operation is performed to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface, including: The data being transmitted on the path between the solid state drive and the host is flushed to the master device interface or the slave device interface in descending order of priority of the data.
4. The method for handling abnormal power failure of a solid state hard disk according to claim 1, characterized in that: The method further comprises: During the data flush operation, new data on the path between the solid state drive and the host is returned to the slave device interface.
5. The method for processing abnormal power failure of a solid state hard disk according to any one of claims 1 to 4, characterized in that: The method further comprises: After the power management module detects that the power of the solid state hard disk is restored, data integrity check and system recovery are performed.
6. The method for handling abnormal power failure of a solid state hard disk according to any one of claims 1 to 4, characterized in that: After the data flush operation is performed to flush the data being transmitted on the path between the solid state drive and the host to the master device interface or the slave device interface, the method further includes: Perform integrity and consistency checks on data flushed to the master device interface or slave device interface.
7. A device for processing abnormal power failure of a solid state hard disk, characterized in that: The solid state hard disk comprises a power control module and a small capacitor, wherein the small capacitor is arranged near the power control module; the device comprises: An acquisition module, used for acquiring the power state of the solid state hard disk detected by the power control module; A control module, configured to provide temporary power supply through a small capacitor and control the solid-state hard disk to stop reading and writing operations after the power management module detects abnormal power failure of the solid-state hard disk; The flush module is used to perform data flush operations to flush the data being transmitted on the path between the solid-state drive and the host to the master device interface or the slave device interface.
8. An electronic 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 for handling abnormal power failure of a solid state hard disk as claimed in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the method for handling abnormal power failure of a solid state hard disk as claimed in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by the processor, the method for handling abnormal power failure of a solid state hard disk as claimed in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
PCIE (Peripheral Component Interface Express) interface based solid-state hard disk power failure protection method and device
CN102156679A
Safe solid-state hard disk data writing method
CN107797899A
ZNS solid state disk power-down data storage method
CN117573420A
Method and device for constructing high speed solid state storage disk with larger capacity dram involved in management of flash media
WO2010066098A1
Power failure protection circuit of solid state disk and solid state disk with DDR cache
WO2017181428A1
Cited By
Power failure protection method and device, electronic equipment and storage medium
CN119690872A
Solid state disk and electronic system
CN120353406A