Data recovery method and device of storage device, medium and product
By using the verification results and verification algorithm of the verification storage device, data is restored when multiple storage devices fail at the same time, solving the problem that the prior art cannot recover multiple device failures, and realizing data recovery of any number of failed storage devices.
Patent Information
- Application Number
- CN202510956617.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-07-11
AI Technical Summary
The prior art cannot recover data in the failed storage device when three or more storage devices fail at the same time.
The data in each data storage device is restored by a verification result in the verification storage device of no less than the number of failed data storage devices and the corresponding verification algorithm.
The data in the failed storage device can be recovered when three or more storage devices fail at the same time, and the limitations of the prior art are solved, and the purpose of restoring data in any number of failed storage devices is achieved.
Smart Images

Figure CN120469852A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a data recovery method, device, medium and product for a storage device. Background Art
[0002] With the rapid development of technologies such as cloud computing, mobility, social networking, and big data, the amount of data generated is increasing, so the demand for data storage is constantly increasing, and storage devices need to be able to not affect the normal operation of related businesses in the event of occasional failures.
[0003] Currently, a storage system consists of multiple storage devices. When a single storage device fails, data in the failed device can be recovered using a storage method that combines data striping and distributed parity. When two storage devices fail simultaneously, data in the failed device can be recovered using a storage method that combines data striping and dual distributed parity. However, current related technologies have significant limitations and are unable to recover data from failed devices when three or more storage devices fail simultaneously. Summary of the Invention
[0004] The present application provides a data recovery method, device, medium and product for a storage device, which can recover data in failed storage devices when three or more storage devices fail at the same time.
[0005] This application provides a data recovery method for a storage device, comprising:
[0006] Detect whether each storage device in the storage system has a fault;
[0007] If it is detected that at least three storage devices among the storage devices have failed, identifying the type of each failed storage device;
[0008] If all the failed storage devices are data storage devices, performing an inverse operation on the data stored in each non-faulty data storage device using verification results stored in verification storage devices of a number not less than the number of failed data storage devices and corresponding verification algorithms to restore the data in each failed data storage device;
[0009] If all the failed storage devices are verification storage devices, the data stored in each data storage device is calculated using a verification algorithm corresponding to each failed verification storage device to restore the verification result in each failed verification storage device;
[0010] If the faulty storage device includes at least one data storage device and at least one verification storage device, the data stored in each non-faulty data storage device is inversely operated using the verification results and corresponding verification algorithms stored in no less than the number of faulty data storage devices to restore the data in each faulty data storage device, and the data stored in each data storage device is operated using the verification algorithm corresponding to each faulty verification storage device to restore the verification result in each faulty verification storage device.
[0011] The present application also provides a data recovery device for a storage device, comprising:
[0012] A detection module is used to detect whether each storage device in the storage system has a fault;
[0013] a processing module, configured to identify a type of each failed storage device if it is detected that at least three storage devices among the storage devices have failed;
[0014] The processing module is further configured to, if all the failed storage devices are data storage devices, perform an inverse operation on the data stored in each non-faulty data storage device using verification results stored in verification storage devices of a number not less than the number of failed data storage devices and corresponding verification algorithms to restore the data in each failed data storage device;
[0015] The processing module is further configured to, if all the failed storage devices are verification storage devices, perform operations on the data stored in each data storage device using a verification algorithm corresponding to each failed verification storage device to restore the verification results in each failed verification storage device;
[0016] The processing module is also used to, if the faulty storage device includes at least one data storage device and at least one verification storage device, perform inverse operations on the data stored in each non-faulty data storage device through the verification results and corresponding verification algorithms stored in the verification storage devices, which are not less than the number of the faulty data storage devices, to restore the data in each faulty data storage device, and perform operations on the data stored in each data storage device through the verification algorithms corresponding to each faulty verification storage devices to restore the verification results in each faulty verification storage device.
[0017] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data recovery methods for storage devices when executing the computer program.
[0018] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data recovery methods for storage devices are implemented.
[0019] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned data recovery methods for storage devices when executed by a processor.
[0020] The data recovery method, device, medium, and product provided by the present application enable the purpose of recovering the data in each data storage device when multiple data storage devices fail by using the verification results and corresponding verification algorithms in a number of verification storage devices that are no less than the number of failed data storage devices. Therefore, based on the method provided by the present application, when three or more data storage devices fail, the data in each failed data storage device can be recovered by using the verification results and corresponding verification algorithms in three or more verification storage devices. Therefore, the technical problem of being unable to recover the data in the failed storage device when three or more storage devices fail simultaneously can be solved, thereby achieving the purpose of recovering data in any number of failed storage devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application;
[0023] Figure 2 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 1 ;
[0024] Figure 3 A schematic diagram of an example striped storage format;
[0025] Figure 4 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 2 ;
[0026] Figure 5 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 3 ;
[0027] Figure 6The correspondence between the check block and the data block is shown in the example Figure 1 ;
[0028] Figure 7 The correspondence between the check block and the data block is shown in the example Figure 2 ;
[0029] Figure 8 The correspondence between the check block and the data block is shown in the example Figure 3 ;
[0030] Figure 9 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 4 ;
[0031] Figure 10 A schematic diagram of an example storage system;
[0032] Figure 11 The overall process diagram of data recovery for the example is as follows;
[0033] Figure 12 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 5 ;
[0034] Figure 13 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 6 ;
[0035] Figure 14 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 7 ;
[0036] Figure 15 Schematic diagram of the verification algorithm operation for example;
[0037] Figure 16 A schematic diagram of the structure of a data recovery device for a storage device provided in an embodiment of the present application;
[0038] Figure 17 This is a schematic diagram of the structure of the electronic device provided in this application. DETAILED DESCRIPTION
[0039] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0040] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0041] Figure 1 A schematic diagram of an application scenario provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the storage system includes multiple storage devices. When a storage device fails, data recovery is required on the failed storage device to obtain a storage device after data recovery. The storage system involved in the embodiment of the present application can be a Redundant Array of Independent Disks (RAID). RAID is a technology that combines multiple independent physical hard disks in different ways to form a hard disk group to provide higher storage performance and data redundancy than a single hard disk. Independent physical hard disks can be used as storage devices in the embodiment of the present application.
[0042] In current related technologies, when a single storage device fails, the data in the failed storage device can be restored based on the RAID5 structure. Specifically, RAID5 requires at least three storage devices, and the data is stored in a striped form on the storage devices. At the same time, corresponding verification results are generated and distributed on the three storage devices. When one of the storage devices fails, the data on the failed storage device can be repaired using the data and verification results on the other storage devices. When two storage devices fail at the same time, the data in the failed storage device can be restored based on the RAID6 structure. Specifically, RAID6 requires at least four storage devices, and uses two independent verification algorithms to generate two sets of verification results distributed on different storage devices. This allows the data on the failed storage device to be repaired using the data on the other two storage devices and the two sets of verification results when two storage devices fail at the same time. However, current related technologies have significant limitations and are unable to restore data in a failed storage device when three or more storage devices fail at the same time.
[0043] In the embodiment of the present application, when multiple data storage devices fail, the data in each data storage device is recovered using the verification results and corresponding verification algorithms in a number of verification storage devices that are no less than the number of failed data storage devices. Therefore, based on the method provided by the present application, when three or more data storage devices fail, the data in each failed data storage device can be recovered using the verification results and corresponding verification algorithms in three or more verification storage devices. This solves the technical problem of being unable to recover data in failed storage devices when three or more storage devices fail simultaneously, thereby achieving the goal of recovering data in any number of failed storage devices.
[0044] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0045] Figure 2 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 1 ,like Figure 2 As shown, an embodiment of the present application provides a data recovery method for a storage device, and the method is described in detail as follows:
[0046] S201: Detect whether each storage device in the storage system has a fault.
[0047] In combination with the scenario example, the voltage of each storage device in the storage system can be detected. If the voltage of the storage device is abnormal, it can be determined that the storage device has failed.
[0048] S202: If it is detected that at least three storage devices among the storage devices fail, identify the type of each failed storage device.
[0049] In this example scenario, the types of storage devices in a storage system include data storage devices and verification storage devices. The storage system includes multiple data storage devices and multiple verification storage devices. The data storage devices are used to store data, and the verification storage devices are used to store verification results. Each verification storage device corresponds to a different verification algorithm, and the verification results stored in the verification storage devices are the results of operating on the data stored in each data storage device using the corresponding verification algorithm.
[0050] S203: If all the faulty storage devices are data storage devices, then the data stored in each non-faulty data storage device is inversely operated using the verification results stored in verification storage devices whose number is not less than the faulty data storage devices and the corresponding verification algorithm to restore the data in each faulty data storage device.
[0051] In a scenario example, assume that there are n data storage devices and m verification storage devices in a storage system, and there are three faulty storage devices, where m is greater than 3. If the three faulty storage devices are all data storage devices, then there are n-3 non-faulty storage devices, and none of the verification storage devices have faults. In this case, three verification storage devices can be selected from the m verification storage devices for data recovery. Specifically, since each verification storage device has a different verification algorithm, the verification results stored by each verification device are different. The verification algorithms corresponding to the three selected verification storage devices are determined, for example, verification algorithm 1, verification algorithm 2, and verification algorithm 3, and the corresponding verification results are verification result 1, verification result 2, and verification result 3, respectively. Verification algorithm 1 and verification result 1 are used to perform an inverse operation on the data stored in n-3 non-faulty storage devices. Verification algorithm 2 and verification result 2 are used to perform an inverse operation on the data stored in n-3 non-faulty storage devices. Verification algorithm 3 and verification result 3 are used to perform an inverse operation on the data stored in n-3 non-faulty storage devices, thereby obtaining three inverse operation results. The three inverse operation results are solved to determine the recovery data of the three faulty storage devices. The recovery data corresponding to the three faulty storage devices are stored back in the corresponding storage devices to restore the data stored in the three faulty storage devices.
[0052] S204: If all the failed storage devices are verification storage devices, then the data stored in each data storage device is calculated using a verification algorithm corresponding to each failed verification storage device to restore the verification result in each failed verification storage device.
[0053] Combined with the scenario example and the above content, taking the case of three faulty storage devices as an example, if the three faulty storage devices are all verification storage devices, it means that none of the n data storage devices have failed. For example, the faulty verification storage devices are verification storage device 1, verification storage device 2, and verification storage device 3, and the corresponding verification algorithms are verification algorithm 1, verification algorithm 2, and verification algorithm 3, respectively. Verification algorithm 1 is used to calculate the data stored in the n data storage devices to obtain the verification result corresponding to verification storage device 1. Verification algorithm 2 is used to calculate the data stored in the n data storage devices to obtain the verification result corresponding to verification storage device 2. Verification algorithm 3 is used to calculate the data stored in the n data storage devices to obtain the recovery verification result corresponding to verification storage device 3. The recovery verification results corresponding to each verification storage device are then stored back in the corresponding verification storage device to restore the verification results of the three faulty verification storage devices.
[0054] S205: If the faulty storage device includes at least one data storage device and at least one verification storage device, perform inverse operations on the data stored in each non-faulty data storage device using the verification results and corresponding verification algorithms stored in no less than the number of faulty data storage devices to restore the data in each faulty data storage device, and perform operations on the data stored in each data storage device using the verification algorithms corresponding to each faulty verification storage device to restore the verification results in each faulty verification storage device.
[0055] In conjunction with the above, taking the example of a storage device with three faults, if it includes one data storage device and two verification storage devices, one verification storage device can be selected from the m verification storage devices for data recovery. Verification algorithm 1 and verification result 1 are determined to correspond to the selected verification storage device. Verification algorithm 1 and verification result 1 are then used to perform inverse operations on the data stored in n-1 non-faulty storage devices to obtain recovered data for the faulty data storage device. The recovered data for the faulty data storage device is then stored back in the faulty data storage device to recover the data in the faulty storage device. Subsequently, similar to S204, the verification algorithms corresponding to the two verification storage devices can be re-used to calculate the data stored in the n data storage devices to obtain recovered verification results corresponding to the two verification storage devices. The recovered verification results corresponding to the two verification storage devices are then stored back in the corresponding verification storage devices to recover the verification results for the two faulty verification storage devices.
[0056] Similarly, if two data storage devices and one verification storage device are included, two verification storage devices can be selected from the m verification storage devices for data recovery. Verification algorithms 1 and 2 and verification results 1 and 2 corresponding to the two selected verification storage devices are determined. Verification algorithm 1 and verification result 1 are then used to perform an inverse operation on the data stored in n-2 non-faulty storage devices. Verification algorithm 2 and verification result 2 are then used to perform an inverse operation on the data stored in n-2 non-faulty storage devices to obtain recovered data from the two faulty data storage devices. The recovered data from the two faulty data storage devices are then stored back in the corresponding two faulty data storage devices to recover the data in the faulty storage devices. Subsequently, similar to S204, the verification algorithm corresponding to the verification storage device can be re-used to calculate the data stored in the n data storage devices to obtain a recovered verification result corresponding to the verification storage device. The recovered verification result corresponding to the verification storage device is then stored back in the verification storage device to recover the verification result of the faulty verification storage device.
[0057] Based on the method provided in this example, when three or more data storage devices fail, the data in each failed data storage device can be recovered using the verification results and corresponding verification algorithms from the three or more verification storage devices. This solves the technical problem of being unable to recover data from a failed storage device when three or more storage devices fail simultaneously, allowing data from any number of failed storage devices to be recovered.
[0058] Optionally, the data stored in each data storage device is composed of multiple data blocks, and the verification results stored in each verification storage device are composed of multiple verification blocks; accordingly, the method further includes:
[0059] The data block group corresponding to each check block in each check storage device is determined by the check algorithm corresponding to each check storage device.
[0060] In combination with the scenario example, the data stored in each data storage device and the verification results stored in each verification storage device are all stored in stripes. Striped storage means dividing data into blocks of fixed size and distributing them to different storage devices according to certain rules. Figure 3 A schematic diagram of striped storage is shown as an example. Figure 3 As shown, the data stored in each data storage device includes multiple data blocks, and the verification results stored in each verification storage device include multiple check blocks. Therefore, when the verification storage device calculates the verification result according to the corresponding verification algorithm, it calculates it in units of data blocks. For example, for the check block 1 in the verification storage device 1, if the data block group corresponding to the check block 1 includes: data block 1 in the data storage device 1, data block 1 in the data storage device 2, data block 1 in the data storage device 3, and data block 1 in the data storage device n, the check block 1 in the verification storage device 1 can be obtained by performing operations on the data block 1 in the data storage device 1, the data block 1 in the data storage device 2, the data block 1 in the data storage device 3, and the data block 1 in the data storage device n through the verification algorithm 1. Similarly, in this way, each check block can be obtained by determining the corresponding data block group and performing operations on the target data block in the data block group.
[0061] Based on the method provided in this example, storage is performed in data blocks, which can improve the efficiency of data operations.
[0062] Optional, Figure 4 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 2 ,like Figure 4 As shown, the data block group corresponding to each check block in each check storage device is determined by the check algorithm corresponding to each check storage device, including:
[0063] S401: Determine the offset values corresponding to the verification algorithms corresponding to the respective verification storage devices.
[0064] In combination with the scenario example, the verification algorithm corresponding to each verification storage device includes the carried misalignment value, and the misalignment value may be a preset value.
[0065] S402: Based on the misalignment value, determine the target data block corresponding to each check block from each data storage device.
[0066] Combined with the scene example, combined with Figure 3 The misalignment value is the misalignment value between the data blocks of two adjacent data storage devices. For example, when the misalignment value carried by the verification algorithm corresponding to the verification storage device 1 is a, in the data block group corresponding to the data block 1, if the target data block corresponding to the data storage device 1 is data block 1, then the target data block corresponding to the data storage device 2 is data block 1+a. Similarly, the target data blocks corresponding to each data storage device in the data block group corresponding to the data block 1 can be determined.
[0067] S403: Combine the target data blocks corresponding to the data storage devices to obtain a data block group corresponding to the check block.
[0068] In combination with the scenario example, the target data blocks corresponding to the data block 1 in each data storage device are combined into corresponding data block groups.
[0069] Based on the method provided in this example, the target data blocks are determined in sequence according to the misalignment values, which can ensure the correctness of the obtained data block group.
[0070] Optional, Figure 5 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 3 ,like Figure 5 As shown, S402 includes:
[0071] S501: Determine the first sequence number of the check block.
[0072] Combined with the scene example, combined with Figure 3 Taking the check storage device 1 as an example, the check blocks are sorted according to 1-k. The first sequence number refers to the specific order of the check block. For example, if the first sequence number is 3, it refers to check block 3.
[0073] S502: Determine a first data storage device according to a preset order among the data storage devices.
[0074] In combination with the scenario example, the data storage devices are sorted according to 1-n, and the data storage device 1 can be determined as the first data storage device.
[0075] S503: For the first data storage device, according to a preset order among the data blocks in the first data storage device, determine the data block corresponding to the first sequence number as the target data block corresponding to the first data storage device.
[0076] In combination with the scenario example, the data blocks in the first data storage device are sorted in the order of 1-k, and the data block with sequence number 3, that is, data block 3 in data storage device 1, is determined as the target data block of data storage device 1.
[0077] S504: For each non-first data storage device, determine the corresponding target data block according to the sequence number corresponding to each non-first data storage device and the preset order, offset value and first sequence number between each data block in each non-first data storage device.
[0078] Combined with the scenario example, according to the sorting of data storage devices 1-n, for data storage device 2 and subsequent data storage devices, the data blocks therein are also sorted in the order of 1-k and determined according to the misalignment value. For example, the misalignment value of verification algorithm 1 corresponding to verification storage device 1 is 1, then for data storage device 2, data block 4 with serial number 4 is determined as the target data block of data storage device 2, and for data storage device 3, data block 5 with serial number 5 is determined as the target data block of data storage device 3, and so on, to obtain the target data blocks corresponding to each non-first data storage device.
[0079] Based on the method provided in this example, the purpose of sequentially determining the data block groups corresponding to each check block in each check storage device and the target data blocks corresponding to each data storage device included in the data block group can be achieved.
[0080] Optionally, S504 includes:
[0081] If the misalignment value is a preset first constant, then according to the preset order between the data blocks in each non-first data storage device, the data blocks with the corresponding first serial numbers in each non-first data storage device are determined as the target data blocks corresponding to each non-first data storage device.
[0082] Combined with the scenario example, the first constant is the preset value 0, Figure 6 The correspondence between the check block and the data block is shown in the example Figure 1 ,like Figure 6As shown, taking the verification storage device 1 as an example, if the misalignment value carried by the corresponding verification algorithm is 0, it means that there is no misalignment value between the target data blocks in each data storage device. Therefore, for the verification block 1 in the verification storage device 1, the sequence number of each target data block in the corresponding data block group is 1, so they are: data block 1 in data storage device 1, data block 1 in data storage device 2, data block 1 in data storage device 3, and data block 1 in data storage device n. Similarly, for the verification block 2 in the verification storage device 1, the sequence number of each target data block in the corresponding data block group is 2, so they are: data block 2 in data storage device 1, data block 2 in data storage device 2, data block 2 in data storage device 3, and data block 2 in data storage device n. And so on, to determine the data block group corresponding to each verification block in the verification storage device 1.
[0083] Based on the method provided in this example, the accuracy of the obtained target data block can be guaranteed.
[0084] Optionally, S504 includes:
[0085] The maximum sequence number of the data block is determined by the preset order between the data blocks.
[0086] If the offset value is the second constant, the target data block corresponding to each non-first data storage device is determined using the following formula:
[0087]
[0088] Wherein, J is the sequence number of the target data block corresponding to the non-first data storage device, j is the first sequence number, is the serial number corresponding to the non-first data storage device, k is the second constant, Used in When the result exceeds the maximum sequence number of the data block, the difference between the result and the maximum sequence number is output.
[0089] Combined with the scene example, Figure 7 The correspondence between the check block and the data block is shown in the example Figure 2 ,like Figure 7 As shown, taking the number of data blocks and check blocks as 5 as an example, the maximum sequence number of the data block is 5. And taking the check storage device 2 as an example, if the second constant is 1, then the corresponding misalignment value carried by the check algorithm 2 is 1, which means that the misalignment value between the target data blocks in each data storage device is 1.
[0090] Using the above formula, we can calculate that for parity block 1 in parity storage device 2, the corresponding target data blocks in the data block group are: data block 1 in data storage device 1, data block 2 in data storage device 2, data block 3 in data storage device 3, and data block 4 in data storage device 4. Similarly, for parity block 2 in parity storage device 2, the corresponding target data blocks in the data block group are: data block 2 in data storage device 1, data block 3 in data storage device 2, data block 4 in data storage device 3, and data block 5 in data storage device 4. For parity block 3 in parity storage device 2, the corresponding target data blocks in the data block group are: data block 3 in data storage device 1, data block 4 in data storage device 2, data block 5 in data storage device 3, and data block 1 in data storage device 4. For data storage device 4, according to the above formula, the corresponding target data block sequence number is 6. However, 6 exceeds the maximum sequence number of 5, so the final target data block sequence number is 1. This method is repeated to determine the data block group corresponding to each parity block in parity storage device 2.
[0091] Based on the method provided in this example, the accuracy of the obtained target data block can be guaranteed.
[0092] Optionally, S504 includes:
[0093] Determine the maximum sequence number of the data block by pre-set sorting between the data blocks;
[0094] If the offset value is the second constant, the target data block corresponding to each non-first data storage device is determined using the following formula:
[0095]
[0096] Wherein, J is the sequence number of the target data block corresponding to the non-first data storage device, j is the first sequence number, is the serial number corresponding to the non-first data storage device, k is the second constant, Used in When the result exceeds the maximum sequence number of the data block, the difference between the result and the maximum sequence number is output.
[0097] Combined with the scene example, Figure 8 The correspondence between the check block and the data block is shown in the example Figure 3 ,like Figure 8As shown, taking the number of data blocks and check blocks as 5 as an example, the maximum sequence number of the data block is 5. And taking the check storage device 3 as an example, the transformation method of the second constant can be to perform four arithmetic operations on the second constant. For example, if the second constant is 1, the transformation method of the second constant is twice the second constant, that is, the corresponding misalignment value carried by the check algorithm 3 is 2, which means that the misalignment value between the target data blocks in each data storage device is 2.
[0098] Using the above formula, we can calculate that for parity block 1 in parity storage device 3, the corresponding target data blocks in the data block group are: data block 1 in data storage device 1, data block 3 in data storage device 2, data block 5 in data storage device 3, and data block 2 in data storage device 4. Similarly, for parity block 2 in parity storage device 3, the corresponding target data blocks in the data block group are: data block 2 in data storage device 1, data block 4 in data storage device 2, data block 1 in data storage device 3, and data block 3 in data storage device 4. For parity block 1, when determining the target data block corresponding to data storage device 4, according to the above formula, the corresponding target data block sequence number is 7. However, 7 exceeds the maximum sequence number of 5, so the final target data block sequence number is 2. Similarly, for parity block 2, when determining the target data block corresponding to data storage device 3, according to the above formula, the corresponding target data block sequence number is 6. However, 6 exceeds the maximum sequence number of 5, so the final target data block sequence number is 1. Similarly, when determining the target data block corresponding to data storage device 4, according to the above formula, the sequence number of the corresponding target data block is 8. However, 8 exceeds the maximum sequence number of 5, so the final sequence number of the target data block is 3. This method is used in a similar manner to determine the data block group corresponding to each parity block in parity storage device 3.
[0099] Based on the method provided in this example, the accuracy of the obtained target data block can be guaranteed.
[0100] Optionally, the verification algorithm is an exclusive OR operation.
[0101] In this scenario, different verification storage devices can use the same verification algorithm, or they can use different algorithms. For example, they can all use the XOR operation as the corresponding verification algorithm, and the corresponding values of each data block and each verification block are binary, 1 or 0. The XOR operation's forward and inverse operations are relatively simple, thus improving data recovery efficiency.
[0102] Optionally, also include:
[0103] A target number of zero data blocks is added to all data storage devices, wherein the target number is the difference between the number of failed data storage devices and a preset third constant.
[0104] In this example scenario, the third constant can be 2. Therefore, if there are three faulty data storage devices, a zero data block needs to be added to each data storage device. Due to the XOR algorithm's rule that identical values are 0 and different values are 1, any value XORed with "0" returns the original value.
[0105] Based on the method provided in this example, the inverse operation of the XOR algorithm can be simplified by adding a zero data block.
[0106] Optional, Figure 9 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 4 ,like Figure 9 As shown, S203 includes:
[0107] S901: For any check block in any check storage device, determine, in a data block group corresponding to the check block, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device.
[0108] Combined with the scene example, Figure 10 A schematic diagram of an example storage system is shown in FIG. Figure 10 As shown, taking a storage system comprising three data storage devices and three parity storage devices as an example, the inverse operation of an XOR operation is described in detail. The three data storage devices are data storage device a, data storage device b, and data storage device c, and the three parity storage devices are parity storage device p, parity storage device q, and parity storage device r. Each data storage device includes four data blocks, of which data block 4 is an added zero data block. The values of the data blocks in data storage device a are a1, a2, a3, and 0, respectively; the values of the data blocks in data storage device b are b1, b2, b3, and 0, respectively; the values of the data blocks in data storage device c are c1, c2, c3, and 0, respectively; the values of the parity blocks in parity storage device p are p1, p2, p3, and 0, respectively; the values of the parity blocks in parity storage device q are q1, q2, q3, and 0, respectively; and the values of the parity blocks in parity storage device r are r1, r2, r3, and 0, respectively. Figure 10 Part (a) is a schematic diagram of the correspondence between the check blocks and data block groups of the check storage device p. Figure 10 Part (b) is a schematic diagram of the correspondence between the check blocks and data block groups of the check storage device q. Figure 10 Part (c) is a schematic diagram of the correspondence between the check blocks and data block groups of the check storage device r.
[0109] Take three faulty storage devices as an example. Figure 11 The overall process diagram of data recovery for the example is as follows: Figure 11As shown, first determine whether the three failed storage devices are all three data storage devices. If so, the data in the parity storage device is not faulty. Therefore, for any parity block in any parity storage device, the corresponding data block group is a faulty data block.
[0110] S902: By verifying the verification algorithm and the verification block corresponding to the verification storage device, an inverse operation of the verification algorithm is performed on the non-faulty data block corresponding to the verification block to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device.
[0111] Combined with the scenario example, the data blocks in the three data storage devices can be regarded as unknown quantities, and the data blocks in the three data storage devices can be regarded as unknown quantities. Figure 10 The corresponding relationship between the check blocks and data block groups of the check storage device p in part (a) is shown in FIG. 1 , and the following equation group (1) is established: Figure 10 The corresponding relationship between the check blocks and data block groups of the check storage device q in part (b) is shown in FIG. 1 , and the following equation group (2) is established: Figure 10 Part (c) shows a schematic diagram of the correspondence between the check blocks and data block groups of the check storage device r, and the following equation group (3) is established.
[0112]
[0113]
[0114]
[0115] In the above equation groups (1), (2) and (3), a1, a2, a3, b1, b2, b3, c1, c2 and c3 are the fault data blocks that need to be solved, and p1, p2, p3, q1, q2, q3, r1, r2 and r3 are known quantities. Therefore, by solving the above equation groups (1), (2) and (3), the recovery data blocks corresponding to a1, a2, a3, b1, b2, b3, c1, c2 and c3 can be obtained respectively.
[0116] S903: Storing each restored data block in a corresponding data storage device to restore data in each failed data storage device.
[0117] In combination with the scenario example, the recovery data blocks corresponding to a1, a2, a3, b1, b2, b3, c1, c2 and c3 are re-stored in the data storage devices to restore data storage device a, data storage device b and data storage device c.
[0118] Based on the method provided in this example, data in a faulty data storage device can be accurately restored by performing an inverse operation using an XOR algorithm.
[0119] Optional, Figure 12 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 5 ,like Figure 12 As shown, S204 includes:
[0120] S1201: For any check block in any faulty check storage device, operate on each data block in the data block group corresponding to the check block using a check algorithm corresponding to the faulty check storage device to obtain a recovery check block corresponding to the check block.
[0121] Combined with the scene example, combined with Figure 11 If all three failed storage devices are parity storage devices, then the data in the data storage devices is not faulty. Therefore, for any parity block in any failed parity storage device, the corresponding data block group can be used to perform an XOR operation on the data blocks within it to obtain the corresponding recovery parity block.
[0122] For example, the recovery check block corresponding to p1 is obtained by calculating a1⊕b1⊕c1, the recovery check block corresponding to p2 is obtained by calculating a2⊕b2⊕c2, and the recovery check block corresponding to p3 is obtained by calculating a3⊕b3⊕c3. The recovery check block corresponding to q1 is obtained by calculating a1⊕b2⊕c3, the recovery check block corresponding to q2 is obtained by calculating a2⊕b3⊕0, and the recovery check block corresponding to q3 is obtained by calculating a3⊕0⊕c1. The recovery check block corresponding to r1 is obtained by calculating a1⊕b3⊕c1, the recovery check block corresponding to r2 is obtained by calculating a2⊕0⊕c2, and the recovery check block corresponding to r3 is obtained by calculating a3⊕b1⊕c3.
[0123] S1202: The restored check blocks corresponding to the check blocks in the failed check storage devices are stored in the corresponding check storage devices to restore the check results in the failed check storage devices.
[0124] Based on the scenario example, the recovery check blocks corresponding to p1, p2, p3, q1, q2, q3, r1, r2 and r3 are re-stored in the check storage devices to restore the check storage device p, the check storage device q and the check storage device r.
[0125] Based on the method provided in this example, the data in the failed parity storage device can be accurately restored by performing operations on the data block group corresponding to the parity block in the failed parity storage device through an XOR algorithm.
[0126] Optional, Figure 13Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 6 ,like Figure 13 As shown, S205 includes:
[0127] S1301: For any check block in any check storage device, determine, in the data block group corresponding to the check block, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device.
[0128] Combined with the scene example, combined with Figure 11 If the three faulty storage devices are two faulty check storage devices and one faulty data storage device, and the two faulty check storage devices are check storage device q and check storage device r, and the faulty data storage device is data storage device a, then the data blocks a1, a2, and a3 are faulty data blocks, and the check blocks q1, q2, q3, r1, r2, and r3 are faulty check blocks.
[0129] S1302: By verifying the verification algorithm and the verification block corresponding to the verification storage device, an inverse operation of the verification algorithm is performed on the non-faulty data block corresponding to the verification block to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device.
[0130] Combined with the scenario example, with data blocks a1, a2 and a3, check blocks q1, q2, q3, r1, r2 and r3 as unknown quantities, and data blocks b1, b2, b3, c1, c2 and c3, check blocks p1, p2 and p3 as known quantities, solve the above equations to obtain the recovered data blocks corresponding to data blocks a1, a2 and a3.
[0131] S1303: Storing each restored data block in a corresponding data storage device to restore data in each failed data storage device.
[0132] In conjunction with the scenario example, the restored data blocks corresponding to the data blocks a1, a2, and a3 are stored in the data storage device a to restore the data storage device a.
[0133] S1304: For any check block in any failed check storage device, operate on each data block in the data block group corresponding to the check block using the check algorithm corresponding to the failed check storage device to obtain a recovery check block corresponding to the check block.
[0134] Combined with the scenario example, after restoring the data storage device a, the data blocks in each data storage device are all known quantities, so the data block groups corresponding to each check block in the check storage device q and the check storage device r can be XORed to obtain the restored check blocks corresponding to each check block in the check storage device q and the check storage device r.
[0135] S1305: The restored check blocks corresponding to the check blocks in the failed check storage devices are stored in the corresponding check storage devices to restore the check results in the failed check storage devices.
[0136] In combination with the scenario example, the restored check blocks corresponding to the check blocks in the check storage device q and the check storage device r are stored in the corresponding check storage devices to restore the check storage device q and the check storage device r.
[0137] Similarly, combined Figure 11 If the three failed storage devices are one failed parity storage device and two failed data storage devices, and the one failed parity storage device is parity storage device q, and the two failed data storage devices are data storage device a and data storage device b, then data blocks a1, a2, a3, b1, b2, and b3 are failed data blocks, and parity blocks q1, q2, and q3 are failed parity blocks. Therefore, using data blocks a1, a2, a3, b1, b2, and b3, and parity blocks q1, q2, and q3 as unknowns, and data blocks c1, c2, and c3, and parity blocks p1, p2, p3, r1, r2, and r3 as knowns, solve the above equations to obtain the recovery data blocks corresponding to data blocks a1, a2, a3, b1, b2, and b3. The recovery data blocks corresponding to data blocks a1, a2, a3, b1, b2, and b3 are stored in data storage device a or data storage device b to restore data storage device a and data storage device b. After restoring data storage device a and data storage device b, the data blocks in each data storage device are known. Therefore, the data block groups corresponding to the parity blocks in parity storage device q can be XORed to obtain the restored parity blocks corresponding to the parity blocks in parity storage device q. The restored parity blocks corresponding to the parity blocks in parity storage device q are stored in the corresponding parity storage device q to restore parity storage device q.
[0138] Based on the method provided in this example, the inverse operation is first performed through the XOR algorithm to accurately restore the data in the faulty data storage device, and then the corresponding data block group is operated through the verification algorithm of the faulty verification storage device to accurately restore the data in the faulty data storage device and the faulty verification storage device.
[0139] Optional, Figure 14 Schematic diagram of the process of the data recovery method of the storage device provided in the embodiment of the application Figure 7 ,like Figure 14 As shown, before S201, it also includes:
[0140] S1401: In the storage system, create at least three verification storage devices.
[0141] In combination with the scenario example, there can be multiple verification storage devices, and no less than three verification storage devices can simultaneously recover data in three failed storage devices.
[0142] S1402: Determine the verification algorithm corresponding to each verification storage device.
[0143] In combination with the scenario example, the verification algorithm may be an XOR algorithm, and the misalignment value carried in the XOR algorithm corresponding to each verification storage device is determined at the same time.
[0144] S1403: Acquire data stored in each data storage device in the storage system.
[0145] Combined with the scene example, Figure 10 For example, the values of the data blocks in data storage device a are a1, a2, a3 and 0, respectively; the values of the data blocks in data storage device b are b1, b2, b3 and 0, respectively; and the values of the data blocks in data storage device c are c1, c2, c3 and 0, respectively.
[0146] S1404: performing operations on the data stored in each data storage device according to the verification algorithm corresponding to each verification storage device, so as to obtain a verification result corresponding to each verification storage device.
[0147] Combined with the scene example, Figure 15 The schematic diagram of the verification algorithm operation is shown as follows: Figure 15 As shown, j is the row number of the parity block, i.e., the parity block sequence number. The XOR algorithm corresponding to parity storage device p carries a misalignment value of 0. Therefore, the XOR values of each data block are calculated using the misalignment value of 0 and stored in parity storage device p. Specifically, the parity result p1 is obtained by calculating a1⊕b1⊕c1, the parity result p2 is obtained by calculating a2⊕b2⊕c2, and the parity result p3 is obtained by calculating a3⊕b3⊕c3. The XOR algorithm corresponding to parity storage device q carries a misalignment value of 1. Therefore, the XOR values of each data block are calculated using the misalignment value of 1 and stored in parity storage device q. Specifically, the parity result q1 is obtained by calculating a1⊕b2⊕c3, the parity result q2 is obtained by calculating a2⊕b3⊕0, and the parity result q3 is obtained by calculating a3⊕0⊕c1. The offset value carried in the XOR algorithm for parity storage device r is 2. Therefore, the XOR values of each data block are calculated using the offset value 2 and then stored in parity storage device r. Specifically, the parity result r1 is obtained by calculating a1⊕b3⊕c1, the parity result r2 is obtained by calculating a2⊕0⊕c2, and the parity result r3 is obtained by calculating a3⊕b1⊕c3.
[0148] S1405: Store each verification result in a corresponding verification storage device.
[0149] Based on the scenario example, the verification results p1, p2 and p3 are stored in the verification storage device p, the verification results q1, q2 and q3 are stored in the verification storage device q, and the verification results r1, r2 and r3 are stored in the verification storage device r.
[0150] Based on the method provided in this example, multiple verification storage devices are created in the data storage system. Since the number of recoverable faulty storage devices is equal to the number of verification storage devices, when there are at least three verification storage devices, the purpose of simultaneously recovering data from three faulty storage devices can be achieved.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0152] Figure 16 This is a schematic diagram of the structure of the data recovery device of the storage device provided in the embodiment of the present application. Figure 16 As shown, an embodiment of the present application further provides a data recovery device for a storage device, comprising:
[0153] Detection module 161, used to detect whether each storage device in the storage system has a fault;
[0154] The processing module 162 is configured to identify the type of each failed storage device if at least three storage devices among the storage devices are detected to have failed;
[0155] The processing module 162 is further configured to, if all the failed storage devices are data storage devices, perform an inverse operation on the data stored in each non-faulty data storage device using verification results stored in verification storage devices of a number not less than the number of failed data storage devices and corresponding verification algorithms, so as to restore the data in each failed data storage device;
[0156] The processing module 162 is further configured to, if all the failed storage devices are verification storage devices, perform operations on the data stored in each data storage device using a verification algorithm corresponding to each failed verification storage device to restore the verification results in each failed verification storage device;
[0157] The processing module 162 is also used to, if the faulty storage device includes at least one data storage device and at least one verification storage device, perform inverse operations on the data stored in each non-faulty data storage device through the verification results and corresponding verification algorithms stored in the verification storage devices, which are not less than the number of the faulty data storage devices, to restore the data in each faulty data storage device, and perform operations on the data stored in each data storage device through the verification algorithms corresponding to each faulty verification storage device to restore the verification results in each faulty verification storage device.
[0158] Optionally, the data stored in each data storage device is composed of multiple data blocks, and the verification results stored in each verification storage device are composed of multiple verification blocks; accordingly,
[0159] The processing module 162 is further configured to determine the data block group corresponding to each check block in each check storage device by using the check algorithm corresponding to each check storage device.
[0160] Optionally, the processing module 162 is further configured to determine the misalignment values corresponding to the verification algorithms corresponding to the respective verification storage devices;
[0161] The processing module 162 is further configured to determine, based on the misalignment value, the target data blocks corresponding to the respective check blocks from the respective data storage devices;
[0162] The processing module 162 is further configured to combine the target data blocks corresponding to the data storage devices to obtain a data block group corresponding to the check block.
[0163] Optionally, the processing module 162 is further configured to determine a first sequence number of the check block;
[0164] The processing module 162 is further configured to determine a first data storage device according to a preset order among the data storage devices;
[0165] The processing module 162 is further configured to determine, for the first data storage device, according to a preset order among the data blocks in the first data storage device, the data block corresponding to the first sequence number as the target data block corresponding to the first data storage device;
[0166] The processing module 162 is also specifically used to determine the corresponding target data block for each non-first data storage device according to the serial number corresponding to each non-first data storage device, and the preset order, offset value and first serial number between each data block in each non-first data storage device.
[0167] Optionally, the processing module 162 is also specifically used to determine the data blocks with corresponding first serial numbers in each non-first data storage device as the target data blocks corresponding to each non-first data storage device according to the preset ordering between the data blocks in each non-first data storage device if the misalignment value is a preset first constant.
[0168] Optionally, the processing module 162 is further configured to determine the maximum sequence number of the data blocks by using a preset order among the data blocks;
[0169] Optionally, the processing module 162 is further configured to determine the target data block corresponding to each non-first data storage device using the following formula if the offset value is a second constant:
[0170]
[0171] Wherein, J is the sequence number of the target data block corresponding to the non-first data storage device, j is the first sequence number, is the serial number corresponding to the non-first data storage device, k is the second constant, Used in When the result exceeds the maximum sequence number of the data block, the difference between the result and the maximum sequence number is output.
[0172] Optionally, the processing module 162 is further configured to determine, for any check block in any check storage device, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device in the data block group corresponding to the check block;
[0173] The processing module 162 is further configured to perform an inverse operation of the verification algorithm on the non-faulty data blocks corresponding to the verification blocks by verifying the verification algorithm and the verification blocks corresponding to the verification storage devices, so as to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device;
[0174] The processing module 162 is further configured to store each restored data block in a corresponding data storage device to restore data in each failed data storage device.
[0175] Optionally, the processing module 162 is further configured to, for any check block in any failed check storage device, perform operations on each data block in the data block group corresponding to the check block using a check algorithm corresponding to the failed check storage device, so as to obtain a restored check block corresponding to the check block;
[0176] The processing module 162 is further configured to store the restored check blocks corresponding to the check blocks in each failed check storage device into the corresponding check storage device, so as to restore the check results in each failed check storage device.
[0177] Optionally, the processing module 162 is further configured to determine, for any check block in any check storage device, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device in the data block group corresponding to the check block;
[0178] The processing module 162 is further configured to perform an inverse operation of the verification algorithm on the non-faulty data blocks corresponding to the verification blocks by verifying the verification algorithm and the verification blocks corresponding to the verification storage devices, so as to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device;
[0179] The processing module 162 is further configured to store each restored data block in a corresponding data storage device to restore data in each failed data storage device;
[0180] The processing module 162 is further configured to, for any check block in any failed check storage device, perform operations on each data block in the data block group corresponding to the check block using a check algorithm corresponding to the failed check storage device to obtain a restored check block corresponding to the check block;
[0181] The processing module 162 is further configured to store the restored check blocks corresponding to the check blocks in each failed check storage device into the corresponding check storage device, so as to restore the check results in each failed check storage device.
[0182] Optionally, the processing module 162 is further configured to create at least three verification storage devices in the storage system;
[0183] The processing module 162 is further configured to determine a verification algorithm corresponding to each verification storage device;
[0184] The processing module 162 is further configured to obtain data stored in each data storage device in the storage system;
[0185] The processing module 162 is further configured to perform operations on the data stored in each data storage device according to the verification algorithm corresponding to each verification storage device to obtain a verification result corresponding to each verification storage device;
[0186] The processing module 162 is further configured to store each verification result in a corresponding verification storage device.
[0187] Optionally, the processing module 162 is further configured to add a target number of zero data blocks to all data storage devices, where the target number is the difference between the number of failed data storage devices and a preset third constant.
[0188] For the description of the features in the embodiment corresponding to the data recovery apparatus of the storage device, reference can be made to the relevant description of the embodiment corresponding to the data recovery method of the storage device, which will not be repeated here.
[0189] Figure 17 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 17 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the electronic device 50 further includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus.
[0190] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502 , so that the at least one processor 501 executes the above-mentioned data recovery method embodiment of the storage device.
[0191] The specific implementation process of the processor 501 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.
[0192] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the application may be directly executed by a hardware processor or by a combination of hardware and software modules within the processor.
[0193] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage.
[0194] A bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be categorized as address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0195] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned data recovery method embodiments for a storage device when running.
[0196] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0197] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned data recovery method embodiments for storage devices are implemented.
[0198] An embodiment of the present application further provides another computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned data recovery method embodiments of the storage device are implemented.
[0199] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0200] The above is a detailed introduction to the data recovery method, device, medium and product of a storage device provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data recovery method for a storage device, characterized in that: include: Detect whether each storage device in the storage system has a fault; If it is detected that at least three storage devices among the storage devices have failed, identifying the type of each failed storage device; If all the failed storage devices are data storage devices, performing an inverse operation on the data stored in each non-faulty data storage device using verification results stored in verification storage devices of a number not less than the number of failed data storage devices and corresponding verification algorithms to restore the data in each failed data storage device; If all the failed storage devices are verification storage devices, the data stored in each data storage device is calculated using a verification algorithm corresponding to each failed verification storage device to restore the verification result in each failed verification storage device; If the faulty storage device includes at least one data storage device and at least one verification storage device, the data stored in each non-faulty data storage device is inversely operated using the verification results and corresponding verification algorithms stored in no less than the number of faulty data storage devices to restore the data in each faulty data storage device, and the data stored in each data storage device is operated using the verification algorithm corresponding to each faulty verification storage device to restore the verification result in each faulty verification storage device.
2. The method according to claim 1, characterized in that The data stored in each data storage device is composed of multiple data blocks, and the verification results stored in each verification storage device are composed of multiple verification blocks; accordingly, the system further includes: The data block group corresponding to each check block in each check storage device is determined by the check algorithm corresponding to each check storage device.
3. The method according to claim 2, characterized in that The step of determining the data block group corresponding to each check block in each check storage device by using a check algorithm corresponding to each check storage device includes: Determine the offset values corresponding to the verification algorithms corresponding to the respective verification storage devices; Based on the misalignment value, determining the target data block corresponding to each check block from each data storage device; The target data blocks corresponding to the data storage devices are combined to obtain a data block group corresponding to the check block.
4. The method according to claim 3, characterized in that The determining, based on the misalignment value, target data blocks corresponding to the respective check blocks from the respective data storage devices, includes: Determining a first sequence number of the check block; Determine a first data storage device according to a preset order among the data storage devices; For the first data storage device, according to a preset order among the data blocks in the first data storage device, the data block corresponding to the first sequence number is determined as the target data block corresponding to the first data storage device; For each non-first data storage device, the corresponding target data block is determined according to the serial number corresponding to each non-first data storage device, the preset order between the data blocks in each non-first data storage device, the offset value and the first serial number.
5. The method according to claim 4, characterized in that The method of determining, for each non-first data storage device, a corresponding target data block according to a sequence number corresponding to each non-first data storage device, a preset order between data blocks in each non-first data storage device, the stagger value, and the first sequence number, includes: If the misalignment value is a preset first constant, then according to the preset order between the data blocks in each non-first data storage device, the data blocks with the corresponding first serial numbers in each non-first data storage device are respectively determined as the target data blocks corresponding to each non-first data storage device.
6. The method according to claim 4, characterized in that The method of determining, for each non-first data storage device, a corresponding target data block according to a sequence number corresponding to each non-first data storage device, a preset order between data blocks in each non-first data storage device, the stagger value, and the first sequence number, includes: Determine the maximum sequence number of the data block by pre-set sorting between the data blocks; If the offset value is a second constant, the target data block corresponding to each non-first data storage device is determined using the following formula: Wherein, J is the sequence number of the target data block corresponding to the non-first data storage device, j is the first sequence number, is the serial number corresponding to the non-first data storage device, k is the second constant, Used in When the result exceeds the maximum sequence number of the data block, the difference between the result and the maximum sequence number is output.
7. The method according to claim 2, characterized in that If all the failed storage devices are data storage devices, performing an inverse operation on the data stored in each non-faulty data storage device using verification results stored in verification storage devices of a number not less than the number of failed data storage devices and corresponding verification algorithms to restore the data in each failed data storage device includes: For any check block in any check storage device, determining, in the data block group corresponding to the check block, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device; Using the verification algorithm and the verification block corresponding to the verification storage device, an inverse operation of the verification algorithm is performed on the non-faulty data blocks corresponding to the verification block to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device; Each restored data block is stored in a corresponding data storage device to restore data in each failed data storage device.
8. The method according to claim 2, characterized in that If each of the failed storage devices is a verification storage device, performing operations on the data stored in each of the data storage devices using a verification algorithm corresponding to each of the failed verification storage devices to restore the verification results in each of the failed verification storage devices includes: For any check block in any faulty check storage device, performing operations on each data block in the data block group corresponding to the check block using a check algorithm corresponding to the faulty check storage device to obtain a restored check block corresponding to the check block; The restored check blocks corresponding to the check blocks in the respective failed check storage devices are stored in the corresponding check storage devices to restore the check results in the respective failed check storage devices.
9. The method according to claim 2, characterized in that If the faulty storage device includes at least one data storage device and at least one verification storage device, performing an inverse operation on the data stored in each non-faulty data storage device using verification results and corresponding verification algorithms stored in no less than the number of the faulty data storage devices to restore the data in each faulty data storage device, and performing an operation on the data stored in each data storage device using the verification algorithm corresponding to each faulty verification storage device to restore the verification result in each faulty verification storage device, including: For any check block in any check storage device, determining, in the data block group corresponding to the check block, non-faulty data blocks corresponding to each non-faulty data storage device and faulty data blocks corresponding to each faulty data storage device; Using the verification algorithm and the verification block corresponding to the verification storage device, an inverse operation of the verification algorithm is performed on the non-faulty data blocks corresponding to the verification block to obtain a recovery data block corresponding to each faulty data block in each faulty data storage device; Storing each restored data block in a corresponding data storage device to restore data in each failed data storage device; For any check block in any faulty check storage device, performing operations on each data block in the data block group corresponding to the check block using a check algorithm corresponding to the faulty check storage device to obtain a restored check block corresponding to the check block; The restored check blocks corresponding to the check blocks in the respective failed check storage devices are stored in the corresponding check storage devices to restore the check results in the respective failed check storage devices.
10. The method according to claim 1, characterized in that Before detecting whether each storage device in the storage system has a fault, the method further includes: In the storage system, creating at least three parity storage devices; Determine the verification algorithm corresponding to each verification storage device; Acquiring data stored in each data storage device in the storage system; According to the verification algorithm corresponding to each verification storage device, the data stored in each data storage device is respectively operated to obtain the verification result corresponding to each verification storage device; Each verification result is stored in the corresponding verification storage device.
11. The method according to any one of claims 1 to 10, characterized in that The verification algorithm is an exclusive OR operation.
12. The method according to claim 11, characterized in that Also includes: A target number of zero data blocks is added to all data storage devices, wherein the target number is the difference between the number of failed data storage devices and a preset third constant.
13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the data recovery method for a storage device according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the data recovery method of the storage device according to any one of claims 1 to 12.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data recovery method for a storage device according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Disk array data recovery method and system, storage medium, and equipment
CN114090345A
Data coding method, system, equipment and medium
CN114153393A
Data consistency verification method, device and system of distributed data storage system
CN115756947A
Hard disk data volume fault tolerance method supporting single-disk data readable
CN116028262A
Data protection method, system and device and storage medium
CN116521433A