Downgrade method, device and system from tp-raid to raid6

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

Patent Information

Application Number
CN202310542098.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2026-10-09
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

如图1所示的三块磁盘三个条带所组成的TP-RAID示意图,其中,p1 p2 p3,p4 p5 p6,p7 p8 p9分别为条带1、2、3运算得到的校验块,d1至d9为数据块,由TP-RAID降级至RAID6需要重新编码实现,如图2所示,首先需要抛弃所有的校验信息,然后对待迁移的数据块进行数据迁移,再重新读取所有的数据进行编码,这种数据迁移方式所需要迁移的数据量较大,导致降级速度较慢、损耗较大

Benefits of technology

[0041] This invention discloses a method, apparatus, system, and computer-readable storage medium for downgrading from TP-RAID to RAID6. The method includes: identifying the outermost disk in a disk group encoded in TP-RAID as the disk to be cleared; for each stripe, determining the position of one original parity block on the original TP-RAID as the position of the data block to be migrated after downgrading to RAID6, and determining the positions of the other two original parity blocks on the original TP-RAID as the positions of the new parity blocks after downgrading to RAID6; calculating the parity information of the new parity blocks based on the data information and parity information on the stripe; and writing the data block to be migrated and the parity information of the new parity blocks to disk in RAID6 mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116560574B_ABST
    Figure CN116560574B_ABST
Patent Text Reader

Abstract

The application discloses a kind of degradation method, device, system and computer readable storage medium from TP-RAID to RAID6, applied to disk array technical field, will be located in the most edge of the disk group coded in TP-RAID mode is determined as the disk to be emptied;For each strip, the position of one original check block on original TP-RAID is determined as the position of the data block to be migrated on the strip after being degraded to RAID6, the position of the other two original check blocks on original TP-RAID is used as the position of new check block after being degraded to RAID6;Based on the data information and check information on strip, the check information of new check block is calculated;The check information of the data block to be migrated and new check block is landed according to the mode of RAID6;The number of data blocks moved in the degradation from TP-RAID to RAID6 is less, and the data read / write amount is small, so as to improve the degradation speed and reduce the loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of disk array technology, and in particular to a method, apparatus, system, and computer-readable storage medium for downgrading from TP-RAID to RAID6. Background Technology

[0002] The basic idea of ​​RAID (Redundant Arrays of Independent Disks) technology is to combine multiple independent, relatively inexpensive, small-capacity disks into a logically unified disk array. This logical combination improves the performance of the entire array, achieving or even exceeding the performance of a single, more expensive disk of comparable capacity. In its implementation, RAID employs techniques such as declustering, striping, and interleaving, and increases data redundancy to ensure the reliability of the array and improve its overall fault tolerance.

[0003] RAID technology has been continuously improved since its inception. Due to different data application needs, technologies such as RAID 0, RAID 1, RAID 5, and RAID 6 have been proposed successively. Among them, RAID 5 uses distributed parity disks, with one parity stripe unit per stripe, and the position of the parity unit varies in different stripes. RAID 6 adds an extra parity disk compared to RAID 5, which is also distributed across each disk. Compared to RAID 5, RAID 6 reads or writes an additional copy of parity data simultaneously during write operations. However, because the operations are performed in parallel, it does not significantly affect read and write efficiency.

[0004] With technological advancements, increased disk lifespan, and larger data volumes stored in servers, RAID technology has gradually become insufficient to meet current storage demands. This has led to the need for TP-RAID (Three Parity Redundant Arrays of Independent Disks). Compared to RAID 5 and 6, TP-RAID, as the name suggests, supports RAID algorithms that can simultaneously handle three errors. While the core of TP-RAID is supporting RAID algorithms that handle three errors simultaneously, product implementation requires supporting multiple solutions for customers, with the ability to quickly migrate between different solutions.

[0005] Currently, the method for downgrading from TP-RAID to RAID6 is to remove one disk from the TP-RAID array. After removing the disk, the data is re-migrated based on a load balancing algorithm and then encoded. Figure 1 The diagram shows a TP-RAID array consisting of three disks and three stripes. p1, p2, p3, p4, p5, p6, p7, p8, and p9 are the parity blocks obtained from operations on stripes 1, 2, and 3, respectively. d1 to d9 are the data blocks. Downgrading from TP-RAID to RAID6 requires re-encoding, as shown below. Figure 2 As shown, firstly, all verification information needs to be discarded, then the data blocks to be migrated are migrated, and then all the data is re-read and encoded. This data migration method requires a large amount of data to be migrated, resulting in slow degradation speed and large loss.

[0006] Therefore, how to provide a method, apparatus, system, and computer-readable storage medium that can reduce the amount of data migration, reduce data reading, and quickly realize the downgrade from TP-RAID to RAID6 has become a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0007] The purpose of this invention is to provide a method, apparatus, system, and computer-readable storage medium for downgrading from TP-RAID to RAID6. During the downgrading process, the number of data blocks moved is small and the amount of data read is small, thereby improving the downgrading speed and reducing losses.

[0008] To address the aforementioned technical problems, embodiments of the present invention provide a method for downgrading from TP-RAID to RAID6, comprising:

[0009] The outermost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared;

[0010] For each stripe, the location of one original parity block on the original TP-RAID is determined as the location of the data block to be migrated on the stripe after being downgraded to RAID6, and the locations of the other two original parity blocks on the original TP-RAID are used as the locations of the new parity blocks after being downgraded to RAID6;

[0011] Based on the data and verification information on the strip, the verification information of the new verification block is calculated;

[0012] The verification information of the data block to be migrated and the new verification block is written to disk in RAID6 mode.

[0013] Optionally, determining the location of an original parity block on the original TP-RAID as the location of the data block to be migrated on the stripe after downgrading to RAID6 includes:

[0014] The location of the triple parity block on the original TP-RAID is determined as the location of the data block to be migrated on the stripe after being downgraded to RAID6.

[0015] Optionally, before calculating the check information of the new check block based on the data information and check information on the stripe, the method further includes:

[0016] Under load balancing, the (m+2)th stripe in every (m+3)th stripe of all stripes encoded in the original TP-RAID method is divided into a recalculation group;

[0017] The other strips in each m+3 stripe are divided into moving groups.

[0018] Optionally, calculating the check information of the new check block based on the data information and check information on the stripe includes:

[0019] For each stripe in the moving group, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID, calculate the parity information corresponding to each new parity block after the stripe is downgraded to RAID6;

[0020] For the stripes in the recalculation group, a downgraded RAID6 encoding method is used to perform load balancing disk writes and calculate the parity information of the new parity block.

[0021] Optionally, for each stripe in the moving group, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID, the calculation of the parity information corresponding to each new parity block after downgrading to RAID6 on the stripe includes:

[0022] For each stripe in the moving group, obtain the verification information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated;

[0023] Based on the first calculation formula, combined with the parity information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated, the parity information corresponding to each new parity block after the stripe is downgraded to RAID6 is calculated.

[0024] Optionally, determining the outermost disk in the TP-RAID-encoded disk group as the disk to be cleared includes:

[0025] The leftmost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared;

[0026] Therefore, the data block to be migrated is the first data block.

[0027] Optionally, the first calculation formula is:

[0028] in, p' represents the first parity check in the downgraded RAID6, q' represents the second parity check in the downgraded RAID6, z' represents the coefficient of data block d1 in the downgraded RAID6, and d 1_loc y' represents the coefficient of data block d1 in TP-RAID, y' represents the coefficient of double parity q' in RAID6 after downgrading, x' represents the coefficient of single parity p' in RAID6 after downgrading, p represents single parity in TP-RAID, q represents double parity in TP-RAID, r represents triple parity in TP-RAID, x represents the coefficient of single parity in TP-RAID, y represents the coefficient of double parity in TP-RAID, and z represents the coefficient of triple parity in TP-RAID.

[0029] Optionally, the downgraded RAID6 encoding method is as follows:

[0030]

[0031] Where d1, d2, ..., d k d k+1 , ...d m Let represent the 1st, 2nd, ..., kth, k+1th, ..., mth data blocks on a stripe, respectively. Let m+3 represent the total number of disks in TP-RAID: m data disks and 3 parity disks. Let p' represent the first parity check in the downgraded RAID6, q' represent the second parity check in the downgraded RAID6, z' represent the coefficient of data block d1 in the downgraded RAID6, x' represent the coefficient of the first parity check p' in the downgraded RAID6, and y' represent the coefficient of the second parity check q' in the downgraded RAID6.

[0032] This invention also provides a downgrade device from TP-RAID to RAID6, comprising:

[0033] The first determining module is used to determine the outermost disk in the disk group encoded in TP-RAID mode as the disk to be cleared;

[0034] The second determining module is used to determine the position of one original parity block on the original TP-RAID as the position of the data block to be migrated on the stripe after being downgraded to RAID6 for each stripe, and to determine the positions of the other two original parity blocks on the original TP-RAID as the positions of the new parity blocks after being downgraded to RAID6.

[0035] The calculation module is used to calculate the verification information of the new verification block based on the data information and verification information on the strip;

[0036] The disk write module is used to write the verification information of the data block to be migrated and the new verification block to disk in RAID6 mode.

[0037] This invention also provides a downgrade system from TP-RAID to RAID6, comprising:

[0038] Memory, used to store computer programs;

[0039] A processor, used to implement the steps of the downgrade method from TP-RAID to RAID6 as described above when executing the computer program.

[0040] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the downgrade method from TP-RAID to RAID6 as described above.

[0041] This invention discloses a method, apparatus, system, and computer-readable storage medium for downgrading from TP-RAID to RAID6. The method includes: identifying the outermost disk in a disk group encoded in TP-RAID as the disk to be cleared; for each stripe, determining the position of one original parity block on the original TP-RAID as the position of the data block to be migrated after downgrading to RAID6, and determining the positions of the other two original parity blocks on the original TP-RAID as the positions of the new parity blocks after downgrading to RAID6; calculating the parity information of the new parity blocks based on the data information and parity information on the stripe; and writing the data block to be migrated and the parity information of the new parity blocks to disk in RAID6 mode.

[0042] As can be seen, in this embodiment of the invention, the outermost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared. Then, for each stripe, the position of one original parity block on the original TP-RAID on the stripe is determined as the position of the data block to be migrated after downgrading to RAID6. The positions of the other two original parity blocks on the original TP-RAID are used as the positions of the new parity blocks after downgrading to RAID6. The parity information of the new parity block is calculated based on the data information and parity information on the stripe. Then, the data block to be migrated and the parity information of the new parity block are written to disk in the RAID6 mode. In this invention, the number of data blocks moved during the downgrading process from TP-RAID to RAID6 is small, and the data read and write volume is small, thereby improving the downgrading speed and reducing losses. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the prior art and embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a schematic diagram of a TP-RAID configuration consisting of three disks and three stripes.

[0045] Figure 2 This is a schematic diagram of an existing process for downgrading from TP-RAID to RAID6;

[0046] Figure 3 This is a schematic diagram of a current TP-RAID disk write method with left-hand misalignment;

[0047] Figure 4 This diagram illustrates the data blocks that need to be moved when downgrading TP-RAID to RAID6 under a traditional left-hand misalignment method.

[0048] Figure 5 A flowchart illustrating a method for downgrading from TP-RAID to RAID6, provided in an embodiment of the present invention;

[0049] Figure 6 A flowchart illustrating another method for downgrading from TP-RAID to RAID6 provided in an embodiment of the present invention;

[0050] Figure 7 This invention provides a schematic diagram illustrating a method for dividing movement groups and recalculation groups, as well as the data movement within movement groups;

[0051] Figure 8 This is a schematic diagram of a RAID6 data distribution scenario provided by an embodiment of the present invention;

[0052] Figure 9 A schematic diagram of another downgrade device from TP-RAID to RAID6 provided in an embodiment of the present invention;

[0053] Figure 10 A schematic diagram of another downgrade system from TP-RAID to RAID6 provided in an embodiment of the present invention;

[0054] Figure 11 This is a schematic diagram of another computer-readable storage medium provided in an embodiment of the present invention. Detailed Implementation

[0055] This invention provides a method, apparatus, system, and computer-readable storage medium for downgrading from TP-RAID to RAID6. The downgrading process involves moving fewer data blocks and reading less data, thereby improving downgrading speed and reducing losses.

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] It should be noted that the traditional TP-RAID algorithm uses the following principle:

[0058]

[0059] Here, p1, p2, and p3 represent the three checksums generated during TP-RAID encoding, and a (i.e., a) 1,1 To a 1,z a 2,1 To a 2,z a 3,1 To a 3,z The ) represents the parameters used during encoding. Represents the XOR operator, d1 to d m Let represent the data corresponding to the 1st to the mth data blocks respectively. To achieve the goal of having a solution for the cubic equation, the key is the choice of 'a'. Conventionally, considering the functional requirement that TP-RAID can solve any three errors, 'a' can be selected from various algorithms that conform to the MDS (maximum distance separable) characteristic. However, considering that in actual products, RAID groups not only need to be able to switch between each other, but also require a switching method that is simpler than direct encoding and a faster switching speed than re-encoding, etc.

[0060] Therefore, in order for RAID groups to be able to switch between each other, that is, for TP-RAID to be able to switch to RAID6, the first two lines of our formula (1) must satisfy the RAID6 characteristics. Therefore, based on the equivalent scalability of RS (Reed-Solomon code), the third line also needs to use a similar RS construction method. Based on the above requirements, the specific implementation relationship of TP-RAID can be obtained as follows:

[0061]

[0062] Among them, the storage scenario of TP-RAID composed of user data from three disks is as follows: Figure 1 As shown, a TP-RAID is constructed using three disks and three stripes. Here, p1, p2, p3, p4, p5, p6, p7, p8, and p9 are the parity blocks obtained from the calculations of stripes 1, 2, and 3, respectively. When actually writing the data to the disk, load balancing needs to be considered. Therefore, four algorithms are commonly used to calculate the disk placement: left-rotation misalignment, left-rotation alignment, right-rotation misalignment, and right-rotation alignment. Figure 1 The method used is left-hand rotation with misalignment. The four load balancing algorithms only affect the selection of specific parameters; there is no difference in performance. Therefore, this embodiment uses left-hand rotation with misalignment as an example. Figure 1 In the process, due to the left rotation misalignment of the load balancer, the x, y, and z values ​​of p1, p2, and p3 in formula (2) are 4, 5, and 6 respectively, and the corresponding p4, p5, and p6 are 3, 4, and 5, and so on.

[0063] The scenario of RAID level downgrading refers to a user's request to reduce the RAID level. Taking TP-RAID as an example, this means downgrading TP-RAID to RAID 5 or RAID 6, and then freeing up a disk for other uses through data migration. The downgrading operation for RAID 5 is relatively simple and will not be described in this embodiment. Downgrading to RAID 6 involves more complex algorithms and more scenarios, so it is mostly implemented by directly recoding. The recoding implementation is as follows... Figure 2 As shown, the process typically involves discarding all verification information first, then migrating the data, and then re-reading all the data for encoding. This operation involves migrating a large number of data blocks (when the stripe size is large enough, the average amount of user data that needs to be shifted is half of all the data), and requires reading and writing all the data twice, which is very slow and has a huge loss.

[0064] Because data migration during the downgrade from TP-RAID to RAID6 is primarily affected by the load balancing algorithm, the most common left-rotation misaligned load balancing algorithm is first used to analyze the different disk write methods affecting the same stripe in TP-RAID. Figure 3 A TP-RAID array consisting of stripes with a total of m data blocks has a total of Figure 3 In the scenarios described, when downgrading to RAID 6 is required, in this embodiment of the invention, the outermost disk (e.g., the leftmost disk) can be left vacant, and the traditional downgrading method can be followed. Figure 3 Example of a RAID6 configuration after downgrading: Figure 4 As shown, Figure 4 yes Figure 3The TP-RAID is downgraded to RAID 6 to satisfy the same load balancing with left-hand rotation misalignment (under the same system architecture, to reduce the probability of errors in firmware encoding and decoding parameters and to prevent data disk errors, the load balancing algorithm is generally required to remain unchanged). For the case where the leftmost disk is emptied first, to maintain load balancing with left-hand rotation misalignment, all user data (chunks, D) involved in the traditional sequential migration are the data marked in gray in the diagram. That is, regardless of the downgrade algorithm used in current technology, to maintain the same load balance and reduce the probability of errors... Figure 4 The gray data blocks in the diagram need to be read and written to achieve migration, and a large number of data blocks need to be moved.

[0065] Based on this, in order to improve degradation efficiency, this embodiment of the invention proposes a degradation method from TP-RAID to RAID6, specifically as follows: Figure 5 As shown, Figure 5 This is a flowchart illustrating a method for downgrading from TP-RAID to RAID6, provided as an embodiment of the present invention. The method includes:

[0066] S110: Identify the outermost disk in the disk group encoded in TP-RAID mode as the disk to be cleared;

[0067] It should be noted that in this embodiment of the invention, the outermost disk in the disk group encoded in TP-RAID mode is first determined as the disk to be cleared. Specifically, the leftmost disk or the rightmost disk can be determined as the disk to be cleared.

[0068] S120: For each stripe, the location of one original parity block on the original TP-RAID is determined as the location of the data block to be migrated on the stripe after being downgraded to RAID6, and the locations of the other two original parity blocks on the original TP-RAID are used as the locations of the new parity blocks after being downgraded to RAID6;

[0069] Specifically, TP-RAID has m+3 disks, including m data disks and 3 parity disks, and correspondingly m+3 stripes. Each stripe stores m data blocks and 3 parity blocks. In this embodiment, the multiple data blocks stored on the disks to be cleared are considered as the data blocks to be migrated on the corresponding stripe. For any stripe, the location of one original parity block of the original TP-RAID on that stripe is determined as the location of the data block to be migrated after downgrading to RAID6. That is, the data block to be migrated is placed at the location of one original parity block of the original TP-RAID. The locations of the other two original parity blocks of the original TP-RAID on that stripe are used as the locations of the new parity blocks after downgrading to RAID6. In other words, on a stripe, the location of one original parity block of the original TP-RAID is the location of the data block to be migrated after downgrading to RAID6, and the other two original parity blocks are still parity blocks, but need to be updated to the new parity blocks after downgrading to RAID6. Furthermore, in practical applications, the location of the triple parity block r on the original TP-RAID can be determined as the location of the data block to be migrated on this stripe after being downgraded to RAID6.

[0070] S130: Calculate the check information of the new check block based on the data information and check information on the strip;

[0071] Specifically, for each stripe, the parity information of each new parity block after downgrading to RAID6 can be calculated based on the original TP-RAID data information and parity information on that stripe.

[0072] S140: Write the parity information of the data block to be migrated and the new parity block to disk in RAID6 mode.

[0073] Specifically, after calculating the verification information of each new parity block, the data blocks to be migrated and each verification information are written to the corresponding location on the disk in RAID6 mode, thereby obtaining all the downgraded data written to the disk in RAID6 mode.

[0074] As can be seen, in this embodiment of the invention, the outermost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared. Then, for each stripe, the position of one original parity block on the original TP-RAID on the stripe is determined as the position of the data block to be migrated after downgrading to RAID6. The positions of the other two original parity blocks on the original TP-RAID are used as the positions of the new parity blocks after downgrading to RAID6. The parity information of the new parity block is calculated based on the data information and parity information on the stripe. Then, the data block to be migrated and the parity information of the new parity block are written to disk in the RAID6 mode. In this invention, the number of data blocks moved during the downgrading process from TP-RAID to RAID6 is small, and the data read and write volume is small, thereby improving the downgrading speed and reducing losses.

[0075] Based on the above embodiments, the present invention further explains and optimizes the technical solution as follows:

[0076] In the embodiments of the present invention, Figure 3 The following explanation uses the example of downgrading TP-RAID encoding to RAID6 as an example. Figure 3 In TP-RAID, the parity block (also known as the check block) is p, q, and r. With m data disks and 3 parity disks, there are m+3 stripe scenarios (where the positions of p, q, and r are different) where TP-RAID is not aligned to the left. Specifically... Figure 3 As shown; Figure 4 In RAID 6, the parity blocks are labeled p' and q'. There are m+2 stripe scenarios where the left rotation is misaligned, such as... Figure 4 As shown, the scenarios for stripe m+2 and stripe m+3 are the same. Therefore, according to... Figure 4 Direct mapping can cause the last strip to fail to be mapped. Therefore, this invention improves upon this, as detailed in the following embodiments. Figure 6 :

[0077] S210: Identify the outermost disk in the disk group encoded in TP-RAID mode as the disk to be cleared;

[0078] Specifically, in practical applications, the leftmost disk in a disk group encoded in TP-RAID mode can be identified as the disk to be emptied so that the leftmost disk can be removed after the data migration is completed.

[0079] S220: Under load balancing, divide the (m+2)th stripe in every (m+3)th stripe of all stripes encoded in the original TP-RAID method into a recalculation group;

[0080] It should be noted that in the case of load balancing (such as left-rotating unaligned load balancing algorithm), for TP-RAID with m+3 disks, each m+3 stripe is used as the smallest unit of load balancing. The m+2th stripe in each m+3 stripe can be divided into a recalculation group. The recalculation group is the group that needs to directly read data and then use the encoding method to implement RAID6 encoding.

[0081] S230: Divide the other strips in every m+3 strips into moving groups;

[0082] It is understandable that all stripes except the (m+2)th stripe in every m+3 stripes are divided into moving groups. A moving group refers to a group formed by stripe scenarios that can be mapped and whose checksum updates can be achieved by migrating data blocks and simply updating check blocks.

[0083] Specifically, in this embodiment of the invention, taking the downgrade of a TP-RAID with m data disks to RAID 6 as an example, the division of the move group and the recalculation group is as follows: Figure 7 As shown, the (m+2)th stripe of the TP-RAID encoding enters the recalculation group, and the 1st, 2nd, ..., (m+1)th and (m+3)th stripes of the TP-RAID encoding enter the moving group. After entering the moving group, the (m+3)th stripe is updated to the (m+2)th stripe.

[0084] It should be noted that, in the case of freeing up the leftmost first disk, the data block to be migrated in this embodiment of the invention is the first data block d1.

[0085] Specifically, for each stripe in the moving group, the position of the first data block d1 in each stripe after migration is the position of the original triplet block r in that stripe, as shown in the following example. Figure 7 The positions shown in middle stripes 3, 4, ..., m-1, m, m+1 are such that the position of the first data block d1 in the original stripes 1, 2 and m+3 remains unchanged.

[0086] S240: For each stripe in the moving group, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID, calculate the parity information corresponding to each new parity block on the stripe after downgrading to RAID6;

[0087] Specifically, in this embodiment of the invention, for each stripe in the moving group, the primary parity p in TP-RAID is updated to the primary parity p' in the downgraded RAID6, and the secondary parity q in TP-RAID is updated to the secondary parity q' in the downgraded RAID6. Then, based on the parity information of the primary parity p, the secondary parity q, the tertiary parity r, and the data information of the data block d1 to be migrated, the parity information of the primary parity p' and the secondary parity q' in the downgraded RAID6 on that stripe are calculated.

[0088] Furthermore, the process in S240 above, for each stripe in the moving group, calculating the corresponding parity information of each new parity block after downgrading to RAID6 on the stripe based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID, may specifically include:

[0089] For each stripe in the moving group, obtain the parity information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated;

[0090] Based on the first calculation formula, combined with the parity information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated, the parity information corresponding to each new parity block after the stripe is downgraded to RAID6 is calculated.

[0091] It should be noted that, in this embodiment of the invention, when calculating the parity information corresponding to each new parity block on each stripe after downgrading to RAID6, the parity information of the first parity p, the parity information of the second parity q, the parity information of the third parity r of the original TP-RAID and the data information of the data block d1 to be migrated can be obtained. Then, the parity information of the first parity p' and the second parity q' after downgrading to RAID6 can be further calculated by combining the first calculation formula.

[0092] Furthermore, the first calculation relationship mentioned above is:

[0093] in, p' represents the first parity check in the downgraded RAID6, q' represents the second parity check in the downgraded RAID6, z' represents the coefficient of data block d1 in the downgraded RAID6, and d 1_loc y' represents the coefficient of data block d1 in TP-RAID, y' represents the coefficient of double parity q' in RAID6 after downgrading, x' represents the coefficient of single parity p' in RAID6 after downgrading, p represents single parity in TP-RAID, q represents double parity in TP-RAID, r represents triple parity in TP-RAID, x represents the coefficient of single parity in TP-RAID, y represents the coefficient of double parity in TP-RAID, and z represents the coefficient of triple parity in TP-RAID.

[0094] That is, for each stripe, the check information corresponding to the new check blocks p' and q' on that stripe can be calculated using the first calculation formula mentioned above. Specifically, for different stripes, the corresponding p, q, r and d1 information are obtained based on that stripe.

[0095] It should be noted that the original TP-RAID encoding can be represented by the following formula:

[0096]

[0097] Where x, y, and z are the coefficients of the first, second, and third parity checks in TP-RAID, respectively, and can take values ​​of 1, 2, 3, ..., m+3.

[0098] Downgrading from TP-RAID to RAID6, the RAID6 encoding after downgrading is as follows:

[0099]

[0100] Where x', y', and z' are the coefficients of the first parity p', the second parity q', and the data block d1 in the downgraded RAID6, respectively. Furthermore, x' = k+1, y' = k+2, and z' = k+3, meaning z' is equal to the coefficient of the third parity in the original TP-RAID.

[0101] In the original encoding of TP-RAID, let:

[0102]

[0103] but,

[0104] In the downgraded RAID6 encoding:

[0105]

[0106] Combining the above formula We can obtain:

[0107] Solving this equation yields:

[0108] Since the coefficient of the second equation d1 in the original encoding of TP-RAID is not 1 in stripes 1 and 2, in order to make all stripes representable by the same formula, the above equation is modified. Written as:

[0109]

[0110] In the above formula, under TP-RAID disk write mode, d in stripe 1 1_loc =3, d in strip 2 1_loc =2, d in strip m+3 1_loc =4, d in the remaining bands 1_loc =1 (m+2 stripes are not in the moving group and are not within the calculation range).

[0111] Depend on Figure 7 It can be seen that the position of data block d1 in stripes 1, 2, and m+3 of the TP-RAID stripe scenario is the same as the position of data block d1 in the downgraded RAID 6 stripe scenario 1, 2, and m+2, that is, d1... 1_loc =z', and because in the Galois domain GF(2 w In d, addition is equivalent to the XOR operation; therefore, in d 1_loc =z' when z'+d 1_loc =0, therefore, the formulas for calculating check blocks p' and q' in these three stripe scenarios are:

[0112]

[0113] Therefore, in TP-RAID striped scenarios 1, 2, and m+3, only three parity blocks (p, q, and r) need to be read, and the above formula can be used to... After calculating p' and q', write p' and q' into the downgraded RAID 6. For the remaining stripes, read data block d1 and three parity blocks p, q, and r, and then use the formula... Calculate p' and q', and then write the obtained p', q', and d1 into the downgraded RAID 6.

[0114] S250: For stripes in the recalculation group, the downgraded RAID6 encoding method is used to perform load balancing disk writes and calculate the parity information of the new parity block.

[0115] Specifically, the downgraded RAID6 encoding method in this embodiment of the invention is as follows:

[0116]

[0117] Where d1, d2, ..., d k d k+1 , ...d m Let represent the 1st, 2nd, ..., kth, k+1th, ..., mth data blocks on a stripe, respectively. Let m+3 represent the total number of disks in TP-RAID: m data disks and 3 parity disks. Let p' represent the first parity check in the downgraded RAID6, q' represent the second parity check in the downgraded RAID6, z' represent the coefficient of data block d1 in the downgraded RAID6, x' represent the coefficient of the first parity check p' in the downgraded RAID6, and y' represent the coefficient of the second parity check q' in the downgraded RAID6.

[0118] It should also be noted that for recalculation groups, because a disk is left unused when transitioning from TP-RAID to RAID6, complete load balancing cannot be guaranteed through simple shifting. Therefore, for every m+3 stripes, one stripe will always be unused and unable to achieve load balancing directly. From n stripes satisfying m+3, a total of n stripes will enter the recalculation group. These stripes will undergo load balancing reorganization on other stripes. For example, when n = m+2, m+2 stripes entering the recalculation group will be reorganized into a new group of 1 to m+2 stripes, uniformly distributed from... Figure 8 In the RAID6 scenario 1 shown, the disk write-to-database and parity calculations (encoding) to meet load balancing requirements should be performed again. Furthermore, the specific value of n can be determined based on actual circumstances in practical applications, and will not be elaborated further in this embodiment.

[0119] S260: Write the verification information of the data block to be migrated and the new verification block to disk in RAID6 mode.

[0120] S260 in this embodiment is the same as S140 in the above embodiment, and will not be described again here.

[0121] As can be seen, this invention can downgrade TP-RAID to RAID6 and significantly reduce data block read / write operations, thus improving downgrade performance. Furthermore, in other TP-RAID to RAID6 downgrade methods, each stripe scenario has its own formula for calculating the parity block after downgrading. That is, when downgrading to RAID6, the parity block calculation formula differs for different stripes, lacking a unified formula, resulting in a large computational load. To address this issue, this invention allows the use of a first calculation formula for each stripe to calculate the parity block data after downgrading to RAID6, thereby significantly reducing computational load and improving downgrade efficiency and overall performance.

[0122] Based on the above embodiments, this invention also provides a downgrade device from TP-RAID to RAID6, please refer to [link / reference needed]. Figure 9 The device may include:

[0123] The first determining module 11 is used to determine the outermost disk in the disk group encoded in TP-RAID mode as the disk to be cleared;

[0124] The second determining module 12 is used to determine the position of one original parity block on the original TP-RAID as the position of the data block to be migrated on the stripe after being downgraded to RAID6 for each stripe, and to determine the positions of the other two original parity blocks on the original TP-RAID as the positions of the new parity blocks after being downgraded to RAID6.

[0125] The calculation module 13 is used to calculate the verification information of the new verification block based on the data information and verification information on the stripe;

[0126] The disk write module 14 is used to write the verification information of the data blocks to be migrated and the new parity blocks to disk in RAID6 mode.

[0127] Furthermore, the second determining module 12 is used to determine the location of the triple check block on the original TP-RAID as the location of the data block to be migrated on the stripe after being downgraded to RAID6.

[0128] Furthermore, this also includes:

[0129] The first partitioning module is used to partition the (m+2)th stripe out of every (m+3) stripes in the original TP-RAID encoding into a recalculation group under load balancing conditions.

[0130] The second division module is used to divide the other strips in each m+3 strips into moving groups.

[0131] Furthermore, the computing module 13 includes:

[0132] The first calculation unit is used to calculate, for each stripe in the moving group, the corresponding parity information of each new parity block after the stripe is downgraded to RAID6, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID.

[0133] The second calculation unit is used to perform load balancing disk write-to-database and calculate the parity information of the new parity block for the stripes in the recalculation group using the downgraded RAID6 encoding method.

[0134] Furthermore, the first computing unit includes:

[0135] The acquisition subunit is used to acquire, for each stripe in the moving group, the verification information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated;

[0136] The calculation subunit is used to calculate the corresponding verification information of each new parity block after the stripe is downgraded to RAID6 based on the first calculation formula, combined with the verification information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated.

[0137] Furthermore, the determining module 11 is used to determine the leftmost disk in the disk group encoded in TP-RAID as the disk to be cleared;

[0138] Therefore, the data block to be migrated is the first data block.

[0139] Furthermore, the first calculation formula is:

[0140] in, p' represents the first parity check in the downgraded RAID6, q' represents the second parity check in the downgraded RAID6, z' represents the coefficient of data block d1 in the downgraded RAID6, and d 1_loc y' represents the coefficient of data block d1 in TP-RAID, y' represents the coefficient of double parity q' in RAID6 after downgrading, x' represents the coefficient of single parity p' in RAID6 after downgrading, p represents single parity in TP-RAID, q represents double parity in TP-RAID, r represents triple parity in TP-RAID, x represents the coefficient of single parity in TP-RAID, y represents the coefficient of double parity in TP-RAID, and z represents the coefficient of triple parity in TP-RAID.

[0141] Furthermore, the downgraded RAID6 encoding method is as follows:

[0142]

[0143] Where d1, d2, ..., d k d k+1 , ...d m Let represent the 1st, 2nd, ..., kth, k+1th, ..., mth data blocks on a stripe, respectively. Let m+3 represent the total number of disks in TP-RAID: m data disks and 3 parity disks. Let p' represent the first parity check in the downgraded RAID6, q' represent the second parity check in the downgraded RAID6, z' represent the coefficient of data block d1 in the downgraded RAID6, x' represent the coefficient of the first parity check p' in the downgraded RAID6, and y' represent the coefficient of the second parity check q' in the downgraded RAID6.

[0144] It should be noted that the downgrade device from TP-RAID to RAID6 in the embodiments of the present invention has the same beneficial effects as the downgrade method from TP-RAID to RAID6 involved in the above embodiments. For a detailed description of the downgrade method from TP-RAID to RAID6 involved in the embodiments of the present invention, please refer to the above embodiments, and this application will not repeat it here.

[0145] Based on the above embodiments, this invention also provides a downgrade system from TP-RAID to RAID6, specifically as follows: Figure 10 As shown, the system includes:

[0146] Memory 20 is used to store computer programs;

[0147] The processor 21 is used to implement the steps of the downgrade method from TP-RAID to RAID6 as described above when executing a computer program.

[0148] The downgrade system from TP-RAID to RAID6 provided in this embodiment can be implemented using electronic devices, including but not limited to smartphones, tablets, laptops, or desktop computers.

[0149] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0150] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the downgrade method from TP-RAID to RAID6 disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, set offsets.

[0151] In some embodiments, the electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0152] Those skilled in the art will understand that Figure 10 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.

[0153] It is understood that if the downgrade method from TP-RAID to RAID6 in the above embodiments is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of this application. The aforementioned storage medium includes: USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk, or optical disk, and other media capable of storing program code.

[0154] Based on this, such as Figure 11 As shown, this embodiment of the invention also provides a computer-readable storage medium 30, on which a computer program 31 is stored. When the computer program 31 is executed by a processor, it implements the steps of the downgrade method from TP-RAID to RAID6 as described above.

[0155] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0156] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0157] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0158] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0159] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for downgrading from TP-RAID to RAID6, characterized in that, include: The outermost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared; For each stripe, the location of one original parity block on the original TP-RAID is determined as the location of the data block to be migrated on the stripe after being downgraded to RAID6, and the locations of the other two original parity blocks on the original TP-RAID are used as the locations of the new parity blocks after being downgraded to RAID6; Based on the data and verification information on the strip, the verification information of the new verification block is calculated; The verification information of the data block to be migrated and the new verification block is written to disk in RAID6 mode; wherein: Before calculating the verification information of the new verification block based on the data information and verification information on the stripe, the method further includes: under load balancing, dividing the (m+2)th stripe in every (m+3) stripes of all stripes encoded in the original TP-RAID method into a recalculation group; and dividing the other stripes in every (m+3) stripes into a moving group; The step of calculating the parity information of the new parity block based on the data information and parity information on the stripe includes: for each stripe in the moving group, calculating the parity information corresponding to each new parity block after downgrading to RAID6 on the stripe based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID; for the stripes in the recalculation group, using the downgraded RAID6 encoding method to perform load balancing disk write and calculate the parity information of the new parity block.

2. The method for downgrading from TP-RAID to RAID6 according to claim 1, characterized in that, The step of determining the location of an original parity block on the original TP-RAID as the location of the data block to be migrated on the stripe after downgrading to RAID6 includes: The location of the triple parity block on the original TP-RAID is determined as the location of the data block to be migrated on the stripe after being downgraded to RAID6.

3. The method for downgrading from TP-RAID to RAID6 according to claim 1, characterized in that, For each stripe in the moving group, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID, the parity information corresponding to each new parity block after downgrading to RAID6 on the stripe is calculated, including: For each stripe in the moving group, obtain the verification information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated; Based on the first calculation formula, combined with the parity information of each original parity block of the original TP-RAID on the stripe and the data information of the data block to be migrated, the parity information corresponding to each new parity block after the stripe is downgraded to RAID6 is calculated.

4. The method for downgrading from TP-RAID to RAID6 according to claim 3, characterized in that, The step of identifying the outermost disk in a disk group encoded in TP-RAID as the disk to be cleared includes: The leftmost disk in the disk group encoded in TP-RAID mode is identified as the disk to be cleared; Therefore, the data block to be migrated is the first data block.

5. The method for downgrading from TP-RAID to RAID6 according to claim 4, characterized in that, The first calculation formula is: ,in, , This indicates a single checksum in the RAID6 array after downgrading. This indicates the double checksum in RAID6 after downgrading. This represents the coefficient of data block d1 in the downgraded RAID6. This represents the coefficient of data block d1 in TP-RAID. This indicates the double checksum in RAID6 after downgrading. coefficient, This indicates a single parity check in RAID6 after downgrading. coefficient, This represents a single checksum in TP-RAID. This indicates double parity in TP-RAID. This indicates triple parity in TP-RAID. This represents the coefficient of one level of parity in TP-RAID. This represents the coefficient of double parity in TP-RAID. This represents the coefficient of triple parity in TP-RAID.

6. The method for downgrading from TP-RAID to RAID6 according to claim 1, characterized in that, The downgraded RAID6 encoding method is as follows: in, , ,..., , ,... These represent the 1st, 2nd, ..., kth, k+1th, ..., mth data blocks on a stripe, respectively, where m+3 represents the total number of disks in the TP-RAID: m data disks and 3 parity disks. This indicates a single checksum in the RAID6 array after downgrading. This indicates the double checksum in RAID6 after downgrading. This represents the coefficient of data block d1 in the downgraded RAID6. This indicates a single parity check in RAID6 after downgrading. coefficient, This indicates the double checksum in RAID6 after downgrading. The coefficient.

7. A downgrade device from TP-RAID to RAID6, characterized in that, include: The first determining module is used to determine the outermost disk in the disk group encoded in TP-RAID mode as the disk to be cleared; The second determining module is used to determine the position of one original parity block on the original TP-RAID as the position of the data block to be migrated on the stripe after being downgraded to RAID6 for each stripe, and to determine the positions of the other two original parity blocks on the original TP-RAID as the positions of the new parity blocks after being downgraded to RAID6. The calculation module is used to calculate the verification information of the new verification block based on the data information and verification information on the strip; The disk write module is used to write the parity information of the data block to be migrated and the new parity block to disk in RAID6 mode; wherein: It also includes: a first partitioning module, used to partition the (m+2)th stripe out of every m+3 stripes in the original TP-RAID encoding into a recalculation group under load balancing; and a second partitioning module, used to partition the other stripes out of every m+3 stripes into a moving group. The calculation module includes: a first calculation unit, used for calculating, for each stripe in the moving group, the corresponding parity information of each new parity block after downgrading to RAID6 on the stripe, based on the data information of the data block to be migrated and the parity information of each original parity block on the original TP-RAID; and a second calculation unit, used for calculating the load balancing disk write and the parity information of the new parity block for the stripes in the recalculation group, using the downgraded RAID6 encoding method.

8. A downgrade system from TP-RAID to RAID6, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the downgrade method from TP-RAID to RAID6 as described in any one of claims 1 to 6 when executing the computer program.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the downgrade method from TP-RAID to RAID6 as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • RAID reconstruction method and device

    CN105302492A

  • RAID rebuilding method and device

    CN108228086A