Power failure protection method and system and storage medium
By sending custom commands to NVMe SSD to identify its power-down protection capabilities and using its persistent memory area for data backup, the problem of high cost and limited reliability of the RAID controller power-down protection hardware is solved, and efficient and economical data persistent storage is achieved, which enhances the reliability and data security of the system.
Patent Information
- Application Number
- CN202510712209.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-05-30
AI Technical Summary
In the prior art, the power-down protection solution of RAID controllers is expensive in hardware and has limited component reliability. The supercapacitor group needs large capacity to supply power. NAND Flash is prone to failure, resulting in data loss and system inconsistency.
Send custom NVMe Admin commands to the NVMe SSD through the RAID controller, identify its power-down protection capabilities, select the target NVMe SSD to store data, and use its persistent memory area for data backup, eliminating dependence on supercapacitors and exclusive NAND flash memory.
Reduces the overall deployment cost of power-down protection, improves system reliability and data security, simplifies hardware design and system integration, and reduces the risk of data loss.
Smart Images

Figure CN120260646A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data storage, and in particular, to a power-off protection method, system, and storage medium. Background Art
[0002] In modern storage systems, the Redundant Array of Independent Disks (RAID) controller, as the core component of data storage management, its power-off data protection function plays a crucial role in ensuring data integrity and system reliability. In critical business scenarios (such as financial transaction systems, medical information systems, etc.), a sudden power outage may cause the loss of cached data that has not been completed for disk writing, which may lead to serious consequences such as data inconsistency and RAID array crashes, posing strict requirements on the disaster recovery ability of the storage system.
[0003] In the prior art, a power-off protection scheme based on hardware redundancy is usually adopted: when an abnormal power-off is detected, the RAID controller provides temporary power supply through an integrated large-capacity supercapacitor bank, and migrates the data to be written in the Dynamic Random Access Memory (DRAM) to the on-board NAND Flash non-volatile memory for persistent storage. After the system resumes power supply, the controller executes the data write-back process, reloads the data temporarily stored in the NAND Flash into the cache, and completes the final hard disk write operation.
[0004] However, this technical solution has significant defects: (1) The hardware cost is high. The supercapacitor bank needs to have sufficient capacity to maintain the power supply for the entire data dump process, and its procurement cost increases exponentially with the capacity requirement; (2) Component reliability limitations. The NAND Flash is limited by the physical write / erase cycle (P / E Cycle) and is prone to storage unit failures in frequent power-off scenarios. Summary of the Invention
[0005] Embodiments of this application provide a power-off protection method, system, and storage medium, which can reduce the overall deployment cost of power-off protection and improve the reliability of components.
[0006] The technical solution of the embodiments of this application is implemented as follows: In a first aspect, embodiments of this application provide a power-off protection method, the method includes: The RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on the information of the data to be stored by the RAID controller in the case of power-off; The RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data with power-off protection; The RAID controller parses the second command to obtain a parsing result; In the event of a power failure, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; Configure the SSD register based on the information of the data to be stored; Based on the configuration of the SSD register, store the data to be stored in the persistent memory area of the target NVMe SSD; In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, and the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash of the target NVMe SSD.
[0007] In some embodiments, the operation code of the first command is used to indicate whether it has the characteristic of migrating data with power-off protection; The first field of the first command is used to indicate the size of the data to be stored.
[0008] In some embodiments, the status code of the second command is used to indicate whether the candidate NVMe SSD has the characteristic of migrating data with power-off protection; The second field of the second command is used to indicate whether the candidate NVMe SSD with the characteristic of migrating data with power-off protection has the ability to migrate data with power-off protection.
[0009] In some embodiments, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the method further includes: The RAID controller modifies the configuration of the SSD register to indicate the end of data backup.
[0010] In some embodiments, before storing the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register, the method further includes: The RAID controller sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
[0011] In some embodiments, the SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enablement; configuring the SSD register based on the information of the data to be stored includes: Configuring the third field based on the size of the data to be stored in the information of the data to be stored; Configuring the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
[0012] In some embodiments, the method further includes: The NVMe SSD polls and reads the configuration of the SSD register; In response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the NVMe SSD reads the third field; The NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0013] In some embodiments, if the fourth field does not indicate the end of data backup within the backup time threshold, it is determined that storing the data to be stored in the target NVMe SSD fails.
[0014] In some embodiments, if the fourth field indicates the end of data backup, the method further includes: The target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through an ONFI high-speed interface.
[0015] In a second aspect, an embodiment of the present application provides a power-off protection system, which at least includes a solid-state drive controller, and the solid-state drive controller includes: A sending module, configured to send a first command to at least one candidate NVMe SSD, where the first command is configured based on the information of the data to be stored by the RAID controller in the event of a power-off; A receiving module, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data for power-off protection; An analysis module, configured to analyze the second command to obtain an analysis result; A selection module, configured to, when a power failure occurs, select a target NVMe SSD from the at least one candidate NVMe SSD, where the target NVMe SSD is used to store the data to be stored; A configuration module, configured to configure an SSD register based on information of the data to be stored; A data backup module, configured to store the data to be stored into a persistent memory area of the target NVMe SSD based on the configuration of the SSD register; The sending module is further configured to, in response to completion of storing the data to be stored into the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored into a NAND flash of the target NVMe SSD.
[0016] In some embodiments, an operation code of the first command is used to indicate whether a power failure protection data migration feature is available; A first field of the first command is used to indicate a size of the data to be stored.
[0017] In some embodiments, a status code of the second command is used to indicate whether the candidate NVMe SSD has a power failure protection data migration feature; A second field of the second command is used to indicate whether the candidate NVMe SSD with the power failure protection data migration feature has a power failure protection data migration capability.
[0018] In some embodiments, in response to completion of storing the data to be stored into the persistent memory area of the target NVMe SSD, the configuration module is further configured to modify the configuration of the SSD register to indicate that data backup is completed.
[0019] In some embodiments, the sending module is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes a size of the data to be stored.
[0020] In some embodiments, the SSD register includes at least a third field, a fourth field, and a fifth field for indicating data backup enablement; The configuration module is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored; Configure the fourth field based on a process of storing the data to be stored into the persistent memory area of the target NVMe SSD.
[0021] In some embodiments, the power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes: A reading module, configured to poll and read the configuration of the SSD register, and read the third field in response to the fourth field indicating that the RAID controller has started backing up the data to be stored. A determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0022] In some embodiments, the determining module is further configured to determine that the storage of the data to be stored in the target NVMe SSD fails in response to the fourth field not indicating the end of data backup within the backup time threshold.
[0023] In some embodiments, the target NVMe SSD further includes: A storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface in response to the fourth field indicating the end of data backup.
[0024] In a third aspect, an embodiment of the present application provides a power-off protection system, and the power-off protection system includes: A processor and a memory communicatively connected to the processor; wherein, The processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor can execute the above-mentioned power-off protection method.
[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, storing executable instructions, which are used to implement the above-mentioned power-off protection method when being executed by a processor.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program product, and the computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by a processor, the above-mentioned power-off protection method is implemented.
[0027] The power-off protection method provided by the embodiments of this application includes: the RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on the information of the data to be stored in the case of power-off by the RAID controller; the RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the power-off protection data migration ability; the RAID controller parses the second command to obtain a parsing result; in the case of power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; configures the SSD register based on the information of the data to be stored; stores the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register; in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, sends a notification message to the target NVMe SSD, and the notification message is used to indicate that the candidate NVMe SSD stores the data to be stored in the NAND flash of the target NVMe SSD. In the embodiments of this application, the first command is a custom NVMe Admin command. By using the custom NVMe Admin command to identify whether the NVMe SSD has the power-off protection offload ability, the data backup is more flexible. In the embodiments of this application, the RAID controller can quickly back up data to the PMR area of the NVMe SSD in the case of power-off, reducing the risk of data loss and improving the reliability of the system. By using the PMR feature of the NVMe SSD device, the efficient and persistent storage of key data in the RAID controller is realized, enhancing the security and integrity of the data. The power-off protection method provided by the embodiments of this application does not require super point-in, eliminates the dependence on super capacitors and dedicated NAND flash, reduces the hardware requirements for power-off protection, simplifies the hardware design and capacitor management of the RAID controller, and thus effectively reduces the overall deployment cost. The embodiments of this application mainly rely on the system firmware to implement power-off protection, without additional hardware modifications, simplifying the hardware design and system integration process, making the maintenance and upgrade of the system more convenient and easy to integrate into the existing storage system. Description of the Drawings
[0028] Figure 1 It is a schematic diagram of a processing flow of the power-off protection method provided by the embodiments of this application; Figure 2 It is a schematic diagram of the structure of the submission queue entry corresponding to the first command provided by the embodiments of this application; Figure 3It is a schematic diagram of the detailed processing flow of a power-off protection method provided by an embodiment of the present application; Figure 4 It is a schematic architecture diagram of a power-off protection system for implementing the power-off protection method provided by an embodiment of the present application; Figure 5 It is a schematic diagram of the composition structure of a power-off protection system provided by an embodiment of the present application; Figure 6 It is another schematic diagram of the structure of the power-off protection system provided by an embodiment of the present application. Detailed implementation manners
[0029] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be construed as limitations on the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.
[0030] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0031] In the following description, the terms "first / second" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second" can be interchanged with a specific order or sequence when allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0033] It should be understood that in various embodiments of the present application, the magnitude of the serial numbers of the various implementation processes does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0034] A schematic diagram of a processing flow of the power-off protection method provided by an embodiment of the present application is as Figure 1 shown, and at least includes the following steps: Step S101, the RAID controller sends a first command to at least one candidate NVMe SSD, and the first command is configured based on the information of the data to be stored by the RAID controller in the power-off situation.
[0035] In some embodiments, the RAID controller may send a first command to multiple candidate NVMe SSDs during the initialization phase; among them, the candidate NVMe SSDs may be the NVMe SSDs attached to the RAID controller. The information of the data to be stored in the case of power failure by the RAID controller may be the size of the data to be stored in the case of power failure.
[0036] In some embodiments, the first command may be a custom NVMe Admin command; the opcode of the first command is used to indicate whether the RAID controller has the power failure protection data migration feature, and the corresponding value of the opcode is Coh. The first field of the first command is used to indicate the size of the data to be stored; among them, the first field may be SQEDword12; as an example, bits 00 to 06 of SQE Dword12 are used to indicate the size of the data to be stored, and the unit may be MB, and bits 07 to 31 of SQE Dword12 are reserved bits.
[0037] In some embodiments, the schematic diagram of the structure of the submission queue entry (SQE) corresponding to the first command is as Figure 2 shown, bits 01:00 are 00b, indicating no data transfer; bit 07 is 1b, indicating a custom NVMe Admin command; bits 06:02 indicate that the size of the data to be stored is 10000b; the opcode is C0h; Command is Powerloss Offload Command (power failure protection instruction).
[0038] Among them, NVMe (Non-Volatile Memory Express) is a non-volatile memory host controller interface specification. The communication protocol based on the PCIe interface is designed specifically for SSDs to provide high-speed and low-latency storage access.
[0039] In the embodiments of the present application, by using a custom NVMe Admin command to identify whether the NVMe SSD has the power failure protection offload ability, the data backup is made more flexible.
[0040] Step S102, the RAID controller receives a second command sent by the candidate NVMe SSD based on the first command.
[0041] In some embodiments, the first command and the second command may be transmitted between the RAID controller and the candidate NVMe SSD through a PCIe high-speed link.
[0042] Step S103, the RAID controller parses the second command to obtain a parsing result.
[0043] In some embodiments, for each candidate NVMe SSD, after receiving the first command, the candidate NVMe SSD parses the first command. Specifically, it parses the Opcode of the first command. When it is parsed that the Opcode indicates the feature of offload of power-off protection data, it further parses the size of the data to be stored in SQE Dword 12 of the first command, and compares the size of the data to be stored with the size of its own persistent memory region (PMR). In one scenario, if the size of the PMR of the candidate NVMe SSD is greater than or equal to the size of the data to be stored, it indicates that the candidate NVMe SSD has the ability of offload of power-off protection data. At this time, the status code of the second command can be "00h", indicating that the candidate NVMe SSD has the feature of offload of power-off protection data; bits 0 to 1 of Dword0 of the second command can be "01b", indicating that the candidate NVMe SSD has the ability of offload of power-off protection data. In another scenario, if the size of the PMR of the candidate NVMe SSD is less than the size of the data to be stored, it indicates that the candidate NVMe SSD does not have the ability of offload of power-off protection data. At this time, the status code of the second command can be "00h", indicating that the candidate NVMe SSD has the feature of offload of power-off protection data; bits 0 to 1 of Dword0 of the second command can be "00b", indicating that the candidate NVMe SSD does not have the ability of offload of power-off protection data.
[0044] In some other embodiments, for each candidate NVMe SSD, after receiving the first command, the candidate NVMe SSD parses the first command. Specifically, it parses the Opcode of the first command. When it is parsed that the Opcode indicates no feature of offload of power-off protection data, there is no need to further parse the size of the data to be stored in SQE Dword 12 of the first command. At this time, the status code of the second command can be "01h", indicating that the candidate NVMe SSD has the feature of offload of power-off protection data, or indicating an invalid command opcode.
[0045] Step S104, in the case of power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored.
[0046] In some embodiments, based on the parsing results of each candidate NVMe SSD, the RAID controller selects one from the candidate NVMe SSDs with the ability to migrate data for power-off protection as the target NVMe SSD for storing the data to be stored.
[0047] As an example, the RAID controller may randomly select one from the candidate NVMe SSDs with the ability to migrate data for power-off protection as the target NVMe SSD. The RAID controller may also randomly select one from the candidate NVMe SSDs with the ability to migrate data for power-off protection in the order of the identifiers of the candidate NVMe SSDs as the target NVMe SSD.
[0048] Step S105, configure the SSD register based on the information of the data to be stored.
[0049] In some embodiments, the RAID controller configures the SSD register based on the size of the data to be stored included in the information of the data to be stored.
[0050] In some embodiments, the SSD register may be a Vendor-customized register. The SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enable. In the embodiments of the present application, a data backup communication mechanism is designed through the Vendor-customized register, making the data backup communication mechanism simpler and more efficient.
[0051] In some embodiments, the specific time limit process of configuring the SSD register based on the information of the data to be stored may include: configuring the third field based on the size of the data to be stored in the information of the data to be stored; configuring the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD. Among them, the third field may be Backup Size, which is used to indicate the amount of backup data, with the unit of MB, and the third field occupies 1 bit size. The fourth field may be a data backup flag (Poweroff Backup Flag), and the fourth field occupies 1 bit size; the fourth field may be one of a data backup end flag and a data backup start flag. As an example, the data backup start flag may be represented as "0xAA", and the data backup end flag may be represented as "0x55". The fifth field is used to indicate data backup enable, and the fifth field occupies 1 bit size; data backup enable is performed by the RAID controller in the initialization stage, and the target NVMe SSD determines whether to back up the data of the RAID controller during the next abnormal power-off through the fifth field; if data backup enable is not performed, the offload function for power-off protection is turned off.
[0052] In some embodiments, the SSD register may further include a reserved field with a size of 1 bit, which is used for subsequent function expansion.
[0053] Step S106, store the data to be stored in the persistent memory area of the target NVMe SSD based on the configuration of the SSD register.
[0054] In some embodiments, the RAID controller first sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored. Then, the RAID controller stores the data to be stored in the persistent memory area of the target NVMe SSD.
[0055] In some embodiments, after receiving the backup message, the target NVMe SSD polls to read the configuration of the SSD register; in response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the NVMe SSD reads the third field; the target NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller. Specifically, the size of the data to be stored indicated by the third field can be divided by the bandwidth of the PCIe high-speed link to obtain a candidate time threshold. The backup time threshold is obtained by multiplying the candidate time threshold by a preset coefficient. Among them, the preset coefficient can be flexibly set according to the actual application scenario; as an example, the preset coefficient can be 1.5 or 2. In response to the fourth field not indicating the end of data backup within the backup time threshold, it is determined that storing the data to be stored in the target NVMe SSD fails. In response to the fourth field indicating the end of data backup within the backup time threshold, the RAID controller modifies the configuration of the SSD register to indicate the end of data backup, then it is determined that storing the data to be stored in the target NVMe SSD is successful, and the target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface.
[0056] In the embodiments of the present application, the RAID controller can quickly back up data to the PMR area of the NVMe SSD in the event of a power failure, reducing the risk of data loss and improving the reliability of the system. By using the PMR feature of the NVMe SSD device, efficient and persistent storage of critical data in the RAID controller is achieved, enhancing data security and integrity. The power-off protection method provided by the embodiments of the present application does not require a super point-in, eliminates the dependence on supercapacitors and dedicated NAND flash memories, reduces the hardware requirements for power-off protection, simplifies the hardware design and capacitor management of the RAID controller, and thus effectively reduces the overall deployment cost. The embodiments of the present application mainly rely on the system firmware to implement power-off protection, without additional hardware modifications, simplifying the hardware design and system integration process, making the maintenance and upgrade of the system more convenient and easy to integrate into existing storage systems.
[0057] A schematic diagram of the detailed processing flow of a power-off protection method provided by an embodiment of the present application is as follows Figure 3 shown, and at least includes the following steps: Step S201, the RAID controller experiences an abnormal power failure, and the RAID controller modifies the third and fourth fields of the Vendor register.
[0058] In some embodiments, the RAID controller modifies the fourth field (Poweroff BackupFlag) of the Vendor register to "0xAA", indicating the start of data backup. The RAID controller modifies the third field (BackupSize) of the Vendor register to the actual amount of backup data.
[0059] Step S202, the NVMe SSD polls and reads the Vendor register. If the fourth field indicates the start of data backup, the NVMe SSD reads the third field, obtains the backup data volume, and calculates the backup time threshold.
[0060] In some embodiments, the NVMe SSD determines the backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0061] Step S203, after the data backup is completed, the RAID controller modifies the fourth field of the Vendor register.
[0062] In some embodiments, the RAID controller modifies the fourth field (Poweroff BackupFlag) of the Vendor register to "0x55", indicating the end of data backup.
[0063] Step S204, the NVMe SSD polls and reads the Vendor register. If the fourth field indicates the end of data backup, the NVMe SSD writes the data in the PMR area to the NAND flash of the NVMe SSD.
[0064] In some embodiments, the NVMe SSD can write the data in the PMR area to the NAND flash of the NVMe SSD through the ONFI interface.
[0065] A schematic diagram of an architecture of a power-off protection system for implementing the power-off protection method provided by the embodiments of the present application is shown in Figure 4 shown, and at least includes: RAID controller 301, NVMe SSD 302, power monitoring module 303, non-super capacitor 304, cache 305, NVMe controller 306, NVMe SSD PMR 307, and NAND 308.
[0066] The RAID controller 301 is responsible for managing and coordinating the RAID array composed of multiple physical hard disks (HDD / SSD), and realizes the high availability, high performance or fault tolerance of data through technologies such as data redundancy, striping or distributed storage.
[0067] The NVMe SSD 302 is a solid-state drive based on the NVMe interface and is used to store data.
[0068] The power monitoring module 303 is used to monitor the power status of the RAID controller 301 and the cache 305; when an abnormal power-off occurs, it starts the power-off protection exception handling program.
[0069] The non-super capacitor 304 is used to provide power for the RAID controller 301 and the cache 305 in a short time when an abnormal power-off occurs in the RAID system, allowing the RAID controller 301 to have enough time to store the data in the cache 305 into the NVMe SSD PMR 307 area. The power supply time provided by the non-super capacitor 304 is usually from a few milliseconds to more than a dozen milliseconds. Compared with the super capacitor, the non-super capacitor 304 has a smaller capacity and a correspondingly extremely low cost.
[0070] In some embodiments, the non-super capacitor 304 can also be referred to as an ordinary capacitor.
[0071] The cache 305 is used to temporarily store frequently accessed RAID data blocks, improve data access speed, reduce access latency, reduce hard disk I / O operations, and extend the service life of physical hard disks. When an abnormal power-off occurs in the RAID system, the key data in the cache 305 needs to be saved to a non-volatile storage medium to avoid data loss.
[0072] The NVMe controller 306 is used to communicate with and manage the connected NVMe drive, convert data read and write instructions into a command set that the NVMe SSD can understand, and send the command set to the corresponding NVMe SSD for execution.
[0073] The NVMe SSD PMR307 is a persistent storage area within the NVMe SSD and is used to store the data in the cache 305 in the event of a power failure in the RAID system. Since the data in this area can still be retained after a power failure, it provides a more reliable data protection mechanism than traditional volatile caches.
[0074] NAND308 is a non-volatile storage medium that stores metadata that needs to be persistent and is usually connected to the SSD controller using the ONFI interface. Among them, ONFI (Open NAND Flash Interface) is an open NAND flash interface, an open standard organization composed of multiple NAND flash manufacturers and related technology companies, aiming to formulate standardized specifications for the NAND flash interface. The ONFI specification defines the physical characteristics, electrical characteristics, operation commands, functions, and performance parameters of the NAND flash chip to ensure compatibility and interoperability between NAND flash memories produced by different manufacturers.
[0075] The power-off protection system provided by the embodiments of the present invention can utilize the PMR characteristics of downstream NVMe SSD devices to achieve efficient persistent storage of key data in the RAID controller cache, eliminate the dependence on supercapacitors and dedicated NAND flash memories, effectively reduce system costs, simplify hardware design, and enhance system reliability.
[0076] A schematic diagram of the composition structure of a power-off protection system provided by an embodiment of the present application is shown as Figure 5 shown, and at least includes a solid-state drive controller 500, and the solid-state drive controller 500 includes: A sending module 501, configured to send a first command to at least one candidate NVMe SSD, and the NVMe Admin command is configured based on information about data to be stored in the event of a power failure in a redundant array of independent disks (RAID) controller; A receiving module 502, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate power-off protection data; An analysis module 503, configured to analyze the second command to obtain an analysis result; A selection module 504, configured to select a target NVMe SSD from the at least one candidate NVMe SSD when a power failure occurs, where the target NVMe SSD is used to store the data to be stored; A configuration module 505, configured to configure SSD registers based on information of the data to be stored; A data backup module 506, configured to store the data to be stored in a persistent memory area of the target NVMe SSD based on the configuration of the SSD registers; The sending module 501 is further configured to send a notification message to the target NVMe SSD in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored in the NAND flash of the target NVMe SSD.
[0077] In some embodiments, the operation code of the first command is used to indicate whether the power failure protection data migration feature is available; the first field of the first command is used to indicate the size of the data to be stored.
[0078] In some embodiments, the status code of the second command is used to indicate whether the candidate NVMe SSD has the power failure protection data migration feature; the second field of the second command is used to indicate whether the candidate NVMe SSD with the power failure protection data migration feature has the power failure protection data migration ability.
[0079] In some embodiments, in response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the configuration module 505 is further configured to modify the configuration of the SSD registers to indicate the end of data backup.
[0080] In some embodiments, the sending module 501 is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
[0081] In some embodiments, the SSD registers at least include a third field, a fourth field, and a fifth field for indicating data backup enable; The configuration module 505 is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored; Configure the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
[0082] In some embodiments, the power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes: A reading module, configured to poll and read the configuration of the SSD register, and read the third field in response to the fourth field indicating that the RAID controller has started backing up the data to be stored. A determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
[0083] In some embodiments, the determining module is further configured to determine that the storage of the data to be stored to the target NVMe SSD fails if the fourth field does not indicate the end of data backup within the backup time threshold.
[0084] In some embodiments, the target NVMe SSD further includes a storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through an ONFI high-speed interface in response to the fourth field indicating the end of data backup.
[0085] An embodiment of the present application further provides a power-off protection system, which includes a processor and a memory communicatively connected to the processor; wherein, the processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the power-off protection method provided in the above embodiments of the present application.
[0086] Another structural schematic diagram of the power-off protection system provided by the embodiment of the present application is as Figure 6 shown, and includes: a processor 410, and a memory 450 communicatively connected to the processor 410. The power-off protection system further includes a bus 440; each module of the power-off protection system is coupled together through the bus 440. Among them, the processor may include multiple ones. It can be understood that the bus 440 is used to realize the connection and communication between these modules. In addition to the data bus, the bus 440 further includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 6 all kinds of buses are labeled as bus 440.
[0087] The processor 410 has the ability to process signals, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware models, etc. Among them, the general-purpose processor may be a microprocessor or any conventional processor, etc.
[0088] The memory 450 stores executable instructions for implementing the power-off protection method provided in the embodiments of the present application; the memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memories, hard disk drives, optical disc drives, etc. The memory 450 optionally includes one or more storage devices physically located far from the processor core 410.
[0089] In some embodiments, the memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof.
[0090] In some embodiments, the power-off protection system may further include: An operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks; A network communication module 452, for reaching other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.
[0091] The embodiments of the present application provide a computer-readable storage medium storing executable instructions, where the executable instructions, when executed by a processor, will trigger the processor to execute the power-off protection method provided in the embodiments of the present application. For example, as Figures 1 to 3 shown in the power-off protection method.
[0092] In some embodiments, the computer-readable storage medium can be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a CD-ROM, etc.; it can also be various devices including one or any combination of the above memories.
[0093] In some embodiments, the executable instructions may be in the form of a program, software, a software module, a script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, a model, a subroutine, or other unit suitable for use in a computing environment.
[0094] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one location, or alternatively, on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0095] An embodiment of the present application provides a computer program product, the computer program product including a computer program / instructions, and when the computer program / instructions are executed by a processor, the power-off protection method described in the present application is implemented.
[0096] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A power-down protection method, characterized in that, The method includes: An independent disk redundant array (RAID) controller sends a first command to at least one candidate non-volatile memory express (NVMe) solid state drive (SSD), where the first command is configured based on information of data to be stored by the RAID controller in the case of power failure; The RAID controller receives a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data for power failure protection; The RAID controller parses the second command to obtain a parsing result; In the case of power failure, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; Configure an SSD register based on information of the data to be stored; Store the data to be stored into a persistent memory area of the target NVMe SSD based on the configuration of the SSD register; In response to the end of storing the data to be stored into the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored into a NAND flash memory of the target NVMe SSD.
2. The method according to claim 1, characterized in that, An operation code of the first command is used to indicate whether it has the feature of migrating data for power failure protection; A first field of the first command is used to indicate the size of the data to be stored; 3. The method according to claim 1, characterized in that, A status code of the second command is used to indicate whether the candidate NVMe SSD has the feature of migrating data for power failure protection; A second field of the second command is used to indicate whether a candidate NVMe SSD with the feature of migrating data for power failure protection has the ability to migrate data for power failure protection; 4. The method according to claim 1, wherein In response to the end of storing the data to be stored into the persistent memory area of the target NVMe SSD, the method further includes: The RAID controller modifies the configuration of the SSD register to indicate the end of data backup; 5. The method according to claim 1, wherein Before storing the data to be stored into the persistent memory area of the target NVMe SSD based on the configuration of the SSD register, the method further includes: The RAID controller sends a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored; 6. The method according to claim 1, wherein The SSD register includes at least a third field, a fourth field, and a fifth field for indicating data backup enable; configuring the SSD register based on information of the data to be stored includes: Configuring the third field based on the size of the data to be stored in the information of the data to be stored; Configuring the fourth field based on a process of storing the data to be stored into the persistent memory area of the target NVMe SSD; 7. The method according to claim 6, characterized in that The method further includes: The target NVMe SSD polls and reads the configuration of the SSD register; In response to the fourth field indicating that the RAID controller has started backing up the data to be stored, the target NVMe SSD reads the third field; The target NVMe SSD determines a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
8. The method according to claim 7, wherein In response to the fourth field not indicating the end of data backup within the backup time threshold, it is determined that the storage of the data to be stored to the target NVMe SSD fails.
9. The method according to claim 7, wherein In response to the fourth field indicating the end of data backup, the method further includes: The target NVMe SSD stores the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface.
10. A power-down protection system, characterized in that, The power-off protection system at least includes a solid-state drive controller, and the solid-state drive controller includes: A sending module, configured to send a first command to at least one candidate NVMe SSD, where the first command is configured based on information of data to be stored by an independent disk redundant array (RAID) controller in a power-off situation; A receiving module, configured to receive a second command sent by the candidate NVMe SSD based on the first command; the second command is used to indicate whether the candidate NVMe SSD has the ability to migrate data for power-off protection; An analysis module, configured to analyze the second command to obtain an analysis result; A selection module, configured to, in the event of a power-off, the RAID controller selects a target NVMe SSD from the at least one candidate NVMe SSD, and the target NVMe SSD is used to store the data to be stored; A configuration module, configured to configure an SSD register based on information of the data to be stored; A data backup module, configured to store the data to be stored to a persistent memory area of the target NVMe SSD based on the configuration of the SSD register; The sending module is further configured to, in response to the end of storing the data to be stored to the persistent memory area of the target NVMe SSD, send a notification message to the target NVMe SSD, where the notification message is used to instruct the candidate NVMe SSD to store the data to be stored to the NAND flash of the target NVMe SSD.
11. The power-off protection system according to claim 10, wherein The operation code of the first command is used to indicate whether it has the characteristic of migrating data for power-off protection; The first field of the first command is used to indicate the size of the data to be stored.
12. The power-off protection system according to claim 10, wherein The status code of the second command is used to indicate whether the candidate NVMe SSD has the characteristic of migrating data for power-off protection; The second field of the second command is used to indicate whether the candidate NVMe SSD with the characteristic of migrating data for power-off protection has the ability to migrate data for power-off protection.
13. The power-off protection system according to claim 10, wherein In response to the end of storing the data to be stored in the persistent memory area of the target NVMe SSD, the configuration module is further configured to modify the configuration of the SSD register to indicate the end of data backup.
14. The power-off protection system according to claim 10, wherein the sending module is further configured to send a backup message to the target NVMe SSD; the backup message is used to instruct the target NVMe SSD to perform data backup, and the backup message includes the size of the data to be stored.
15. The power-off protection system according to claim 10, characterized in that, The SSD register at least includes a third field, a fourth field, and a fifth field for indicating data backup enablement; The configuration module is specifically configured to configure the third field based on the size of the data to be stored in the information of the data to be stored; Configure the fourth field based on the process of storing the data to be stored in the persistent memory area of the target NVMe SSD.
16. The power-down protection system according to claim 15, characterized in that, The power-off protection system further includes a target NVMe SSD, and the target NVMe SSD includes: a reading module, configured to poll and read the configuration of the SSD register, and in response to the fourth field indicating that the backup of the data to be stored has been started by the RAID controller, read the third field; a determining module, configured to determine a backup time threshold based on the third field and the bandwidth of the PCIe high-speed link between the target NVMe SSD and the RAID controller.
17. The power-down protection system according to claim 16, wherein, The determining module is further configured to determine that the storage of the data to be stored in the target NVMe SSD fails if the fourth field does not indicate the end of data backup within the backup time threshold.
18. The power-down protection system according to claim 16, wherein, The target NVMe SSD further includes: a storage module, configured to store the data to be stored from the persistent memory area to the NAND flash of the target NVMe SSD through the ONFI high-speed interface in response to the fourth field indicating the end of data backup.
19. A power-down protection system, characterized in that, The power-off protection system includes: a processor and a memory communicatively connected to the processor; wherein the processor memory stores instructions executable by the processor, and when the instructions are executed by the processor, the processor is enabled to execute the power-off protection method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, Stored with executable instructions, which are used to implement the power-off protection method according to any one of claims 1 to 9 when executed by a processor.
21. A computer program product, characterized in that, The computer program product includes computer programs / instructions, and when the computer programs / instructions are executed by a processor, the power-off protection method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
SSD storage method, device and system based on data characteristics
CN108664218A
Power failure processing method, solid state disk and computing device
CN116417025A
NVMe permanent memory allocation method and NVMe controller
CN119127726A
Data storage method and device, equipment and medium
CN119179439A
Power failure protection method and device, electronic equipment and storage medium
CN119690872A