CN113420341A - 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
CN113420341A
CN113420341A CN202110655578.0A CN202110655578A CN113420341A CN 113420341 A CN113420341 A CN 113420341A CN 202110655578 A CN202110655578 A CN 202110655578A CN 113420341 A CN113420341 A CN 113420341A
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.)
Granted
Application number
CN202110655578.0A
Other languages
Chinese (zh)
Other versions
CN113420341B (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.)
Maxio Technology Hangzhou Ltd
Original Assignee
Maxio Technology Hangzhou 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 Maxio Technology Hangzhou Ltd filed Critical Maxio Technology Hangzhou 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

Images

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

Abstract

The invention discloses a data protection method, data protection equipment and a computer system. The data protection method according to the embodiment of the invention comprises the steps of responding to a data protection task and obtaining data to be protected; protecting the data to be protected by adopting a first RAID mode; writing the data to be protected in the first RAID mode into a cache area and storing the data 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 and storing the cache data as storage data. According to the data protection method, the data protection device and the computer system, the data protection capability 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 Disks (SSDs) have been widely used in various applications. With the improvement of the manufacturing process, the storage capacity of the NAND flash (solid state disk) is also increasing continuously. However, as the storage capacity increases, the quality of the NAND flash decreases, resulting in an increased possibility of data loss.
In the prior art, in order to solve the problems of data Error and loss, an instruction Checking and Correcting (ECC) technique is usually used for Error correction; or a Redundant Array of Independent Disks (RAID) mode is adopted to store data. However, the instruction error correction technique cannot recover data when the original error bit (error bit) of the data is too high or the program fails (program fail). The applicability of RAID is poor, and adverse effects are brought in the utilization rate of the solid state disk, the reading speed, and the like.
Therefore, it is desirable to have a new data protection method, data protection device and computer system that overcome the above-mentioned problems.
Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a data protection method, a data protection device, and a computer system, so as to improve data protection capability and save storage space of check data.
According to an aspect of the present invention, there is provided a data protection method, including: acquiring data to be protected; protecting the data to be protected by adopting a first RAID mode; writing the data to be protected in the first RAID mode into a cache area and storing the data 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 and storing the cache data as storage data.
Preferably, the error tolerance rate of the first RAID mode to the data to be protected is greater than the error tolerance rate of the second RAID mode to 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 is check data generated when the data to be protected is protected by adopting the first RAID mode, the second check data is check data generated when the data to be protected is protected by adopting the second RAID mode, and the data volume of the first check data is larger than the data volume of the second check data.
Preferably, the first RAID mode is a Block RAID of RAID 5; the second RAID mode adopts a Page RAID of RAID 6.
Preferably, the buffer area includes a plurality of buffer groups, and each of the buffer groups includes a first parity 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 in each first protection data block; according to the Block RAID of RAID5, obtaining first check data of each cache group from the data to be protected in each cache group, and storing the first check data of each cache group in 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 of the storage groups comprises two second check-up data pages and a plurality of second protection data pages;
the protecting the cache data by adopting the second RAID mode, and writing the cache data protected by the second RAID mode into a storage area includes:
writing the data to be protected in the cache region into each second protection data page; according to the Page RAID of RAID6, obtaining second check-up data of each storage group from the data to be protected in each storage group, and storing the second check-up data of each storage group in a second check-up data Page in each storage group, wherein the second check-up data is used for checking RAID 6.
Preferably, after the data to be protected by the first RAID method 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 volume of the cache data in the cache region reaches a set threshold value, 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.
Preferably, the buffer area comprises SLC memory cells, and the storage 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 a programming failure occurs when the data to be protected is written into the buffer area, the data protection method further includes: and restoring the data to be protected which fails to be programmed according to the Block RAID of the RAID5, and writing the restored data to be protected into the cache area again.
According to another aspect of the present invention, there is provided a data protection apparatus including: the cache region 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, and each of the buffer groups includes a first parity 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 by the data to be protected according to a Block RAID of RAID5, wherein the first check data is used for checking of RAID 5;
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 a Page RAID of RAID6, wherein the second check data is used for checking of RAID 6.
Preferably, the data protection apparatus further comprises: the threshold unit is used for acquiring the data volume of the cache data in the cache region and sending a storage instruction after the data volume of the cache data in the cache region reaches a set threshold; the storage instruction is used for controlling the cache data in the cache region to be written into the storage region; and the recovery unit is used for recovering the data to be protected which fails to be programmed according to the Block RAID of the RAID5 under the condition that the data to be protected fails to be programmed when being written into the cache area, and writing the recovered data to be protected into the cache area again.
According to yet another aspect of the present invention, there is provided a computer system including a host; the data protection device is connected with the host 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, different RAID strategies are used for the cache part and the storage part, 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 cache area are protected in 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 protection modes of different levels.
According to the data protection method, the data protection equipment and the computer system, the data in the cache area are protected by adopting an RAID5 mode; and the data in the storage area is protected by adopting a RAID6 mode, 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 the embodiments of the present invention with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a memory structure of a memory;
FIG. 2 shows a schematic of the storage structure of RAID 5;
FIG. 3 shows a schematic of the storage structure of RAID 6;
FIG. 4 illustrates a method flow diagram of a data protection method according to an embodiment of the invention;
FIG. 5 illustrates a method flow diagram of a data protection method according to an embodiment of the invention;
FIG. 6 is a schematic diagram illustrating a storage structure of RAID5 according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating a storage structure of RAID6 according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a data protection apparatus according to an embodiment of the present invention;
FIG. 9 shows an apparatus diagram of a data protection device according to an embodiment of the invention;
FIG. 10 is a schematic diagram showing the structure of a data protection apparatus according to an embodiment of the present invention;
FIG. 11 shows an apparatus diagram 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. Like elements in the various figures are denoted by the same or similar reference numerals. For purposes of clarity, the various features in the drawings are not necessarily drawn to scale. Moreover, certain well-known elements may not be shown in the figures.
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. In the following description, numerous specific details of the invention, such as structure, materials, dimensions, processing techniques and techniques of components, are set forth in order to provide a more 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, region or layer is referred to as being "on" or "over" another layer, region or layer in describing the structure of the component, it can be directly on the other layer, region or layer or intervening layers or regions may also be present. Also, if the component is turned over, one layer or region may be "under" or "beneath" another layer or region.
Fig. 1 shows a schematic diagram of a memory structure of the memory. 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 consists of one or more targets (e.g., 4); a target is composed of one or more LUNs (e.g., 2); one LUN is composed of multiple planes (e.g., 2); a Plane is composed of a plurality of blocks (e.g., 256); a Block consists of multiple pages (e.g., 512). A Page is typically 16 KB. The basic unit of NAND flash erase is Block; the basic unit of programming and reading is Page. FIG. 1 shows a 2Targets, 2LUN, 2Plane NAND flash, with Page Y in Block X for each Plane labeled.
Raid (redundant array of dependent disk) improves the reliability of a disk array by adding redundant disks to the disk array. The redundant disk is used for storing redundant information instead of actual data, and the redundant information can be used for performing effective data recovery when necessary, so that the stored data is protected, and the reliability of the disk array is increased. There are many different levels of RAID, including RAID1, RAID3, RAID4, RAID5, RAID6, RAID10, and so forth.
Fig. 2 shows a schematic diagram of a storage structure of RAID 5. RAID5 (parity) realizes a redundant error correction function for a single disk, and has a high effective utilization rate of the disk while having a data protection function. As shown in fig. 2, taking RAID5(4D + P) as an example, 4 disks (disk1 to disk4) are used, and 1 disk (one of disk1 to disk4) is used to store parity bits (non-data bits). The basic principle is that one bit of check information is generated from the striped data 4D (using four bits of data), and stored in the fifth disk.
The formula for generating the P parity bits is generally such that:
Figure BDA0003113557130000061
wherein P is a check bit, D1-D3 respectively represent three data bits,
Figure BDA0003113557130000062
indicating 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 check bit P can be used for recovery, and the specific recovery formula is as follows:
for example, when D1 is lost,
Figure BDA0003113557130000063
fig. 3 shows a schematic diagram of a storage structure of RAID 6. RAID6 is different from RAID5 in that a 2 nd check bit Q bit is added in addition to a P check bit on the basis of RAID 5. Taking RAID6(6D +1P +1Q) as an example, this system needs 8 hard disks, of which 6 are used to store data, 1 is used to store P parity, and 1 is used to store Q parity. Not all of a specific independent disk is used for storing P check information and the other Q check information. But for a certain bit group (6 data bits + P bits + Q bits), a certain principle is adopted, wherein 6 disks store data bits, 1 disk stores P bits, and 1 disk stores Q bits.
The mathematical principle is as follows:
and (3) generating a check bit:
Figure BDA0003113557130000064
Figure BDA0003113557130000065
among them, D1-D3 are striped data; p is a check bit; q is a check bit;
Figure BDA0003113557130000066
is an exclusive or operation; GF (D1) is the Galois Field transform for the D1 bit.
When a data error or loss occurs in one disk, the recovery method is the same as that of RAID5, and the Q check bit is not needed. When data on the two disks are wrong or lost, the recovery method comprises the following steps: by using the generation formula of P and Q given above and the simultaneous equations, the damaged data can be solved for the lost two-bit data regardless of whether the damaged data includes P or Q, thereby realizing the protection of the data.
In an optional embodiment of the present invention, writing the data to be protected by the first RAID mode into the cache region, storing the data as cache data includes obtaining first check data P1 from data (data to be protected) according to RAID5, and storing the data and P1 as cache data in the cache region. Writing the cache data protected by the second RAID mode into a storage area, wherein the storage of the cache data comprises writing data in the cache area into the storage area, obtaining second check data P2+ Q from the data according to RAID6, and storing the data + P2+ Q as storage data in the storage area. When the data to be protected in the storage area is wrong, the data to be protected still exists in the cache area, and the original data cannot be lost and 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 to acquire 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, for example, responds to a data storage task (instruction) of a Central Processing Unit (CPU), obtains data to be protected from at least one of an external input device, other storage devices, and the like, 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 used to protect 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 as cache data;
and writing the data to be protected in the first RAID mode into a cache area and storing the data as cache data. For example, the data to be protected in the first RAID mode is written into the cache area as cache data stored in the cache 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, a Page RAID mode of RAID6 is used to protect data to be protected.
Step S105: and writing the cache data protected by the second RAID mode into a storage area and storing the cache data as storage data.
And writing the cache data protected by the second RAID mode into a storage area and storing the cache data as storage data. For example, the cache data protected by the second RAID method is written into the storage area as the 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 cache area and the storage area, so that the data protection capability is improved, and the occupation of the storage space is reduced.
In the above embodiment of the present invention, when the data to be protected in the storage area is in error (e.g. programming fails), the data to be protected still remains in the cache area, and the original data is not lost and protected, thereby ensuring the security of the data.
In an optional embodiment of the present invention, the error tolerance rate of the data to be protected by the first RAID mode is greater than the error tolerance rate of the data to be protected by the second RAID mode; the cache data comprises 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 is check data generated when the data to be protected is protected by adopting a first RAID mode, the second check data is check data generated when the data to be protected is protected by adopting a second RAID mode, and the data volume of the first check data is larger than that of the second check data.
Different RAID strategies are used for data to be protected in the cache area and the storage area, the data protection capability is improved, meanwhile, the occupation of storage space is reduced, and the combination mode can balance the data protection capability and the occupied storage space of different RAIDs.
In an alternative embodiment of the present invention, the cache area 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 invention, the cache data and the storage data are stored in the same solid state disk.
In an optional embodiment of the present invention, the data protection method further comprises striping the data to be protected. Striping/striping (striping) is a method of dividing contiguous data into equal-sized blocks of data, each of which is written separately to a different disk in an array. Briefly, striping is a method of merging multiple disk drives into a volume. In many cases, this is done through a hardware controller. Specifically, after the data to be protected is acquired in response to the data protection task, the data to be protected is striped to obtain striped data to be protected so as to meet the storage requirement of the RAID storage mode.
In an optional embodiment of the present invention, the data protection method further includes obtaining a data amount of the cache data in the cache region; and after the data volume of the cache data in the cache region reaches a set threshold value, writing the data to be protected in the cache region into a storage region. 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 transferred 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 optional embodiment of the present invention, the data protection method further includes obtaining a set threshold according to the test data. Specifically, the set threshold is, for example, a fixed threshold, and may be an empirical value. The set threshold is obtained, for example, according to different test requirements, such as the amount of data (test data) written by a typical CD Mark (CD Mark) test. Optionally, the number of SLC blocks is converted according to the amount of data written by the CDMark test.
In an optional embodiment of the present invention, the data protection method further includes reading cache data from the cache region; recovering the read cache data to obtain recovered data to be protected; and writing the recovered data to be protected into a storage area to obtain stored data, and protecting and recovering the data to be protected by adopting a second RAID mode. In the above embodiments of the present invention, when an error occurs in the cache data (data to be protected) in the cache region, the error can be corrected in the data to be protected by the recovery data, so as to improve the accuracy of data storage.
In an optional embodiment of the present invention, in a case that a programming failure occurs when writing data to be protected into a cache area, the data protection method further includes: and restoring the data to be protected which fails to be programmed according to the Block RAID of the RAID5, and writing the restored data to be protected into the cache area again. By protecting the higher-level Block RAID, the problem of programming failure of a write cache region (such as an SLC storage unit) can be solved.
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 on the 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 an embodiment of the present invention includes the steps of:
step S201: responding to the data protection task, and acquiring data to be protected;
and responding to the data protection task to acquire 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 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 as cache data;
and protecting the data to be protected by adopting a Block RAID mode of RAID5, and writing the data to be protected into a cache area to be stored as cache data. For example, data to be protected (input by a user) is written into an SLC (Single-Level Cell) Block.
Step S203: judging whether the data volume in the cache region reaches a set threshold value;
and judging whether the data volume in the buffer area reaches a set threshold value. For example, it is determined whether the data amount (data to be protected/cache data) in the SLC Block reaches a set threshold.
When the data amount in the buffer area reaches the set threshold, executing step S204: and protecting the data to be protected by adopting a Page RAID mode of RAID6, writing the data to be protected into a cache region, and storing the data 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 region, and storing the data as storage data. For example, the storage data/cache data in the SLC Block is written to the QLC (four-layer storage unit) Block in the RAID6 manner.
When the data amount in the buffer is judged not to reach the set threshold, step S201 is executed. Namely, the data protection task is responded, and the data to be protected is obtained.
In an optional embodiment of the present invention, when the data to be protected is protected by using a first RAID mode (not limited to RAID5 or RAID 6), the data to be protected is protected by using a Block RAID mode; when the data to be protected is protected by adopting a second RAID mode (not limited to RAID5 or RAID6 and the like), the data to be protected is protected by adopting a Page RAID mode.
In another optional embodiment of the present invention, the first RAID mode is a RAID5 mode; the second RAID scheme is a RAID6 scheme. Specifically, the data protection method further comprises the steps of obtaining a first check code according to the 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 data to be protected and a second parity (i.e., the first parity includes the first parity and the second parity includes the second parity). The first check code is used for checking RAID 5; the second parity code is used for parity checking of RAID 6.
In an optional embodiment of the present invention, when writing in the NAND flash, the data to be protected (user data) is written into the SLC Block first, and at this time, the Block RAID using RAID5 may be used to protect the data; when the amount of data stored in the SLC Block reaches a certain amount (i.e. the above-mentioned fixed threshold value, which is generally an empirical value, and is converted into the number of SLC blocks according to different test requirements, such as the amount of data written in a general CDMark test), the data in the SLC Block is written into the QLC Block, and at this time, the Page RAID using RAID6 may be used to protect the data. In the above embodiments of the present invention, the data is protected by using a combination of RAID5 and RAID6, and the storage space occupied by the check data is reduced while the data protection is implemented. When user data is written into an SLC Block, if program fail occurs, the user data can be recovered through a Block RAID of RAID5 (original data cannot be traced back). When the data of the SLC Block is written into the QLC Block, if a program fail occurs, the original data is still in the SLC Block, and errors of user data cannot be caused. If a problem occurs in the data of the QLC, the data can be recovered back through a Page RAID of RAID 6.
FIG. 6 shows a schematic diagram of a storage structure of RAID5 according to an embodiment of the present invention. Fig. 6(a) shows a Block RAID storage structure of RAID 5; fig. 6(b) shows the storage structure of Page RAID of RAID 5.
As shown in fig. 6(a), when a Block RAID of RAID5 is used, an area corresponding to a shaded portion in fig. 6(a) is a parity area; the area corresponding to the non-shaded portion in fig. 6(a) is a data block. As shown in fig. 6(b), when the Page RAID of RAID5 is used, the area corresponding to the shaded portion in fig. 6(b) is a check Page; the area corresponding to the unshaded portion in fig. 6(b) is a data page.
Fig. 7 shows a schematic diagram of a storage structure of RAID6 according to an embodiment of the present invention. Fig. 7(a) shows a Block RAID storage structure of RAID 6; fig. 7(b) shows a Page RAID storage structure of RAID 6.
As shown in fig. 7(a), when a Block RAID of RAID6 is used, an area corresponding to a shaded portion in fig. 7(a) is a parity area; the area corresponding to the non-shaded portion in fig. 7(a) is a data block. As shown in fig. 7(b), when the Page RAID of RAID6 is used, the area corresponding to the shaded portion in fig. 7(b) is a check Page; the area corresponding to the unshaded portion in fig. 7(b) is a data page.
In an optional embodiment of the present invention, the first RAID mode is a Block RAID of RAID5, and the second RAID mode is a Page RAID of RAID 6. The buffer area includes a plurality of buffer groups, each buffer group includes a first parity 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 parity 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 of which includes two second parity data pages and a plurality of second protection data pages, as shown in fig. 7(b), the area corresponding to the shaded portion is a second parity data page, and the area corresponding to the non-shaded portion is a second protection data page.
Specifically, taking a Block RAID of RAID5 of 2LUN and 2Plane as an example, Block X contains 3Pages (Page 0, Page1, and Page 2). Since the basic unit of program is Page, the check data obtained by RAID operation of Plane0/LUN0, Plane1/LUN0 and Plane0/LUN1 is finally written into the corresponding Page of Plane1/LUN 1. If the abnormal data cannot be read normally when a certain Page of a certain Plane is found to be abnormal during reading, reading the data of the same Page of the same Block on other planes, and acquiring the original data of the abnormal Page according to the requirement of RAID operation. In the above storage manner (storage structure), the Block RAID may protect each Page, that is, under the RAID5 policy, a Page0, a Page1, and a Page2 may simultaneously generate an error; under the RAID6 policy, there may be 2 errors at the same time.
In an optional embodiment of the present invention, the first RAID mode adopts a Block RAID, that is, check data is obtained according to data to be protected, for example, check data is obtained according to RAID 5. The data to be protected and the check data are respectively stored in different areas. Taking a Page RAID of RAID5 of 2LUN and 2Plane as an example, Block X contains 3Pages (Page 0, Page1 and Page 2). Because the basic unit of program is Page, RAID data obtained by all pages 0 and 1 and the pages 2 of the first three planes in the program process is finally written into Page2 of Plane1/LUN1, if some Page of some Plane is abnormal, all other pages need to be read out, and original data of an error position can be obtained according to the flow of RAID decoding.
The Page RAID can protect a certain Page of a plurality of pages, namely Page0, Page1 and Page2 can only generate one error under the RAID5 strategy; under the RAID6 strategy, only 2 errors can occur.
In an optional embodiment of the present invention, the second RAID mode adopts a Page RAID of RAID6, that is, the data to be protected obtains the check data in the programming (program) process. For example, according to the RAID6, during the programming process, the check data is obtained from the data to be protected, and the data to be protected and the check data are stored in different areas, respectively.
From the above description, we can see that a Block RAID can protect data of one Block:
RAID 5: one error occurs 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 and page i (i is 0,1,2 …) of block X in Plane1/LUN1, and the error can be protected/recovered by page i corresponding to block X in Plane1/LUN1, wherein the fault tolerance is 1/4;
RAID 6: 2 of the page i of block X in Plane0/LUN0, the page i of block X in Plane1/LUN0, the page i of block X in Plane0/LUN1 and the page i (i is 0,1,2 …) of block X in Plane1/LUN1 have errors, and the page i corresponding to block X in Plane0/LUN1 and the page i corresponding to block X in Plane1/LUN1 can be used for protection/recovery, and the fault tolerance is 2/4.
Page RAID can only protect a few pages:
RAID 5: an error occurs 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, the error can be protected/recovered by page2 of block X in Plane1/LUN1, the fault tolerance rate is 1/12 and is smaller than 1/4 of block RAID of RAID 5;
RAID 6: 2 errors occur 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, the page2 of block X in Plane0/LUN1 and the page2 of block X in Plane1/LUN1 can be used for protection/recovery, the fault tolerance rate is 2/12, and is smaller than 2/4 of RAID6 block RAID. At the protection level, the Block RAID is more capable.
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 according to the RAID5 mode, and stored as cache data; and writing the cache data into the 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 embodiment of the invention, different RAID is used for different blocks, and the combined mode not only protects the data, but also saves the storage space occupied by the RAID check data. RAID6 can recover error data of two units, and RAID5 can recover error data of one unit; the Page RAID can protect data at the Page level, and the Block RAID can protect data at the Block level. When user data is written into an SLC Block, the Block RAID with a higher protection level is provided, and the problem of Program fail can be solved (due to the characteristics of NAND flash, the minimum unit of Program operation is Page); when data is written from slcblock to QLC, because the data is already in NAND flash, even if Program fail occurs, there is no concern that the original data is lost, and when data is in QLC, there is a problem that may cause adjacent ones to also have a problem, so RAID6 that can solve multiple errors is required for protection.
According to another aspect of the present invention, a data protection apparatus is provided. The data protection device according to an embodiment of the present invention is used, for example, to implement the data protection method as described above.
Fig. 8 is 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 between the buffer area 11 and the storage area 12 is a functional division, and may not be a physical division.
Specifically, the cache 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 by adopting a second RAID mode.
Fig. 9 shows an apparatus diagram 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 including a first check data block and a plurality of first protection data blocks; the storage area 12 includes a plurality of storage groups, each of which includes two second check-up data pages and a plurality of second protection data pages.
Specifically, the buffer 11 includes a plurality of buffer groups, each of which includes a first parity 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 by the data to be protected according to Block RAID of RAID5, wherein the first check data is used for checking of RAID 5.
The storage area 12 includes a plurality of storage groups, each of which includes two second check-up data pages and a plurality of second protection data pages. The second protection data page is used for storing data to be protected; the second parity data Page is used for storing second parity data obtained from the data to be protected according to Page RAID of RAID6, wherein the second parity data is used for parity of RAID 6.
In an alternative embodiment of the invention, the buffer area 11 and the storage area 12 are located on the same solid state disk.
In an alternative embodiment of the present invention, the data protection device further comprises a check code unit (not shown in the figure). The check code unit is used for obtaining a first check code according to the data bit of the stored data and obtaining the first check code and/or a second check code according to the cache data.
In alternative embodiments of the present invention, the cache region 11 may be a part of the solid state disk or may be a cache memory independent of the solid state disk.
Fig. 10 is 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 cache data in the cache region, and send a storage instruction after the data amount of the cache data in the cache region 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. Optionally, the threshold unit 14 is further configured to obtain a set threshold according to the test data. And the recovery unit 15 is configured to read the cache data from the cache region, and recover the read cache data to obtain recovered data to be protected. Optionally, the recovery unit is configured to, when a programming failure occurs when the data to be protected is written into the cache area, recover the data to be protected, which has failed to be programmed, according to a Block RAID of RAID5, 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 present invention includes, for example, the data protection device as described above, for implementing the data protection method described above.
FIG. 11 shows an apparatus diagram of a computer system according to an embodiment of the invention. As shown in fig. 11, the computer system according to the embodiment of the present invention includes a data protection apparatus 10 and a host 20.
Specifically, the data protection apparatus 10 is connected with the host 20 to acquire data to be protected 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 acquire data to be protected and store the data to be protected as buffered data. The solid-state disk is connected with the buffer to obtain the buffer data/data to be protected and store the buffer 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 is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
While embodiments in accordance with the invention have been described above, these embodiments are not intended to be exhaustive or to limit the invention to the precise embodiments described. 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 embodiments with various modifications as are suited to the particular use contemplated. The invention is limited only by the claims and their full scope and equivalents.

Claims (13)

1. A method for protecting data, comprising:
acquiring data to be protected;
protecting the data to be protected by adopting a first RAID mode;
writing the data to be protected in the first RAID mode into a cache area and storing the data 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 and storing the cache data as storage data.
2. The data protection method according to claim 1, wherein the error tolerance rate of the first RAID method to the data to be protected is greater than the error tolerance rate of the second RAID method to 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 is check data generated when the data to be protected is protected by adopting the first RAID mode, the second check data is check data generated when the data to be protected is protected by adopting the second RAID mode, and the data volume of the first check data is larger than the data volume of the second check data.
3. The data protection method according to claim 2, wherein the first RAID scheme is a Block RAID of RAID 5;
the second RAID mode adopts a Page RAID of RAID 6.
4. The data protection method of claim 3, wherein the buffer area comprises a plurality of buffer groups, each of the buffer groups comprising a first parity 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 in each first protection data block;
according to the Block RAID of RAID5, obtaining first check data of each cache group from the data to be protected in each cache group, and storing the first check data of each cache group in a first check data Block in the cache group, wherein the first check data is used for checking RAID 5.
5. The data protection method according to claim 3, wherein the storage area includes a plurality of storage groups, each of the storage groups including two second check-up data pages and a plurality of second protection data pages;
the protecting the cache data by adopting the second RAID mode, and writing the cache data protected by the second RAID mode into a storage area includes:
writing the data to be protected in the cache region into each second protection data page;
according to the Page RAID of RAID6, obtaining second check-up data of each storage group from the data to be protected in each storage group, and storing the second check-up data of each storage group in a second check-up data Page in each storage group, wherein the second check-up data is used for checking RAID 6.
6. The data protection method according to claim 1, wherein after the data to be protected in the first RAID mode is written into a cache area and stored as cache data, the data protection method further comprises:
acquiring the data volume of the cache data in the cache region; and
and after the data volume of the cache data in the cache region reaches a set threshold value, 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.
7. The data protection method according to any one of claims 1 to 6, wherein the buffer area comprises SLC memory cells, and the storage area comprises MLC memory cells or TLC memory cells or QLC memory cells.
8. The data protection method according to any one of claims 1 to 6, wherein the cache data and the storage data are stored in the same solid-state disk.
9. The data protection method according to claim 3, wherein in case of a programming failure in writing the data to be protected into the buffer area, the data protection method further comprises:
and restoring the data to be protected which fails to be programmed according to the Block RAID of the RAID5, and writing the restored data to be protected into the cache area again.
10. A data protection device, comprising:
the cache region is used for storing data to be protected and protecting the data to be protected by adopting a first RAID mode; and
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.
11. The data protection device of claim 10, wherein the buffer comprises a plurality of buffer groups, each of the buffer groups comprising a first parity 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 by the data to be protected according to a Block RAID of RAID5, wherein the first check data is used for checking of RAID 5;
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 a Page RAID of RAID6, wherein the second check data is used for checking of RAID 6.
12. The data protection device of claim 10, further comprising:
the threshold unit is used for acquiring the data volume of the cache data in the cache region and sending a storage instruction after the data volume of the cache data in the cache region reaches a set threshold; the storage instruction is used for controlling the cache data in the cache region to be written into the storage region; and
and the recovery unit is used for recovering the data to be protected which fails to be programmed according to the Block RAID of the RAID5 under the condition that the data to be protected fails to be programmed when being written into the cache area, and writing the recovered data to be protected into the cache area again.
13. A computer system, comprising:
a host; and
a data protection apparatus as claimed in any one of claims 10 to 12, 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 true CN113420341A (en) 2021-09-21
CN113420341B 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 (8)

* 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
US20100095150A1 (en) * 2007-06-13 2010-04-15 Fujitsu Limited Raid-group converting apparatus and method
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
US20160188211A1 (en) * 2014-12-30 2016-06-30 International Business Machines Corporation Optimizing thin provisioning in a data storage system through selective use of multiple grain sizes
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

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100095150A1 (en) * 2007-06-13 2010-04-15 Fujitsu Limited Raid-group converting apparatus and method
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
US20160188211A1 (en) * 2014-12-30 2016-06-30 International Business Machines Corporation Optimizing thin provisioning in a data storage system through selective use of multiple grain sizes
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
卜海兵 等: "《数据存储、恢复与安全应用实践》", 31 May 2012, 中国铁道出版社, pages: 363 - 365 *

Also Published As

Publication number Publication date
CN113420341B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
US11042441B2 (en) Stripe mapping in memory
EP3696676B1 (en) Memory system with multiple striping of raid groups and method for performing the same
US8589761B2 (en) Apparatus and methods for providing data integrity
KR101448192B1 (en) Memory Management System and Method
EP2732373B1 (en) Method and apparatus for flexible raid in ssd
US8438455B2 (en) Error correction in a solid state disk
US10353614B2 (en) Raid system and method based on solid-state storage medium
US7984325B2 (en) Storage control device, data recovery device, and storage system
US9086983B2 (en) Apparatus and methods for providing data integrity
US20140068319A1 (en) Error Detection And Correction In A Memory System
JP6175684B2 (en) Architecture for storage of data on NAND flash memory
KR101679530B1 (en) Selection of redundant storage configuration based on available memory space
US20090172335A1 (en) Flash devices with raid
US11010076B2 (en) Memory system with multiple striping of raid groups and method for performing the same
US10915394B1 (en) Schemes for protecting data in NVM device using small storage footprint
US8074113B2 (en) System and method for data protection against power failure during sector remapping
US9424131B2 (en) Spatially decoupled redundancy schemes for a solid state drive (SSD)
US20100138603A1 (en) System and method for preventing data corruption after power failure
CN113420341B (en) Data protection method, data protection equipment and computer system
US11455118B1 (en) Method for redundant array of independent disks striping against programming failures and apparatus thereof
US20220254435A1 (en) Semiconductor storage device and error processing method for defective memory cell in the device

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