A data protection method, apparatus, electronic device, and storage medium
By using supercapacitors to power the RAID controller and target cache, management information and data to be protected are migrated to flash memory. This solves the problem of SSD's reliance on built-in capacitors during power failure, reduces hardware design complexity and cost, and improves the speed and reliability of data protection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, RAID controllers rely on the SSD's built-in capacitors for power supply when power is lost, which increases the hardware design complexity and production cost of the SSD, and makes the data recovery process complicated.
By using supercapacitors to provide emergency power to the RAID controller and target cache in the event of a power outage, management information and data to be protected can be migrated to flash memory, eliminating the reliance on the SSD's built-in capacitors and reducing hardware design complexity and cost.
This technology enables data to be directly saved to the flash memory of the RAID controller in the event of a power failure, reducing the complexity of SSD hardware design and production costs, simplifying the data recovery process, and improving the speed of data protection and system reliability.
Smart Images

Figure CN122131972A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to a data protection method, apparatus, electronic device, and storage medium. Background Technology
[0002] In modern storage systems, the power-loss protection function of the Redundant Array of Independent Disks (RAID) controller prevents the loss of user data in the event of an unexpected power outage. When the server experiences an abnormal power outage, supercapacitors power the RAID controller and cache, while solid-state drives (SSDs) have built-in capacitors that power the SSDs, ensuring that data in the cache can be safely transferred to the power-loss protection zone within the SSD. After the abnormal situation is resolved and power is restored, the system recovers the data from the SSD's power-loss protection zone.
[0003] In related technologies, when a power failure occurs, the RAID controller is usually powered by a supercapacitor, and the SSD is powered by a built-in capacitor. Therefore, the SSD needs to be equipped with a dedicated built-in capacitor to ensure the power supply during power failure, which increases the hardware design complexity and production cost of the SSD. At the same time, data recovery requires the RAID controller and the SSD to work together, which increases the complexity of the operation. Summary of the Invention
[0004] This application provides a data protection method, apparatus, electronic device, and storage medium to at least solve the problem in the related art where data protection relies on the built-in capacitors of the SSD during abnormal power loss.
[0005] This application provides a data protection method, including:
[0006] Obtain the configuration information of the management information cache, the data to be protected in the target cache, and the management information of the data to be protected; wherein, the management information includes at least the FTL mapping table, garbage collection policy, or wear leveling policy; Based on the configuration information, the management information of the data to be protected is stored in the management information cache area; the management information cache area belongs to the host memory, and the RAID controller accesses the management information cache area through memory mapping technology; In the event of a power outage, the supercapacitor is activated to migrate the management information of the data to be protected from the management information buffer to the flash memory, and to migrate the data to be protected from the target buffer to the flash memory; the supercapacitor is used to provide emergency power to the RAID controller and the target buffer. With both the data to be protected and management information stored in flash memory, the supercapacitor is turned off.
[0007] This application also provides a data protection device, including: The acquisition module is used to acquire configuration information of the management information cache, data to be protected in the target cache, and management information of the data to be protected; wherein, the management information includes at least an FTL mapping table, garbage collection strategy, or wear leveling strategy; The storage module is used to store the management information of the data to be protected into the management information cache area according to the configuration information; the management information cache area belongs to the host memory, and the RAID controller accesses the management information cache area through memory mapping technology; The migration module is used to activate the supercapacitor in the event of a power failure, migrating the management information of the data to be protected from the management information buffer to the flash memory, and migrating the data to be protected from the target buffer to the flash memory; the supercapacitor is used to provide emergency power to the RAID controller and the target buffer. The shutdown module is used to shut down the supercapacitor when both the data to be protected and the management information are stored in flash memory.
[0008] This application also provides a data protection system, including: a RAID controller, a supercapacitor, a target cache, and a hard drive; The target buffer is used to store the data to be protected; Hard drives are used to store management information for data that needs to be protected; Supercapacitors are used to provide emergency power to the RAID controller and target buffer; The RAID controller is used to implement the steps of any of the above data protection methods to protect the data to be protected and the management information.
[0009] This application also provides a server that includes a data protection system.
[0010] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing the steps of any of the above data protection methods when executing the computer program.
[0011] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described data protection methods.
[0012] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described data protection methods.
[0013] This application eliminates the reliance on SSD built-in capacitors by storing management information of the data to be protected in the management information cache based on the configuration information obtained from the management information cache. In the event of a power failure, the supercapacitor is activated to migrate the management information of the data to be protected from the management information cache to the flash memory, and the data to be protected is migrated from the target cache to the flash memory. When both the data to be protected and the management information are stored in the target cache, the supercapacitor is turned off. By storing the management information in the management information cache and using the supercapacitor to power the RAID controller and the target cache in the event of a power failure, the data to be protected in the target cache and the management information of the management information cache are directly saved to the flash memory of the RAID controller. This reduces the reliance on the built-in capacitors of the SSD and lowers the complexity of SSD hardware design and production costs. Attached Figure Description
[0014] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating the data protection method provided in this application embodiment; Figure 2 A schematic diagram of an exemplary conventional RAID controller power-loss protection system provided in this application embodiment; Figure 3 A schematic diagram of the structure of an exemplary management information cache area provided in an embodiment of this application; Figure 4 A schematic diagram illustrating an exemplary data protection structure provided in this application embodiment; Figure 5 A schematic diagram of the structure of the data protection device provided in the embodiments of this application; Figure 6 This is a schematic diagram of the structure of the data protection system provided in the embodiments of this application; Figure 7 This is a schematic diagram of the server structure provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0016] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0017] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0018] RAID controllers integrate multiple physical hard drives into a single logical storage unit, improving data read and write speeds and enhancing system fault tolerance. Independent of the host system, they efficiently handle complex tasks such as data striping, parity checking, erasure coding operations, and data reconstruction through a built-in dedicated chip. They also integrate cache memory, improving I / O operation speed and response time, and can handle high-concurrency and large-data-volume tasks.
[0019] The power-loss protection function of the RAID controller prevents the loss of user data in the event of an unexpected power failure. In related technologies, when a power failure occurs, the RAID controller is usually powered by a supercapacitor, and the SSD is powered by a built-in capacitor. Therefore, the SSD needs to be equipped with a dedicated built-in capacitor to ensure the power supply needs during power failure, which increases the hardware design complexity and production cost of the SSD. At the same time, data recovery requires the RAID controller and the SSD to work together, which increases the complexity of the operation.
[0020] To address the aforementioned technical problems, this application provides a data protection method, apparatus, electronic device, and storage medium. The method includes: acquiring configuration information of a management information cache, data to be protected in a target cache, and management information of the data to be protected; wherein the management information includes at least an FTL mapping table, a garbage collection strategy, or a wear leveling strategy; storing the management information of the data to be protected in the management information cache according to the configuration information; wherein the management information cache is part of the host memory, and the RAID controller accesses the management information cache through memory mapping technology; in the event of a power failure, activating a supercapacitor to migrate the management information of the data to be protected from the management information cache to flash memory, and migrating the data to be protected from the target cache to flash memory; wherein the supercapacitor is used to provide emergency power to the RAID controller and the target cache; and deactivating the supercapacitor when both the data to be protected and the management information are stored in flash memory. The method provided by the above solution, by storing the management information of the data to be protected in the management information cache based on the configuration information of the management information cache, activating the supercapacitor in the event of a power failure, migrating the management information of the data to be protected from the management information cache to the flash memory, migrating the data to be protected from the target cache to the flash memory, and deactivating the supercapacitor when both the data to be protected and the management information are stored in the target cache, eliminates the dependence on the built-in capacitor of the SSD, and reduces the complexity of SSD hardware design and production costs.
[0021] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] The specific application environment architecture or specific hardware architecture on which the implementation of the data protection method depends is described here.
[0023] This application provides a data protection method for protecting data during power outages. The subject of this application is an electronic device, such as a server, desktop computer, laptop computer, tablet computer, or other electronic devices that can be used for data protection.
[0024] like Figure 1 The diagram shown is a flowchart illustrating a data protection method provided in an embodiment of this application. This method is applied to a RAID controller, which includes a management information cache and flash memory, and includes: Step 201: Obtain the configuration information of the management information cache, the data to be protected in the target cache, and the management information of the data to be protected.
[0025] The management information includes at least an FTL mapping table, garbage collection strategy, or wear leveling strategy.
[0026] Specifically, the RAID controller requests an HMB memory area from the host for use as an SSD cache. The HMB memory area is a management information cache, and its configuration information includes its size and location.
[0027] Accordingly, by storing the FTL mapping table, garbage collection strategy, etc., which were originally stored in SRAM, to the HMB memory area, the SSD's dependence on the built-in SRAM is eliminated.
[0028] Step 202: Based on the configuration information, store the management information of the data to be protected in the management information cache area.
[0029] The management information cache is part of the host memory, and the RAID controller accesses the management information cache through memory mapping technology.
[0030] Specifically, the RAID controller interacts with the solid-state drive (SSD) via a standard non-volatile memory express (NVMe) driver, sending the allocated HMB (Host Management Buffer) information—the configuration information for the management cache—to the SSD and enabling the HMB function. Upon receiving the HMB information, the SSD controller initializes the HMB area to ensure its proper functioning. Under normal operating conditions, the SSD stores data from the Flash Translation Layer Mapping Table (FTL), garbage collection strategies, and wear leveling strategies in the HMB memory area. Simultaneously, the RAID controller driver is adapted to perform memory mapping operations on the allocated HMB memory.
[0031] Accordingly, ensure that the RAID controller can still access the HMB memory normally in the event of a power failure.
[0032] Step 203: In the event of a power failure, activate the supercapacitor to migrate the management information of the data to be protected from the management information cache to the flash memory, and migrate the data to be protected from the target cache to the flash memory.
[0033] The supercapacitor is used to provide emergency power to the RAID controller and the target buffer.
[0034] Specifically, the flash memory refers to the flash memory chips inside the RAID card, which can persistently store data and is not easily lost when power is off. Upon detecting a power failure, the power-loss protection program is activated. A supercapacitor provides emergency power to the RAID controller and the target buffer. The RAID controller sends the data to be protected in the target buffer to its NAND flash memory for storage. Simultaneously, it sends data such as the FTL mapping table, garbage collection policies, or wear leveling policies from the management information buffer to the RAID controller's NAND flash memory for storage. Notably, the RAID controller's NAND flash memory is not easily lost when power is off.
[0035] Correspondingly, since the flash memory is located in the RAID controller, the path of data from the target buffer and management buffer to the flash memory of the RAID controller is shorter, thus effectively reducing the transmission time. At the same time, the shorter path results in shorter data transmission time, reducing power consumption, saving system costs, and improving system response time.
[0036] Step 204: With both the data to be protected and the management information stored in the flash memory, turn off the supercapacitor.
[0037] Correspondingly, since data is temporarily stored in the RAID controller's flash memory during power loss, compared to storing the data to be protected from the target cache through the RAID controller to the SSD during power loss, this reduces the power supply to the SSD by its internal capacitors, eliminating the SSD's dependence on internal capacitors. Simultaneously, it eliminates the SSD's dependence on internal SRAM, reducing system costs and improving data protection speed. Because the power loss protection scheme primarily relies on firmware implementation without adding additional hardware components, it reduces system maintenance complexity and is easily integrated into existing RAID controller architectures.
[0038] Based on the above embodiments, as an implementable approach, in one embodiment, in the event of a power failure, a supercapacitor is activated to migrate management information from the management information cache to the flash memory, and to migrate the data to be protected from the target cache to the flash memory, including: Step 2031: In the event of a power failure, activate the supercapacitor and, according to the preset management and protection rules, filter the target management data in the management information cache. Step 2032: According to the preset data protection rules, filter the target data to be protected in the target cache; Step 2033: Migrate the target management data from the management information cache to the flash memory, and migrate the target data to be protected from the target cache to the flash memory.
[0039] Specifically, the management information cache stores FTL mapping tables, garbage collection strategies, and wear leveling strategies. In the event of a power outage, according to preset management protection rules, target management data is filtered from the management information in the management information cache and sent to the flash memory for data protection. The preset management protection rules filter data based on the latest and most effective rules, prioritizing currently active data, in-process data, incomplete data, and important data as target management data, while discarding runtime temporary statistics and performance logs. The RAID controller utilizes the previously established memory mapping, i.e., DMA mapping, to directly read the target management data from the HMB.
[0040] The target cache includes a high-speed cache that stores data to be protected. In the event of a power outage, the target cache filters out the data to be protected according to preset data protection rules and sends this data to the flash memory for protection. The preset data protection rules prioritize new data that has been modified by the host but not written back to the SSD, or data that has not yet been stored on the SSD, as target data to be protected. Data already stored on the SSD and unchanged can be discarded.
[0041] Accordingly, by filtering management information and data to be protected, priority transmission and data protection of important data are ensured in the event of power failure.
[0042] In some alternative implementations, step 2033 above includes: Step b1: Based on the preset segmentation criteria, target management data, and target data to be protected, the target management data and target data to be protected are respectively divided into multiple target management data blocks to be migrated and multiple target data blocks to be migrated and protected. Step b2: Migrate multiple target management data blocks to be migrated to the first flash memory module; Step b3: Migrate multiple target data blocks to be protected to the second flash memory module.
[0043] The flash memory includes a first flash memory module and a second flash memory module.
[0044] Specifically, based on preset segmentation criteria, continuous data is divided into multiple data blocks. These criteria include segmentation according to the size of the data block to be migrated; for example, if the target management data block to be migrated is 16KB in size and the target management data is 160KB, it is evenly divided into 10 16KB data blocks. Alternatively, segmentation can be based on the logical structure of the data; for example, if an FTL mapping table consists of multiple mapping pages, one mapping page is defined as one data block during segmentation.
[0045] The flash memory of the RAID controller includes a first flash memory module and a second flash memory module. The first flash memory module is used to store target management data, and the second flash memory module is used to store target data to be protected. After the target management data and target data to be protected are divided into multiple data blocks to be migrated, the target management data blocks to be migrated are migrated to the first flash memory module in parallel, and the multiple target data blocks to be migrated are migrated to the second flash memory module.
[0046] Accordingly, by segmenting the target management data and the target data to be protected into multiple data blocks to be migrated, and simultaneously transmitting these data blocks to different flash memory modules concurrently, the data transmission time is effectively shortened, improving the performance of cached data backup and recovery. Through the flash memory on the RAID card, the RAID controller can quickly perform non-volatile storage of cache and HMB data in the event of a power outage, reducing the risk of data loss and improving the reliability of system and user data.
[0047] Specifically, in one embodiment, the current voltage value is obtained; if the current voltage value is less than a preset safety threshold, a power outage anomaly is determined to have occurred.
[0048] Specifically, the preset safety threshold is the minimum voltage value required for the system to ensure normal data transmission. The RAID controller uses its voltage monitoring module to collect the power supply voltage value in real time as the current voltage value. When the current voltage value is lower than the preset safety threshold, it indicates that a power failure has occurred in the system. When the RAID controller detects a power failure, it initiates the power failure protection program, including activating the supercapacitor for emergency power supply and migrating management information and data to be protected to flash memory.
[0049] Specifically, in one embodiment, after power-on restart, the RAID controller performs a hardware self-test; if the hardware self-test passes, the management information is migrated from flash memory to the management information cache, and the data to be protected is migrated from flash memory to the target cache; according to the management information, the data to be protected is written to the hard disk.
[0050] Specifically, after the host is powered on, the RAID controller starts up and first performs a hardware self-test, including checking the functionality of components such as chips and internal Static Random-Access Memory (SRAM), scanning the PCIe bus, and identifying and connecting all SSDs. After confirming that all components are functioning correctly, the controller migrates the management information from the first flash memory module back to the management information cache and migrates the data to be protected back to the target cache. Once the data migration is complete, normal operation resumes, and the controller continues to write the data to be protected from the target cache to the SSDs based on the restored management information.
[0051] Accordingly, shifting data protection functions from the SSD side to the RAID card side reduces the complexity of SSD design and interaction between the SSD side and the RAID card side.
[0052] For example, such as Figure 2 The diagram shown is a schematic of the structure of an exemplary conventional RAID controller power-loss protection system provided in this application embodiment. After the RAID controller detects a power failure, it starts the power-loss protection program. The supercapacitor supplies power to the RAID controller and the cache, and the SSD's built-in capacitor supplies power to the SSD. The RAID controller stores the data to be protected in the cache to the temporary storage area in the SSD, where the SRAM stores data such as the FTL mapping table.
[0053] For example, such as Figure 3 The diagram shown is an exemplary structural diagram of the management information cache area provided in this application embodiment. The SRAM and built-in capacitors in the original SSD are eliminated, the RAID controller requests the HMB memory area for use as SRAM, and stores the FTL mapping table and other data stored in the SRAM into the HMB.
[0054] For example, such as Figure 4 The diagram illustrates an exemplary data protection structure provided in this application embodiment. The RAID controller requests memory space from the host based on the configuration information of the management information cache and enables the HMB function, caching FTL mapping table, garbage collection, and wear leveling data in the HMB. The RAID controller driver is adapted to perform memory mapping operations on the requested HMB memory, enabling the RAID controller to access the HMB memory normally during power outages. When the RAID controller detects an abnormal power outage, it initiates an abnormal power outage protection program. The power outage protection program within the controller writes critical data blocks from the cache and HMB memory into the flash memory. The management information and the data to be protected are divided into multiple data blocks and stored in the first flash memory module and the second flash memory module, respectively. After all critical data in the cache and HMB memory has been written into the flash memory, the capacitor switch is turned off.
[0055] Specifically, in one embodiment, priority tags are set for target management data and target data to be protected. The scheduler in the RAID controller sorts the data according to the priority tags to ensure that high-priority data is stored in flash memory first, so that critical data is saved first in the event of power failure.
[0056] The data protection method provided in this application includes: acquiring configuration information of a management information cache, data to be protected in a target cache, and management information of the data to be protected; wherein the management information includes at least an FTL mapping table, a garbage collection strategy, or a wear leveling strategy; storing the management information of the data to be protected in the management information cache according to the configuration information; wherein the management information cache is part of the host memory, and the RAID controller accesses the management information cache through memory mapping technology; in the event of a power failure, activating a supercapacitor to migrate the management information of the data to be protected from the management information cache to flash memory, and migrating the data to be protected from the target cache to flash memory; wherein the supercapacitor is used to provide emergency power to the RAID controller and the target cache; and deactivating the supercapacitor when both the data to be protected and the management information are stored in flash memory.
[0057] The method provided by the above solution, by storing the management information of the data to be protected in the management information cache based on the configuration information of the management information cache, activating the supercapacitor in the event of a power failure, migrating the management information of the data to be protected from the management information cache to the flash memory, migrating the data to be protected from the target cache to the flash memory, and deactivating the supercapacitor when both the data to be protected and the management information are stored in the target cache, eliminates the dependence on the built-in capacitor of the SSD, and reduces the complexity of SSD hardware design and production costs.
[0058] Furthermore, by storing the FTL mapping table and garbage collection strategy, originally stored in SRAM, in the HMB memory area, the SSD's dependence on the built-in SRAM is eliminated. This ensures that the RAID controller can still access the HMB memory normally during power failures. Since the flash memory is located in the RAID controller, the data path from the target buffer and management cache to the RAID controller's flash memory is shorter, effectively reducing transmission time. Simultaneously, the shorter path reduces data transmission time, lowering power consumption, saving system costs, and improving system response time. Because data is temporarily stored in the RAID controller's flash memory during power failures, compared to storing the data to be protected from the target cache through the RAID controller and then to the SSD during power failures, the power supply to the SSD by its built-in capacitors is reduced, eliminating the SSD's dependence on built-in capacitors. This also eliminates the SSD's dependence on built-in SRAM, reducing system costs and improving data protection speed. Since the power failure protection scheme mainly relies on firmware implementation, no additional hardware components are added, reducing system maintenance complexity and facilitating integration into existing RAID controller architectures. By filtering management information and data to be protected, priority transmission and data protection of critical data are ensured even in the event of a power outage. By segmenting target management data and target data to be protected into multiple data blocks to be migrated, and simultaneously transmitting these data blocks concurrently to different flash memory modules, data transmission time is effectively shortened, improving the performance of cached data backup and recovery. Utilizing the flash memory on the RAID card, the RAID controller can quickly perform non-volatile storage of cache and HMB data in the event of a power outage, reducing the risk of data loss and improving the reliability of system and user data. Shifting data protection functions from the SSD side to the RAID card side reduces the complexity of SSD design and the interaction between the SSD and RAID card sides.
[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0060] Embodiments of this application also provide a data protection device for performing the data protection method provided in the above embodiments.
[0061] like Figure 5 The diagram shown is a structural schematic of a data protection device provided in an embodiment of this application. The data protection device 50 includes: an acquisition module 501, a storage module 502, a migration module 503, and a shutdown module 504.
[0062] The system includes the following modules: an acquisition module for acquiring configuration information from the management information cache, the data to be protected in the target cache, and management information for the data to be protected; the management information includes at least an FTL mapping table, garbage collection strategy, or wear leveling strategy; a storage module for storing the management information of the data to be protected in the management information cache according to the configuration information; the management information cache is part of the host memory, and the RAID controller accesses the management information cache through memory mapping technology; a migration module for activating a supercapacitor in the event of a power failure to migrate the management information of the data to be protected from the management information cache to flash memory, and to the data to be protected from the target cache to flash memory; the supercapacitor provides emergency power to the RAID controller and the target cache; and a shutdown module for shutting down the supercapacitor when both the data to be protected and the management information are stored in flash memory.
[0063] For a description of the features in the embodiments corresponding to the data protection device, please refer to the relevant descriptions in the embodiments corresponding to the data protection method, which will not be repeated here.
[0064] Embodiments of this application also provide a data protection system for performing the polishing pad wear detection method provided in the above embodiments.
[0065] like Figure 6 The diagram shown is a structural schematic of a data protection system provided in an embodiment of this application. The system includes: a RAID controller, a supercapacitor, a target cache, and a hard disk. The target buffer is used to store the data to be protected; the hard disk is used to store the management information of the data to be protected; the supercapacitor is used to provide emergency power to the RAID controller and the target buffer; the RAID controller is used to protect the data to be protected and the management information using any of the above data protection methods.
[0066] For a description of the features in the embodiments corresponding to the data protection system, please refer to the relevant descriptions in the embodiments corresponding to the data protection method, which will not be repeated here.
[0067] Embodiments of this application also provide a server for executing the data protection method provided in the above embodiments.
[0068] like Figure 7 The diagram shown is a structural schematic of a server provided in an embodiment of this application. The server includes a data protection system.
[0069] Embodiments of this application also provide an electronic device, such as... Figure 8The diagram shown is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, including a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to perform the steps in any of the above-described data protection method embodiments.
[0070] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above data protection method embodiments when running.
[0071] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0072] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data protection method embodiments.
[0073] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described data protection method embodiments.
[0074] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0075] The data protection method, apparatus, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A data protection method, characterized in that, The method is applied to a RAID controller, which has a management information cache and flash memory. The method includes: The configuration information of the management information cache, the data to be protected in the target cache, and the management information of the data to be protected are obtained; wherein, the management information includes at least an FTL mapping table, a garbage collection policy, or a wear leveling policy. According to the configuration information, the management information of the data to be protected is stored in the management information cache; wherein, the management information cache belongs to the host memory, and the RAID controller accesses the management information cache through memory mapping technology; In the event of a power outage, the supercapacitor is activated to migrate the management information of the data to be protected from the management information cache to the flash memory, and to migrate the data to be protected from the target cache to the flash memory; wherein, the supercapacitor is used to provide emergency power to the RAID controller and the target cache; When the data to be protected and the management information are both stored in the flash memory, the supercapacitor is turned off.
2. The data protection method according to claim 1, characterized in that, In the event of a power outage, the supercapacitor is activated to migrate the management information from the management information cache to the flash memory, and the data to be protected is migrated from the target cache to the flash memory, including: In the event of a power outage, the supercapacitor is activated, and target management data is filtered in the management information cache according to preset management and protection rules. According to the preset data protection rules, the target data to be protected is filtered in the target cache; The target management data is migrated from the management information cache to the flash memory, and the target data to be protected is migrated from the target cache to the flash memory.
3. The data protection method according to claim 2, characterized in that, The step of migrating the target management data from the management information cache to flash memory, and migrating the target data to be protected from the target cache to flash memory, includes: Based on the preset segmentation criteria, the target management data, and the target data to be protected, the target management data and the target data to be protected are respectively divided into multiple target management data blocks to be migrated and multiple target data blocks to be migrated and protected. Migrate the multiple target management data blocks to be migrated to the first flash memory module; Migrate the multiple target data blocks to be migrated and protected to the second flash memory module; The flash memory includes a first flash memory module and a second flash memory module.
4. The data protection method according to claim 1, characterized in that, The method further includes: Get the current voltage value; If the current voltage value is less than a preset safety threshold, a power outage is determined to have occurred.
5. The data protection method according to claim 1, characterized in that, The method further includes: After power-on, the RAID controller performs a hardware self-test; If the hardware self-test passes, the management information is migrated from the flash memory to the management information cache, and the data to be protected is migrated from the flash memory to the target cache. Based on the management information, the data to be protected is written to the hard disk.
6. A data protection device, characterized in that, The device includes: The acquisition module is used to acquire configuration information of the management information cache, data to be protected in the target cache, and management information of the data to be protected; wherein, the management information includes at least an FTL mapping table, a garbage collection strategy, or a wear leveling strategy. The storage module is used to store the management information of the data to be protected into the management information cache area according to the configuration information; wherein, the management information cache area belongs to the host memory, and the RAID controller accesses the management information cache area through memory mapping technology; The migration module is used to activate a supercapacitor in the event of a power outage to migrate the management information of the data to be protected from the management information cache to the flash memory, and to migrate the data to be protected from the target cache to the flash memory; wherein, the supercapacitor is used to provide emergency power to the RAID controller and the target cache; The shutdown module is used to shut down the supercapacitor when the data to be protected and the management information are both stored in the flash memory.
7. A data protection system, characterized in that, The system includes: a RAID controller, a supercapacitor, a target cache, and a hard drive; The target buffer is used to store the data to be protected; The hard drive is used to store management information for the data to be protected; The supercapacitor is used to provide emergency power to the RAID controller and the target buffer; The RAID controller is used to perform data protection on the data to be protected and the management information using the data protection method as described in any one of claims 1 to 5.
8. A server, characterized in that, The server includes the data protection system as described in claim 7.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data protection method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data protection method as described in any one of claims 1 to 5.