RAID level migration method and device, chip, electronic equipment, storage medium and computer program method
By using the TP-RAID check information to generate RAID55 check information XOR during the RAID level migration process and optimizing the data area division, the problems of slow migration speed and low efficiency in the existing technology are solved, and fast and efficient level migration is achieved.
Patent Information
- Application Number
- CN202510698947.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-19
AI Technical Summary
In the prior art, when reducing the RAID level from TP-RAID to RAID55, all data information needs to be read and written twice, resulting in slow migration speed and low efficiency, and significant performance loss.
By performing an XOR operation on the three check information of TP-RAID, the second check information of RAID55 is generated, and the data area is divided into two groups. The third check information is determined based on the grouped data information and the check information. Only half of the data information needs to be read at a time, reducing the amount of data reading and writing.
It improves the speed and efficiency of RAID level migration, significantly reduces performance loss, and achieves a fast level migration process.
Smart Images

Figure CN120669906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a RAID level migration method, device, chip, electronic device, storage medium, and computer program method. Background Art
[0002] RAID (Redundant Arrays of Independent Disks (RAID) refers to a disk array with redundancy. A disk array is created by combining multiple independent disks to create a large-capacity disk group. RAID storage technology can greatly increase storage capacity, improve the system's input and output request processing capabilities, and enhance data reliability through distributed data storage, parallel access, and information redundancy. In the field of RAID, user needs necessitate migrating RAID levels. For example, TP-RAID involves downgrading TP-RAID to RAID 5, RAID 6, or RAID 55. Currently, downgrading the RAID level from TP-RAID to RAID 55 can only be achieved through recoding. Recoding requires reading and writing all data twice, making the migration process extremely slow and inefficient, with significant performance loss. Summary of the Invention
[0003] The present application provides a RAID level migration method, device, chip, electronic device, storage medium and computer program method.
[0004] In one aspect, an embodiment of the present application provides a RAID level migration method, which is applied to a RAID, wherein the RAID includes at least one stripe, and the stripe includes three parity areas and at least two data areas. The method includes:
[0005] In response to a level migration instruction issued by a user, determining second parity information of the stripe based on three first parity information of the stripe, where the first parity information is read from the parity area of the stripe;
[0006] determining two third parity information corresponding to the two data region groups based on data information in any one data region group of the stripe and the three first parity information, the stripe including two data region groups, the two data region groups being obtained by dividing the at least two data regions of the stripe;
[0007] The second check information and the two third check information of the stripe are stored in the three check areas of the stripe respectively.
[0008] The determining the second parity information of the stripe based on the three first parity information of the stripe includes:
[0009] Reading three pieces of first verification information of the stripe from the three verification areas of the stripe;
[0010] An exclusive OR operation is performed on the three first check information of the stripe to obtain the second check information of the stripe.
[0011] The determining of two third verification information corresponding to the two data region groups based on the data information in any one data region group of the stripe and the three first verification information includes:
[0012] Reading data information in any data area group of the stripe;
[0013] determining third verification information corresponding to the group of data region groups based on the data information in the group of data region groups;
[0014] The third parity information corresponding to another group of data region groups of the stripe is determined based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups.
[0015] The data region group includes at least one data region, and determining the third verification information corresponding to the data region group based on the data information in the data region group includes:
[0016] Acquire first location information corresponding to the data region in the data region group, where the first location information is determined based on a storage region to which the data region belongs;
[0017] The third verification information corresponding to the group of data region groups is determined based on the data information in the at least one data region in the group of data region groups and the corresponding first position information.
[0018] The determining of the third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups includes:
[0019] Obtaining second position information of third verification information corresponding to the data region group, where the second position information is determined based on a storage region to which a verification region corresponding to the third verification information belongs;
[0020] Obtaining third position information of the three first verification information of the stripe, where the third position information is determined based on a storage area to which a verification area corresponding to the first verification information belongs;
[0021] The third parity information corresponding to another data region group of the stripe is determined based on the three first parity information of the stripe, the third position information, the third parity information corresponding to the group of data region groups, and the second position information.
[0022] The storing of the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively includes:
[0023] Obtaining a storage area type of a storage area to which the check area of the stripe belongs;
[0024] The second parity information and the two third parity information of the stripe are stored in the three parity areas of the stripe respectively based on the storage area type.
[0025] The storing, based on the storage area type, the second check information and the two third check information of the stripe into the three check areas of the stripe respectively includes:
[0026] storing the second check information of the stripe in a first check area in the stripe, where the first check area is a check area in the stripe whose storage area is of a first storage area type;
[0027] The two third verification information of the stripe are respectively stored in the second verification area in the stripe, the second verification area is a verification area in the stripe whose storage area is of the second storage area type, and the read and write performance of the second storage area type storage area is higher than the read and write performance of the first storage area type storage area.
[0028] Another aspect of the present application provides a RAID level migration device, comprising:
[0029] a read / write module, configured to, in response to a level migration instruction issued by a user, determine second parity information of the stripe based on three first parity information of the stripe, wherein the first parity information is read from the parity area of the stripe;
[0030] a calculation module, configured to determine two pieces of third parity information corresponding to the two data region groups based on data information in any one of the data region groups of the stripe and the three pieces of first parity information, the stripe including two data region groups, the two data region groups being obtained by dividing the at least two data regions of the stripe;
[0031] The read / write module is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively.
[0032] The read / write module is further configured to read three pieces of first verification information of the stripe from the three verification areas of the stripe;
[0033] The calculation module is further configured to perform an exclusive OR operation on the three first check information of the stripe to obtain the second check information of the stripe.
[0034] Wherein, the read / write module is further used to read data information in any group of data area groups of the stripe;
[0035] The calculation module is further configured to determine third verification information corresponding to the data region group based on the data information in the data region group;
[0036] The calculation module is further configured to determine third verification information corresponding to another data region group of the stripe based on the three first verification information of the stripe and the third verification information corresponding to the group of data region groups.
[0037] The read / write module is further configured to obtain a storage area type of a storage area to which the check area of the stripe belongs;
[0038] The read / write module is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively based on the storage area type.
[0039] Another aspect of an embodiment of the present application provides a chip, the chip including a processor, and the processor capable of executing the RAID level migration method.
[0040] Another aspect of an embodiment of the present application provides an electronic device, the electronic device includes a chip, the chip includes a processor, and the processor is capable of executing the RAID level migration method.
[0041] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the RAID level migration method.
[0042] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, for causing a processor to execute and implement the RAID level migration method provided in the embodiment of the present application.
[0043] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, in which:
[0045] In the drawings, the same or corresponding reference numerals denote the same or corresponding parts.
[0046] Figure 1 A flowchart of a RAID level migration method according to an embodiment of the present application is shown;
[0047] Figure 2 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0048] Figure 3 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0049] Figure 4 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0050] Figure 5 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0051] Figure 6 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0052] Figure 7 A flowchart of a RAID level migration method according to another embodiment of the present application is shown;
[0053] Figure 8 A schematic structural diagram of a RAID level migration device according to an embodiment of the present application is shown;
[0054] Figure 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0055] In order to make the purpose, features, and advantages of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0056] The solution of the present application is used to migrate TP-RAID (Triple Parity RAID, a RAID level) to RAID55 (a RAID level).
[0057] TP-RAID uses three global parity disks to store one copy of global parity data each. All three copies of global parity data are encoded based on the data stored on the data disks. If a disk error occurs, up to three faulty disks can be recovered simultaneously.
[0058] For example, a TP-RAID consists of k storage devices, including three global parity disks (storage devices that store global parity data) and k-3 data disks (storage devices that store storage data). The three copies of global parity data are p, q, and r. The three copies of global parity data p, q, and r can be determined using the storage data stored on the k-3 data disks and the following formulas (1), (2), and (3).
[0059]
[0060] in, is the XOR operation, d i is the storage data in the i-th data disk, v i is the location information of the i-th storage device.
[0061] When a disk error occurs, decoding can be performed using the stored data in the non-error disk, the global check data, and the above formulas (1), (2), and (3), thereby being able to simultaneously recover data in up to three error disks.
[0062] RAID 55 uses one global parity disk to store one copy of global parity data, and two local parity disks to store one copy of local parity data. The global parity data is encoded based on the data stored on the data disks. By dividing the data disks into two groups, the two local parity data are encoded based on the data stored on the data disks in the corresponding group. If a disk error occurs, up to two disks can be recovered simultaneously, and in some cases, up to three disks can be recovered simultaneously.
[0063] For example, a total of k storage devices form a RAID-55, including one global parity disk (a storage device that stores global parity data), two local parity disks, and k-3 data disks (storage devices that store storage data). The one global parity data is p', and the two local parity data are l0 and l1. The k-3 data disks are divided into two groups of data disks, each group of data disks corresponding to one local parity data. The one global parity data is p', and the two local parity data are l0 and l1, which can be determined from the storage data stored in the k-3 data disks and the following formulas (4), (5), and (6).
[0064]
[0065] in, is the XOR operation, d i is the storage data in the i-th data disk, v i is the location information of the i-th storage device, d1…d j For the first set of data disks in RAID55, d j+1 …d k-3 For the second set of data disks in RAID55, j <k-3。
[0066] When a disk error occurs, decoding can be performed using the stored data in the non-error disk, the above formulas (1), (2), (3), and the local check data and / or the global check data, thereby being able to simultaneously recover the data in any two error disks, and in some cases, the data in any three error disks. Specifically, some cases include all cases except the following two:
[0067] Type 1: The three faulty disks all belong to the same data disk group;
[0068] The second type: One of the three faulty disks is a global parity disk, and the other two belong to the same data disk group.
[0069] In order to quickly convert the RAID level from TP-RAID to RAID-55 after the user issues a level migration instruction, an embodiment of the present application provides a RAID level migration method, which is applied to a RAID, wherein the RAID includes at least one stripe, and the stripe includes three check areas and at least two data areas, such as Figure 1 As shown, the method includes:
[0070] Step 101 : In response to a level migration instruction issued by a user, second parity information of the stripe is determined based on three first parity information of the stripe, where the first parity information is read from the parity area of the stripe.
[0071] In RAID, a storage area is divided into fixed-size regions (data regions or parity regions) and distributed across multiple storage areas. A stripe consists of contiguous data regions and / or parity regions distributed across multiple storage areas.
[0072] When the user issues a level migration instruction, it is determined that the user needs to migrate the RAID level from TP-RAID to RAID-55. Then, the three first verification information in each stripe (global verification information of TP-RAID) are obtained. Based on formula (1) and formula (4), if the data in the data area are the same, then Therefore, the second verification information (global verification information) of the stripe RAID-55 can be determined based on the three first verification information of the TP-RAID in each stripe using formula (7).
[0073] For example, as shown in Table 1, Table 1 shows a RAID that includes 8 storage devices and performs disk flushing in a left-handed non-aligned manner. 8 stripes are set, and each stripe has 3 parity areas and 5 data areas. The second verification information p1 of stripe 1 is determined based on the three first verification information p1, q1, and r1 of stripe 1. ′ 1. Determine the second verification information p2 of stripe 2 based on the three first verification information p2, q2 and r2 of stripe 2 ′ 2. Determine the second verification information p3 of stripe 3 based on the three first verification information p3, q3 and r3 of stripe 3 ′ 3. Determine the second verification information p of stripe 4 based on the three first verification information p4, q4 and r4 of stripe 4 ′ 4. Determine the second verification information p5 of stripe 5 based on the three first verification information p5, q5 and r5 of stripe 5 ′ 5. Determine the second verification information p6 of stripe 6 based on the three first verification information p6, q6 and r6 of stripe 6 ′ 6. Determine the second verification information p7 of stripe 7 based on the three first verification information p7, q7 and r7 of stripe 7 ′ 7. Determine the second verification information p of stripe 8 based on the three first verification information p8, q8 and r8 of stripe 8 ′ 8.
[0074]
[0075]
[0076] Table 1
[0077] Step 102: Determine two third verification information corresponding to the two data area groups based on the data information in any one data area group of the stripe and the three first verification information, wherein the stripe includes two data area groups, and the two data area groups are obtained by dividing the at least two data areas of the stripe.
[0078] The data area of each stripe is divided into two data area groups, and then two third verification information (local verification information) corresponding to the two data area groups are determined based on the data information in any group of data area groups and the three first verification information.
[0079] In this embodiment, there are two methods for determining two third verification information corresponding to two data region groups based on the data information in any grouped data region group and the three first verification information:
[0080] The first method is to use formula (5) to determine the third check information l0 of the first data region group based on the data information in the first data region group in the stripe. Based on formula (5) and formula (6), we can get Based on formula (2) and formula (8), if the data in the data area are the same, then The third parity information l1 of the second data region group of the stripe is determined based on the three first parity information of the stripe and the third parity information l0 of the first data region group using formula (9).
[0081] The second method is to first use formula (5) to determine the third check information l1 of the second data area group based on the data information in the second data area group in the stripe. Based on formula (5) and formula (6), we can get Based on formula (2) and formula (8), if the data in the data area are the same, then The third parity information l0 of the first data region group of the stripe is determined based on the three first parity information of the stripe and the third parity information l1 of the second data region group using formula (9).
[0082] Continuing with the above example, if the data area of stripe 1 is divided into two groups, the first group is d1, d2 and d3, and the second group is d4 and d5. Then, using formula (5), the third parity information of stripe 1 is determined based on the data information in d1, d2 and d3. Then using formula (9), based on the three first check information p1, q1 and r1 of stripe 1 and the third check information of the first group Determine the third verification information of the second group The subsequent strips are the same as the above method and will not be described again here.
[0083] Step 103: Store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively.
[0084] The second check information and two third check information of each stripe are stored in the three check areas of each stripe respectively.
[0085] Continuing with the above example, the second parity information and two third parity information for each stripe are stored in the three parity areas of each stripe, as shown in Table 2. After storage, the RAID level is successfully migrated to RAID 55. The parity areas that originally stored the three first parity information for TP-RAID are now used to store the second parity information and two third parity information for RAID 55.
[0086]
[0087]
[0088] Table 2
[0089] It should be noted that the data area division and the storage locations of the second verification information and the third verification information mentioned in the above examples are just examples, and the specific method can be set based on user needs. i is the serial number of the storage device to which the corresponding data area or parity area belongs. For the TP-RAID shown in Table 1, v1 in formula (2) is the serial number of the storage device to which d1 belongs, that is, 1. The solution of this embodiment is applicable to RAIDs that perform disk flushing in the following ways: left-hand misalignment, left-hand alignment, right-hand alignment, or left-hand misalignment.
[0090] In the above scheme, by reusing the three first check information (global check information) and data information of the original TP-RAID in each stripe, the RAID level is quickly migrated from TP-RAID to RAID55. The second check information (global check information) of RAID55 of each stripe is directly generated by the three first check information of the original TP-RAID in the stripe through an exclusive OR operation, without the need to reread any data information. When determining the third check information (local check information) of RAID55, the data area of the stripe is divided into two groups, and the data information in any one data area group is first read to determine the third check information of the group, while the third check information of the other data area group does not need to read any data information again. The third check information of the other data area group can be determined by the three first check information of the original TP-RAID in the stripe and the third check information of the determined data area group, thereby controlling the data reading amount to at most half of the data information. The traditional solution requires re-encoding, which requires two full reads and writes of data information, and is compressed to a single read of up to half of the data information, improving migration speed and efficiency and significantly reducing performance loss.
[0091] In an example of this application, a RAID level migration method is also provided. Figure 2 As shown, the determining the second parity information of the stripe based on the three first parity information of the stripe includes:
[0092] Step 201 : Read three pieces of first verification information of the stripe from the three verification areas of the stripe.
[0093] For example, in the RAID shown in Table 1, the three pieces of first verification information p1, q1, and r1 of stripe 1 are read from stripe 1. The three pieces of first verification information p2, q2, and r2 of stripe 2 are read from stripe 2. The three pieces of first verification information p3, q3, and r3 of stripe 3 are read from stripe 3. The three pieces of first verification information p4, q4, and r4 of stripe 4 are read from stripe 4. The three pieces of first verification information p5, q5, and r5 of stripe 5 are read from stripe 5. The three pieces of first verification information p6, q6, and r6 of stripe 6 are read from stripe 6. The three pieces of first verification information p7, q7, and r7 of stripe 7 are read from stripe 7. The three pieces of first verification information p8, q8, and r8 of stripe 8 are read from stripe 8.
[0094] Step 202: Perform an XOR operation on the three first check information of the stripe to obtain the second check information of the stripe.
[0095] Following the above example, based on formula (7), the second verification information of stripe 1 is determined as Second verification information of stripe 2 Second verification information of stripe 3 Second verification information of stripe 4 Second verification information of stripe 5 Second verification information of stripe 6 Second verification information of stripe 7 Second verification information of stripe 8
[0096] In the above scheme, based on formulas (1) and (4), as well as the characteristics of the XOR operation, it can be seen that the second verification information of each stripe is equal to the value of the three first verification information of the original TP-RAID of the stripe after the XOR operation. Therefore, the second verification information of each stripe RAID55 can be determined without reading any data information.
[0097] In an example of this application, a RAID level migration method is also provided. Figure 3 As shown, the determining of two third verification information corresponding to the two data region groups based on the data information in any one data region group of the stripe and the three first verification information includes:
[0098] Step 301: Read data information in any data area group of the stripe.
[0099] For example, in the RAID shown in Table 1, the data area of stripe 1 is divided into two groups: the first group consists of d1, d2, and d3, and the second group consists of d4 and d5. Data in d1, d2, and d3 in the first group can be read, as can data in d4 and d5 in the second group. The data area of stripe 2 is divided into two groups: the first group consists of d10, d6, and d7, and the second group consists of d8 and d9. Data in d10, d6, and d7 in the first group can be read, as can data in d8 and d9 in the second group. The data area of stripe 3 is divided into two groups: the first group consists of d14, d15, and d11, and the second group consists of d12 and d13. Data in d14, d15, and d11 in the first group can be read, as can data in d12 and d13 in the second group. The data area of stripe 4 is divided into two groups: the first group consists of d18, d19, and d20, and the second group consists of d16 and d17. Data in d18, d19, and d20 in the first group can be read, as can data in d16 and d17 in the second group. The data area of stripe 5 is divided into two groups: the first group consists of d23, d24, and d25, and the second group consists of d21 and d22. Data in d23, d24, and d25 in the first group can be read, as can data in d21 and d22 in the second group. The data area of stripe 6 is divided into two groups: the first group consists of d28, d29, and d30, and the second group consists of d26 and d27. Data in d28, d29, and d30 in the first group can be read, as can data in d26 and d27 in the second group. The data area of stripe 7 is divided into two groups: the first group consists of d33, d34, and d35, and the second group consists of d31 and d32. Data in d33, d34, and d35 in the first group can be read, as can data in d31 and d32 in the second group. The data area of stripe 8 is divided into two groups: the first group consists of d37, d38, and d39, and the second group consists of d40 and d36. Data in d37, d38, and d39 in the first group can be read, as can data in d40 and d36 in the second group. Of course, for each stripe, the group with the least total data is read first.
[0100] Step 302: Determine third verification information corresponding to the data region group based on the data information in the data region group.
[0101] For the data information in a group of data region groups read, the third verification information corresponding to the group of data region groups is determined using formula (5).
[0102] Continuing with the above example, if the amount of data information in each data area is the same, then read the second group in stripe 1, i.e., d4 and d5, and determine the third parity information of stripe 1 based on the data information in d4 and d5. Read the second group in stripe 2, i.e., d8 and d9, and determine the third parity information of stripe 2 based on the data information in d8 and d9 Read the second group in stripe 3, i.e., d12 and d13, and determine the third parity information of stripe 3 based on the data information in d12 and d13 Read the second group in stripe 4, i.e., d16 and d17, and determine the third parity information of stripe 4 based on the data information in d16 and d17 Read the second group in stripe 5, i.e., d21 and d22, and determine the third check information of stripe 5 based on the data information in d21 and d22 Read the second group in stripe 6, i.e. d26 and d27, and determine the third check information of stripe 6 based on the data information in d26 and d27 Read the second group in stripe 7, namely d31 and d32, and determine the third check information of stripe 7 based on the data information in d31 and d32 Read the second group in stripe 8, i.e. d40 and d36, and determine the third check information of stripe 8 based on the data information in d40 and d36
[0103] Step 303 : Determine third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups.
[0104] Based on formula (5) and formula (6), we can know formula (8) And formula (2) is Therefore, in each stripe, when the data information remains unchanged, formula (9) can be obtained, that is, Based on formula (9), the third parity information corresponding to another data region group of the stripe can be determined based on the three first parity information of the original TP-RAID of each stripe and the third parity information corresponding to any one data region group.
[0105] Continuing with the above example, based on the three first check information p1, q1, r1 of stripe 1 and the third check information of the second group of data areas Determine the third parity information of the first data region group of stripe 1 Based on the three first parity information p2, q2 and r2 of stripe 2 and the third parity information of the second group of data areas Determine the third parity information of the first data area group of stripe 2 Based on the three first parity information p3, q3 and r3 of stripe 3 and the third parity information of the second group of data areas Determine the third parity information of the first data area group of stripe 3 Based on the three first parity information p4, q4 and r4 of stripe 4 and the third parity information of the second group of data areas Determine the third check information of the first data area group of stripe 4 Based on the three first parity information p5, q5 and r5 of stripe 5 and the third parity information of the second group of data areas Determine the third parity information of the first data area group of stripe 5 Based on the three first parity information p6, q6 and r6 of stripe 6 and the third parity information of the second group of data areas Determine the third parity information of the first data area group of stripe 6 Based on the three first parity information p7, q7 and r7 of stripe 7 and the third parity information of the second group of data areas Determine the third check information of the first data area group of stripe 7 Based on the three first parity information p8, q8 and r8 of stripe 8 and the third parity information of the second group of data areas Determine the third check information of the first data area group of stripe 8
[0106] In the above scheme, when determining the third check information of RAID55, the data area of the stripe is divided into two groups. The data information in any one data area group is first read to determine the third check information of the group, while the third check information of the other data area group does not need to read any data information again. The third check information of the other data area group can be determined by the three first check information of the original TP-RAID in the stripe and the third check information of the determined data area group, thereby controlling the data reading amount to at most half of the data information. The traditional scheme requires re-encoding, which requires two full reads and writes of data information, and is compressed to only a single read of at most half of the data information, thereby improving the migration speed and efficiency and significantly reducing performance loss.
[0107] In an example of this application, a RAID level migration method is also provided. Figure 4 As shown, the data region group includes at least one data region, and determining the third verification information corresponding to the data region group based on the data information in the data region group includes:
[0108] Step 401: Acquire first location information corresponding to the data region in the data region group, where the first location information is determined based on the storage region to which the data region belongs.
[0109] As shown in Table 1, for the TP-RAID, the first location information v1 corresponding to d1 is the serial number 1 of the storage device to which d1 belongs.
[0110] Step 402: Determine third verification information corresponding to the data region group based on the data information in the at least one data region in the data region group and the corresponding first position information.
[0111] In the above solution, the inclusion of the first position information corresponding to the data region further optimizes the parity information generation logic. When determining the first third parity information in a stripe, calculations are performed based on the storage device serial number and data information of each data region in any data region group, correlating the data distribution with the data information. Generating parity information for that data region group is completed solely with the first position information and data information corresponding to that data region.
[0112] In an example of this application, a RAID level migration method is also provided. Figure 5 As shown, determining the third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups includes:
[0113] Step 501 : obtaining second position information of third verification information corresponding to the data region group, wherein the second position information is determined based on a storage region to which a verification region corresponding to the third verification information belongs.
[0114] It is necessary to first determine the check area storing the second check information and two pieces of third check information in the stripe, and then obtain the second position information of the third check information in the entry.
[0115] As shown in Table 2, RAID55 Corresponding second location information That is The serial number of the storage device to which it belongs is 5.
[0116] Step 502 : Acquire third position information of the three first verification information of the stripe, where the third position information is determined based on the storage area to which the verification area corresponding to the first verification information belongs.
[0117] As shown in Table 1, the third position information v corresponding to TP-RAID p1 p1 , which is the serial number 4 of the storage device to which p1 belongs.
[0118] Step 503 : Determine third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe, the third position information, the third parity information corresponding to the group of data region groups, and the second position information.
[0119] In the above solution, the verification information generation logic is further optimized by introducing the second position relationship of the third verification information and the third position information of the first verification information. When generating the third verification information for another data area group, the third position information of the original TP-RAID first verification information is directly associated with the first verification information, and the third verification information is associated with the second position information. Finally, this information is used to determine the third verification information for the other data area group. This avoids the multiple cross-storage area searches required to obtain complete data in traditional solutions, and only the two third verification information for each entry can be determined based on the position information. This further reduces system resource consumption and improves the speed and efficiency of the overall migration.
[0120] In an example of this application, a RAID level migration method is also provided. Figure 6 As shown, storing the second check information and the two third check information of the stripe into the three check areas of the stripe respectively includes:
[0121] Step 601: Obtain the storage area type of the storage area to which the check area of the stripe belongs.
[0122] In this embodiment, the storage area type may represent conditions such as the read and write speed of the storage area, the failure rate of the storage area, etc. In other implementations, the storage area type may represent any other conditions.
[0123] Step 602: Store the second check information and the two third check information of the stripe into the three check areas of the stripe respectively based on the storage area type.
[0124] The second parity information and two third parity information of the stripe are stored in three parity areas of the stripe respectively based on the storage area type.
[0125] For example, the storage area type represents the read and write speed of the storage area, and the third verification information is preferentially stored in a verification area of the storage area with a faster read and write speed.
[0126] For another example, the storage area type represents the failure rate of the storage area, and the third verification information is preferentially stored in a verification area of a storage area with a lower failure rate.
[0127] In the above solution, by optimizing the storage layout of verification information based on storage area type, the overall efficiency of the storage system is significantly improved. Based on indicators such as the read / write speed or failure rate of the storage area to which the verification area belongs, frequently accessed third verification information is preferentially stored in high-speed storage areas or low-failure-rate storage areas, ensuring rapid response to verification requests for high-frequency data. This optimizes the overall resource allocation of the storage array, enabling the system to balance performance, cost, and stability over long-term operation.
[0128] In an example of this application, a RAID level migration method is also provided. Figure 7 As shown, storing the second check information and the two third check information of the stripe into the three check areas of the stripe respectively based on the storage area type includes:
[0129] Step 701: Store the second check information of the stripe into a first check area in the stripe, where the first check area is a check area in the stripe whose storage area is of a first storage area type.
[0130] Step 702: Store the two third verification information of the stripe into the second verification area in the stripe respectively. The second verification area is a verification area of the second storage area type storage area in the stripe. The read and write performance of the second storage area type storage area is higher than the read and write performance of the first storage area type storage area.
[0131] When the three parity areas of the stripe include the first parity area and the second parity area, the third parity information is preferentially stored in the second parity area of the storage area having higher read / write performance.
[0132] For example, as shown in Table 3, the three parity areas of stripe 1 belong to storage device 4 (second storage area type), storage device 5 (first storage area type) and storage device 6 (second storage area type), so the two third parity information of stripe 1 are and The second verification information is stored in two storage devices of the second storage area type, storage device 4 and storage device 6, respectively, and the second verification information is stored in storage device 5. Subsequent stripes are the same as the above method, which will not be repeated here.
[0133]
[0134]
[0135] Table 3
[0136] In this solution, frequently accessed third verification information is prioritized for storage in high-speed storage areas based on the read and write speeds of the storage areas to which the verification area belongs, ensuring rapid response to verification requests for frequently accessed data. This optimizes the overall resource allocation of the storage array, enabling the system to balance performance, cost, and stability over long-term operation.
[0137] In order to implement the above RAID level migration method, such as Figure 8 As shown, an example of the present application provides a RAID level migration device, including:
[0138] The read / write module 801 is configured to determine, in response to a level migration instruction issued by a user, second parity information of the stripe based on three first parity information of the stripe, where the first parity information is read from the parity area of the stripe;
[0139] a calculation module 802 configured to determine two pieces of third parity information corresponding to the two data region groups based on data information in any one of the data region groups of the stripe and the three pieces of first parity information, the stripe including two data region groups, the two data region groups being obtained by dividing the at least two data regions of the stripe;
[0140] The read / write module 801 is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively.
[0141] The read / write module 801 is further configured to read three pieces of first verification information of the stripe from the three verification areas of the stripe;
[0142] The calculation module 802 is further configured to perform an XOR operation on the three pieces of first check information of the stripe to obtain the second check information of the stripe.
[0143] The read / write module 801 is further configured to read data information in any data region group of the stripe;
[0144] The calculation module 802 is further configured to determine third verification information corresponding to the data region group based on the data information in the data region group;
[0145] The calculation module 802 is further configured to determine third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups.
[0146] The data region group includes at least one data region, and the read / write module 801 is further configured to obtain first location information corresponding to the data region in the data region group, where the first location information is determined based on the storage region to which the data region belongs;
[0147] The calculation module 802 is further configured to determine third verification information corresponding to the data region group based on the data information in the at least one data region in the data region group and the corresponding first position information.
[0148] The read / write module 801 is further configured to obtain second position information of the third verification information corresponding to the data region group, wherein the second position information is determined based on the storage region to which the verification region corresponding to the third verification information belongs;
[0149] The read / write module 801 is further configured to obtain third position information of the three first verification information of the stripe, where the third position information is determined based on a storage area to which a verification area corresponding to the first verification information belongs;
[0150] The calculation module 802 is further configured to determine the third verification information corresponding to another data region group of the stripe based on the three first verification information of the stripe, the third position information, the third verification information corresponding to the group of data region groups, and the second position information.
[0151] The read / write module 801 is further configured to obtain a storage area type of a storage area to which the check area of the stripe belongs;
[0152] The read / write module 801 is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively based on the storage area type.
[0153] The read / write module 801 is further configured to store the second check information of the stripe into a first check area in the stripe, where the first check area is a check area in the stripe whose storage area is of a first storage area type;
[0154] The read-write module 801 is also used to store the two third verification information of the stripe into the second verification area in the stripe respectively. The second verification area is a verification area in the stripe whose storage area is of the second storage area type. The read and write performance of the second storage area type storage area is higher than the read and write performance of the first storage area type storage area.
[0155] An embodiment of the present application further provides a chip, which includes a processor capable of executing the RAID level migration method provided in the embodiment of the present application.
[0156] An embodiment of the present application also provides an electronic device.
[0157] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0158] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0159] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0160] The computing unit 901 may be a variety of general and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the RAID level migration method. For example, in some embodiments, the RAID level migration method may be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the RAID level migration method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the RAID level migration method in any other appropriate manner (e.g., by means of firmware).
[0161] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein a computer program is stored therein, and the computer program is used to execute the RAID level migration method provided by the embodiment of the present application.
[0162] An embodiment of the present application provides a computer program product, comprising a computer program or instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or instructions from the computer-readable storage medium and executes the computer program or instructions, causing the computer device to perform the RAID level migration method described above in the embodiment of the present application.
[0163] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
[0164] In some embodiments, a computer program may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and it may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0165] By way of example, a computer program may be deployed to be executed on one computing device or on multiple computing devices at one site or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0166] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0167] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0168] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0170] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0171] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0172] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0173] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features being referred to. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout the present disclosure, "plurality" means two or more, unless otherwise specifically defined.
[0174] The above description is merely a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A RAID level migration method, applied to a RAID, wherein the RAID includes at least one stripe, the stripe including three parity areas and at least two data areas, the method comprising: In response to a level migration instruction issued by a user, determining second parity information of the stripe based on three first parity information of the stripe, where the first parity information is read from the parity area of the stripe; determining two third parity information corresponding to the two data region groups based on data information in any one data region group of the stripe and the three first parity information, the stripe including two data region groups, the two data region groups being obtained by dividing the at least two data regions of the stripe; The second check information and the two third check information of the stripe are stored in the three check areas of the stripe respectively.
2. The method according to claim 1 , wherein determining the second parity information of the stripe based on the three first parity information of the stripe comprises: Reading three pieces of first verification information of the stripe from the three verification areas of the stripe; An exclusive OR operation is performed on the three first check information of the stripe to obtain the second check information of the stripe.
3. The method according to claim 1 , wherein determining two third parity information corresponding to the two data region groups based on the data information in any one data region group of the stripe and the three first parity information comprises: Reading data information in any data area group of the stripe; determining third verification information corresponding to the group of data region groups based on the data information in the group of data region groups; The third parity information corresponding to another group of data region groups of the stripe is determined based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups.
4. The method according to claim 3, wherein the data region group includes at least one data region, and determining the third verification information corresponding to the data region group based on the data information in the data region group comprises: Obtaining first location information corresponding to the data region in the data region group, where the first location information is determined based on a storage region to which the data region belongs; The third verification information corresponding to the group of data region groups is determined based on the data information in the at least one data region in the group of data region groups and the corresponding first position information.
5. The method according to claim 3, wherein determining the third parity information corresponding to another data region group of the stripe based on the three first parity information of the stripe and the third parity information corresponding to the group of data region groups comprises: Obtaining second position information of third verification information corresponding to the data region group, where the second position information is determined based on a storage region to which a verification region corresponding to the third verification information belongs; Obtaining third position information of the three first verification information of the stripe, where the third position information is determined based on a storage area to which a verification area corresponding to the first verification information belongs; The third parity information corresponding to another data region group of the stripe is determined based on the three first parity information of the stripe, the third position information, the third parity information corresponding to the group of data region groups, and the second position information.
6. The method according to claim 1, wherein storing the second check information and the two third check information of the stripe into the three check areas of the stripe respectively comprises: Obtaining a storage area type of a storage area to which the check area of the stripe belongs; The second parity information and the two third parity information of the stripe are stored in the three parity areas of the stripe respectively based on the storage area type.
7. The method according to claim 6, wherein storing the second parity information and the two third parity information of the stripe into the three parity areas of the stripe based on the storage area type comprises: storing the second check information of the stripe in a first check area in the stripe, where the first check area is a check area in the stripe whose storage area is of a first storage area type; The two third verification information of the stripe are respectively stored in the second verification area in the stripe, the second verification area is a verification area in the stripe whose storage area is of the second storage area type, and the read and write performance of the second storage area type storage area is higher than the read and write performance of the first storage area type storage area.
8. A RAID level migration device, comprising: a read / write module, configured to, in response to a level migration instruction issued by a user, determine second parity information of the stripe based on three first parity information of the stripe, wherein the first parity information is read from the parity area of the stripe; a calculation module, configured to determine two pieces of third parity information corresponding to the two data region groups based on data information in any one of the data region groups of the stripe and the three pieces of first parity information, the stripe including two data region groups, the two data region groups being obtained by dividing the at least two data regions of the stripe; The read / write module is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively.
9. The apparatus according to claim 8, comprising: The read / write module is further configured to read three pieces of first verification information of the stripe from the three verification areas of the stripe; The calculation module is further configured to perform an exclusive OR operation on the three first check information of the stripe to obtain the second check information of the stripe.
10. The apparatus according to claim 8, comprising: The read / write module is further configured to read data information in any data area group of the stripe; The calculation module is further configured to determine third verification information corresponding to the data region group based on the data information in the data region group; The calculation module is further configured to determine third verification information corresponding to another data region group of the stripe based on the three first verification information of the stripe and the third verification information corresponding to the group of data region groups.
11. The apparatus according to claim 8, comprising: The read / write module is further configured to obtain a storage area type of a storage area to which the check area of the stripe belongs; The read / write module is further configured to store the second verification information and the two third verification information of the stripe into the three verification areas of the stripe respectively based on the storage area type.
12. A chip, characterized in that: The chip includes a processor, and the processor is capable of executing the RAID level migration method according to any one of claims 1 to 7.
13. An electronic device, characterized in that: The electronic device includes a chip, the chip includes a processor, and the processor is capable of executing the RAID level migration method according to any one of claims 1 to 7.
14. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the RAID level migration method according to any one of claims 1 to 7.
15. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the RAID level migration method according to any one of claims 1 to 7 is implemented.