Disk array data recovery method, system, storage medium and device
By dividing the number of blocks of each disk in the disk array and using diagonal dropping method, the problem of slow recovery of error blocks in the disk array in the prior art is solved, and efficient data recovery and uniform disk IO access are achieved.
Patent Information
- Application Number
- CN202111108474.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-22
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2041-09-22
AI Technical Summary
The existing disk array has a slow recovery rate due to the need to read data on each disk after the error block occurs.
By obtaining the data blocks to be encoded and the number of recoverable data blocks, dividing the number of blocks for each disk, and using a diagonal disk drop method, ensuring that when an error occurs in the disk array, each disk is only read once, and the number of data blocks read is basically the same.
It realizes the high access speed of disk arrays during data recovery, and achieves the effect of parallel reading and high computing speed improvement by evenly allocating data reading pressure.
Smart Images

Figure CN113986608B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a disk array data recovery method, system, storage medium and device. Background Art
[0002] With the rapid development of communication technology and network technology, digital information has exploded exponentially, and data storage technology has also ushered in huge challenges. The reliability of data in storage systems and the energy consumption of storage systems are increasingly being concerned by people. Nowadays, facing such a huge data scale, the reliability of data in storage systems is inversely proportional to the number of components contained in the storage system, that is, the more components in the storage system, the lower the reliability of data in the storage system. According to relevant surveys, in an Internet data center consisting of 600 disks, about 30 disks will be damaged every month. In large-scale storage systems, the reduction in data reliability caused by disk failures is a very serious problem, and people have started to study related fault-tolerant technologies.
[0003] After the RAID structure was proposed, it became a key technology to increase storage space. RAID (Redundant Arrays of Independent Disks) is a disk array with redundant capabilities. The disk array is obtained by combining multiple independent disks together to obtain a disk group with huge capacity. The use of RAID storage technology can greatly increase storage capacity, improve the system's input and output request processing capabilities, and improve data reliability through data distributed storage technology, parallel access methods and information redundancy technology. RAID mainly uses data striping, data verification and mirroring technology to obtain stronger performance, higher reliability, better fault tolerance and stronger scalability. According to different data application requirements, the strategies and architectures of these three technologies can be used or combined. Therefore, according to different strategies and architectures, RAID can be divided into different levels: RAID 0, RAID 1, RAID 5, RAID 6, RAID 10. Among them, RAID 5 and RAID 6 require parity code when recovering data.
[0004] The parity code of RAID 5 (independent disk structure with distributed parity) exists on all disks. RAID5 has high read efficiency, average write efficiency, and good block-based collective access efficiency. Because its parity code is on different disks, it improves reliability. However, it does not solve the parallelism of data transmission well, and the design of the controller is also quite difficult. For RAID 5, most data transmissions only operate on one disk and can be operated in parallel. There is a "write loss" in RAID 5, that is, each write operation will generate four actual read / write operations, two of which read the old data and parity information, and two write the new data and parity information.
[0005] RAID 6 is an independent disk structure with two types of distributed storage and parity check codes. It is an extension of RAID 5 and is mainly used in situations where data must not be wrong. Due to the introduction of the second parity check value, N+2 disks are required, and the controller design becomes very complicated, further improving the data reliability of the disk array. However, more space is required to store the check value, and there is a higher performance loss in the write operation.
[0006] RAID 5 and RAID 6 can recover one and two error blocks respectively, but each data recovery is still limited by the speed limit of each disk when reading large amounts of data. Summary of the invention
[0007] In view of this, the purpose of the present invention is to provide a disk array data recovery method, system, storage medium and device to solve the problem in the prior art that when recovering data after an erroneous block in a disk array, the recovery speed is slow because data must be read on each disk.
[0008] Based on the above purpose, the present invention provides a disk array data recovery method, comprising the following steps:
[0009] Obtain the data blocks to be encoded, and obtain the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtain the number of blocks divided by each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein the blocks are used to store data blocks and check blocks;
[0010] The disk array is divided based on the number of blocks of each disk to sequentially obtain a plurality of divided disk groups each containing a plurality of disks;
[0011] Sequentially write the data blocks and check blocks of the first disk group to disks;
[0012] The diagonal placement mode of the current disk group is obtained based on the placement mode of the previous disk group, and the data blocks and check blocks of the current disk group are placed in the diagonal placement mode until several disk groups are placed in order, and the current disk group is not the first disk group.
[0013] In response to a disk in a disk array being damaged, data on the damaged disk is recovered based on a number of disk groups that have completed disk flushing.
[0014] In some embodiments, the diagonal placement mode of the current disk group is obtained based on the placement mode of the previous disk group, and the data blocks and the check blocks of the current disk group are placed in the diagonal placement mode until the placement of the disks of the plurality of disk groups is completed in sequence, including:
[0015] In response to the number of blocks per disk being equal to two, obtaining data corresponding to data of a first column of blocks of a first disk group and storing it in a diagonal block of a second disk group;
[0016] The data corresponding to the data of the second column block of the first disk group is obtained and stored in another diagonal block of the second disk group to complete the flushing of the second disk group.
[0017] In some embodiments, the diagonal placement mode of the current disk group is obtained based on the placement mode of the previous disk group, and the data blocks and the check blocks of the current disk group are placed in the diagonal placement mode until the placement of the plurality of disk groups is completed in sequence, and the method further includes:
[0018] In response to the number of blocks per disk being greater than two, obtaining data corresponding to data of a first column of blocks of a first disk group and storing it in a diagonal block of a second disk group;
[0019] Obtain data corresponding to the data of the nth column block of the first disk group, and store it in the right-shifted and left-shifted blocks of the diagonal of the second disk group, where n≥2;
[0020] The data corresponding to the last column of blocks of the disk group preceding the last disk group is obtained, and the data is stored in the remaining blocks of the last disk group until the plurality of disk groups are sequentially stored on disk.
[0021] In some embodiments, partitioning the disk array based on the number of blocks per disk includes:
[0022] Obtaining the total number of divided disks and the number of disks in each disk group based on the number of blocks in each disk, and obtaining the number of disk groups based on the total number of divided disks and the number of disks in each disk group;
[0023] The disk array is divided based on the number of disk groups, the number of disks each disk group has, and the number of blocks per disk.
[0024] In some embodiments, in response to a disk in a disk array being damaged, recovering data on the damaged disk based on a number of disk groups that have completed flushing includes:
[0025] In response to a disk in a disk array having a number of data blocks less than or equal to the number of recoverable data blocks being damaged, data on the damaged disk is recovered based on a number of disk groups that have completed flushing.
[0026] In some embodiments, the method further comprises:
[0027] In response to the total amount of data blocks to be encoded being less than the total amount of blocks after the disk array is divided, the difference data between the total amount of blocks after the disk array is divided and the total amount of data blocks to be encoded is set to binary zero.
[0028] In some embodiments, the method further comprises:
[0029] In response to the disk array being RAID 5, the number of recoverable data blocks is 1;
[0030] In response to the disk array being RAID 6, the number of recoverable data blocks is 2.
[0031] Another aspect of the present invention further provides a disk array data recovery system, comprising:
[0032] A block number obtaining module is configured to obtain data blocks to be encoded, and obtain the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtain the number of blocks divided by each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein a block is used to store data blocks and check blocks;
[0033] A disk array partitioning module is configured to partition the disk array based on the number of blocks of each disk, so as to sequentially obtain a plurality of disk groups each containing a plurality of disks after partitioning;
[0034] A first disk group flushing module configured to flush data blocks and check blocks of the first disk group to disks in sequence;
[0035] All disk group placement modules are configured to obtain a diagonal placement mode of a current disk group based on a placement mode of a previous disk group, and place data blocks and check blocks of the current disk group in the diagonal placement mode until the placement of multiple disk groups is completed in sequence, wherein the current disk group is not the first disk group; and
[0036] The data recovery module is configured to respond to a disk in the disk array being damaged and to recover data from the damaged disk based on a number of disk groups that have completed disk flushing.
[0037] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and the computer program instructions implement the above method when executed by a processor.
[0038] According to another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the computer program executes the above method when executed by the processor.
[0039] The present invention has at least the following beneficial technical effects:
[0040] The present invention obtains the number of blocks divided into each disk based on the total amount of data blocks to be encoded and the number of recoverable data blocks, and divides the disk array according to the number of blocks of each disk, thereby obtaining an optimal grouping scheme for the disks that can be realized, and the data is placed on each disk according to the arrangement mode set by the present invention, so that when the disk array performs data recovery after an error occurs, each disk is read only once, and the number of data blocks read is basically the same for each disk, thereby achieving uniform IO (data input and output) access of all disks, and data is read in parallel without affecting each other; the data reading pressure can be distributed to each disk more evenly, and the parallel reading of each disk is achieved, thereby achieving a higher access speed to the disk array, so as to achieve a greater improvement in the computing speed during data recovery. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of a disk array data recovery method provided according to an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a left-symmetrical RAID 5 disk placement according to the prior art;
[0044] Figure 3 A schematic diagram of sequential placement of a first group of 4*4 disks according to an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a second group of 4*4 diagonal placement according to an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of a RAID 5 according to an embodiment of the present invention having completed all disk flushing;
[0047] Figure 6 A schematic diagram of disk flushing of RAID 5 when k=18 provided according to an embodiment of the present invention;
[0048] Figure 7 A schematic diagram of a disk array data recovery system provided according to an embodiment of the present invention;
[0049] Figure 8 A schematic diagram of a computer-readable storage medium for implementing a disk array data recovery method according to an embodiment of the present invention;
[0050] Fig. 9 The present invention is a schematic diagram of the hardware structure of a computer device for executing a disk array data recovery method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0052] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two non-identical entities or non-identical parameters with the same name. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, other steps or units inherent to a process, method, system, product or device that includes a series of steps or units.
[0053] Based on the above purpose, a first aspect of an embodiment of the present invention provides an embodiment of a disk array data recovery method. Figure 1 FIG. 2 is a schematic diagram of an embodiment of a disk array data recovery method provided by the present invention. Figure 1 As shown, the embodiment of the present invention includes the following steps:
[0054] Step S10, obtaining the data blocks to be encoded, and obtaining the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtaining the number of blocks divided by each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein the blocks are used to store data blocks and check blocks;
[0055] Step S20: dividing the disk array based on the number of blocks of each disk to sequentially obtain a plurality of divided disk groups each containing a plurality of disks;
[0056] Step S30, sequentially write the data blocks and check blocks of the first disk group to disks;
[0057] Step S40: based on the disk placement mode of the previous disk group, a diagonal disk placement mode of the current disk group is obtained, and data blocks and check blocks of the current disk group are placed on disk in the diagonal disk placement mode until the placement of multiple disk groups is completed in sequence, wherein the current disk group is not the first disk group;
[0058] Step S50: In response to a disk in the disk array being damaged, data of the damaged disk is recovered based on a number of disk groups that have completed disk flushing.
[0059] The embodiment of the present invention obtains the number of blocks divided into each disk based on the total amount of data blocks to be encoded and the number of recoverable data blocks, and divides the disk array according to the number of blocks of each disk, thereby obtaining an optimal grouping scheme for the disks that can be realized, and the data is placed on each disk according to the arrangement mode set in the embodiment of the present invention, so that when the disk array performs data recovery after an error occurs, each disk is read only once, and the number of data blocks read is basically the same for each disk, thereby achieving uniform IO (data input and output) access of all disks, and data is read in parallel without affecting each other; the data reading pressure can be distributed to each disk more evenly, and the parallel reading of each disk is achieved, thereby achieving a higher access speed to the disk array, so as to achieve a greater improvement in computing speed during data recovery.
[0060] In some embodiments, a diagonal disk placement method of the current disk group is obtained based on a disk placement method of a previous disk group, and data blocks and check blocks of the current disk group are placed on disk in a diagonal manner until several disk groups complete the placement in sequence, including: in response to the number of blocks on each disk being equal to two, obtaining data corresponding to data of a first column of blocks of the first disk group, and storing it in a diagonal block of a second disk group; obtaining data corresponding to data of a second column of blocks of the first disk group, and storing it in another diagonal block of the second disk group to complete the placement of the second disk group.
[0061] In some embodiments, the diagonal disk placement method of the current disk group is obtained based on the disk placement method of the previous disk group, and the data blocks and check blocks of the current disk group are placed on disk in the diagonal disk placement method until several disk groups complete the placement in sequence. The method also includes: in response to the number of blocks of each disk being greater than two, obtaining data corresponding to the data of the first column of blocks of the first disk group, and storing it in the diagonal blocks of the second disk group; obtaining data corresponding to the data of the nth column of blocks of the first disk group, and storing it in the right-shifted and left-shifted blocks of the diagonal of the second disk group, where n≥2; obtaining data corresponding to the last column of blocks of the previous disk group of the last disk group, and storing the data in the remaining blocks of the last disk group, until several disk groups complete the placement in sequence.
[0062] In some embodiments, dividing the disk array based on the number of blocks of each disk includes: obtaining the total number of divided disks and the number of disks each disk group has based on the number of blocks of each disk, and obtaining the number of disk groups based on the total number of divided disks and the number of disks each disk group has; dividing the disk array based on the number of disk groups, the number of disks each disk group has, and the number of blocks of each disk.
[0063] In some embodiments, in response to a disk in a disk array being damaged, data recovery of the damaged disk based on several disk groups that have completed write-to-disk includes: in response to a disk in the disk array having a number less than or equal to the number of recoverable data blocks being damaged, data recovery of the damaged disk based on several disk groups that have completed write-to-disk.
[0064] In some embodiments, the method further includes: in response to the total amount of data blocks to be encoded being less than the total amount of blocks after the disk array is divided, setting the difference data between the total amount of blocks after the disk array is divided and the total amount of data blocks to be encoded to binary zero.
[0065] In some embodiments, the method further includes: in response to the disk array being RAID 5, the number of recoverable data blocks is 1; in response to the disk array being RAID 6, the number of recoverable data blocks is 2.
[0066] Specifically, a disk array data recovery method according to an exemplary embodiment of the present invention is as follows:
[0067] Disk arrays (RAID) include RAID 0, RAID 1, RAID 5, RAID 6, and RAID 10.
[0068] RAID 0 is the earliest RAID mode, i.e. data striping technology. RAID 0 is the simplest form of disk array formation, requiring only two or more hard disks, with low cost, and can improve the performance and throughput of the entire disk. RAID 0 does not provide redundancy or error repair capabilities, but the implementation cost is the lowest. The simplest way to implement RAID 0 is to connect N identical hard disks in hardware through an intelligent disk controller or in software using the disk driver in the operating system to create a large volume set. During use, computer data is written to each hard disk in sequence. Its biggest advantage is that it can double the capacity of the hard disk. If three 80GB hard disks are used to form a RAID 0 mode, the disk capacity will be 240GB. Its speed is exactly the same as that of a single hard disk. The biggest disadvantage is that if any hard disk fails, the entire system will be damaged, and the reliability is only 1 / N of a single hard disk.
[0069] RAID 1 is called disk mirroring. The principle is to mirror the data of one disk to another disk. That is to say, when data is written to one disk, a mirror file will be generated on another idle disk. The reliability and repairability of the system are guaranteed to the maximum extent without affecting the performance. As long as at least one disk in any pair of mirror disks in the system can be used, the system can operate normally even when half of the hard disks have problems. When a hard disk fails, the system will ignore the hard disk and use the remaining mirror disk to read and write data, which has good disk redundancy. Although this is absolutely safe for data, the cost will also increase significantly. The disk utilization rate is 50%. For four 80GB hard disks, the available disk space is only 160GB. In addition, the RAID system with hard disk failure is no longer reliable. The damaged hard disk should be replaced in time, otherwise the remaining mirror disk will also have problems, and the whole system will collapse. After replacing the new disk, the original data will take a long time to synchronize the mirror, and the outside world's access to the data will not be affected, but the performance of the whole system will be reduced at this time. Therefore, RAID 1 is mostly used in occasions where critical and important data is stored.
[0070] RAID 5 has only one parity block, generally named P. When encoding, assume that the data to be encoded is divided into n blocks, each data block is named d n , then the relationship is expressed as:
[0071]
[0072] Through the above setting, RAID 5 can use a check block p to correct errors when any of the above data blocks (d and p) has an error.
[0073] When implementing RAID 6, it is necessary to support two parity blocks at the same time: p and q. The relationship between them is:
[0074]
[0075] Through the above setting, RAID 6 can use two check blocks: p and q. When any one or two of the above data blocks (d, p and q) have errors, error correction can be performed.
[0076] Common RAID 5 and 6 data disk layouts are left-symmetrical or right-symmetrical. Here is an example of left-symmetrical RAID 5: Figure 2 The diagram shown is a left-symmetrical disk-falling schematic diagram of RAID 5 in the prior art.
[0077] Correspondingly, right symmetry means placing the check block to the right and so on.
[0078] For this commonly used method, the above Figure 1 For example, if disk 1 fails, we need to restore the data blocks of disk 1: 1, 5, 9, 13, p5. For data block 1, the required operation is:
[0079]
[0080] Here 1,2,3,4 refers to Figure 1 Data blocks 1, 2, 3, and 4 in the disk. Then, through the calculation of formula (3), it can be known that in order to recover data block 1, the first data blocks in disks 2-5 need to be taken out for calculation.
[0081] Similarly, for data block 5, when restoring it, it is necessary to take out 6, 7, p2, and 8 from disk 2-5 for calculation.
[0082] To restore the data on disk 1, each data block on disks 2-5 needs to be taken out for calculation, and the data in the disk needs to be read in sequence. This recovery method requires sequential retrieval, which means that the recovery of disk 1 is also sequential.
[0083] Assuming that the read speed of each disk is n times of a data block, then for Figure 1 In the example where a disk is divided into 5 data blocks, a speed of 5n is required. This recovery is quite slow.
[0084] RAID 6 has the same disadvantage, because it needs to restore two data blocks, p and q, and thus takes twice the time mentioned above.
[0085] The disk array data recovery method according to the embodiment of the present invention improves this problem.
[0086] The implementation method of the embodiment of the present invention is as follows:
[0087] (1) Calculate the total amount of divided data blocks required after encoding.
[0088] The calculation here involves RAID 5 or 6, which are RAID code algorithms that can perform data recovery. Because the data cannot be recovered for RAID 0, there is no need to decode and perform corresponding data calculation and reading operations. Similarly, for RAID 1, because it is a mirror image, the data corresponding to the data block is a fixed position, and no calculation is involved.
[0089] Taking RAID 5 or 6 as an example, for the k data blocks that need to be encoded, the total number of data blocks is divided based on the number of recoverable data blocks m that the encoding algorithm can support. The formula is:
[0090] (x+m) 3 -m(x+m) 2 ≥k (4)
[0091] Here x+m is the number of data blocks divided into each disk.
[0092] Formula (4) has already determined m and k, so what needs to be found is x. The "≥" in formula (4) is because under the premise that both x and m must be integers, and m can recover the most error data blocks based on the RAID algorithm, it is not necessarily possible to find x that satisfies "=" any k, so what needs to be found at this time is the case that satisfies the condition that is greater than and closest to k.
[0093] (2) Divide the disk placement positions based on the obtained x.
[0094] For better explanation, the above situation is described by using RAID 5 and a total of 40 data blocks to be encoded.
[0095] First, solve formula (4). Here, because RAID 5 is used, m = 1. Fill in formula (4) to get:
[0096]
[0097] However, x can only be an integer, so to meet condition 1, the best value of x here is x=3.
[0098] At this time, m=1, and each disk has 3+1=4 blocks, of which 3 are data blocks and 1 is a check block.
[0099] Based on 3+1=4, a total of disks are set, and each (x+m)=4 disks are divided into a group. The disk placement positions are adjusted in sequence, and then the disk placement positions are generated in sequence. The specific operations are as follows:
[0100] a. Generate the first set of placement positions sequentially:
[0101] Taking the above situation as an example, the first group of 4*4 disk slots is generated as follows:
[0102] like Figure 3 The schematic diagram shown is a schematic diagram of sequential disk placement by the first group of 4*4. The disk placement by the first group of 4*4 is sequential, which is exactly the same as the normal RAID solution.
[0103] b. Generate the second set of placement positions sequentially:
[0104] The second group is stored in the first column of the first group and stored diagonally, and then the second column of the first group is shifted right by one position, as shown in the gray block in the figure. Then the third column of the first group is shifted right by one position, and so on.
[0105] The second set of placements is as follows: Figure 4 The diagram shows the second group of 4*4 diagonal placements.
[0106] c. Generate all placement positions in sequence:
[0107] For the second set of disk placement, use the method in b to generate the third set in sequence, and then generate all the disk placement methods in the same way, such as Figure 5 The following is a diagram showing that all RAID 5 files have been flushed to disk:
[0108] Each data represents a combination of the same type of data block and its corresponding check block. As shown in the figure above, the number 1 has four groups. Because it is RAID 5, one group is the check block and the other three groups are data blocks. Because the encoded check blocks and data blocks have the same value for recovery operations, they are not distinguished here. Based on the encoding requirements, they can be written to the disk in the encoding way.
[0109] In the above example, a total of 48 data blocks are allocated, but as mentioned in the example, only 40 data blocks need to be stored. In this case, the data at the lower ranking can be set to zero on average (not used).
[0110] The following example illustrates the decoding balance:
[0111] For example, when an error occurs on disk 4, the corresponding data blocks are 4, 8, 12, and 16;
[0112] The recovery of data block 4 requires taking out a block 4 of data from disk 8, disk 12, and disk 16 respectively;
[0113] To recover block 8, you need to fetch block 8 from disk 5, disk 11, and disk 15 respectively;
[0114] The recovery of data block 12 requires taking out a block of data 12 from disk 6, disk 12, and disk 14 respectively;
[0115] The recovery of data block 16 requires taking out a block of data 16 from disk 7, disk 10, and disk 13 respectively.
[0116] From the above, it can be seen that disks 5-16 are involved in the verification and recovery operation, and only disk 12 is read twice, and the remaining disks are each read only once, achieving the maximum averaging of disk reading and distributing the load evenly to each disk. Except for disk 12, each disk is read evenly.
[0117] The following describes the situation when the data block is equal to the allocatable number:
[0118] Assume that RAID 5 is used, and the number of data blocks to be encoded is k=18. Since RAID 5 is used, m=1, and then x=2 can be obtained.
[0119] The disk placement scheme implemented according to this method is as follows Figure 6 The diagram shown is a schematic diagram of disk flushing of RAID 5 when k=18 according to an embodiment of the present invention.
[0120] according to Figure 6 It can be seen that the embodiment of the present invention can not only completely write all data to the disk at this time, but also in the case of the example, when any disk error is recovered, each disk is read only once, and the data blocks read by each disk are of the same size, so that the load pressure is evenly distributed to each disk, and all disks can be read in parallel to achieve the highest access speed, which obviously has the advantage of parallel high speed.
[0121] A second aspect of the embodiments of the present invention further provides a disk array data recovery system. Figure 7 FIG. 1 is a schematic diagram of an embodiment of a disk array data recovery system provided by the present invention. Figure 7As shown, a disk array data recovery system includes: a block number acquisition module 10, configured to obtain data blocks to be encoded, and obtain the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtain the number of blocks divided for each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein the block is used to store data blocks and check blocks; a disk array division module 20, configured to divide the disk array based on the number of blocks of each disk, so as to obtain a number of disk groups containing multiple disks after division; a first disk group placement module 30, configured to place the data blocks and check blocks of the first disk group on disk in sequence; an all disk group placement module 40, configured to obtain a diagonal placement mode of the current disk group based on the placement mode of the previous disk group, and place the data blocks and check blocks of the current disk group on disk according to the diagonal placement mode until the placement of several disk groups is completed in sequence, wherein the current disk group is not the first disk group; and a data recovery module 50, configured to respond to a disk in the disk array being damaged, and to recover data from the damaged disk based on the several disk groups that have completed placement.
[0122] A third aspect of the embodiments of the present invention further provides a computer-readable storage medium. Figure 8 A schematic diagram of a computer-readable storage medium for implementing a disk array data recovery method according to an embodiment of the present invention is shown. Figure 8 As shown, the computer-readable storage medium 3 stores computer program instructions 31. When the computer program instructions 31 are executed by a processor, the method of any one of the above embodiments is implemented.
[0123] It should be understood that, in the absence of mutual conflicts, all the embodiments, features and advantages described above for the disk array data recovery method according to the present invention are also applicable to the disk array data recovery system and storage medium according to the present invention.
[0124] A fourth aspect of the embodiments of the present invention further provides a computer device, including: Fig. 9 The memory 402 and the processor 401 are shown, and the memory 402 stores a computer program, and when the computer program is executed by the processor 401, the method of any one of the above embodiments is implemented.
[0125] like Fig. 9 FIG. 1 is a schematic diagram of the hardware structure of a computer device for executing a disk array data recovery method according to an embodiment of the present invention. Fig. 9Taking the computer device shown in FIG. 4 as an example, the computer device includes a processor 401 and a memory 402, and may also include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means. Fig. 9 The example of the bus connection is taken as an example. The input device 403 can receive input digital or character information, and generate key signal input related to user settings and function control of the disk array data recovery system. The output device 404 can include display devices such as a display screen.
[0126] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the disk array data recovery method in the embodiment of the present application. The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the use of the disk array data recovery method, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] The processor 401 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 402, that is, implements the disk array data recovery method of the above method embodiment.
[0128] Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. As an example and not by way of limitation, a nonvolatile memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. A volatile memory may include a random access memory (RAM), which may act as an external cache memory. As an example and not by way of limitation, RAM may be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to include, but are not limited to, these and other suitable types of memory.
[0129] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0130] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0131] It should be understood that, as used herein, the singular form "a" or "an" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the items listed in association. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for description only and do not represent the advantages and disadvantages of the embodiments.
[0132] Those skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A disk array data recovery method, characterized in that: The following steps are involved: Obtaining data blocks to be encoded, and obtaining the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtaining the number of blocks divided by each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein the blocks are used to store data blocks and check blocks; Dividing the disk array based on the number of blocks of each disk to sequentially obtain a plurality of divided disk groups each containing a plurality of disks; Sequentially write the data blocks and check blocks of the first disk group to disks; Obtaining a diagonal disk placement mode of a current disk group based on a disk placement mode of a previous disk group, and placing data blocks and check blocks of the current disk group on disks according to the diagonal disk placement mode until the plurality of disk groups complete the placement in sequence, wherein the current disk group is not the first disk group; In response to a disk in the disk array being damaged, data on the damaged disk is recovered based on the plurality of disk groups that have completed disk flushing.
2. The method according to claim 1, characterized in that Obtaining a diagonal disk placement mode of a current disk group based on a disk placement mode of a previous disk group, and placing data blocks and check blocks of the current disk group on disks according to the diagonal disk placement mode until the plurality of disk groups complete the placement in sequence includes: In response to the number of blocks per disk being equal to two, obtaining data corresponding to data of a first column of blocks of a first disk group and storing it in a diagonal block of a second disk group; The data corresponding to the data of the second column block of the first disk group is obtained, and stored in another diagonal block of the second disk group, so as to complete the placement of the second disk group.
3. The method according to claim 1, characterized in that The step of obtaining a diagonal disk placement mode of a current disk group based on a disk placement mode of a previous disk group, and placing data blocks and check blocks of the current disk group on disks according to the diagonal disk placement mode until the plurality of disk groups complete the placement in sequence further includes: In response to the number of blocks per disk being greater than two, obtaining data corresponding to data of a first column of blocks of a first disk group and storing the data in a diagonal block of a second disk group; Obtain data corresponding to the data of the nth column block of the first disk group, and store the data in the right-shifted and left-shifted blocks of the diagonal of the second disk group, where n≥2; The data corresponding to the last column of blocks of the disk group preceding the last disk group is obtained, and the data is stored in the remaining blocks of the last disk group until the plurality of disk groups are sequentially written to disks.
4. The method according to claim 1, characterized in that: Dividing the disk array based on the number of blocks per disk includes: Obtaining the total number of divided disks and the number of disks in each disk group based on the number of blocks in each disk, and obtaining the number of disk groups based on the total number of divided disks and the number of disks in each disk group; The disk array is divided based on the number of disk groups, the number of disks each disk group has, and the number of blocks per disk.
5. The method according to claim 1, characterized in that In response to a disk in the disk array being damaged, recovering data on the damaged disk based on the plurality of disk groups that have completed disk flushing includes: In response to a disk in the disk array having a number less than or equal to the number of recoverable data blocks being damaged, data on the damaged disk is recovered based on the plurality of disk groups that have completed flushing.
6. The method according to claim 1, characterized in that Also includes: In response to the total amount of the data blocks to be encoded being less than the total amount of blocks after the disk array is divided, the difference data between the total amount of blocks after the disk array is divided and the total amount of the data blocks to be encoded is set to binary zero.
7. The method according to claim 1, characterized in that Also includes: In response to the disk array being RAID 5, the number of recoverable data blocks is 1; In response to the disk array being RAID 6, the number of recoverable data blocks is 2.
8. A disk array data recovery system, characterized in that: include: A block number obtaining module is configured to obtain data blocks to be encoded, and obtain the number of recoverable data blocks supported by the disk array based on the encoding algorithm used, and obtain the number of blocks divided by each disk based on the total number of data blocks to be encoded and the number of recoverable data blocks, wherein the blocks are used to store data blocks and check blocks; A disk array partitioning module configured to partition the disk array based on the number of blocks of each disk, so as to sequentially obtain a plurality of disk groups each containing a plurality of disks after partitioning; A first disk group flushing module configured to flush data blocks and check blocks of the first disk group to disks in sequence; a disk placement module for all disk groups, configured to obtain a diagonal disk placement mode of a current disk group based on a disk placement mode of a previous disk group, and place data blocks and check blocks of the current disk group in disk placement according to the diagonal disk placement mode until the plurality of disk groups complete the placement in sequence, wherein the current disk group is not the first disk group; and The data recovery module is configured to respond to a disk in the disk array being damaged and to recover data from the damaged disk based on the plurality of disk groups that have completed disk flushing.
9. A computer-readable storage medium, characterized in that: Computer program instructions are stored, and when the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Method for constructing redundant array of inexpensive disks (RAID) 6 level
CN101901115A
Disk array data recovery method and device based on RAID6
CN111737049A