Data processing method and device, electronic equipment and storage medium

By using a combination of non-volatile data storage disks and parity disks in the RAID system, the problems of high power-down protection costs and short supercapacitor lifespan in the RAID system are solved, achieving efficient data protection and system reliability, and simplifying Improved design and reduced costs.

CN118625912APending Publication Date: 2024-09-10SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410806801.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

After the performance of RAID systems is improved and the storage medium is converted from hard disks to SSDs, the cost and complexity of power-off protection increase, and the life of supercapacitors is limited, resulting in high system design and implementation costs and the risk of data loss.

Method used

Using a combination of non-volatile data storage disks and verification disks, the data to be written and the verification data are stored in the non-volatile cache respectively, and written into the non-volatile storage area after the system is restored, simplifying Designed to eliminate the need for battery backup units and cache, reducing system complexity and cost.

Benefits of technology

It realizes effective power-down protection function in RAID system, reduces system complexity and cost, improves data security and system reliability, and avoids data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118625912A
    Figure CN118625912A
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: responding to a first data writing request for to-be-written data, and storing the to-be-written data in a first nonvolatile cache of a nonvolatile data storage disk; generating verification data based on the to-be-written data, and writing the verification data into a second nonvolatile cache of a nonvolatile data verification disk; and sending a second data writing request to the nonvolatile data storage disk to enable the to-be-written data to be written into a first nonvolatile storage area of the nonvolatile data storage disk from the first nonvolatile cache, and sending a third data writing request to the nonvolatile data verification disk to enable the to-be-written data to be written into a second nonvolatile storage area of the nonvolatile data storage disk from the second nonvolatile cache. And the check data is written into a second nonvolatile storage area of the nonvolatile data check disk from the second nonvolatile cache according to the first nonvolatile cache so that the check data can be written into the second nonvolatile storage area of the nonvolatile data check disk from the second nonvolatile cache. According to the embodiment of the invention, the complexity of the RAID system and the implementation cost of the RAID system are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, electronic equipment and storage medium. Background Art

[0002] RAID (Redundant Array of Independent Disks) technology combines multiple disk devices into a storage array group to improve performance and increase redundancy to protect data. The independent cache in the RAID system can act as an intermediary between the system and the disk. When data is written, the system first gives the data to the cache, and then writes the data from the cache to the disk. This method can significantly improve write performance.

[0003] The power-off protection function of the RAID system is mainly to protect the data stored in the RAID system cache from loss in the event of an unexpected power failure or power outage, ensuring data integrity and system reliability. When the host performs a write operation, the data will first be written to a separate cache in the RAID system, and then written to the hard disk at an appropriate time. If a power failure occurs during this process and there is no power-off protection measure, the data in the cache that has not yet been written to the hard disk will be lost, which may result in data loss and data inconsistency in the RAID system.

[0004] To solve this problem, RAID systems use different power-off protection technologies. One is the battery backup unit (BBU): This is a common power-off protection method that provides temporary power to the RAID system's cache through a small battery. During normal operation, the BBU is continuously charged so that it can provide power immediately when a power outage occurs. When a power outage is detected, the BBU takes over the power supply, maintains the data in the cache, and safely writes the data back to the hard disk after power is restored.

[0005] Supercapacitors are another power-off protection technology that has the characteristics of fast charging and discharging. They can quickly provide power when the power is interrupted, saving the data in the cache to a more stable storage medium. After the power is restored, the system reads the cached data from the non-volatile storage medium and then writes it back to the hard disk.

[0006] These power-off protection measures ensure that the RAID system can protect critical data from loss in the event of an unexpected power outage, thereby improving data security and system reliability. Through these technologies, even in extreme cases, user data can be effectively protected, avoiding potential data loss caused by power outages.

[0007] However, these technologies also have some problems. With the improvement of RAID system performance, the storage medium has evolved from hard disk to SSD (Solid state drive). In order to achieve better performance, the control in the RAID system consumes more and more power, and the cost of implementing power-off protection is also getting higher and higher. In order to have enough time to execute data protection when the system loses power, it is necessary to provide larger and larger super capacitors and use complex, expensive and high-speed Flash memory, which further increases the cost and complexity of the RAID system. In addition, super capacitors have a lifespan problem. They are usually only valid for about 3 years. After expiration, the capacity may decrease or fail, causing the backup power system to fail to work. Summary of the invention

[0008] In view of the above problems, embodiments of the present invention are proposed to provide a data processing method, device, electronic device and storage medium that overcome the above problems or at least partially solve the above problems.

[0009] In a first aspect, an embodiment of the present invention discloses a data processing method, the method comprising:

[0010] In response to a first data write request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk;

[0011] Generating verification data based on the data to be written, and writing the verification data into a second non-volatile cache of the non-volatile data verification disk;

[0012] A second write data request is sent to the nonvolatile data storage disk so that the data to be written is written from the first nonvolatile cache to the first nonvolatile storage area of ​​the nonvolatile data storage disk, and a third write data request is sent to the nonvolatile data check disk so that the check data is written from the second nonvolatile cache to the second nonvolatile storage area of ​​the nonvolatile data check disk.

[0013] Optionally, in response to a first data write request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk comprises:

[0014] When the first write data request sent by the host is obtained, determining at least one non-volatile data storage disk for writing the data to be written from the redundant array of disks according to the first write data request and the level of the redundant array of disks to which the non-volatile data storage disk belongs;

[0015] Acquire the data to be written from the host, and split the data to be written according to the number of non-volatile data storage disks to obtain at least one sub-data;

[0016] The at least one sub-data is stored in a first non-volatile buffer of the at least one non-volatile data storage disk.

[0017] Optionally, before generating verification data based on the data to be written, the method includes:

[0018] Generate a first data descriptor in the first non-volatile cache; the first data descriptor is used to record relevant information of the data to be written;

[0019] Before sending the second data write request to the nonvolatile data storage disk, the method includes:

[0020] Generate a second data descriptor in the second non-volatile cache; the second data descriptor is used to record relevant information of the verification data;

[0021] The first data descriptor is updated to obtain a target first data descriptor; the target first data descriptor is a basis for writing the data to be written from the first non-volatile cache into the first non-volatile storage area, and the second data descriptor is a basis for writing the verification data from the second non-volatile cache into the second non-volatile storage area;

[0022] The method further comprises:

[0023] When the data to be written and the verification data are both written completely, the target first data descriptor and the second data descriptor are deleted.

[0024] Optionally, generating a first data descriptor in the first non-volatile cache includes:

[0025] Determining a first starting address of the data to be written in the first non-volatile storage area;

[0026] Determining a first data length of the data to be written;

[0027] Determine a first data pointer of the data to be written; the first data pointer is used to represent the position of the data to be written in the first non-volatile cache;

[0028] Setting the first status flag of the data to be written to a cache status;

[0029] generating a first data descriptor based on the first starting address, the first data length, the first data pointer and the first status flag;

[0030] Generating a second data descriptor in the second non-volatile cache comprises:

[0031] Determining a second starting address of the verification data in the second non-volatile storage area;

[0032] Determining a second data length of the verification data;

[0033] Determine a second data pointer of the verification data; the second data pointer is used to represent the position of the verification data in the second non-volatile cache;

[0034] Setting the second status flag of the verification data to a write status;

[0035] A second data descriptor is generated based on the second starting address, the second data length, the second data pointer and the second status flag.

[0036] Optionally, the updating the first data descriptor to obtain a target first data descriptor includes:

[0037] The status flag in the first data descriptor is updated to a write status to obtain a target first data descriptor.

[0038] Optionally, it also includes:

[0039] When the redundant array of disks to which the nonvolatile data storage disk belongs is powered on again, and the state flag in the first data descriptor is in a cache state, the step of generating verification data based on the data to be written is linked to.

[0040] Optionally, it also includes:

[0041] When the redundant disk array to which the nonvolatile data storage disk belongs is powered on again, and the status flag in the target first data descriptor and the status flag in the second data descriptor are both in the write state, it is linked to the step of sending a second write data request to the nonvolatile data storage disk so that the data to be written is written from the first nonvolatile cache to the first nonvolatile storage area of ​​the nonvolatile data storage disk, and sending a third write data request to the nonvolatile data check disk so that the check data is written from the second nonvolatile cache to the second nonvolatile storage area of ​​the nonvolatile data check disk.

[0042] In a second aspect, an embodiment of the present invention discloses a data processing device, the device comprising:

[0043] A storage module, configured to store the data to be written in a first non-volatile cache of the non-volatile data storage disk in response to a first data write request for the data to be written;

[0044] A first generating module, used to generate verification data based on the data to be written;

[0045] A writing module, used for writing the verification data into a second non-volatile cache of the non-volatile data verification disk;

[0046] A sending module is used to send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and to send a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk.

[0047] In a third aspect, the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of the above-mentioned data processing method when executed by the processor.

[0048] In a fourth aspect, the present invention further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data processing method as described above are implemented.

[0049] The embodiments of the present invention include the following advantages:

[0050] In response to a first write data request for data to be written, a RAID controller in a RAID system stores the data to be written in a first non-volatile cache of a non-volatile data storage disk, generates verification data based on the data to be written, and writes the verification data into a second non-volatile cache of a non-volatile data verification disk, sends a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and sends a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk. In this way, the design of the RAID system is simplified by utilizing the characteristics of the non-volatile cache in the non-volatile storage disk, and the battery backup unit, super capacitor and cache are omitted while also realizing the power-off protection function, thereby reducing the complexity of the RAID system and the implementation cost of the RAID system. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 is a flow chart of steps of a data processing method provided by an embodiment of the present invention;

[0052] Figure 2 It is a schematic diagram of the framework of a RAID system provided by an embodiment of the present invention;

[0053] Figure 3 is a flowchart of another data processing method provided by an embodiment of the present invention;

[0054] Figure 4 It is a schematic diagram of the structure of a data descriptor in a non-volatile cache of a non-volatile storage disk provided by an embodiment of the present invention;

[0055] Figure 5 is a flowchart of another data processing method provided by an embodiment of the present invention;

[0056] Figure 6 It is a schematic diagram of a specific process provided by an embodiment of the present invention;

[0057] Figure 7 is a structural block diagram of an electronic device provided by an embodiment of the present invention;

[0058] Figure 8 It is a structural block diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0059] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] like Figure 1 , shows a flow chart of the steps of a data processing method provided by an embodiment of the present invention, which can be applied to a RAID controller in a redundant array of independent disks RAID system, such as Figure 2 , shows a schematic diagram of the architecture of a RAID system provided by an embodiment of the present invention. The RAID system can interact with a host for data, and the RAID system may include a RAID controller and a RAID.

[0061] Among them, the RAID controller may include a DMA (Direct Memory Access) controller and a PCIe (peripheral component interconnect express, a high-speed serial computer expansion bus standard) root complex. The DMA controller is used to move the data to be written from the host to the non-volatile cache of the non-volatile storage disk in the RAID; the PCIe root complex is used to hang the non-volatile storage disk in the RAID, and can realize the mapping of the non-volatile cache in the non-volatile storage disk on the system bus, so that the RAID controller can access the non-volatile cache.

[0062] RAID includes multiple non-volatile storage disks, which can be NVMe SSDs (Non-Volatile Memory express, non-volatile memory host controller interface specification; Solid state drive, solid state drive). Non-volatile storage disks can be used to store user data (recorded as "non-volatile data storage disk") and verification data (recorded as "non-volatile data verification disk").

[0063] Each non-volatile storage disk includes a non-volatile cache and a non-volatile storage area. The data area of ​​the non-volatile cache has a smaller capacity and supports retaining data content after the disk is powered off. It is used to temporarily store user data to be written to the non-volatile storage area. The non-volatile storage area is the main storage area of ​​the disk and is the final storage space after data is written to the disk. It is used to store user data.

[0064] It should be noted that a RAID may include at least one non-volatile data check disk. In practical applications, the specific number of non-volatile data check disks may be set according to actual needs, and the embodiment of the present invention does not limit this.

[0065] The method of the embodiment of the present invention may specifically include the following steps:

[0066] Step 101 : In response to a first data write request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk.

[0067] The host can send a write data request (referred to as the "first write data request") to the RAID controller to write the data to be written into the RAID. After obtaining the first write data request, the RAID controller can move the data to be written from the host to the non-volatile cache of the non-volatile data storage disk (referred to as the "first non-volatile cache").

[0068] In one embodiment, in response to a first write data request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk includes:

[0069] When the first write data request sent by the host is obtained, determining at least one non-volatile data storage disk for writing the data to be written from the redundant array of disks according to the first write data request and the level of the redundant array of disks to which the non-volatile data storage disk belongs;

[0070] Acquire the data to be written from the host, and split the data to be written according to the number of non-volatile data storage disks to obtain at least one sub-data;

[0071] The at least one sub-data is stored in a first non-volatile buffer of the at least one non-volatile data storage disk.

[0072] Specifically, when the RAID controller obtains the first write data request sent by the host, it can determine at least one non-volatile data storage disk for writing the to-be-written data from the RAID according to the first write data request and the RAID level in the RAID system. That is, the number of non-volatile data storage disks determined is different for different RAID levels in the RAID system.

[0073] After determining the non-volatile data storage disks in the RAID, the RAID controller can obtain the data to be written from the host, and then split the data to be written according to the number of non-volatile data storage disks, thereby obtaining sub-data equal to the number of non-volatile data storage disks, and then store each sub-data in the first non-volatile cache of each non-volatile data storage disk. For example, if the RAID includes 10 non-volatile storage disks, and the RAID controller determines that 3 of them are used to write the data to be written, then after obtaining the data to be written from the host, the data to be written can be split into 3 sub-data, and then the 3 sub-data can be stored in the non-volatile caches of the 3 non-volatile data storage disks.

[0074] In this way, the characteristics of the non-volatile cache in the non-volatile storage disk are utilized to simplify the design of the RAID system. While still realizing the power-off protection function, the battery backup unit, supercapacitor and cache are eliminated, thereby reducing the complexity of the RAID system and the implementation cost of the RAID system.

[0075] Step 102: Generate verification data based on the data to be written, and write the verification data into a second non-volatile cache of a non-volatile data verification disk.

[0076] After the data to be written is stored in the non-volatile cache, the RAID controller can generate verification data based on the written data, and then write the verification data into the non-volatile cache of the non-volatile data verification disk (recorded as the "second non-volatile cache"). In this way, the integrity of the data to be written can be guaranteed by the verification data.

[0077] Step 103: Send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and send a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk.

[0078] After the writing of the data to be written and the verification data is completed, the RAID controller can send a write data request (recorded as a "second write data request") to the non-volatile data storage disk. After obtaining the second write data request, the non-volatile data storage disk can write the data to be written from the first non-volatile cache to the non-volatile storage area (recorded as the "first non-volatile storage area"), thereby completing the writing of the data to be written to the disk.

[0079] Similarly, the RAID controller can send a write data request (recorded as the "third write data request") to the non-volatile data verification disk. After receiving the third write data request, the non-volatile data verification disk can write the data to be written from the second non-volatile cache to the non-volatile storage area (recorded as the "second non-volatile storage area"), thereby completing the writing of the verification data to the disk.

[0080] In an embodiment of the present invention, a RAID controller in a RAID system, in response to a first write data request for data to be written, stores the data to be written in a first non-volatile cache of a non-volatile data storage disk, generates verification data based on the data to be written, and writes the verification data into a second non-volatile cache of a non-volatile data verification disk, sends a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and sends a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk. In this way, the characteristics of the non-volatile cache in the non-volatile storage disk are utilized to simplify the design of the RAID system, and under the premise of also realizing the power-off protection function, the battery backup unit, super capacitor and cache are omitted, thereby reducing the complexity of the RAID system and the implementation cost of the RAID system.

[0081] like Figure 3 , shows a flowchart of another data processing method provided by an embodiment of the present invention, and the method may specifically include the following steps:

[0082] Step 301: In response to a first data write request for data to be written, the data to be written is stored in a first non-volatile cache of a non-volatile data storage disk.

[0083] Among them, step 301 is substantially the same as step 101, and will not be described here to avoid repetition.

[0084] Step 302: Generate a first data descriptor in the first non-volatile cache; the first data descriptor is used to record relevant information of the data to be written.

[0085] After the RAID controller moves the data to be written from the host to the first non-volatile cache, it can generate a data descriptor (referred to as the "first data descriptor") in the first non-volatile cache. The first data descriptor is used to record relevant information of the data to be written, including but not limited to: status flag, starting address, data length and data pointer.

[0086] like Figure 4 , shows a schematic diagram of the structure of a data descriptor in a non-volatile cache of any non-volatile storage disk. The data descriptor may include the following data:

[0087] 1) Status flag, used to indicate the current status of the non-volatile storage disk. The status flag includes three states: idle state, cache state and write state. The idle state indicates that the data descriptor is currently idle and not in use; the cache state indicates that there is valid data to be written stored in the non-volatile cache, but the write operation has not yet started; the write state indicates that the data to be written in the non-volatile cache is being written to the non-volatile storage area;

[0088] 2) A starting address, which is used to indicate the starting position of the data to be written in the non-volatile storage area;

[0089] 3) Data length, used to indicate the length of the data to be written;

[0090] 4) Data pointer, used to indicate the location of the data to be written in the non-volatile cache.

[0091] In one embodiment, generating a first data descriptor in the first non-volatile cache includes:

[0092] Determining a first starting address of the data to be written in the first non-volatile storage area;

[0093] Determining a first data length of the data to be written;

[0094] Determine a first data pointer of the data to be written;

[0095] Setting the first status flag of the data to be written to a cache status;

[0096] A first data descriptor is generated based on the first starting address, the first data length, the first data pointer and the first status flag.

[0097] Specifically, for any non-volatile data storage disk, after obtaining the corresponding data to be written (sub-data), a first data descriptor can be generated, and then the data length (recorded as "first data length"), the starting address and data pointer (recorded as "first data pointer") in the first non-volatile storage area are determined according to the data to be written, and then the first starting address, first data length and first data pointer are recorded in the first data descriptor, and the status flag in the first data descriptor is set to the cache status, thereby obtaining the final first data descriptor.

[0098] After the first data descriptor is generated, the RAID controller can return the data writing completion information to the host. In this way, the first data descriptor can be used to determine whether the data in the first non-volatile cache has been written to the first non-volatile storage area, so that data can be restored according to the first data descriptor after power failure recovery, thereby ensuring that the data to be written can be written to the disk.

[0099] It should be noted that when the first data descriptor is generated, the status flag thereof is in an idle state. Since the data to be written has been stored in the non-volatile cache at this time, the status flag can be immediately updated to a cache state.

[0100] Step 303: Generate verification data based on the data to be written, and write the verification data into a second non-volatile cache of the non-volatile data verification disk.

[0101] Among them, step 303 is substantially the same as step 102, and will not be described here to avoid repetition.

[0102] Step 304: Generate a second data descriptor in the second non-volatile cache; the second data descriptor is used to record relevant information of the verification data.

[0103] After the RAID controller writes the verification data into the second non-volatile cache, it can generate a data descriptor (referred to as "second data descriptor") in the second non-volatile cache. The second data descriptor is used to record relevant information of the verification data, including but not limited to: status flag, starting address, data length and data pointer.

[0104] In one embodiment, generating a second data descriptor in the second non-volatile cache includes:

[0105] Determining a second starting address of the verification data in the second non-volatile storage area;

[0106] Determining a second data length of the verification data;

[0107] Determine a second data pointer of the verification data; the second data pointer is used to represent the position of the verification data in the second non-volatile cache;

[0108] Setting the second status flag of the verification data to a write status;

[0109] A second data descriptor is generated based on the second starting address, the second data length, the second data pointer and the second status flag.

[0110] Specifically, for any non-volatile data verification disk, after obtaining the corresponding verification data, a second data descriptor can be generated, and then its data length (recorded as "second data length"), the starting address and data pointer (recorded as "second data pointer") in the second non-volatile storage area can be determined according to the verification data, and then the second starting address, second data length and second data pointer are recorded in the second data descriptor, and the status flag in the second data descriptor is set to the write status, thereby obtaining the final second data descriptor.

[0111] In this way, the second data descriptor can be used to determine whether all data in the second non-volatile cache have been written into the second non-volatile storage area, so that data can be restored according to the second data descriptor after power failure recovery, thereby ensuring that all data to be written can be written to the disk.

[0112] It should be noted that when the second data descriptor is generated, its status flag is in an idle state. Since the verification data of the second non-volatile cache is ready to be written into the second non-volatile storage area, the status flag can be immediately updated to a write state.

[0113] Step 305, update the first data descriptor to obtain a target first data descriptor; the target first data descriptor is the basis for writing the data to be written from the first non-volatile cache to the first non-volatile storage area, and the second data descriptor is the basis for writing the verification data from the second non-volatile cache to the second non-volatile storage area.

[0114] After the second data descriptor is generated, the data to be written is now ready to be written from the first non-volatile cache to the first non-volatile storage area, and the verification data is now ready to be written from the second non-volatile cache to the second non-volatile storage area. However, at this time, the status flag in the first data descriptor is a cache state, so it is necessary to update the status flag in the first data descriptor to a write state, thereby obtaining an updated target first data descriptor.

[0115] Furthermore, since both the target first data descriptor and the second data descriptor include a starting address, a data length and a data pointer, when the data to be written is written from the first non-volatile cache to the first non-volatile storage area, it can be written according to the starting address, data length and data pointer in the target first data descriptor. Similarly, when the verification data is written from the second non-volatile cache to the second non-volatile storage area, it can also be written according to the starting address, data length and data pointer in the second data descriptor.

[0116] In this way, through the status flags in the first data descriptor and the target first data descriptor, it can be confirmed whether the data to be written has begun to be written from the first non-volatile cache to the first non-volatile storage area, so as to facilitate the node to perform data recovery during power failure recovery.

[0117] Step 306: Send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and send a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk.

[0118] Among them, step 306 is substantially the same as step 103, and will not be described here to avoid repetition.

[0119] Step 307: When the data to be written and the verification data are both written completely, the target first data descriptor and the second data descriptor are deleted.

[0120] When all the data to be written are written from the first non-volatile cache to the first non-volatile storage area, and all the verification data are written from the second non-volatile cache to the second non-volatile storage area, the target first data descriptor in the first non-volatile cache can be deleted, and the second data descriptor in the second non-volatile cache can be deleted. In this way, the occupancy of the first non-volatile cache and the second non-volatile cache can be reduced.

[0121] In an embodiment of the present invention, a RAID controller in a RAID system, in response to a first write data request for data to be written, stores the data to be written in a first non-volatile cache of a non-volatile data storage disk, generates verification data based on the data to be written, and writes the verification data into a second non-volatile cache of a non-volatile data verification disk, sends a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and sends a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk. In this way, the characteristics of the non-volatile cache in the non-volatile storage disk are utilized to simplify the design of the RAID system, and under the premise of also realizing the power-off protection function, the battery backup unit, super capacitor and cache are omitted, thereby reducing the complexity of the RAID system and the implementation cost of the RAID system.

[0122] Furthermore, a first data descriptor is set for the data to be written, and a second data descriptor is set for the verification data. In this way, it is possible to determine whether the data to be written and the verification data are all written to the disk through the status flags in the first data descriptor and the second data descriptor, so that after power failure recovery, it is possible to determine whether data recovery is needed based on the first data descriptor and the second data descriptor.

[0123] like Figure 5 , shows a flowchart of another data processing method provided by an embodiment of the present invention, and the method may specifically include the following steps:

[0124] Step 501: In response to a first data write request for data to be written, the data to be written is stored in a first non-volatile cache of a non-volatile data storage disk.

[0125] Step 502: Generate a first data descriptor in the first non-volatile cache; the first data descriptor is used to record relevant information of the data to be written.

[0126] Step 503: Generate verification data based on the data to be written, and write the verification data into a second non-volatile cache of the non-volatile data verification disk.

[0127] Step 504: Generate a second data descriptor in the second non-volatile cache; the second data descriptor is used to record relevant information of the verification data.

[0128] Step 505, update the first data descriptor to obtain a target first data descriptor; the target first data descriptor is the basis for writing the data to be written from the first non-volatile cache to the first non-volatile storage area, and the second data descriptor is the basis for writing the verification data from the second non-volatile cache to the second non-volatile storage area.

[0129] Step 506: Send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and send a third write data request to the non-volatile data check disk so that the check data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data check disk.

[0130] Step 507: When the data to be written and the verification data are both written completely, the target first data descriptor and the second data descriptor are deleted.

[0131] Among them, steps 501 to 507 are substantially the same as steps 301 to 307, and will not be described here for avoiding repetition.

[0132] Step 508: when the redundant array of disks to which the nonvolatile data storage disk belongs is powered on again and the status flag in the first data descriptor is in a cache state, link to the step of generating verification data based on the data to be written.

[0133] Specifically, when the RAID system detects that the RAID has been powered off and then powered on again, and the status flag in the first data descriptor in the first non-volatile cache is in the cache state, it indicates that the data to be written has not yet been written from the first non-volatile cache to the first non-volatile storage area. Since the verification data has not yet been generated at this time, or the verification data is wrong due to power failure, it is possible to link to the step of generating verification data based on the data to be written, that is, link to step 503 for data recovery.

[0134] Step 509, when the redundant array disk to which the nonvolatile data storage disk belongs is powered on again, and the status flag in the target first data descriptor and the status flag in the second data descriptor are both in the write state, link to the step of sending a second write data request to the nonvolatile data storage disk so that the data to be written is written from the first nonvolatile cache to the first nonvolatile storage area of ​​the nonvolatile data storage disk, and sending a third write data request to the nonvolatile data check disk so that the check data is written from the second nonvolatile cache to the second nonvolatile storage area of ​​the nonvolatile data check disk.

[0135] Specifically, when the RAID system detects that the RAID is powered off and then powered on again, and the status flags in the target first data descriptor and the second data descriptor in the first non-volatile cache are both in the write state, it means that before the power failure, the data to be written has been prepared to be written from the first non-volatile cache to the first non-volatile storage area, and the verification data is prepared to be written from the second non-volatile cache to the second non-volatile storage area, or a part of the data to be written has been written from the first non-volatile cache to the first non-volatile storage area, and a part of the verification data has been written from the second non-volatile cache to the second non-volatile storage area. Therefore, at this time, it can be linked to the step of sending a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and sending a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk, that is, linking to step 506 for data recovery.

[0136] In an embodiment of the present invention, a RAID controller in a RAID system, in response to a first write data request for data to be written, stores the data to be written in a first non-volatile cache of a non-volatile data storage disk, generates verification data based on the data to be written, and writes the verification data into a second non-volatile cache of a non-volatile data verification disk, sends a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and sends a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk. In this way, the characteristics of the non-volatile cache in the non-volatile storage disk are utilized to simplify the design of the RAID system, and under the premise of also realizing the power-off protection function, the battery backup unit, super capacitor and cache are omitted, thereby reducing the complexity of the RAID system and the implementation cost of the RAID system.

[0137] Furthermore, a first data descriptor is set for the data to be written, and a second data descriptor is set for the verification data. In this way, it is possible to determine whether the data to be written and the verification data are all written to the disk through the status flags in the first data descriptor and the second data descriptor, thereby realizing data recovery of the data to be written and the verification data according to the first data descriptor and the second data descriptor after the RAID power is restored.

[0138] For ease of understanding, Figure 6, showing the specific process of the embodiment of the present invention. Among them, when the RAID system performs a write operation, it is necessary to simultaneously update the non-volatile data storage disk D and the non-volatile data check disk P. According to the different distribution of the data to be written on the RAID stripe, the RAID system has two update modes: RMW (Read-Modify-Write) and RCW (Read-Construct-Write).

[0139] The embodiment of the present invention takes RMW as an example, assuming that the data to be written is D new , the old data in the corresponding non-volatile storage area is D old , the old calibration data is P old , the new verification data to be generated is P new , then the new verification data generation algorithm is:

[0140] P new =D new ⊕D old ⊕P old

[0141] Among them, ⊕ is the exclusive OR operation.

[0142] 1) The host sends write data D to the RAID controller new Request.

[0143] 2) The RAID controller determines through calculation that this write operation must be completed through RMW, and the RAID controller uses the internal DMA controller to new Non-volatile cache moved from the host to drive D.

[0144] 3) The RAID controller creates a data descriptor in the non-volatile cache of disk D and sets the status flag to the cache state, indicating that the data to be written has been cached.

[0145] 4) The RAID controller returns the data writing completion information to the host.

[0146] 5) RAID controller calculates the check data P new , and then use the DMA controller to new Write to the non-volatile cache of the P disk.

[0147] 6) Update the status flag in the data descriptor of the D disk to the write status, create a data descriptor in the non-volatile cache of the P disk, and set the status flag to the write status, indicating the start of the disk write operation.

[0148] 7) The RAID controller sends commands to the D disk and P disk respectively. new and P newWrites nonvolatile storage space from the nonvolatile cache to disk.

[0149] 8) Delete the data descriptors on disk D and disk P, indicating that the data write operation is completed.

[0150] In the above steps, data recovery can be performed if an unexpected power failure occurs in any step:

[0151] 1) If power failure occurs before steps 1, 2, and 3 are completed, no recovery operation is required because the data descriptor status has not been updated.

[0152] 2) If power failure occurs after step 3 is completed but before step 6 is completed, the status flag in the data descriptor of disk D is in cache status and the descriptor status of disk P has not been generated. The data recovery operation at this time is to start the data recovery operation again from step 5.

[0153] 3) If a power failure occurs after step 6 is completed, the status flags in the data descriptors on the D disk and the P disk are both in the write state, and the operation is restarted from step 7 to perform data recovery.

[0154] The present invention also provides a data processing device, comprising:

[0155] A storage module, configured to store the data to be written in a first non-volatile cache of the non-volatile data storage disk in response to a first data write request for the data to be written;

[0156] A first generating module, used to generate verification data based on the data to be written;

[0157] A writing module, used for writing the verification data into a second non-volatile cache of the non-volatile data verification disk;

[0158] A sending module is used to send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and to send a third write data request to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk.

[0159] Optionally, the storage module is specifically used to:

[0160] When the first write data request sent by the host is obtained, determining at least one non-volatile data storage disk for writing the data to be written from the redundant array of disks according to the first write data request and the level of the redundant array of disks to which the non-volatile data storage disk belongs;

[0161] Acquire the data to be written from the host, and split the data to be written according to the number of non-volatile data storage disks to obtain at least one sub-data;

[0162] The at least one sub-data is stored in a first non-volatile buffer of the at least one non-volatile data storage disk.

[0163] Optionally, it also includes:

[0164] A second generating module is used to generate a first data descriptor in the first non-volatile cache before generating verification data based on the data to be written; the first data descriptor is used to record relevant information of the data to be written; and

[0165] Before sending the second data write request to the non-volatile data storage disk, generating a second data descriptor in the second non-volatile cache; the second data descriptor is used to record relevant information of the verification data;

[0166] an updating module, configured to update the first data descriptor to obtain a target first data descriptor; the target first data descriptor is a basis for writing the data to be written from the first non-volatile cache to the first non-volatile storage area, and the second data descriptor is a basis for writing the verification data from the second non-volatile cache to the second non-volatile storage area;

[0167] A deletion module is used to delete the target first data descriptor and the second data descriptor when the data to be written and the verification data are both written completely.

[0168] Optionally, the second generating module is specifically used to:

[0169] Determining a first starting address of the data to be written in the first non-volatile storage area;

[0170] Determining a first data length of the data to be written;

[0171] Determine a first data pointer of the data to be written; the first data pointer is used to represent the position of the data to be written in the first non-volatile cache;

[0172] Setting the first status flag of the data to be written to a cache status;

[0173] generating a first data descriptor based on the first starting address, the first data length, the first data pointer and the first status flag;

[0174] The second generating module is further specifically used for:

[0175] Determining a second starting address of the verification data in the second non-volatile storage area;

[0176] Determining a second data length of the verification data;

[0177] Determine a second data pointer of the verification data; the second data pointer is used to represent the position of the verification data in the second non-volatile cache;

[0178] Setting the second status flag of the verification data to a write status;

[0179] A second data descriptor is generated based on the second starting address, the second data length, the second data pointer and the second status flag.

[0180] Optionally, the update module is specifically used to:

[0181] The status flag in the first data descriptor is updated to a write status to obtain a target first data descriptor.

[0182] Optionally, it also includes:

[0183] When the redundant array of disks to which the nonvolatile data storage disk belongs is powered on again, and the state flag in the first data descriptor is in a cache state, the first generating module is called.

[0184] Optionally, it also includes:

[0185] When the redundant array of disks to which the nonvolatile data storage disk belongs is powered on again, and the status flag in the target first data descriptor and the status flag in the second data descriptor are both in the write state, the sending module is called.

[0186] like Figure 7 , showing a structural block diagram of an electronic device 70 provided in an embodiment of the present invention, including:

[0187] A processor 701, a memory 702, and a computer program 7021 stored in the memory 702 and capable of running on the processor 701. When the computer program 7021 is executed by the processor 701, each process of the above-mentioned data processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0188] like Figure 8 , shows a structural block diagram of a computer-readable storage medium 80 provided in an embodiment of the present invention. A computer program 801 is stored on the computer-readable storage medium 80. When the computer program 801 is executed by the processor, the various processes of the above-mentioned data processing method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0189] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0190] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0191] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0192] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0193] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0194] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0195] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0196] The data processing method, device, electronic device and storage medium provided by the present invention are introduced in detail above. The principle and implementation mode of the present invention are explained in detail using specific examples. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A data processing method, characterized in that: include: In response to a first data write request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk; Generating verification data based on the data to be written, and writing the verification data into a second non-volatile cache of the non-volatile data verification disk; A second write data request is sent to the nonvolatile data storage disk so that the data to be written is written from the first nonvolatile cache to the first nonvolatile storage area of ​​the nonvolatile data storage disk, and a third write data request is sent to the nonvolatile data check disk so that the check data is written from the second nonvolatile cache to the second nonvolatile storage area of ​​the nonvolatile data check disk.

2. The data processing method according to claim 1, characterized in that: In response to a first data write request for data to be written, storing the data to be written in a first non-volatile cache of a non-volatile data storage disk comprises: When the first write data request sent by the host is obtained, determining at least one non-volatile data storage disk for writing the data to be written from the redundant array of disks according to the first write data request and the level of the redundant array of disks to which the non-volatile data storage disk belongs; Acquire the data to be written from the host, and split the data to be written according to the number of non-volatile data storage disks to obtain at least one sub-data; The at least one sub-data is stored in a first non-volatile buffer of the at least one non-volatile data storage disk.

3. The data processing method according to claim 1, characterized in that: Before generating verification data based on the data to be written, the method includes: Generate a first data descriptor in the first non-volatile cache; the first data descriptor is used to record relevant information of the data to be written; Before sending the second data write request to the nonvolatile data storage disk, the method includes: Generate a second data descriptor in the second non-volatile cache; the second data descriptor is used to record relevant information of the verification data; The first data descriptor is updated to obtain a target first data descriptor; the target first data descriptor is a basis for writing the data to be written from the first non-volatile cache into the first non-volatile storage area, and the second data descriptor is a basis for writing the verification data from the second non-volatile cache into the second non-volatile storage area; The method further comprises: When the data to be written and the verification data are both written completely, the target first data descriptor and the second data descriptor are deleted.

4. The data processing method according to claim 3, characterized in that: Generating a first data descriptor in the first non-volatile cache comprises: Determining a first starting address of the data to be written in the first non-volatile storage area; Determine a first data length of the data to be written; Determine a first data pointer of the data to be written; the first data pointer is used to represent the position of the data to be written in the first non-volatile cache; Setting the first status flag of the data to be written to a cache status; generating a first data descriptor based on the first starting address, the first data length, the first data pointer and the first status flag; Generating a second data descriptor in the second non-volatile cache comprises: Determining a second starting address of the verification data in the second non-volatile storage area; Determining a second data length of the verification data; Determine a second data pointer of the verification data; the second data pointer is used to represent the position of the verification data in the second non-volatile cache; Setting the second status flag of the verification data to a write status; A second data descriptor is generated based on the second starting address, the second data length, the second data pointer and the second status flag.

5. The data processing method according to claim 3, characterized in that: The updating of the first data descriptor to obtain a target first data descriptor includes: The status flag in the first data descriptor is updated to a write status to obtain a target first data descriptor.

6. The data processing method according to claim 3, characterized in that: Also includes: When the redundant array of disks to which the nonvolatile data storage disk belongs is powered on again, and the state flag in the first data descriptor is in a cache state, the step of generating verification data based on the data to be written is linked to.

7. The data processing method according to claim 3, characterized in that: Also includes: When the redundant disk array to which the nonvolatile data storage disk belongs is powered on again, and the status flag in the target first data descriptor and the status flag in the second data descriptor are both in the write state, it is linked to the step of sending a second write data request to the nonvolatile data storage disk so that the data to be written is written from the first nonvolatile cache to the first nonvolatile storage area of ​​the nonvolatile data storage disk, and sending a third write data request to the nonvolatile data check disk so that the check data is written from the second nonvolatile cache to the second nonvolatile storage area of ​​the nonvolatile data check disk.

8. A data processing device, characterized in that: The device comprises: A storage module, configured to store the data to be written in a first non-volatile cache of the non-volatile data storage disk in response to a first data write request for the data to be written; A first generating module, used to generate verification data based on the data to be written; A writing module is used to write the verification data into a second non-volatile cache of the non-volatile data verification disk; a sending module is used to send a second write data request to the non-volatile data storage disk so that the data to be written is written from the first non-volatile cache to the first non-volatile storage area of ​​the non-volatile data storage disk, and a third write data request is sent to the non-volatile data verification disk so that the verification data is written from the second non-volatile cache to the second non-volatile storage area of ​​the non-volatile data verification disk.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the data processing method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data processing method according to any one of claims 1 to 7 are implemented.