CN113420341B - Data protection method, data protection equipment and computer system - Google Patents

Data protection method, data protection equipment and computer system Download PDF

Info

Publication number
CN113420341B
CN113420341B CN202110655578.0A CN202110655578A CN113420341B CN 113420341 B CN113420341 B CN 113420341B CN 202110655578 A CN202110655578 A CN 202110655578A CN 113420341 B CN113420341 B CN 113420341B
Authority
CN
China
Prior art keywords
data
protected
raid
cache
check
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110655578.0A
Other languages
Chinese (zh)
Other versions
CN113420341A (en
Inventor
刘双
陈正亮
蔡全
王琛銮
蔡勤世
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lianyun Technology Hangzhou Co ltd
Original Assignee
Lianyun Technology Hangzhou Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lianyun Technology Hangzhou Co ltd filed Critical Lianyun Technology Hangzhou Co ltd
Priority to CN202110655578.0A priority Critical patent/CN113420341B/en
Publication of CN113420341A publication Critical patent/CN113420341A/en
Application granted granted Critical
Publication of CN113420341B publication Critical patent/CN113420341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/80Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in storage media based on magnetic or optical technology, e.g. disks with sectors
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention discloses a data protection method, data protection equipment and a computer system. The data protection method comprises the steps of responding to a data protection task and obtaining data to be protected; the data to be protected is protected by adopting a first RAID mode; writing the data to be protected by the first RAID mode into a cache area, and storing the data to be protected as cache data; protecting the cache data by adopting a second RAID mode; and writing the cache data protected by the second RAID mode into a storage area to store the cache data as storage data. According to the data protection method, the data protection device and the computer system, the data protection capacity is improved, and meanwhile, the extra storage space required by data protection is saved.

Description

Data protection method, data protection equipment and computer system
Technical Field
The present invention relates to the field of computer storage technologies, and in particular, to a data protection method, a data protection device, and a computer system.
Background
Solid State Disk (SSD) has been widely used in various applications. With the improvement of the manufacturing process, the storage capacity of NAND flash (solid state disk) is also continuously increased. However, as the storage capacity increases, the quality of NAND flash decreases, resulting in an increased possibility of data loss.
In the prior art, in order to solve the problems of data errors, losses, etc., instruction error correction techniques (Error Checking and Correcting, ECC) are generally used for error correction; or by means of a (redundant independent) disk array (Redundant Arrays of Independent Disks, RAID). However, the instruction error correction technique cannot recover data in the case that the original error bit (error bit) of the data is too high or programming fails (program fail) or the like. RAID has poor applicability and can bring adverse effects on the utilization rate, the reading speed and the like of the solid state disk.
Accordingly, it is desirable to have a new data protection method, data protection apparatus, and computer system that overcome the above-described problems.
Disclosure of Invention
In view of the foregoing, an object of the present invention is to provide a data protection method, a data protection device, and a computer system, so as to save a storage space of check data while improving a data protection capability.
According to an aspect of the present invention, there is provided a data protection method, including: acquiring data to be protected; the data to be protected is protected by adopting a first RAID mode; writing the data to be protected by the first RAID mode into a cache area, and storing the data to be protected as cache data; protecting the cache data by adopting a second RAID mode; and writing the cache data protected by the second RAID mode into a storage area to store the cache data as storage data.
Preferably, the fault tolerance of the first RAID mode for errors of the data to be protected is greater than the fault tolerance of the second RAID mode for errors of the data to be protected; the cache data comprises the data to be protected and first check data, and the storage data comprises the data to be protected and second check data; the first check data are generated when the data to be protected are protected by adopting the first RAID mode, the second check data are generated when the data to be protected are protected by adopting the second RAID mode, and the data size of the first check data is larger than that of the second check data.
Preferably, the first RAID mode adopts a Block RAID of RAID 5; and the second RAID mode adopts a Page RAID of RAID 6.
Preferably, the buffer area includes a plurality of buffer groups, each buffer group includes a first check data block and a plurality of first protection data blocks;
the protecting the data to be protected by adopting the first RAID mode, and writing the data to be protected by adopting the first RAID mode into a cache area includes:
storing the data to be protected into each first protection data block; according to the Block RAID of RAID5, obtaining first check data of each cache group from data to be protected in each cache group, and storing the first check data of each cache group into a first check data Block in the cache group, wherein the first check data is used for checking RAID 5.
Preferably, the storage area comprises a plurality of storage groups, each storage group comprising two second check data pages and a plurality of second protection data pages;
the protecting the cache data by adopting a second RAID mode, and writing the cache data protected by the second RAID mode into a storage area comprises the following steps:
writing the data to be protected in the cache area into each second protection data page; according to the Page RAID of RAID6, obtaining second check data of each storage group from the data to be protected in each storage group, and storing the second check data of each storage group in a second check data Page of each storage group, wherein the second check data is used for checking RAID 6.
Preferably, after the data to be protected by the first RAID manner is written into a cache area and stored as cache data, the data protection method further includes:
acquiring the data volume of the cache data in the cache region; and after the data quantity of the cache data in the cache area reaches a set threshold, writing the data to be protected in the cache area into the storage area, and protecting the data to be protected by adopting the second RAID mode.
Preferably, the buffer area comprises SLC memory cells, and the memory area comprises MLC memory cells or TLC memory cells or QLC memory cells.
Preferably, the cache data and the storage data are stored in the same solid state disk.
Preferably, in the case that the programming failure occurs when the data to be protected is written into the buffer area, the data protection method further includes: and recovering the data to be protected which is failed in programming according to the Block RAID of RAID5, and writing the recovered data to be protected into the buffer area again.
According to another aspect of the present invention, there is provided a data protection apparatus comprising: the cache area is used for storing data to be protected and protecting the data to be protected by adopting a first RAID mode; and the storage area is used for storing the data to be protected and protecting the data to be protected by adopting a second RAID mode.
Preferably, the buffer area includes a plurality of buffer groups, each buffer group includes a first check data block and a plurality of first protection data blocks; the first protection data block is used for storing the data to be protected; the first check data Block is used for storing first check data obtained from the data to be protected according to RAID5 Block RAID, wherein the first check data is used for RAID5 check;
the storage area comprises a plurality of storage groups, and each storage group comprises two second check data pages and a plurality of second protection data pages; the second protection data page is used for storing the data to be protected; the second check data Page is used for storing second check data obtained from the data to be protected according to the Page RAID of RAID6, wherein the second check data is used for checking RAID 6.
Preferably, the data protection device further includes: the threshold unit is used for acquiring the data volume of the cache data in the cache area and sending a storage instruction after the data volume of the cache data in the cache area reaches a set threshold; the storage instruction is used for controlling the cache data in the cache area to be written into the storage area; and the recovery unit is used for recovering the data to be protected which is failed in programming according to the Block RAID of RAID5 under the condition that the data to be protected is written into the buffer area and writing the recovered data to be protected into the buffer area again.
According to yet another aspect of the present invention, there is provided a computer system including a host; and the data protection equipment is connected with the host computer to acquire the data to be protected and is used for storing the data to be protected.
According to the data protection method, the data protection device and the computer system provided by the embodiment of the invention, different RAID strategies are used for the cache part and the storage part, so that the data protection capability is improved, and meanwhile, the occupation of the storage space is reduced.
According to the data protection method, the data protection device and the computer system, the data to be protected in the buffer area is protected by adopting a Block RAID mode; the data to be protected in the storage area is protected by adopting a Page RAID mode, and smooth writing, erasing, programming and the like of the data can be ensured by adopting different levels of protection modes.
According to the data protection method, the data protection device and the computer system provided by the embodiment of the invention, data in a cache area is protected by adopting a RAID5 mode; and the RAID6 mode is adopted to protect the data in the storage area, so that the occupation of the storage space is reduced while the data security is improved.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 shows a schematic diagram of a memory structure of a memory;
FIG. 2 illustrates a storage architecture diagram of RAID 5;
FIG. 3 illustrates a storage architecture diagram of RAID6;
FIG. 4 shows a method flow diagram of a data protection method according to an embodiment of the invention;
FIG. 5 shows a method flow diagram of a data protection method according to an embodiment of the invention;
FIG. 6 illustrates a storage architecture diagram of RAID5 according to an embodiment of the present invention;
FIG. 7 illustrates a storage architecture diagram of RAID6 according to an embodiment of the present invention;
fig. 8 shows a schematic structural diagram of a data protection apparatus according to an embodiment of the present invention;
FIG. 9 shows a schematic diagram of an apparatus for data protection according to an embodiment of the present invention;
fig. 10 shows a schematic structural diagram of a data protection apparatus according to an embodiment of the present invention;
FIG. 11 shows a schematic diagram of an apparatus of a computer system according to an embodiment of the invention.
Detailed Description
Various embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. The same reference numbers will be used throughout the drawings to refer to the same or like parts. For clarity, the various features of the drawings are not drawn to scale. Furthermore, some well-known portions may not be shown in the drawings.
The following describes in further detail the embodiments of the present invention with reference to the drawings and examples. Numerous specific details of the invention, such as construction, materials, dimensions, processing techniques and technologies, may be set forth in the following description in order to provide a thorough understanding of the invention. However, as will be understood by those skilled in the art, the present invention may be practiced without these specific details.
It will be understood that when a layer, an area, or a structure is described as being "on" or "over" another layer, another area, it can be referred to as being directly on the other layer, another area, or another layer or area can be included between the layer and the other layer, another area. And if the component is turned over, that layer, one region, will be "under" or "beneath" the other layer, another region.
Fig. 1 shows a schematic diagram of a memory storage structure. As shown in fig. 1, taking a NAND flash (NAND type flash memory) as an example, a block of NAND flash is composed of one or more packages (e.g., 2); a package is made up of one or more targets (e.g., 4); a target consists of one or more LUNs (e.g., 2); a LUN is made up of multiple planes (e.g., 2); one Plane is made up of blocks (e.g., 256); a Block is made up of multiple pages (e.g., 512). One Page is typically 16KB. The basic unit of NAND flash erase is Block; the basic unit of programming and reading is Page. FIG. 1 shows a 2target, 2LUN, 2Plane NAND flash, with Page Y in Block X for each Plane labeled.
RAID (Redundant array of inexpensive disk) improves the reliability of disk arrays by adding redundant disks to the disk array. The redundant magnetic disk is used for storing some redundant information instead of actual data, and the redundant information can be used for effectively recovering data when necessary, so that the protection of stored data is realized, and the reliability of the magnetic disk array is improved. There are many different levels of RAID, including RAID1, RAID3, RAID4, RAID5, RAID6, RAID10, etc.
FIG. 2 shows a schematic diagram of the storage structure of RAID 5. RAID5 (parity check) realizes the redundant error correction function of a single disk, and has higher effective utilization rate of the disk while having the data protection function. As shown in fig. 2, taking RAID5 (4d+p) as an example, 4 disks (disk 1 to disk 4) are used, and 1 disk (one of disk1 to disk 4) is used to store check bits (non-data bits). The basic principle is that one-bit check information is generated according to striped data 4D (using four-bit data) and stored in a fifth disk.
The formula for generating the P-check bit is generally as follows:
wherein P is a check bit, D1-D3 respectively represent three data bits,representing an exclusive or operation.
It can be seen that when the remaining one of D1, D2, and D3 is lost, the remaining three data bits and the parity bit P can be used for recovery, and a specific recovery formula is as follows:
for example, when D1 is lost,
FIG. 3 shows a schematic diagram of the storage structure of RAID 6. RAID6 differs from RAID5 by adding the 2 nd check bit Q bit in addition to the P check bit based on RAID 5. Taking RAID6 (6D+1P+1Q) as an example, this system requires 8 hard disks, 6 of which are used to store data, 1 for storing P parity, and 1 for storing Q parity. Not a specific individual disk is used to store P-check information in its entirety, but another Q-check information. Instead, for a certain bit group (6 data bits+p bits+q bits), a certain principle is adopted, where 6 blocks of disks store data bits, 1 block of disks store P bits, and 1 block of disks store Q bits.
The mathematical principle is as follows:
generating check bits:
wherein, D1-D3 are striped data; p is a check bit; q is a check bit;is an exclusive or operation; GF (D1) is Galois Field transform of the D1 bit.
When a disk has data error or is lost, the recovery method is the same as RAID5, and Q check bit is not needed. When the data on the two magnetic disks are in error or lost, the recovery method comprises the following steps: by using the generation formulas of P and Q given above, the simultaneous equations can always solve the lost two-bit data no matter whether the damaged data comprises P or Q, thereby realizing the protection of the data.
In an alternative embodiment of the present invention, writing data to be protected by a first RAID manner into a cache area, where storing the data as cache data includes obtaining first test data P1 from data (data to be protected) according to RAID5, taking the data and P1 as cache data, and storing the cache area. Writing the cache data protected by the second RAID mode into a storage area, wherein storing the cache data into the storage area comprises writing data in the cache area into the storage area, obtaining second check data P2+Q from the data according to RAID6, taking the data+P2+Q as the storage data, and storing the storage area. When the data to be protected in the storage area is in error, the data to be protected is still in the buffer area, the original data cannot be lost, and the data can be protected.
Fig. 4 shows a method flow diagram of a data protection method according to an embodiment of the invention. As shown in fig. 4, the data protection method according to the embodiment of the present invention includes the steps of:
step S101: acquiring data to be protected;
and responding to the data storage task, and acquiring the data to be protected. For example, the firmware actively protects the acquired data to be protected, and stores the (protected) data to be protected. Optionally, the data to be protected is obtained from host. Optionally, the data storage device obtains data to be protected from at least one of an external input device, other storage device, etc., for example, in response to a data storage task (instruction) of a central processing unit (central processing unit, CPU), and stores and protects the obtained data to be protected.
Step S102: protecting data to be protected by adopting a first RAID mode;
and protecting the data to be protected by adopting a first RAID mode. For example, a Block RAID mode of RAID5 is adopted to protect the data to be protected.
Step S103: writing the data to be protected in the first RAID mode into a cache area, and storing the data to be protected as cache data;
and writing the data to be protected in the first RAID mode into a cache area, and storing the data to be protected as cache data. For example, the data to be protected by the first RAID mode is written into the buffer area and used as the buffer data stored in the buffer area.
Step S104: protecting the cache data by adopting a second RAID mode;
and protecting the data to be protected by adopting a second RAID mode. For example, the data to be protected is protected by adopting a Page RAID mode of RAID 6.
Step S105: and writing the cache data protected by the second RAID mode into a storage area to store the cache data as storage data.
And writing the cache data protected by the second RAID mode into a storage area to store the cache data as storage data. For example, the cache data protected by the second RAID method is written into the storage area as storage data stored in the storage area.
In the embodiment of the invention, different RAID strategies are used for the data to be protected in the buffer area and the storage area, so that the occupation of the storage space is reduced while the data protection capability is improved.
In the above embodiment of the present invention, when the data to be protected in the storage area is in error (such as programming failure), the data to be protected is still in the cache area, and the original data is not lost, so that the security of the data is ensured.
In an alternative embodiment of the present invention, the error tolerance of the first RAID mode to errors in data to be protected is greater than the error tolerance of the second RAID mode to errors in data to be protected; the cache data comprises data to be protected and first check data, and the storage data comprises data to be protected and second check data. The first check data are check data generated when the data to be protected are protected by adopting a first RAID mode, and the second check data are check data generated when the data to be protected are protected by adopting a second RAID mode, wherein the data volume of the first check data is larger than that of the second check data.
Different RAID strategies are used for the data to be protected in the cache area and the storage area, the occupation of the storage space is reduced while the data protection capability is improved, and the combination mode can balance the data protection capability and the occupied storage space of different RAID.
In an alternative embodiment of the present invention, the cache region includes SLC memory cells; the storage area includes MLC memory cells or TLC memory cells or QLC memory cells.
In an alternative embodiment of the present invention, the cache data and the storage data are stored within the same solid state disk.
In an alternative embodiment of the present invention, the data protection method further includes striping the data to be protected. Stripe/striping (stripe) is a method of dividing continuous data into blocks of the same size, and writing each segment of data separately onto a different disk in the array. Briefly, a stripe is a method of merging multiple disk drives into one volume. In many cases, this is done by a hardware controller. Specifically, after responding to a data protection task, obtaining data to be protected, striping the data to be protected to obtain striped data to be protected so as to meet the storage requirement of a RAID storage mode.
In an optional embodiment of the present invention, the data protection method further includes obtaining a data amount of cache data in the cache region; and after the data quantity of the cache data in the cache area reaches a set threshold value, writing the data to be protected in the cache area into the storage area. Namely, the data to be protected is firstly stored in the buffer area, and when the data to be protected in the buffer area reaches a certain amount (threshold value), the data in the buffer area is transferred to the storage area. Optionally, after the data in the buffer area is restored to the storage area, the data in the buffer area, which has been stored in the storage area, is deleted to receive the subsequent data to be protected.
In an alternative embodiment of the present invention, the data protection method further includes obtaining a set threshold according to the test data. Specifically, the set threshold value is, for example, a fixed threshold value, and may be an empirical value. The set threshold is for example obtained according to different test requirements, such as the amount of data (test data) written for a typical CD Mark test. Alternatively, the amount of data written is converted to the number of SLC blocks according to the CDMark test.
In an optional embodiment of the present invention, the data protection method further includes reading cache data from a cache area; recovering the read cache data to obtain the data to be protected; and writing the data to be protected to the storage area to obtain the storage data, and protecting and recovering the data to be protected by adopting a second RAID mode. In the above embodiment of the present invention, when an error occurs in the cache data (data to be protected) in the cache area, the error correction can be performed on the data to be protected by recovering the data, thereby improving the accuracy of data storage.
In an optional embodiment of the present invention, in case of a programming failure occurring when writing data to be protected into the buffer, the data protection method further includes: and recovering the data to be protected which is failed in programming according to the Block RAID of RAID5, and writing the recovered data to be protected into the buffer area again. The problem of programming failure in writing into a cache area (such as SLC memory cells) can be solved by using a Block RAID with higher protection level.
In the embodiment of the invention, different RAID strategies are used for different blocks, so that the data protection capability is improved, and the occupation of check data generated by RAID to NAND flash space is reduced.
Fig. 5 shows a method flow diagram of a data protection method according to an embodiment of the invention. As shown in fig. 5, the data protection method according to the embodiment of the present invention includes the steps of:
step S201: responding to a data protection task, and acquiring data to be protected;
and responding to the data protection task, and acquiring the data to be protected. For example, the firmware actively protects the acquired data to be protected, and stores the (protected) data to be protected.
Step S202: protecting data to be protected by adopting a Block RAID mode of RAID5, writing the data to be protected into a cache area, and storing the data to be protected as cache data;
and protecting the data to be protected by adopting a Block RAID mode of RAID5, writing the data to be protected into a cache area, and storing the data to be protected as cache data. For example, write data to be protected (input by a user) to SLC (Single-Level Cell) Block.
Step S203: judging whether the data quantity in the buffer area reaches a set threshold value or not;
and judging whether the data quantity in the buffer area reaches a set threshold value. For example, it is determined whether the amount of data (data to be protected/buffered) in SLC Block reaches a set threshold.
When it is determined that the data amount in the buffer reaches the set threshold, step S204 is executed: and protecting the data to be protected by adopting a Page RAID mode of RAID6, writing the data to be protected into a cache area, and storing the data to be protected as storage data.
And protecting the data to be protected by adopting a Page RAID mode of RAID6, writing the data to be protected into a cache area, and storing the data to be protected as storage data. For example, the stored data/buffered data in SLC Block is written into QLC (four-layer storage unit) Block by RAID 6.
When it is determined that the data amount in the buffer area does not reach the set threshold, step S201 is performed. And responding to the data protection task, and acquiring the data to be protected.
In an alternative embodiment of the present invention, when protecting data to be protected by adopting a first RAID mode (not limited to RAID5 or RAID6, etc.), protecting the data to be protected by adopting a Block RAID mode; when the second RAID mode (not limited to RAID5 or RAID 6) is adopted to protect the data to be protected, the Page RAID mode is adopted to protect the data to be protected.
In another alternative embodiment of the present invention, the first RAID mode is a RAID5 mode; the second RAID mode is a RAID6 mode. Specifically, the data protection method further comprises the steps of obtaining a first check code according to data to be protected; and obtaining a second check code according to the data to be protected and/or the cache data. The cache data comprises data to be protected and a first check code; the stored data includes the data to be protected and a second check code (i.e., the first check data includes a first check code; the second check data includes a second check code). The first check code is used for checking RAID 5; the second check code is used for RAID6 checks.
In an alternative embodiment of the present invention, when the NAND flash is written, the SLC Block is written first, and at this time, the Block RAID using RAID5 may be used to protect the data; when the data amount stored in the SLC Block reaches a certain amount (i.e., the fixed threshold is generally an empirical value, and the data amount is converted into the number of SLC blocks according to different test requirements, such as the data amount written in a general CDMark test), the data in the SLC Block is written into the QLC Block, and Page RAID using RAID6 can be used to protect the data at this time. In the above embodiment of the present invention, the data is protected by using a combination of RAID5 and RAID6, so that the storage space occupied by the check data is reduced while the data protection is implemented. When user data is written into SLC Block, if program fail occurs, the user data can be recovered through the Block RAID of RAID5 (original data cannot be traced). When the data of the SLC Block is written into the QLC Block, if the program fail occurs, the original data is still in the SLC Black, and user data errors cannot be caused. If a problem occurs in the data of the QLC, the data can be recovered through the Page RAID of RAID 6.
FIG. 6 illustrates a storage architecture diagram of RAID5 according to an embodiment of the present invention. FIG. 6 (a) shows the storage structure of a Block RAID of RAID 5; fig. 6 (b) shows the storage structure of the Page RAID of RAID 5.
As shown in fig. 6 (a), when a Block RAID of RAID5 is adopted, the area corresponding to the hatched portion in fig. 6 (a) is a check Block; the area corresponding to the unshaded part in fig. 6 (a) is a data block. As shown in fig. 6 (b), when a Page RAID of RAID5 is adopted, the area corresponding to the hatched portion in fig. 6 (b) is a check Page; the area corresponding to the unshaded part in fig. 6 (b) is a data page.
FIG. 7 illustrates a storage architecture diagram of RAID6 according to an embodiment of the present invention. FIG. 7 (a) shows the storage structure of a Block RAID of RAID6; fig. 7 (b) shows a storage structure of the Page RAID of RAID 6.
As shown in fig. 7 (a), when a Block RAID of RAID6 is adopted, the area corresponding to the hatched portion in fig. 7 (a) is a check Block; the area corresponding to the unshaded part in fig. 7 (a) is a data block. As shown in fig. 7 (b), when a Page RAID of RAID6 is adopted, the area corresponding to the hatched portion in fig. 7 (b) is a check Page; the area corresponding to the unshaded part in fig. 7 (b) is a data page.
In an alternative embodiment of the present invention, the first RAID mode uses a Block RAID of RAID5, and the second RAID mode uses a Page RAID of RAID 6. The buffer area includes a plurality of buffer groups, each buffer group includes a first check data block and a plurality of first protection data blocks, as shown in fig. 6 (a), the area corresponding to the shaded portion is the first check data block, and the area corresponding to the non-shaded portion is the first protection data block. The storage area includes a plurality of storage groups, each storage group includes two second check data pages and a plurality of second protection data pages, as shown in fig. 7 (b), the area corresponding to the hatched portion is the second check data page, and the area corresponding to the non-hatched portion is the second protection data page.
Specifically, taking a Block RAID of RAID5 of one 2LUN, 2Plane as an example, block X contains 3Pages (Page 0, page1 and Page 2). Because the basic unit of program is Page, the check data resulting from RAID operations of Plane0/LUN0, plane1/LUN0, and Plane0/LUN1 are written to the corresponding Page of Plane1/LUN 1. If the Page of a certain Plane is found to be abnormal during reading, the data cannot be read normally, the data of the same Page of the same Block on other planes are read, and the original data of the abnormal Page can be obtained according to the RAID operation requirement. In the above storage manner (storage structure), the Block RAID can protect each Page, that is, page0, page1 and Page2, under the RAID5 policy, an error can occur at the same time; under the RAID6 policy, 2 errors may exist simultaneously.
In an alternative embodiment of the present invention, the first RAID mode uses Block RAID, that is, the data to be protected is obtained according to the data to be protected, for example, the data to be protected is obtained according to RAID 5. The data to be protected and the verification data are respectively stored in different areas. Taking a Page RAID of RAID5, 2LUN, 2Plane as an example, block X contains 3Pages (Page 0, page1 and Page 2). Because the basic unit of the program is Page, RAID data obtained in the process of the program by all Page0, page1 and Page2 of the first three planes is finally written into Page2 of Plane1/LUN1, if an abnormality occurs in a certain Page of a certain Plane, all other Page needs to be read out, and the original data of the error position can be obtained according to the RAID decoding flow.
Page RAID can protect a certain Page in a plurality of pages, namely Page0, page1 and Page2 can only have one error under RAID5 strategy; under the RAID6 policy, only 2 errors can occur.
In an alternative embodiment of the present invention, the second RAID mode uses Page RAID of RAID6, that is, the data to be protected obtains check data in the process of programming (program). For example, according to the RAID6 mode, check data is obtained according to the data to be protected in the programming process, and the data to be protected and the check data are respectively stored in different areas.
From the above description, we can see that a Block RAID can protect data of a Block:
RAID5: one of page i of block X in Plane0/LUN0, page i of block X in Plane1/LUN0, page i of block X in Plane0/LUN1 and page i of block X in Plane1/LUN1 (i=0, 1,2 …) has an error, and can be protected/recovered by the corresponding page i of block X in Plane1/LUN1, with a fault tolerance of 1/4;
RAID6: 2 errors occur in page i of block X in Plane0/LUN0, page i of block X in Plane1/LUN0, page i of block X in Plane0/LUN1, page i of block X in Plane1/LUN1 (i=0, 1,2 …), and the error tolerance is 2/4, and the errors can be protected/recovered by page i corresponding to block X in Plane0/LUN1 and page i corresponding to block X in Plane1/LUN 1.
Page RAID can only protect a few pages:
RAID5: one of page0-2 of block X in Plane0/LUN0, page0-2 of block X in Plane1/LUN0, page0-2 of block X in Plane0/LUN1 and page0-2 of block X in Plane1/LUN1 has an error, can be protected/recovered by page2 of block X in Plane1/LUN1, has a fault tolerance of 1/12, and is smaller than the fault tolerance of 1/4 of a block RAID of RAID 5;
RAID6: there are 2 errors in page0-2 of block X in Plane0/LUN0, page0-2 of block X in Plane1/LUN0, page0-2 of block X in Plane0/LUN1, and page0-2 of block X in Plane1/LUN1, and can be protected/recovered by page2 of block X in Plane0/LUN1 and page2 of block X in Plane1/LUN1, with a fault tolerance of 2/12, which is less than the fault tolerance of 2/4 of RAID 6. The Block RAID is more capable at the protection level.
In the preferred embodiment of the invention, the data to be protected is written into the cache area by taking the page as a basic unit and is stored as cache data in a RAID5 mode; and writing the cache data into a storage area by taking the page as a basic unit according to a RAID6 mode, and storing the cache data as storage data.
In the above embodiment of the present invention, different blocks use different RAIDs, and this combination way not only protects the data, but also saves the storage space occupied by the RAID check data. RAID6 may recover the error data of two units and RAID5 may recover the error data of one unit; page RAID can achieve Page-level data protection, and Block RAID can achieve Block-level data protection. When user data is written into SLC blocks, the SLC blocks are provided with RAID with higher protection level, so that the problem of Program fail can be solved (because of the characteristic of NAND flash, the minimum unit of Program operation is Page); when data is written from SLC Block to QLC, even if Program fail occurs, there is no concern about the problem of original data loss because the data is already in NAND flash, and when the data is in QLC, problems occur, which may cause problems in adjacent ones, so RAID6 that can solve a plurality of errors is required to protect.
According to another aspect of the present invention, a data protection apparatus is provided. The data protection device according to the embodiment of the invention is for example used for implementing the data protection method described above.
Fig. 8 shows a schematic structural diagram of a data protection apparatus according to an embodiment of the present invention. As shown in fig. 8, the data protection apparatus 10 according to the embodiment of the present invention includes a buffer area 11 and a storage area 12. The division of the buffer area 11 and the storage area 12 may be functional, and may not be physical.
Specifically, the buffer area 11 is used for storing data to be protected, and protecting the data to be protected by adopting a first RAID mode.
The storage area 12 is used for storing data to be protected, and protecting the data to be protected in a second RAID mode.
Fig. 9 shows a schematic diagram of an apparatus of a data protection device according to an embodiment of the present invention. As shown in fig. 9, the data protection apparatus 10 according to the embodiment of the present invention includes a buffer area 11 and a storage area 12. The buffer area 11 includes a plurality of buffer groups, each buffer group includes a first check data block and a plurality of first protection data blocks; the memory area 12 comprises several memory groups, each comprising two pages of second parity data and a plurality of pages of second protection data.
Specifically, the buffer area 11 includes a plurality of buffer groups, each of which includes a first check data block and a plurality of first protection data blocks. The first protection data block is used for storing data to be protected; the first check data Block is used for storing first check data obtained from data to be protected according to RAID 5's Block RAID, wherein the first check data is used for RAID 5's check.
The memory area 12 comprises several memory groups, each comprising two pages of second parity data and a plurality of pages of second protection data. The second protection data page is used for storing data to be protected; the second check data Page is used for storing second check data obtained from data to be protected according to the Page RAID of RAID6, wherein the second check data is used for checking RAID 6.
In an alternative embodiment of the invention the buffer 11 and the storage area 12 are located on the same solid state disk.
In an alternative embodiment of the invention, the data protection device further comprises a check code unit (not shown in the figures). The check code unit is used for obtaining a first check code according to data bits of the stored data and obtaining the first check code and/or a second check code according to the cached data.
In an alternative embodiment of the present invention, the buffer 11 may be a part of the solid state disk, or may be a cache memory independent of the solid state disk.
Fig. 10 shows a schematic structural diagram of a data protection apparatus according to an embodiment of the present invention. As shown in fig. 10, the data protection apparatus 10 according to the embodiment of the present invention includes a buffer area 11, a storage area 12, a threshold unit 14, and a restoration unit 15.
Specifically, the threshold unit 14 is configured to obtain a data amount of the buffered data in the buffer, and send a storage instruction after the data amount of the buffered data in the buffer reaches a set threshold; the store instruction is to control writing of the cache data in the cache region to the storage region. Optionally, the threshold unit 14 is further configured to obtain a set threshold value according to the test data. And the recovery unit 15 is used for reading the cache data from the cache area and recovering the read cache data to obtain the data to be protected. Optionally, the recovery unit is configured to recover the data to be protected that fails in programming according to the Block RAID of RAID5 when the data to be protected fails in programming when the data to be protected is written into the cache area, and write the recovered data to be protected into the cache area again.
According to yet another aspect of the present invention, a computer system is provided. The computer system according to the embodiment of the invention comprises the data protection device as described above, for example, for implementing the data protection method described above.
FIG. 11 shows a schematic diagram of an apparatus of a computer system according to an embodiment of the invention. As shown in fig. 11, a computer system according to an embodiment of the present invention includes a data protection device 10 and a host 20.
Specifically, the data protection device 10 is connected to the host 20 to obtain data to be protected, and is used for storing the data to be protected.
In an alternative embodiment of the present invention, the data protection device 10 includes a buffer and a memory. The buffer is connected to the host 20 to obtain data to be protected, and stores the data to be protected as buffered data. The solid-state disk is connected with the buffer to obtain the buffered data/data to be protected, and stores the buffered data/data to be protected as storage data. Optionally, the buffer is a device independent of the solid state disk. Optionally, the buffer is part of a solid state disk.
It should be noted that in this document relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Embodiments in accordance with the present invention, as described above, are not intended to be exhaustive or to limit the invention to the precise embodiments disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best utilize the invention and various modifications as are suited to the particular use contemplated. The invention is limited only by the claims and the full scope and equivalents thereof.

Claims (9)

1. A data protection method, applied to a NAND-type flash memory, comprising:
acquiring data to be protected;
the data to be protected is protected by adopting a first RAID mode;
writing the data to be protected by the first RAID mode into a cache area of the NAND flash memory, and storing the data to be protected as cache data;
protecting the cache data by adopting a second RAID mode;
writing the cache data protected by the second RAID mode into a storage area of the NAND flash memory to store the cache data as storage data,
the first RAID mode is Block RAID5 or Block RAID6; the second RAID mode is Page RAID5 or Page RAID6,
the buffer area comprises a plurality of buffer groups, when data is written by adopting Block RAID5, each buffer group comprises a first check data Block and a plurality of first protection data blocks, and each buffer group comprises: obtaining first check data by RAID operation of data to be protected in the plurality of first protection data blocks, wherein the first check data occupies one first check data block; when data is written by using Block RAID6, each cache group comprises two first check data blocks and a plurality of first protection data blocks, and each cache group comprises: obtaining two first check data by RAID operation of data to be protected in the plurality of first protection data blocks, wherein the two first check data occupy the two first check data blocks;
the storage area comprises a plurality of storage groups, when the Page RAID5 is adopted for writing data, each storage group comprises a second check data Page and a plurality of second protection data pages, and each storage group comprises: obtaining second check data by RAID operation of data to be protected in the plurality of second protection data pages, wherein the second check data occupies one second check data page; when data is written using Page RAID6, each of the storage groups includes two pages of second parity data and a plurality of pages of second protection data, for each of the storage groups: obtaining two second check data by RAID operation of the data to be protected in the plurality of second protection data pages, wherein the two second check data occupy the two second check data pages.
2. The data protection method according to claim 1, wherein the first RAID mode has a greater fault tolerance to errors of the data to be protected than the second RAID mode has to errors of the data to be protected; the data amount of the first check data is larger than the data amount of the second check data.
3. The data protection method according to claim 1, wherein the first RAID mode is a Block RAID of RAID 5;
and the second RAID mode adopts a Page RAID of RAID 6.
4. The data protection method according to claim 1, wherein after the writing the data to be protected by the first RAID method into a cache area, storing the data as cache data, the writing the cache data protected by the second RAID method into a storage area of the NAND-type flash memory, storing the data as storage data includes:
acquiring the data volume of the cache data in the cache region; and
after the data quantity of the cache data in the cache region reaches a set threshold, writing the data to be protected in the cache region into the storage region, and protecting the data to be protected by adopting the second RAID mode.
5. The data protection method according to any one of claims 1 to 4, wherein the buffer area comprises SLC memory cells, and the storage area comprises MLC memory cells or TLC memory cells or QLC memory cells.
6. The data protection method according to claim 1, wherein in the case of a program failure occurring when writing the data to be protected into the buffer area, the data protection method further comprises:
and recovering the data to be protected which is failed in programming according to the RAID5 or the RAID6 Block RAID, and writing the recovered data to be protected into the buffer area again.
7. A data protection device, comprising:
the cache area is used for storing data to be protected and protecting the data to be protected by adopting a first RAID mode; and
a storage area for storing the data to be protected and protecting the data to be protected by adopting a second RAID mode,
the first RAID mode is Block RAID5 or Block RAID6; the second RAID mode is Page RAID5 or Page RAID6,
the buffer area comprises a plurality of buffer groups, when data is written by adopting Block RAID5, the buffer groups comprise a first check data Block and a plurality of first protection data blocks, the first check data of each buffer group is obtained by the data to be protected in each buffer group, and the first check data of each buffer group is stored in the first check data Block in the buffer group; when the Block RAID6 is adopted to write data, the cache group comprises two first check data blocks and a plurality of first protection data blocks, the two first check data of each cache group are obtained from the data to be protected in each cache group, and the two first check data of each cache group are stored in the two first check data blocks in the cache group;
the storage area comprises a plurality of storage groups, when data is written in by using Page RAID5, each storage group comprises a second check data Page and a plurality of second protection data pages, the second check data of each storage group is obtained by the data to be protected in each storage group, and the second check data of each storage group is stored in the second check data Page in each storage group; when the Page RAID6 is adopted to write data, each storage group comprises two second check data pages and a plurality of second protection data pages, the two second check data of each storage group are obtained from the data to be protected in each storage group, and the two second check data of each storage group are stored in the two second check data pages in each storage group.
8. The data protection device of claim 7, wherein the data protection device further comprises:
the threshold unit is used for acquiring the data volume of the cache data in the cache area and sending a storage instruction after the data volume of the cache data in the cache area reaches a set threshold; the storage instruction is used for controlling the cache data in the cache area to be written into the storage area; and
and the recovery unit is used for recovering the data to be protected which is failed in programming according to the Block RAID of RAID5 under the condition that the data to be protected is written into the buffer area and writing the recovered data to be protected into the buffer area again.
9. A computer system, comprising:
a host; and
a data protection device as claimed in any one of claims 7 to 8, connected to the host to obtain the data to be protected, for storing the data to be protected.
CN202110655578.0A 2021-06-11 2021-06-11 Data protection method, data protection equipment and computer system Active CN113420341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110655578.0A CN113420341B (en) 2021-06-11 2021-06-11 Data protection method, data protection equipment and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110655578.0A CN113420341B (en) 2021-06-11 2021-06-11 Data protection method, data protection equipment and computer system

Publications (2)

Publication Number Publication Date
CN113420341A CN113420341A (en) 2021-09-21
CN113420341B true CN113420341B (en) 2023-08-25

Family

ID=77788363

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110655578.0A Active CN113420341B (en) 2021-06-11 2021-06-11 Data protection method, data protection equipment and computer system

Country Status (1)

Country Link
CN (1) CN113420341B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673191A (en) * 2009-09-28 2010-03-17 成都市华为赛门铁克科技有限公司 Data writing method and device as well as data memory system
CN103761058A (en) * 2014-01-23 2014-04-30 天津中科蓝鲸信息技术有限公司 RAID1 and RAID4 hybrid structure network storage system and method
CN105094696A (en) * 2015-07-06 2015-11-25 中国科学院计算技术研究所 Method and apparatus for ensuring data reliability during conversion process based on RAID 1 and RAID 4 mixture structure
CN105573681A (en) * 2015-12-31 2016-05-11 湖南国科微电子股份有限公司 Method and system for establishing RAID in SSD
CN111813609A (en) * 2020-07-23 2020-10-23 深圳大普微电子科技有限公司 Data recovery method in storage medium, data recovery system and related equipment
CN112596673A (en) * 2020-12-18 2021-04-02 南京道熵信息技术有限公司 Multi-active multi-control storage system with dual RAID data protection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008152708A1 (en) * 2007-06-13 2008-12-18 Fujitsu Limited Raid group converter, raid group conversion method, and raid group conversion program
US9785575B2 (en) * 2014-12-30 2017-10-10 International Business Machines Corporation Optimizing thin provisioning in a data storage system through selective use of multiple grain sizes

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101673191A (en) * 2009-09-28 2010-03-17 成都市华为赛门铁克科技有限公司 Data writing method and device as well as data memory system
CN103761058A (en) * 2014-01-23 2014-04-30 天津中科蓝鲸信息技术有限公司 RAID1 and RAID4 hybrid structure network storage system and method
CN105094696A (en) * 2015-07-06 2015-11-25 中国科学院计算技术研究所 Method and apparatus for ensuring data reliability during conversion process based on RAID 1 and RAID 4 mixture structure
CN105573681A (en) * 2015-12-31 2016-05-11 湖南国科微电子股份有限公司 Method and system for establishing RAID in SSD
CN111813609A (en) * 2020-07-23 2020-10-23 深圳大普微电子科技有限公司 Data recovery method in storage medium, data recovery system and related equipment
CN112596673A (en) * 2020-12-18 2021-04-02 南京道熵信息技术有限公司 Multi-active multi-control storage system with dual RAID data protection

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
卜海兵 等.磁盘阵列与数据安全.《数据存储、恢复与安全应用实践》.中国铁道出版社,2012,第363-365页. *

Also Published As

Publication number Publication date
CN113420341A (en) 2021-09-21

Similar Documents

Publication Publication Date Title
US10761766B2 (en) Memory management system and method
US11042441B2 (en) Stripe mapping in memory
EP3696676B1 (en) Memory system with multiple striping of raid groups and method for performing the same
US10353614B2 (en) Raid system and method based on solid-state storage medium
US8589761B2 (en) Apparatus and methods for providing data integrity
JP5522480B2 (en) Fault tolerant non-volatile integrated circuit memory
US20140068319A1 (en) Error Detection And Correction In A Memory System
US9292382B2 (en) Codewords that span pages of memory
CN107678695B (en) Selecting redundant storage configurations based on available memory space
US20090172335A1 (en) Flash devices with raid
US20100169743A1 (en) Error correction in a solid state disk
US10915394B1 (en) Schemes for protecting data in NVM device using small storage footprint
US20190303008A1 (en) Memory system with multiple striping of raid groups and method for performing the same
US9424131B2 (en) Spatially decoupled redundancy schemes for a solid state drive (SSD)
CN113420341B (en) Data protection method, data protection equipment and computer system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310051 room c1-604, building C, No. 459, Qianmo Road, Xixing street, Binjiang District, Hangzhou, Zhejiang Province

Applicant after: Lianyun Technology (Hangzhou) Co.,Ltd.

Address before: 6 / F, block C1, spotlight center, 459 Qianmo Road, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Applicant before: MAXIO TECHNOLOGY (HANGZHOU) Ltd.

GR01 Patent grant
GR01 Patent grant