Method for degrading a raid 6 disk array to a raid 5 disk array

CN116450048BActive Publication Date: 2026-06-26SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
Filing Date
2023-04-21
Publication Date
2026-06-26

Smart Images

  • Figure CN116450048B_ABST
    Figure CN116450048B_ABST
Patent Text Reader

Abstract

The application discloses a method for degrading a RAID6 disk array into a RAID5 disk array, which comprises the following steps: dividing the RAID6 disk array into moving group strips and recalculation group strips; releasing a target disk according to a preselected RAID6 disk array load balancing mode; obtaining first check blocks belonging to the moving group strips in the target disk; replacing the first check blocks of each moving group strip with data blocks in the target disk; determining a relationship expression between original check blocks and target check blocks according to a RAID6 original encoding formula and a RAID5 encoding formula, and determining first strips corresponding to each moving group strip according to the calculated target check blocks; recalculating each recalculation group strip to obtain second strips, and constructing a target RAID5 disk array. The application reduces the disk read / write amount, reduces the bandwidth consumption, and improves the performance. The application also discloses a device, equipment and storage medium, which have corresponding technical effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of communication and network technologies, digital information is growing exponentially, posing significant challenges to data storage technology. The reliability of data and the energy consumption of storage systems are receiving increasing attention. Currently, given the massive scale of data, the reliability of data in a storage system is inversely proportional to the number of components; that is, the more components a storage system has, the lower its reliability. In large-scale storage systems, disk failures causing a significant drop in data reliability are a serious problem, prompting research into related fault-tolerance technologies.

[0003] RAID (Redundant Arrays of Independent Disks) architecture has become a key technology for increasing storage capacity. A disk array combines multiple independent disks to create a large-capacity disk group. RAID significantly increases storage capacity and improves system I / O processing capabilities by utilizing data striping, data verification, and mirroring technologies. Furthermore, it enhances data reliability through distributed storage, parallel access, and information redundancy. RAID can be categorized into different levels: RAID 0, 1, 5, 6, and 10.

[0004] RAID 0, or Data Stripping, is the earliest RAID mode. It's the simplest form of disk array, requiring only two or more hard drives, making it low-cost and improving overall disk performance and throughput. RAID 0 doesn't offer redundancy or error correction capabilities, but its implementation cost is the lowest. The simplest way to implement RAID 0 is to connect N identical hard drives together in hardware via an intelligent disk controller or in software via disk drivers in the operating system to create a large volume. During use, computer data is written sequentially to each hard drive. Its biggest advantage is that it can double the hard drive capacity. For example, using three 80GB hard drives in RAID 0 mode will result in a total disk capacity of 240GB. Its speed is exactly the same as a single hard drive. The biggest disadvantage is that if any one hard drive fails, the entire system will be compromised; its reliability is only 1 / N of that of a single hard drive.

[0005] RAID 1, or RAID mirroring, works by mirroring data from one disk to another. While data is written to one disk, a mirror image is created on a spare disk. This maximizes system reliability and recoverability without impacting performance. As long as at least one disk in any mirror pair is usable, the system can continue operating even if half the hard drives fail. When a hard drive fails, the system ignores it and uses the remaining mirror disk for reading and writing data, providing excellent disk redundancy. While this ensures absolute data security, it significantly increases costs. Disk utilization is reduced to 50%; for example, with four 80GB hard drives, only 160GB of space is usable. Furthermore, a RAID system with a failed hard drive is unreliable and should be replaced promptly. Otherwise, if the remaining mirror disk also fails, the entire system will crash. After replacing the drive, the original data requires a long time to synchronize with the mirror image. External access to the data is unaffected, but overall system performance will decrease. Therefore, RAID 1 is primarily used for storing critical and important data.

[0006] RAID 5 (Distributed Parity Independent Disk Architecture) uses a parity check code distributed across all disks. Here, p0 represents the parity value of stripe 0, and the others have similar meanings. RAID 5 offers high read efficiency, moderate write efficiency, and good block-level collective access efficiency. Because the parity code is distributed across different disks, reliability is improved. However, it struggles with handling data transfer parallelism, and controller design is quite challenging. With RAID 5, most data transfers operate on only one disk, allowing for parallel operations. RAID 5 has a "write penalty," meaning each write operation generates four actual read / write operations: two reads of old data and parity information, and two writes of new data and parity information.

[0007] RAID 6 is a parity check array with two distributed storage options. It's an extension of RAID 5, primarily used in applications requiring absolutely error-free data. Because it introduces a second parity value, it requires N+2 disks, significantly increasing the complexity of the controller design and further enhancing the data reliability of the array. It requires more space to store the parity value and incurs a higher performance penalty during write operations.

[0008] In real-world applications, users often need to downgrade existing RAID arrays. Downgrading involves reducing a RAID 6 array to RAID 5, 1, or 0, or a TP-RAID array to RAID 6, 5, 1, or 0. A common downgrade method involves removing a disk originally used for parity storage from the RAID array. This requires data migration from the original RAID array and recalculation of the downgraded RAID array. Traditional methods for downgrading a RAID 6 array to RAID 5 involve removing the disk, rearranging all related data based on load balancing algorithms, and then re-encoding. Existing downgrade algorithms, to maintain the same load balance and reduce error rates, require numerous disk read / write operations, making the process complex, bandwidth-intensive, and performance-inefficient.

[0009] In summary, effectively addressing the issues of extensive disk read / write operations required to downgrade an existing RAID6 disk array to a RAID5 disk array, the complexity of the operation, high bandwidth consumption during downgrade, and poor performance of the downgrade operation is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0010] The purpose of this invention is to provide a method for downgrading a RAID6 disk array to a RAID5 disk array. This method greatly reduces the amount of disk read and write operations, reduces the bandwidth consumption caused by the downgrading operation, and improves the performance of the downgrading operation. Another purpose of this invention is to provide an apparatus, device, and computer-readable storage medium for downgrading a RAID6 disk array to a RAID5 disk array.

[0011] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0012] A method for downgrading a RAID6 disk array to a RAID5 disk array includes:

[0013] Divide the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes;

[0014] Release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method;

[0015] Obtain the first checksum block belonging to the mobile group stripe in the target disk;

[0016] The data blocks in the target disk are used to replace the first check block in each of the move group stripes after the target disk is released;

[0017] Based on the original RAID6 encoding formula corresponding to each of the moving group stripes and the RAID5 encoding formula corresponding to the target disk after release, determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array. Calculate the target parity block based on the relationship expression, and determine the first stripe corresponding to each of the moving group stripes based on the target parity block.

[0018] The recalculation group stripes are recalculated to satisfy the load balancing disk write and parity block calculations to obtain the second stripes, and the target RAID5 disk array is constructed based on the first stripes and the second stripes.

[0019] In one specific embodiment of the present invention, the stripes of the RAID6 disk array to be downgraded are divided into moving group stripes and recalculation group stripes, including:

[0020] Obtain the number of data disks in the RAID6 disk array;

[0021] The stripes of the RAID6 disk array to be downgraded are divided into the moving group stripes and the recalculation group stripes according to the ratio of the number of data disks plus 1:1.

[0022] In one specific embodiment of the present invention, releasing the target disk in each disk constituting the RAID6 disk array according to a pre-selected RAID6 disk array load balancing method includes:

[0023] When the pre-selected RAID6 disk array load balancing mode is left-handed non-aligned mode, the leftmost disk among the disks constituting the RAID6 disk array is determined as the target disk, and the target disk is released.

[0024] In one specific embodiment of the present invention, based on the original RAID6 encoding formula corresponding to each of the moving group stripes and the RAID5 encoding formula corresponding to the target disk after release, a relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is determined, including:

[0025] Select one strip from each of the aforementioned mobile group strips, and determine the selected strip as the target mobile group strip;

[0026] Obtain the first fraction of the original RAID6 encoding formula obtained by XORing each data block and parity block in the target mobile group stripe to 0;

[0027] After obtaining the target disk and releasing the target disk and replacing the first parity block in the target mobile group stripe with the data blocks in the target disk, the RAID5 encoding formula corresponding to the XOR equal to 0 of each current data block and the target parity block in the target mobile group stripe;

[0028] Based on the first fraction and the RAID5 encoding formula, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is expressed as follows: the target parity block is equal to the XOR operation of two of the original parity blocks.

[0029] In one specific embodiment of the present invention, selecting one strip from each of the moving group strips includes:

[0030] Randomly select one strip from each of the aforementioned moving group strips.

[0031] In one specific embodiment of the present invention, calculating the target verification block based on the relational expression includes:

[0032] The target check block is obtained by performing an XOR operation on the two original check blocks.

[0033] In one specific embodiment of the present invention, determining the first stripe corresponding to each moving group stripe according to the target verification block includes:

[0034] The target check block is used to replace the second check block (excluding the first check block) in one of the two original check blocks contained in each of the moving group strips, to obtain the check block replacement result.

[0035] Based on the check block replacement result and the data block replacement result of the first check block in each of the mobile group stripes after releasing the target disk and replacing the target disk with data blocks in the target disk, the first stripe corresponding to each of the mobile group stripes is determined.

[0036] An apparatus for downgrading a RAID6 disk array to a RAID5 disk array, comprising:

[0037] The stripe partitioning module is used to divide the stripes of the RAID6 disk array to be downgraded into moving group stripes and recalculation group stripes;

[0038] The disk release module is used to release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method;

[0039] The check block acquisition module is used to acquire the first check block belonging to the mobile group stripe in the target disk;

[0040] The data block replacement module is used to replace the first check block in each of the moving group stripes after the target disk is released with the data block in the target disk;

[0041] The first stripe acquisition module is used to determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array according to the original RAID6 encoding formula corresponding to each of the mobile group stripes and the RAID5 encoding formula corresponding to the target disk after release, and to calculate the target parity block according to the relationship expression to obtain the first stripe corresponding to each of the mobile group stripes.

[0042] The disk array construction module is used to recalculate the disk placement and verification blocks to satisfy load balancing for each of the recalculation group stripes, to obtain each second stripe, and to construct the target RAID5 disk array based on each of the first stripes and each of the second stripes.

[0043] A device for downgrading a RAID6 disk array to a RAID5 disk array includes:

[0044] Memory, used to store computer programs;

[0045] A processor, used to execute the computer program, implements the steps of the method for downgrading a RAID6 disk array to a RAID5 disk array as described above.

[0046] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method for downgrading a RAID6 disk array to a RAID5 disk array as described above.

[0047] The method for downgrading a RAID6 disk array to a RAID5 disk array provided by this invention involves dividing the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes; releasing the target disks in each disk constituting the RAID6 disk array according to a pre-selected RAID6 disk array load balancing method; obtaining the first parity block belonging to the moving stripe in the target disk; replacing the first parity blocks in each moving stripe after releasing the target disk with data blocks from the target disk; determining the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array according to the original RAID6 encoding formula corresponding to each moving stripe and the RAID5 encoding formula corresponding to the target disk after release; calculating the target parity block according to the relationship expression; determining the first stripe corresponding to each moving stripe according to the target parity block; recalculating the disk placement and parity block to satisfy load balancing for each recalculation stripe to obtain each second stripe; and constructing the target RAID5 disk array based on each first stripe and each second stripe.

[0048] As can be seen from the above technical solution, by dividing the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes, for the moving stripes, by making reasonable use of the relationship between the parity block of the original RAID6 disk array and the parity of the target RAID5 disk array after downgrading, an expression between the parity block of the RAID6 disk array and the parity of the target RAID5 disk array after downgrading is established. This greatly reduces the amount of disk read and write operations compared to traditional downgrading operations, reduces the bandwidth consumption caused by downgrading operations, and improves the performance of downgrading operations.

[0049] Accordingly, the present invention also provides an apparatus, device, and computer-readable storage medium for downgrading a RAID6 disk array to a RAID5 disk array, corresponding to the method described above for downgrading a RAID6 disk array to a RAID5 disk array, which has the aforementioned technical effects and will not be elaborated further here. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0051] Figure 1 This is a schematic diagram of a left-handed, non-aligned RAID6 disk array.

[0052] Figure 2This is a schematic diagram of the disk placement method of a RAID6 disk array with left-hand misalignment.

[0053] Figure 3 This is a schematic diagram of a disk placement method for downgrading a RAID6 disk array to a RAID5 disk array under left-hand misalignment in the prior art;

[0054] Figure 4 This is a flowchart illustrating one implementation of the method for downgrading a RAID6 disk array to a RAID5 disk array in this invention.

[0055] Figure 5 This is a schematic diagram illustrating the structure of dividing moving group stripes and recalculation group stripes, and the data movement of moving group stripes, according to an embodiment of the present invention.

[0056] Figure 6 This is a schematic diagram of the data distribution structure of a RAID5 disk array in an embodiment of the present invention;

[0057] Figure 7 This is a flowchart illustrating another implementation of the method for downgrading a RAID6 disk array to a RAID5 disk array in this invention.

[0058] Figure 8 This is a structural block diagram of a device for downgrading a RAID6 disk array to a RAID5 disk array according to an embodiment of the present invention;

[0059] Figure 9 This is a structural block diagram of a device for downgrading a RAID6 disk array to a RAID5 disk array according to an embodiment of the present invention;

[0060] Figure 10 This is a schematic diagram of the specific structure of a device for downgrading a RAID6 disk array to a RAID5 disk array, as provided in this embodiment. Detailed Implementation

[0061] Commonly used RAID algorithms require first determining the RAID encoding parameters, which are generally determined based on the specific arrangement of load balancers.

[0062] See Figure 1 , Figure 1This is a schematic diagram of a left-handed, non-aligned RAID 6 disk array. Taking a common left-handed, non-aligned load-balanced arrangement as an example, with 3 data disks and 2 parity disks, a RAID 6 group is formed. P1 and P2 represent the two parity blocks in the RAID 6 group, D0-D14 are different user data blocks, rows represent stripes, and columns represent the actual hard drives. Data blocks and parity blocks are arranged in a load-balanced manner in the RAID 6 group composed of 5 hard drives. The position of the parity block is different for each stripe based on the left-handed, non-aligned arrangement, thereby achieving average disk access demand. Based on the disk numbers (1-5), the encoding and decoding parameters of RAID 6 can be obtained. Using the corresponding data blocks based on this relationship, the encoding of each stripe can be completed.

[0063] If a degradation occurs, the corresponding check block must first be removed. Then, based on the requirements of the load balancing algorithm, the corresponding data blocks must be moved and the information of the encoded check block must be rewritten.

[0064] The traditional RAID5 algorithm uses the following principle:

[0065]

[0066] The RAID 6 algorithm works as follows:

[0067]

[0068] The RAID encoding / decoding algorithm solves the equation with p as the unknown, based on the above relationship. This operation uses Galois domain arithmetic in storage; therefore, the relationships for p in traditional RAID5 and RAID6 are as follows:

[0069] RAID5:

[0070]

[0071] RAID6:

[0072]

[0073] In storage systems, to reduce computational complexity and prevent data overflow, the above-mentioned unification and storage encoding / decoding operations are generally implemented using Galois fields. That is, in hardware implementation, addition and subtraction are implemented using XOR operations, while multiplication and division are implemented using Galois multiplication and division methods specific to different Galois field polynomials.

[0074] In a normal RAID operation, when a degradation occurs, all the data involved will be rearranged and then re-encoded based on the load balancing algorithm's arrangement requirements.

[0075] See Figure 2 and Figure 3 , Figure 2 This is a schematic diagram of the disk placement method of a RAID6 disk array with left-hand misalignment. Figure 3 This is a schematic diagram illustrating a disk placement method in the prior art for downgrading a RAID 6 disk array to a RAID 5 disk array under left-hand misalignment. The RAID 6 disk array, composed of stripes with a total of K data blocks, has a total of... Figure 3 The above describes several scenarios. When downgrading to a RAID 5 disk array, the rightmost disk is typically left unused.

[0076] like Figure 3 As shown, is Figure 2 The RAID 6 disk array is downgraded to a RAID 5 disk array to maintain the same load balancing with a 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). Here, the empty disk is assumed to be the rightmost disk. Therefore, to maintain load balancing with the left-hand rotation misalignment, all user data (chunks, D) involved in sequential migration are marked in gray in the diagram. That is to say, regardless of the downgrade algorithm used, to maintain the same load balancing and reduce the probability of errors, Figure 3 The data blocks in the gray area must be read and written to achieve the migration.

[0077] Figure 2 In RAID6 disk arrays, the parity block implemented by encoding is pq. With K data disks and 2 parity disks, there are K+2 stripe scenarios for RAID6 left-hand misalignment. Figure 3 In a RAID 5 disk array, the parity block is labeled P'. There are K+1 stripe scenarios where the left rotation is misaligned, such as... Figure 3 As shown. Therefore, according to Figure 3 Direct mapping movement will result in Figure 2 The last strip cannot be mapped.

[0078] Existing degradation algorithms require a large number of disk read and write operations to maintain the same load balance and reduce the probability of errors. The operation is relatively complex, the bandwidth consumption is large, and the performance of degradation operation is poor.

[0079] Therefore, the method for downgrading a RAID6 disk array to a RAID5 disk array provided in this application greatly reduces the amount of disk read / write operations, lowers the bandwidth consumption caused by the downgrading operation, and improves the performance of the downgrading operation.

[0080] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and 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.

[0081] See Figure 4 , Figure 4 This is a flowchart illustrating an implementation of a method for downgrading a RAID6 disk array to a RAID5 disk array according to an embodiment of the present invention. The method may include the following steps:

[0082] S401: Divide the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes.

[0083] When a RAID6 disk array to be downgraded to a RAID5 disk array needs to be downgraded, the stripes of the RAID6 disk array to be downgraded are divided into moving group stripes and recalculation group stripes.

[0084] As the name suggests, moving group stripes update stripes during disk array degradation by moving data blocks. Recalculating group stripes update stripes during disk array degradation by recalculating the disk write and parity blocks to meet load balancing requirements.

[0085] In one specific embodiment of the present invention, step S401 may include the following steps:

[0086] Step 1: Obtain the number of data disks in the RAID6 disk array;

[0087] Step 2: Divide the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes according to the number of data disks plus a 1:1 ratio.

[0088] For ease of description, the two steps above can be combined for explanation.

[0089] See Figure 5 , Figure 5This is a schematic diagram illustrating the division of mover stripes and recalculation stripes, and the data movement within the mover stripes, as described in an embodiment of the present invention. The number of data disks in the RAID 6 disk array is obtained. The stripes of the RAID 6 disk array to be downgraded are divided into mover stripes and recalculation stripes at a ratio of k+1:1. For example, assuming the number of data disks in the RAID 6 disk array is k, the stripes are divided into mover stripes and recalculation stripes at a ratio of k+1:1. This ensures that each mover stripe can achieve stripe changes during the disk array downgrade process through simple data block movement and parity block reading, while minimizing the number of recalculation stripes involved in the recalculation process.

[0090] S402: Release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method.

[0091] When downgrading from a RAID 6 to a RAID 5 array, one disk needs to be freed up from the disks constituting the RAID 6 array. The location of the disk to be freed up varies depending on the RAID 6 load balancing method. Therefore, the target disk to be freed up is determined based on the pre-selected RAID 6 load balancing method, and then the target disk is released. For example, if the selected RAID 6 load balancing method is left-hand non-aligned, the target disk to be freed up should be the leftmost disk in the RAID 6 array. In addition, other load balancing methods such as right-hand non-aligned, left-hand aligned, and right-hand aligned can be selected, and the position of the target disk to be freed up will change accordingly.

[0092] In one specific embodiment of the present invention, step S402 may include the following steps:

[0093] When the pre-selected RAID6 disk array load balancing mode is left-handed unaligned mode, the leftmost disk in each disk constituting the RAID6 disk array is determined as the target disk and the target disk is released.

[0094] like Figure 5 As shown, when the pre-selected RAID6 disk array load balancing mode is left-handed unaligned mode, the leftmost disk in each disk constituting the RAID6 disk array is determined as the target disk and the target disk is released.

[0095] S403: Obtain the first parity block belonging to the moving group stripe in the target disk.

[0096] After releasing the target disk from each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method, the parity blocks belonging to the move group stripe within the target disk are of the same type, and this type of parity block is identified as the first parity block. The first parity block belonging to the move group stripe in the target disk is then obtained.

[0097] like Figure 5 As shown, the first check block belonging to the mobile group stripe in the target disk is check block q.

[0098] S404: Replace the first parity block in each move group stripe after the target disk is released with data blocks from the target disk.

[0099] After obtaining the first parity block belonging to the move group stripe in the target disk, the first parity block in each move group stripe after the target disk is released is replaced with the data block in the target disk.

[0100] like Figure 5 As shown, when the pre-selected RAID6 disk array load balancing mode is left-rotation unaligned mode, the data block d1 in the leftmost disk replaces the parity block q in each of the moving group stripes from 1 to k+1.

[0101] S405: Based on the original RAID6 encoding formula corresponding to each moving group stripe and the RAID5 encoding formula corresponding to the target disk after release, determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array, calculate the target parity block based on the relationship expression, and determine the first stripe corresponding to each moving group stripe based on the target parity block.

[0102] After replacing the first parity block in each move group stripe with the data block in the target disk and releasing the target disk, the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is determined according to the original RAID6 encoding formula corresponding to each move group stripe and the RAID5 encoding formula corresponding to the released target disk. The target parity block is calculated according to the relationship expression, and the first stripe corresponding to each move group stripe is determined according to the target parity block.

[0103] like Figure 5 As shown, the original encoding of stripe 1 for a RAID6 disk array is:

[0104]

[0105] The encoding of stripe 1 in the downgraded RAID5 disk array is as follows:

[0106]

[0107] Combining the two formulas above, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is expressed as follows:

[0108]

[0109] For RAID stripe 1, no data blocks need to be moved. The original parity blocks p and q are read, and the current parity block p' can be obtained through the above relational expression.

[0110] The original encoding for stripe 2 of a RAID6 disk array is:

[0111]

[0112] The encoding of stripe 2 in the downgraded RAID5 disk array is as follows:

[0113]

[0114] Combining the two formulas above, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is expressed as follows:

[0115]

[0116] For RAID stripe 2, it is only necessary to move the data block d1 to the position of the original RAID 6 disk array parity block q, read the original parity blocks p and q, and obtain the current parity block p' through the above relational expression.

[0117] Similarly, for stripes 3, 4, 5, ... k+1, we only need to move data block d1 to the position of the original RAID6 disk array parity block q, read the original parity blocks p and q, and obtain the current parity block p' through the above relational expression.

[0118] Based on the above operations, a RAID6 disk array can be downgraded to a RAID5 disk array. Stripe 1 does not need to move data blocks, but only needs to read two parity blocks. Other stripes only need to move one data block and only need to read two parity blocks.

[0119] S406: Recalculate the disk write and parity block to satisfy load balancing for each recalculation group stripe to obtain each second stripe, and construct the target RAID5 disk array based on each first stripe and each second stripe.

[0120] The load balancing disk write and parity block calculations are recalculated for each recalculation group stripe to obtain each second stripe, and the target RAID5 disk array is constructed based on each first stripe and each second stripe.

[0121] See Figure 6 , Figure 6 This is a schematic diagram of the data distribution structure of a RAID5 disk array in an embodiment of the present invention. For recalculated stripes, because one disk is left unused when transferring from the RAID6 disk array to the RAID5 disk array, complete load balancing cannot be guaranteed through simple shifting. Therefore, when the number of data disks in the RAID6 disk array is k, every k+2 stripe groups will always have one stripe left unused, preventing direct load balancing. For n stripe groups satisfying k+2, a total of n stripes are generated and enter the recalculated group. After these stripes are reassembled and load balanced by other stripes, they are uniformly arranged as follows: Figure 6 The RAID5 disk array scenario shown can then be recalculated (encoded) to satisfy load balancing on disk and for parity blocks.

[0122] As can be seen from the above technical solution, by dividing the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes, for the moving stripes, by making reasonable use of the relationship between the parity block of the original RAID6 disk array and the parity of the target RAID5 disk array after downgrading, an expression between the parity block of the RAID6 disk array and the parity of the target RAID5 disk array after downgrading is established. This greatly reduces the amount of disk read and write operations compared to traditional downgrading operations, reduces the bandwidth consumption caused by downgrading operations, and improves the performance of downgrading operations.

[0123] It should be noted that, based on the above embodiments, the present invention also provides corresponding improvements. In subsequent embodiments, steps identical or corresponding to those in the above embodiments can be referenced interchangeably, and their respective beneficial effects can also be referred to each other. These improvements will not be elaborated upon in the following improved embodiments.

[0124] See Figure 7 , Figure 7 This is another implementation flowchart of the method for downgrading a RAID6 disk array to a RAID5 disk array according to an embodiment of the present invention. The method may include the following steps:

[0125] S701: Divides the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes.

[0126] S702: Release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method.

[0127] S703: Obtain the first parity block belonging to the moving group stripe in the target disk.

[0128] S704: Replace the first parity block in each move group stripe after the target disk is released with the data blocks in the target disk.

[0129] S705: Select one strip from each moving group strip and determine the selected strip as the target moving group strip.

[0130] After dividing the stripes of the RAID6 disk array to be downgraded into moving group stripes and recalculation group stripes, a stripe is selected from each moving group stripe, and the selected stripe is determined as the target moving group stripe.

[0131] In one specific embodiment of the present invention, selecting a strip from each moving group strip may include the following steps:

[0132] Randomly select one strip from each moving group strip.

[0133] When selecting a target moving group strip from various moving group strips, a strip can be randomly selected from each moving group strip, and this randomly selected strip can be designated as the target moving group strip. This allows for unrestricted selection of the target moving group strip.

[0134] S706: Obtain the first fraction of the RAID6 original encoding formula obtained by XORing each data block and parity block in the target moving group stripe to 0.

[0135] After determining the target mobile group stripe, obtain the first fraction of the RAID6 original encoding formula obtained by XORing each data block and parity block in the target mobile group stripe to 0.

[0136] like Figure 5 As shown, when the selected target moving group stripe is stripe 1, the first fraction of the original RAID6 encoding formula obtained by XORing each data block and parity block in stripe 1 with 0 is:

[0137]

[0138] When the selected target moving group stripe is stripe 2, the first fraction of the RAID6 original encoding formula obtained by XORing each data block and parity block in stripe 2 with 0 is:

[0139]

[0140] S707: After obtaining and releasing the target disk and replacing the first parity block in the target mover group stripe with the data blocks in the target disk, the RAID5 encoding formula corresponding to the XOR of each current data block in the target mover group stripe and the target parity block being equal to 0.

[0141] After acquiring and releasing the target disk and replacing the first parity block in the target mover stripe with the data blocks in the target disk, the RAID5 encoding formula corresponding to the XOR of each current data block in the target mover stripe and the target parity block being equal to 0.

[0142] like Figure 5 As shown, when the selected target move group stripe is stripe 1, after acquiring and releasing the target disk and replacing the first parity block q in the target move group stripe with data block d1 from the target disk, the RAID5 encoding formula corresponding to the XOR of each current data block and the target parity block in stripe 1 being equal to 0 is:

[0143]

[0144] When the selected target mover stripe is stripe 2, after acquiring and releasing the target disk and replacing the first parity block q in the target mover stripe with data block d1 from the target disk, the RAID5 encoding formula corresponding to the XOR equality of each current data block and the target parity block in stripe 2 being 0 is as follows:

[0145]

[0146] S708: Based on the first fraction and the RAID5 encoding formula, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is determined by the expression that the target parity block is equal to the XOR calculation of the two original parity blocks.

[0147] After obtaining the first fraction of the RAID6 original encoding formula and the RAID5 encoding formula, when the selected target moving group stripe is stripe 1, according to the first fraction... and RAID5 encoding formula The expression that determines the relationship between the original parity block of a RAID6 disk array and the target parity block of a downgraded target RAID5 disk array is as follows: When the selected target moving group strip is strip 2, according to the first fraction and RAID5 encoding formula The expression that determines the relationship between the original parity block of a RAID6 disk array and the target parity block of a downgraded target RAID5 disk array is as follows: For stripes 3, 4, 5, ... k+1, and so on, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is expressed as follows: The relationship between the original parity block of a RAID6 disk array and the target parity block of a downgraded RAID5 disk array is expressed as follows: the target parity block is equal to the XOR operation of the two original parity blocks.

[0148] S709: Calculate the target check block based on the relational expression, and determine the first strip corresponding to each moving group strip based on the target check block.

[0149] In one specific embodiment of the present invention, calculating the target verification block based on the relational expression may include the following steps:

[0150] The target check block is obtained by performing an XOR operation on the two original check blocks.

[0151] After determining the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array as the target parity block equals the XOR operation of the two original parity blocks, the target parity block is obtained by performing an XOR operation on the two original parity blocks. Thus, the calculation of the parity block in the target RAID5 disk array can be achieved simply by reading the parity block in the original RAID6 disk array.

[0152] In one specific embodiment of the present invention, determining the first stripe corresponding to each moving group stripe based on the target verification block may include the following steps:

[0153] Step 1: Replace the second check block (excluding the first check block) in each moving group strip with the target check block to obtain the check block replacement result;

[0154] Step 2: Based on the parity block replacement results and the data block replacement results of the first parity block in each move group stripe after releasing the target disk and replacing the data block in the target disk with the data block in the target disk, determine the first stripe corresponding to each move group stripe.

[0155] For ease of description, the two steps above can be combined for explanation.

[0156] After calculating the target parity block, the second parity block (excluding the first parity block) in each of the two original parity blocks contained in each move group stripe is replaced with the target parity block to obtain the parity block replacement result. Based on the parity block replacement result and the data block replacement result of the first parity block in each move group stripe after releasing the target disk and replacing the data block in the target disk with the data block in the target disk, the first stripe corresponding to each move group stripe is determined.

[0157] like Figure 5 As shown, the second parity block p in each move group stripe is replaced by the target parity block p', and the data block replacement results of the previous release of the leftmost disk and the replacement of the first parity block q in each move group stripe by the data block d1 are used to determine the 1 to k+1 stripes in the target RAID5 disk array.

[0158] S710: Recalculate the disk write and parity blocks to satisfy load balancing for each recalculation group stripe to obtain each second stripe, and construct the target RAID5 disk array based on each first stripe and each second stripe.

[0159] Corresponding to the above method embodiments, the present invention also provides an apparatus for downgrading a RAID6 disk array to a RAID5 disk array. The apparatus for downgrading a RAID6 disk array to a RAID5 disk array described below can be referred to in correspondence with the method for downgrading a RAID6 disk array to a RAID5 disk array described above.

[0160] See Figure 8 , Figure 8 This is a structural block diagram of an apparatus for downgrading a RAID6 disk array to a RAID5 disk array according to an embodiment of the present invention. The apparatus may include:

[0161] The stripe partitioning module 81 is used to divide the stripes of the RAID6 disk array to be downgraded into moving group stripes and recalculation group stripes;

[0162] The disk release module 82 is used to release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method.

[0163] The check block acquisition module 83 is used to acquire the first check block belonging to the moving group stripe in the target disk;

[0164] The data block replacement module 84 is used to replace the first check block in each move group stripe after the target disk is released with the data block in the target disk.

[0165] The first stripe acquisition module 85 is used to determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array based on the original RAID6 encoding formula corresponding to each mobile group stripe and the RAID5 encoding formula corresponding to the target disk after release, and to calculate the target parity block based on the relationship expression to obtain the first stripe corresponding to each mobile group stripe.

[0166] The disk array construction module 86 is used to recalculate the disk placement and verification blocks to meet the load balancing requirements of each recalculation group stripe, obtain each second stripe, and construct the target RAID5 disk array based on each first stripe and each second stripe.

[0167] As can be seen from the above technical solution, by dividing the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes, for the moving stripes, by making reasonable use of the relationship between the parity block of the original RAID6 disk array and the parity of the target RAID5 disk array after downgrading, an expression between the parity block of the RAID6 disk array and the parity of the target RAID5 disk array after downgrading is established. This greatly reduces the amount of disk read and write operations compared to traditional downgrading operations, reduces the bandwidth consumption caused by downgrading operations, and improves the performance of downgrading operations.

[0168] In one specific embodiment of the present invention, the strip division module 81 includes:

[0169] The data disk count acquisition submodule is used to obtain the number of data disks in a RAID6 disk array;

[0170] The stripe partitioning submodule is used to divide the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes according to the number of data disks plus 1:1 ratio.

[0171] In one specific embodiment of the present invention, the disk release module 82 is specifically a module that, when the pre-selected RAID6 disk array load balancing mode is left-handed non-aligned mode, determines the leftmost disk among the disks constituting the RAID6 disk array as the target disk and releases the target disk.

[0172] In one specific embodiment of the present invention, the first strip acquisition module 85 includes:

[0173] The strip selection submodule is used to select a strip from each mobile group strip and determine the selected strip as the target mobile group strip.

[0174] The fraction acquisition submodule is used to obtain the first fraction of the original RAID6 encoding formula obtained by XORing each data block and parity block in the target moving group stripe to 0.

[0175] The encoding formula acquisition submodule is used to obtain the RAID5 encoding formula corresponding to the XOR equal to 0 of each current data block and the target parity block in the target mobile group stripe after releasing the target disk and replacing the first parity block in the target mobile group stripe with the data blocks in the target disk.

[0176] The relational expression determination submodule is used to determine the relational expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array based on the first fraction and the RAID5 encoding formula. The relational expression is that the target parity block is equal to the XOR calculation of the two original parity blocks.

[0177] In one specific embodiment of the present invention, the strip selection submodule is specifically a module that randomly selects a strip from each moving group of strips.

[0178] In one specific embodiment of the present invention, the first strip acquisition module 85 includes a check block calculation submodule, which is specifically a module that performs an XOR calculation on two original check blocks to obtain a target check block.

[0179] In one specific embodiment of the present invention, the first strip acquisition module 85 includes:

[0180] The check block replacement submodule is used to replace the second check block (excluding the first check block) in the two original check blocks contained in each moving group strip with the target check block, and obtain the check block replacement result.

[0181] The first stripe determination submodule is used to determine the first stripe corresponding to each move group stripe based on the check block replacement result and the data block replacement result of the first check block in each move group stripe after releasing the target disk and replacing the data block in the target disk with the data block in the target disk.

[0182] For the method embodiments described above, see [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram of the device for downgrading a RAID6 disk array to a RAID5 disk array provided by the present invention. The device may include:

[0183] Memory 332 is used to store computer programs;

[0184] The processor 322 is configured to execute a computer program to implement the steps of the method embodiment described above for downgrading a RAID6 disk array to a RAID5 disk array.

[0185] For details, please refer to Figure 10 , Figure 10This is a schematic diagram illustrating the specific structure of a device for downgrading a RAID6 disk array to a RAID5 disk array, as provided in this embodiment. The device for downgrading a RAID6 disk array to a RAID5 disk array can vary significantly depending on its configuration or performance. It may include a processor (central processing unit, CPU) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the data processing device. Furthermore, the processor 322 may be configured to communicate with the memory 332, executing the series of instruction operations stored in the memory 332 on the device 301 for downgrading a RAID6 disk array to a RAID5 disk array.

[0186] The device 301 that downgrades a RAID6 disk array to a RAID5 disk array may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.

[0187] The steps in the method for downgrading a RAID6 disk array to a RAID5 disk array described above can be implemented by the structure of the device used to downgrade a RAID6 disk array to a RAID5 disk array.

[0188] Corresponding to the above method embodiments, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the following steps:

[0189] The RAID6 disk array to be downgraded is divided into moving stripes and recalculation stripes. The target disks in the RAID6 disk array are released according to the pre-selected RAID6 disk array load balancing method. The first parity block belonging to the moving stripe in the target disk is obtained. The first parity block in each moving stripe after the target disk is released is replaced with the data block in the target disk. Based on the original RAID6 encoding formula corresponding to each moving stripe and the corresponding RAID5 encoding formula after the target disk is released, the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is determined. The target parity block is calculated based on the relationship expression, and the first stripe corresponding to each moving stripe is determined based on the target parity block. The load-balanced disk placement and parity block calculation are re-performed for each recalculation stripe to obtain the second stripe. The target RAID5 disk array is constructed based on each first stripe and each second stripe.

[0190] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0191] For a description of the computer-readable storage medium provided by the present invention, please refer to the above method embodiments; the present invention will not be described in detail here.

[0192] 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 apparatuses, devices, and computer-readable storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0193] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for downgrading a RAID6 disk array to a RAID5 disk array, characterized in that, include: Divide the stripes of the RAID6 disk array to be downgraded into moving stripes and recalculation stripes; Release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method; Obtain the first checksum block belonging to the mobile group stripe in the target disk; The data blocks in the target disk are used to replace the first check block in each of the move group stripes after the target disk is released; Based on the original RAID6 encoding formula corresponding to each of the moving group stripes and the RAID5 encoding formula corresponding to the target disk after release, determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array. Calculate the target parity block based on the relationship expression, and determine the first stripe corresponding to each of the moving group stripes based on the target parity block. The recalculation group stripes are recalculated to satisfy the load balancing disk write and parity block calculations to obtain the second stripes, and the target RAID5 disk array is constructed based on the first stripes and the second stripes.

2. The method for downgrading a RAID6 disk array to a RAID5 disk array according to claim 1, characterized in that, The stripes of the RAID6 disk array to be downgraded are divided into moving stripes and recalculation stripes, including: Obtain the number of data disks in the RAID6 disk array; The stripes of the RAID6 disk array to be downgraded are divided into the moving group stripes and the recalculation group stripes according to the ratio of the number of data disks plus 1:

1.

3. The method for downgrading a RAID6 disk array to a RAID5 disk array according to claim 1, characterized in that, According to the pre-selected RAID6 disk array load balancing method, the target disk in each disk constituting the RAID6 disk array is released, including: When the pre-selected RAID6 disk array load balancing mode is left-handed non-aligned mode, the leftmost disk among the disks constituting the RAID6 disk array is determined as the target disk, and the target disk is released.

4. The method for downgrading a RAID6 disk array to a RAID5 disk array according to any one of claims 1 to 3, characterized in that, Based on the original RAID6 encoding formula corresponding to each of the moving stripes and the RAID5 encoding formula corresponding to the target disk after release, the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is determined, including: Select one strip from each of the aforementioned mobile group strips, and determine the selected strip as the target mobile group strip; Obtain the first fraction of the original RAID6 encoding formula obtained by XORing each data block and parity block in the target mobile group stripe to 0; After obtaining the target disk and releasing the target disk and replacing the first parity block in the target mobile group stripe with the data blocks in the target disk, the RAID5 encoding formula corresponding to the XOR equal to 0 of each current data block and the target parity block in the target mobile group stripe; Based on the first fraction and the RAID5 encoding formula, the relationship between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array is expressed as follows: the target parity block is equal to the XOR operation of two of the original parity blocks.

5. The method for downgrading a RAID6 disk array to a RAID5 disk array according to claim 4, characterized in that, Selecting one strip from each of the aforementioned moving group strips includes: Randomly select one strip from each of the aforementioned moving group strips.

6. The method for downgrading a RAID6 disk array to a RAID5 disk array according to claim 4, characterized in that, Calculating the target verification block based on the relational expression includes: The target check block is obtained by performing an XOR operation on the two original check blocks.

7. The method for downgrading a RAID6 disk array to a RAID5 disk array according to claim 6, characterized in that, The first stripe corresponding to each moving group stripe is determined based on the target verification block, including: The target check block is used to replace the second check block (excluding the first check block) in one of the two original check blocks contained in each of the moving group strips, to obtain the check block replacement result. Based on the check block replacement result and the data block replacement result of the first check block in each of the mobile group stripes after releasing the target disk and replacing the target disk with data blocks in the target disk, the first stripe corresponding to each of the mobile group stripes is determined.

8. An apparatus for downgrading a RAID6 disk array to a RAID5 disk array, characterized in that, include: The stripe partitioning module is used to divide the stripes of the RAID6 disk array to be downgraded into moving group stripes and recalculation group stripes; The disk release module is used to release the target disk in each disk constituting the RAID6 disk array according to the pre-selected RAID6 disk array load balancing method; The check block acquisition module is used to acquire the first check block belonging to the mobile group stripe in the target disk; The data block replacement module is used to replace the first check block in each of the moving group stripes after the target disk is released with the data block in the target disk; The first stripe acquisition module is used to determine the relationship expression between the original parity block of the RAID6 disk array and the target parity block of the downgraded target RAID5 disk array according to the original RAID6 encoding formula corresponding to each of the mobile group stripes and the RAID5 encoding formula corresponding to the target disk after release, and to calculate the target parity block according to the relationship expression to obtain the first stripe corresponding to each of the mobile group stripes. The disk array construction module is used to recalculate the disk placement and verification blocks to satisfy load balancing for each of the recalculation group stripes, to obtain each second stripe, and to construct the target RAID5 disk array based on each of the first stripes and each of the second stripes.

9. A device for downgrading a RAID6 disk array to a RAID5 disk array, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for downgrading a RAID6 disk array to a RAID5 disk array as described in any one of claims 1 to 7 when executing the computer program.

10. 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 method for downgrading a RAID6 disk array to a RAID5 disk array as described in any one of claims 1 to 7.