RAID stripe repairing method and device, equipment, storage medium and program product

By recording pre-embedded information in RAID data blocks and constructing multi-level page table comparison mapping relationships, the limitations of traditional RAID repair methods are overcome, enabling broader fault repair and more efficient data recovery.

CN121387183APending Publication Date: 2026-01-23DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511432131.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

Traditional RAID repair methods cannot effectively address complex phenomena such as stripe duplication, data block duplication, and garbage data caused by multi-node concurrency, network transmission errors, network latency, and system failures in distributed systems. They have limited application scenarios and insufficient repair efficiency and accuracy.

Method used

Pre-embedded information, including block identifier, stripe identifier, and data write timestamp, is recorded in the RAID data blocks. By deduplication and building a multi-level page table to compare the actual and preset mapping relationships, stripe repair is performed to repair abnormal stripes and data blocks.

Benefits of technology

It expands the application scenarios of RAID repair, improves repair efficiency and accuracy, reduces the risk of data loss, and ensures fast and stable data recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387183A_ABST
    Figure CN121387183A_ABST
Patent Text Reader

Abstract

The invention relates to an RAID stripe repairing method and device, equipment, a storage medium and a program product. Pre-embedded information is recorded in data blocks of stripes of the RAID, and the pre-embedded information recorded in each data block at least comprises a block identifier of the data block, a stripe identifier of the stripe to which the data block belongs and a data disk falling timestamp of the data block; the stripe repairing method of the RAID comprises the following steps: performing duplicate removal processing on each data block according to pre-embedded information of each data block of the RAID to obtain a target data block; comparing the actual mapping relationship corresponding to the target data block with a preset mapping relationship between a block identifier and a stripe identifier stored in the metadata of the RAID; wherein the actual mapping relationship is a mapping relationship between a block identifier and a stripe identifier in the pre-embedded information of the target data block; and according to a comparison result, performing stripe repair on the RAID. By adopting the method, the application scene of RAID repair can be expanded, and the efficiency and accuracy of RADI strip repair are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a RAID stripe repair method, apparatus, device, storage medium, and program product. Background Technology

[0002] With the development of data storage technology, RAID (Redundant Array of Independent Disks) technology has emerged. It is a technology that combines multiple physical hard drives into a logical disk group to improve storage performance, enhance data reliability, or both.

[0003] RAID introduces striping technology to divide data into fixed-size blocks (strip units) and distribute them across multiple physical storage devices. In other words, RAID uses stripes to store data, and each stripe consists of multiple fixed-size data blocks belonging to different physical hard drives (such as disks).

[0004] In traditional technologies, RAID repair methods are usually based on methods such as multi-replica redundancy and parity correction to recover the data stored in the stripe, focusing on the data transmission efficiency and reliability of the data stored in the stripe.

[0005] However, the application scenarios of the aforementioned traditional technologies are too limited and cannot cope with the complex phenomena in real-world applications caused by the concurrency of multiple nodes in distributed systems, network transmission errors, network latency, system failures, etc., such as duplicate stripe allocation, duplicate data block allocation, and the presence of garbage data in stripes. Summary of the Invention

[0006] Therefore, it is necessary to provide a RAID stripe repair method, apparatus, device, storage medium, and program product to address the aforementioned technical problems, which can expand the application scenarios of RAID repair and improve the efficiency and accuracy of RAID stripe repair.

[0007] Firstly, this application provides a RAID stripe repair method, wherein the data blocks of the stripes in a Redundant Array of Independent Disks (RAID) record pre-embedded information, and the pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier of the stripe to which the data block belongs, and the data write-to-disk timestamp of the data block; the RAID stripe repair method includes:

[0008] Based on the pre-embedded information of each data block in the RAID, the data blocks are deduplicated to obtain the target data block;

[0009] Compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; where the actual mapping relationship is the mapping relationship between the block identifier and the stripe identifier in the embedded information of the target data block;

[0010] Based on the comparison results, stripe repair was performed on the RAID.

[0011] In this embodiment, on the one hand, by recording pre-embedded information in the data blocks, abnormal stripes in the RAID can be repaired by comparing the actual mapping relationship with the preset mapping relationship, thus expanding the types of RAID faults that can be repaired and consequently broadening the application scenarios of RAID repair. On the other hand, the actual mapping relationship can characterize the true correspondence between RAID stripes and data blocks. Repairing abnormal stripes in the RAID based on the true correspondence can effectively improve the efficiency and accuracy of RAID stripe repair. Based on this, the bottleneck problem in RAID repair is solved, ensuring that data can be quickly and stably recovered after RAID stripe anomalies, reducing the risk of data loss during RAID stripe repair, and filling the gap in RAID repair methods for complex phenomena.

[0012] In one embodiment, based on the pre-embedded information of each data block in the RAID, the data blocks are deduplicated to obtain the target data block. This includes: scanning the RAID disk with the data volume of the data block as the scan step size to obtain the pre-embedded information of each data block; identifying multiple data blocks in the pre-embedded information that have the same block identifier and stripe identifier, and deduplicating the other data blocks among the multiple data blocks except for the data block with the largest data disk timestamp to obtain the target data block.

[0013] In this embodiment of the application, by using the disk timestamp for multiple data blocks in the pre-embedded information where both the block identifier and the stripe identifier are the same, the garbage data stored in the multiple data blocks can be deleted, thereby improving the accuracy of the determined target data blocks. Furthermore, it can reduce the storage space occupied by garbage data on the RAID disk and improve the utilization rate of the storage space on the RAID disk.

[0014] In one embodiment, comparing the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata includes: constructing a multi-level page table as the actual mapping relationship based on the block identifier and stripe identifier in the embedded information of the target data block; wherein the multi-level page table includes a first-level page table indexed by the stripe identifier and indexed by the address of the second-level page table corresponding to the stripe identifier, and a second-level page table including the block identifier; searching for each mapping relationship in the multi-level page table from the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; wherein the preset mapping relationship includes a preset stripe allocation table indexed by the stripe identifier and indexed by the block identifier, and a preset data block allocation table indexed by the block identifier and indexed by the stripe identifier.

[0015] In this embodiment, a multi-level page table is constructed as the actual mapping relationship to achieve a comparison between the actual mapping relationship and the preset mapping relationship. Since the multi-level page table enables a fast lookup of each mapping relationship in the actual mapping relationship, the comparison efficiency between the preset mapping relationship and the actual mapping relationship can be improved, thereby improving the stripe repair efficiency of RAID.

[0016] In one embodiment, when the comparison results indicate that there is a mapping relationship between the same stripe identifier and multiple block identifiers, and the data write timestamps corresponding to the multiple block identifiers are not completely the same, stripe repair is performed on the RAID according to the comparison results, including: grouping the block identifiers with the same data write timestamps into a group to obtain multiple block identifier groups; retaining the mapping relationship between any block identifier group in the multiple block identifier groups and the same stripe identifier; allocating different stripe identifiers that are not currently occupied to the remaining block identifier groups other than the block identifier group in the multiple block identifier groups to obtain the first stripe.

[0017] In the embodiments of this application, stripe redistribution anomalies in RAID can be repaired, expanding the types of RAID faults that can be repaired, thereby expanding the application scenarios of RAID repair and filling the gap in RAID repair methods for complex phenomena.

[0018] In one embodiment, when the comparison results indicate that the same identifier has a mapping relationship with multiple stripe identifiers, stripe repair is performed on the RAID according to the comparison results, including: if a first stripe identifier exists among the multiple stripe identifiers, the stripe corresponding to the first stripe identifier is retained, and the stripes corresponding to other stripe identifiers besides the first stripe identifier are deleted; wherein, the data blocks in the stripe corresponding to the first stripe identifier have the same data disk timestamp; if the first stripe identifier does not exist among the multiple stripe identifiers, the data blocks in the data blocks to be reconstructed with the same data disk timestamp are striped to obtain a second stripe, and an unused stripe identifier is allocated to the second stripe; wherein, the data blocks to be reconstructed include the data blocks in the stripes corresponding to each of the multiple stripe identifiers.

[0019] In the embodiments of this application, data block redistribution anomalies in RAID can be repaired, expanding the types of RAID faults that can be repaired, thereby expanding the application scenarios of RAID repair and filling the gap in RAID repair methods for complex phenomena.

[0020] In one embodiment, the RAID stripe repair method further includes: for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset stripe allocation table, reconstructing the mapping relationship between the second stripe identifier and each block identifier according to the multi-level page table, and updating the reconstructed mapping relationship to the preset stripe allocation table; wherein the second stripe identifier is the stripe identifier in the mapping relationship; and / or, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset data block allocation table, updating the mapping relationship to the preset data block allocation table.

[0021] In this embodiment, the preset mapping relationship is updated by updating the preset stripe allocation table and the preset data block allocation table, thereby improving the consistency between the preset mapping relationship and the actual mapping relationship. This improves the comparison efficiency between the preset mapping relationship and the actual mapping relationship during the subsequent RAID stripe repair process, and thus enhances the RAID stripe repair efficiency.

[0022] In one embodiment, the RAID stripe repair method further includes: determining each data block in each stripe according to the actual mapping relationship; for each stripe, if the data disk timestamps of each data block in the stripe are not completely the same, performing stripe reconstruction on the data block with the largest data disk timestamp in each data block to obtain a third stripe, and allocating a currently unoccupied stripe identifier to the third stripe; deleting each data block except the data block with the largest data disk timestamp in each data block, and updating the preset mapping relationship according to the stripe identifier of the third stripe and the block identifier of each data block in the third stripe.

[0023] In the embodiments of this application, garbage data in the stripes of RAID can be deleted, reducing the storage space occupied by garbage data on the RAID disk, improving the utilization rate of the storage space on the RAID disk, and expanding the types of RAID faults that can be repaired, thereby expanding the application scenarios of RAID repair and filling the gap in RAID repair methods in complex phenomena.

[0024] In one embodiment, the RAID stripe repair method further includes: for each reconstructed stripe, reconstructing the stripe bitmap according to the usage of data blocks in the stripe, and adding the bitmap to a preset bitmap.

[0025] In this embodiment, by updating the preset bit chart, the usage of each data block in the RAID stripe can be accurately recorded, improving the efficiency of understanding the true situation of the RAID. Furthermore, based on the preset bit chart and the preset stripe allocation table and preset data block allocation table in the preset mapping relationship, a new RAID stripe repair approach can be provided to improve the efficiency of RAID stripe repair.

[0026] In one embodiment, the RAID stripe repair method further includes: upon receiving a stripe request for the RAID, obtaining the stripe identifier of the stripe allocated in response to the stripe request and the block identifier of each data block in the allocated stripe; adding the obtained mapping relationship between the stripe identifier and each block identifier to a preset mapping relationship; and adding the bitmap of the allocated stripe to a preset bitmap.

[0027] In this embodiment of the application, when allocating each stripe in the RAID, the mapping relationship between the stripe identifier of the allocated stripe and the block identifier of each data block in the allocated stripe is added to the preset mapping relationship in a timely manner. This ensures the real-time performance and accuracy of the generation of each mapping relationship in the preset mapping relationship, improves the accuracy of the preset mapping relationship, and thus improves the accuracy of RAID stripe repair.

[0028] In one embodiment, the RAID stripe repair method further includes: determining the check value of the original data based on the original data stored in each data block of each stripe, and comparing the check value with the check data stored in each data block of the stripe; if the check value and the check data are inconsistent, performing data repair on the stripe based on the original data and the check data.

[0029] In the embodiments of this application, it is possible to repair data with abnormal phenomena stored in RAID stripes, improve the data transmission efficiency and reliability of data stored in RAID stripes, and improve the accuracy of data in stripes after stripe repair.

[0030] Secondly, this application also provides a RAID stripe repair device, wherein the data blocks of the stripes in the Independent Disk Redundancy Array (RAID) record pre-embedded information, and the pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier of the data block to which the data block belongs, and the data write-to-disk timestamp of the data block; the RAID stripe repair device includes:

[0031] The data block deduplication module is used to deduplicatize each data block according to the pre-embedded information of each data block in the RAID to obtain the target data block.

[0032] The mapping comparison module is used to compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; wherein, the actual mapping relationship is the mapping relationship between the block identifier and the stripe identifier in the embedded information of the target data block;

[0033] The stripe repair module is used to repair stripes on the RAID array based on comparison results.

[0034] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the various method embodiments provided in the first aspect above.

[0035] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments provided in the first aspect above.

[0036] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the various method embodiments provided in the first aspect above.

[0037] In the aforementioned RAID stripe repair method, apparatus, device, storage medium, and program products, pre-embedded information, including at least the block identifier of the data block, the stripe identifier of the data block, and the data write-to-disk timestamp of the data block, is recorded in the data blocks of the RAID stripe. When performing stripe repair on the RAID, firstly, based on the pre-embedded information of each data block of the RAID, deduplication processing is performed on each data block of the RAID to obtain the target data block; then, the mapping relationship between the block identifier and the stripe identifier in the pre-embedded information of the target data block is used as the actual mapping relationship corresponding to the target data block, and the actual mapping relationship is compared with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; then, based on the obtained comparison result, stripe repair is performed on the RAID. In this way, on the one hand, by recording pre-embedded information in the data blocks, abnormal stripes in the RAID can be repaired by comparing the actual mapping relationship with the preset mapping relationship, thus expanding the types of RAID faults that can be repaired and consequently broadening the application scenarios of RAID repair. On the other hand, the actual mapping relationship can represent the true correspondence between RAID stripes and data blocks. Repairing abnormal stripes in the RAID based on the true correspondence can effectively improve the efficiency and accuracy of RAID stripe repair. Based on this, the bottleneck problem in RAID repair is solved, ensuring that data can be quickly and stably recovered after RAID stripe anomalies, reducing the risk of data loss during RAID stripe repair, and filling the gap in RAID repair methods for complex phenomena. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 A flowchart illustrating a RAID stripe repair method provided in some embodiments of this application;

[0040] Figure 2 This application provides schematic flowcharts for data block deduplication processing in some embodiments.

[0041] Figure 3 A flowchart illustrating the comparison between actual mapping relationships and preset mapping relationships provided for some embodiments of this application;

[0042] Figure 4 A schematic diagram illustrating the stripe repair process for RAID provided in some embodiments of this application;

[0043] Figure 5 A flowchart illustrating a RAID stripe repair method provided in other embodiments of this application;

[0044] Figure 6 A flowchart illustrating a RAID stripe repair method provided in some embodiments of this application;

[0045] Figure 7 This is a structural block diagram of a RAID stripe repair device provided in some embodiments of this application;

[0046] Figure 8 Internal structural diagrams of a computer device provided in some embodiments of this application;

[0047] Figure 9 Internal structural diagrams of a computer device provided for other embodiments of this application. Detailed Implementation

[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0049] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments or any combination of multiple embodiments.

[0050] Traditional RAID repair methods typically rely on multi-replica redundancy and parity correction to recover data stored in the stripe, focusing on data transfer efficiency and reliability. However, these traditional techniques have overly simplistic application scenarios and cannot address the complexities of real-world applications caused by concurrent multi-node distribution in distributed systems, network transmission errors, network latency, and system failures, leading to issues such as duplicate stripe allocation, duplicate data block allocation, and the presence of garbage data in stripes.

[0051] Based on this, in order to solve the above-mentioned technical problems, an exemplary embodiment provides a RAID stripe repair method that can be applied to computer devices. The computer device can be a server or a terminal. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, etc.

[0052] Based on the above embodiments, in an exemplary embodiment, such as Figure 1 As shown, a RAID stripe repair method is provided. In this method, pre-embedded information is recorded in the data blocks of the RAID stripes. The pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier to which the data block belongs, and the data write timestamp of the data block. This pre-embedded information reduces the amount of disk data read during the RAID stripe repair process, improving repair efficiency. Optionally, the pre-embedded information recorded in each data block may also include the VBA (Virtual Block Address) of the data block to map to the physical block address of the data block. Furthermore, optionally, pre-embedded information can be recorded at the end of the data block.

[0053] Taking the application of this method to a server as an example, the steps may include:

[0054] S101 performs deduplication on each data block according to the pre-embedded information of each data block in the RAID to obtain the target data block.

[0055] The data write-to-disk time of a data block refers to the specific moment when the data in the data block is actually and stably written to the physical hard disk and the actual storage space corresponding to that data block (i.e., the data is finally solidified to the physical storage medium). The data write-to-disk timestamp of the data block is used to characterize the data write-to-disk time of the data block. In essence, it is to convert the data write-to-disk time of the data block into a set of numbers or character sequences for representation.

[0056] Typically, the embedded information for each data block in each stripe of a RAID array includes the same data write timestamp. Furthermore, since each data block should belong to only one stripe, for a set of block identifiers and stripe identifiers, only one data block's embedded information includes both the block identifier and the stripe identifier.

[0057] Based on this, when multiple data blocks (at least two) in a RAID array have the same block identifier and stripe identifier in their pre-embedded information, it can be determined that these multiple data blocks contain garbage data that needs to be deleted. Furthermore, since RAID is a storage technology that supports sequential writes, the longer the data block's disk write time, the more recent the time is, and therefore the newer the data in the data block. Thus, the disk write timestamps in the pre-embedded information of these multiple data blocks can be used to deduplicate them, retaining only one data block. In this way, after deduplicating each data block according to its pre-embedded information, the retained data blocks are the target data blocks, and the block identifier and / or stripe identifier in the pre-embedded information of different target data blocks are different.

[0058] In one optional embodiment, the RAID stripe repair method may further include: determining the check value of the original data based on the original data stored in each data block of each stripe, and comparing the check value with the check data stored in each data block of the stripe; if the check value and the check data are inconsistent, repairing the stripe based on the original data and the check data.

[0059] Typically, each data block in a RAID stripe is divided into two categories: one for storing raw data and the other for storing parity data determined from the raw data. Raw data refers to the data transmitted to the RAID for storage, such as business data and user data. In the event of data loss, errors, or other anomalies in the data stored in a stripe, data recovery can be performed on that stripe based on the stored raw data and parity data. Optionally, the parity data is determined by performing an XOR (Exclusive OR) operation on the raw data. Thus, during the deduplication process of each data block based on pre-embedded information, for each stripe, the parity value of the raw data stored in that stripe can be determined and compared with the parity data stored in that stripe. If there are no anomalies in the data stored in that stripe, the parity value and the parity data should match. Therefore, if the parity value and the parity data are inconsistent, it indicates an anomaly in the data storage of that stripe, and data repair can then be performed on that stripe based on the stored raw data and parity data. Optionally, using an EC (Erasure Coding) mechanism, the original data in the stripe containing anomalies can be recovered based on the original data and parity data stored in the stripe. Alternatively, the parity data can be redefined to update the original parity data stored in the stripe. Based on this, in this embodiment, data containing anomalies stored in RAID stripes can be repaired, improving the data transmission efficiency and reliability of data stored in RAID stripes, and also improving the accuracy of the data in the repaired stripe.

[0060] S102, compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and stripe identifier stored in the RAID metadata.

[0061] The actual mapping relationship is the mapping relationship between the block identifier and the strip identifier in the pre-embedded information of the target data block.

[0062] RAID metadata is key management information stored in a RAID array, used to define the array's structure, member disk roles, and data distribution rules. RAID metadata includes a preset mapping relationship between block identifiers and stripe identifiers. This preset mapping relationship represents the correspondence between each stripe and the data blocks allocated to that stripe when it is generated in the RAID array.

[0063] Correspondingly, during the deduplication process of each data block in the RAID, the pre-embedded information of each data block is read one by one. By reading the pre-embedded information of each target data block, the actual mapping relationship corresponding to the target data block can be determined based on the mapping relationship between the block identifier and the stripe identifier in the pre-embedded information. This actual mapping relationship represents the true correspondence between stripes and data blocks in the RAID at the current moment.

[0064] Normally, the actual mapping relationship and the preset mapping relationship should be the same. However, in practical applications of RAID, issues such as concurrency of multiple nodes in a distributed system, network transmission errors, network latency, and system failures can often lead to problems like duplicate stripe allocation and duplicate data block allocation, resulting in stripe anomalies in the RAID and causing inconsistencies between the actual and preset mapping relationships. Therefore, by comparing the actual and preset mapping relationships, abnormal stripes in the RAID can be identified and repaired.

[0065] In one optional embodiment, the RAID stripe repair method may further include, upon receiving a stripe request for the RAID, obtaining the stripe identifier of the stripe allocated in response to the stripe request and the block identifier of each data block in the allocated stripe; and adding the obtained mapping relationship between the stripe identifier and each block identifier to a preset mapping relationship.

[0066] Typically, when writing data to a RAID array, a stripe needs to be requested from the RAID array to store the written data. Upon receiving a stripe request for the RAID array, the system responds by allocating a stripe and determining the stripe identifier and block identifiers of each data block within the allocated stripe. This allows the system to obtain the stripe identifier and block identifiers of the allocated stripe and data blocks within it, and to add the obtained mapping relationship between the stripe identifier and block identifiers to a preset mapping relationship. Therefore, in this embodiment, when allocating each stripe in the RAID array, the mapping relationship between the stripe identifier and block identifiers of the allocated stripe and data blocks within it is added to the preset mapping relationship in a timely manner. This ensures the real-time performance and accuracy of the generation of each mapping relationship in the preset mapping relationship, improves the accuracy of the preset mapping relationship, and consequently improves the accuracy of RAID stripe repair.

[0067] S103, based on the comparison results, perform stripe repair on the RAID.

[0068] The comparison between the actual mapping relationship and the preset mapping relationship can characterize the abnormal stripes in the RAID and the abnormal conditions of the stripes. Therefore, the stripes of the RAID can be repaired by comparing the results.

[0069] Optionally, if the comparison results indicate that the RAID has stripe redistribution, determine the unique set of data blocks corresponding to the redistributed stripe to eliminate the stripe redistribution anomaly. And / or, if the comparison results indicate that the RAID has data block redistribution, determine the unique stripe to which the redistributed data belongs to eliminate the data block redistribution anomaly.

[0070] Optionally, after stripe repair of RAID, the stripe identifier in the pre-embedded information of each data block in the repaired stripe will be updated to the stripe identifier of the repaired stripe, and the actual mapping relationship will be updated accordingly.

[0071] In the aforementioned RAID stripe repair method, pre-embedded information, including at least the block identifier of the data block, the stripe identifier of the data block, and the data write-to-disk timestamp of the data block, is recorded in the data blocks of the RAID stripe. When performing stripe repair on the RAID, firstly, based on the pre-embedded information of each data block of the RAID, deduplication is performed on each data block of the RAID to obtain the target data block; then, the mapping relationship between the block identifier and the stripe identifier in the pre-embedded information of the target data block is used as the actual mapping relationship corresponding to the target data block, and the actual mapping relationship is compared with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; then, based on the obtained comparison result, stripe repair is performed on the RAID. In this way, on the one hand, by recording pre-embedded information in the data blocks, abnormal stripes in the RAID can be repaired by comparing the actual mapping relationship with the preset mapping relationship, thus expanding the types of RAID faults that can be repaired and consequently broadening the application scenarios of RAID repair. On the other hand, the actual mapping relationship can represent the true correspondence between RAID stripes and data blocks. Repairing abnormal stripes in the RAID based on the true correspondence can effectively improve the efficiency and accuracy of RAID stripe repair. Based on this, the bottleneck problem in RAID repair is solved, ensuring that data can be quickly and stably recovered after RAID stripe anomalies, reducing the risk of data loss during RAID stripe repair, and filling the gap in RAID repair methods for complex phenomena.

[0072] Based on the above embodiments, in an exemplary embodiment, the deduplication process for each data block is further refined. Optionally, such as... Figure 2 As shown, the following steps may be included:

[0073] S201 scans the RAID disks using the data size of each data block as the scan step size to obtain the pre-embedded information for each data block.

[0074] The disks in a RAID array refer to the disks where the individual data blocks reside.

[0075] In RAID, the data size of each data block is fixed and the same, for example, it can be 8KB (KiloByte). Therefore, the RAID disk can be fully scanned using the data size of the data blocks as the scan step size to obtain each data block and parse out the embedded information of each data block.

[0076] Optionally, for each disk in the RAID array, starting from the first data entry point, the data on the disk is divided into blocks according to the size of each data block.

[0077] S202, identify multiple data blocks in the pre-embedded information that have the same block identifier and stripe identifier, and perform deduplication processing on the other data blocks except for the data block with the largest data disk timestamp to obtain the target data block.

[0078] Based on the pre-embedded information of each data block, it can be determined whether the block identifier and stripe identifier in the pre-embedded information of different data blocks are the same. Therefore, if multiple data blocks have the same block identifier and stripe identifier in their pre-embedded information, multiple data blocks with identical block identifiers and stripe identifiers can be identified. Furthermore, considering that in RAID, a larger data block write-to-disk time indicates that the data is most recent and the data in the block is newer, the data block with the largest write-to-disk timestamp can be retained, while the other data blocks are deleted. The retained data block with the largest write-to-disk timestamp becomes the target data block. Deleting a data block means releasing the actual storage space corresponding to that data on the RAID disk. The actual storage space corresponding to that data block on the RAID disk becomes available, and the data block can be allocated to a new stripe to store new data, overwriting the currently stored data in that data block. Optionally, in the actual mapping relationship, the mapping relationship between the block identifier and stripe identifier in the pre-embedded information of the data block is deleted.

[0079] In this embodiment, by using the disk timestamp to identify multiple data blocks with the same block identifier and stripe identifier in the pre-embedded information, garbage data stored in these multiple data blocks can be deleted, improving the accuracy of the identified target data blocks. Furthermore, it can reduce the storage space occupied by garbage data on the RAID disk and improve the utilization rate of the RAID disk storage space.

[0080] Based on the above embodiments, in an exemplary embodiment, the comparison between the actual mapping relationship and the preset mapping relationship is further refined. Optionally, such as Figure 3 As shown, the following steps may be included:

[0081] S301, construct a multi-level page table based on the block identifier and stripe identifier in the pre-embedded information of the target data block, as the actual mapping relationship.

[0082] The multi-level page table includes a first-level page table indexed by the stripe identifier and the address of the second-level page table corresponding to the stripe identifier as the index value, and a second-level page table including the block identifier.

[0083] A multi-level page table (MLP) is a paging mechanism used for memory management. Taking a two-level page table as an example, it includes a first-level page table and a second-level page table. The first-level page table (also called the top-level page table) stores the base address of the second-level page table. Each entry in the table points to a second-level page table, and the second-level page table corresponds to a virtual address, which in turn points to a vpage (virtual page).

[0084] After identifying the target data block, a first-level page table can be created. In this first-level page table, the address of the second-level page table dedicated to that stripe identifier is stored as the index value, using the stripe identifier in the pre-embedded information of the target data block as the index. Then, for each stripe identifier, a second-level page table is created, and the block identifier corresponding to that stripe identifier in the pre-embedded information of the target data block is stored in the second-level page table. In this way, a multi-level page table is created, forming a mapping relationship between stripe identifiers and block identifiers, thus obtaining the actual mapping relationship.

[0085] In one optional embodiment, the second-level page table is indexed by a block identifier and the block information of the data block corresponding to the block identifier is used as the index value. The block information may include at least one of the following: storage address, metadata information, status identifier, etc., and the storage address may include a physical storage address and / or a logical storage address.

[0086] Optionally, a first-level page table is created, and in this first-level page table, the address of the second-level page table dedicated to the stripe identifier is stored as an index in the pre-embedded information of the target data block. Then, for each stripe identifier, a second-level page table is created, and the block information of the data block with each block identifier is stored as an index value, using the block identifier corresponding to the stripe identifier in the pre-embedded information of the target data block. In this way, a multi-level page table is created, forming a complete mapping from stripe identifier, block identifier to data block information.

[0087] S302, from the preset mapping relationship between block identifiers and stripe identifiers stored in the RAID metadata, look up each mapping relationship in the multi-level page table.

[0088] The preset mapping relationship includes a preset stripe allocation table indexed by stripe identifier and block identifier, and a preset data block allocation table indexed by block identifier and stripe identifier.

[0089] When each stripe is generated, the stripe identifier and the block identifiers of each data block within that stripe can be stored in a preset stripe allocation table. This preset stripe allocation table allows the identification of each data block within each stripe. Similarly, for each data block within a stripe, the block identifier and the stripe identifier can be stored in a preset data block allocation table. This preset data block allocation table allows the identification of the stripe to which each data block belongs. Optionally, the preset stripe allocation table may also include other information as index values, such as the logical and / or physical address of the data block, the stripe status identifier, etc. No specific limitations are imposed on this.

[0090] After creating a multi-level page table as the actual mapping relationship, for each target data block, the stripe identifier in the pre-embedded information is used as an index to query the first-level page table, obtaining the corresponding second-level page table. Then, by traversing the block identifiers stored in the obtained second-level page tables, the block identifiers corresponding to the stripe identifier can be obtained. Thus, the mapping relationship between the stripe identifier and each block identifier is obtained, resulting in each mapping relationship in the multi-level page table. Each mapping relationship includes a stripe identifier and a block identifier. Then, each mapping relationship in the multi-level page table can be searched from the preset stripe allocation table and the preset data block allocation table to compare the actual mapping relationship with the preset mapping relationship. The search results can then be used as the comparison results between the actual mapping relationship and the preset mapping relationship.

[0091] Optionally, upon receiving a stripe request for RAID, the system obtains the stripe identifier of the stripe allocated in response to the stripe request and the block identifier of each data block in the allocated stripe, stores the mapping relationship between the stripe identifier of the allocated stripe and the block identifier of each data block in the allocated stripe in a preset stripe allocation table, and stores the mapping relationship between the block identifier of each data block in the allocated stripe and the stripe identifier of the allocated stripe in a preset data block allocation table.

[0092] In one optional embodiment, the RAID stripe repair method may further include, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset stripe allocation table, reconstructing the mapping relationship between the second stripe identifier and each block identifier according to the multi-level page table, and updating the reconstructed mapping relationship to the preset stripe allocation table; wherein, the second stripe identifier is the stripe identifier in the mapping relationship.

[0093] Normally, for each mapping relationship in a multi-level page table, the corresponding mapping relationship should exist in the preset stripe allocation table. If the mapping relationship is not found in the preset stripe allocation table, the corresponding block identifiers in the mapping relationship are searched from the multi-level page table. Based on the search results, the mapping relationship between the stripe identifiers and block identifiers in the mapping relationship is reconstructed, and the reconstructed mapping relationship is added to the preset stripe allocation table, so that the preset stripe allocation table includes every mapping relationship from the multi-level page table.

[0094] In another optional embodiment, the RAID stripe repair method may further include updating the mapping relationship to the preset data block allocation table for each mapping relationship in the multi-level page table if the mapping relationship is not found in the preset data block allocation table.

[0095] Similar to the default stripe allocation table, under normal circumstances, for each mapping relationship in the multi-level page tables, the default data block allocation table should also contain that mapping relationship. Therefore, if the mapping relationship is not found in the default data block allocation table, it is added to the default data block allocation table to ensure that the default data block allocation table includes every mapping relationship from the multi-level page tables.

[0096] Optionally, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset stripe allocation table and no mapping relationship is found in the preset data block allocation table, the mapping relationship between the second stripe identifier and each block identifier is reconstructed according to the multi-level page table, and the reconstructed mapping relationship is updated to the preset stripe allocation table and the mapping relationship is updated to the preset data block allocation table.

[0097] In this way, by updating the preset stripe allocation table and the preset data block allocation table, the preset mapping relationship is updated, improving the consistency between the preset mapping relationship and the actual mapping relationship. This facilitates the comparison efficiency between the preset mapping relationship and the actual mapping relationship during the subsequent RAID stripe repair process, thereby improving the RAID stripe repair efficiency.

[0098] In this embodiment, a multi-level page table is constructed as the actual mapping relationship to achieve a comparison between the actual mapping relationship and the preset mapping relationship. Since the multi-level page table enables a fast lookup of each mapping relationship in the actual mapping relationship, the comparison efficiency between the preset mapping relationship and the actual mapping relationship can be improved, thereby improving the stripe repair efficiency of RAID.

[0099] Based on the above embodiments, in an exemplary embodiment, the stripe repair of RAID is further refined. Optionally, when the comparison results indicate that the same stripe identifier has a mapping relationship with multiple block identifiers, and the data write timestamps corresponding to the multiple block identifiers are not completely identical, such as... Figure 4 As shown, the following steps may be included:

[0100] S401, group the block identifiers with the same data write-to-disk timestamp among the multiple block identifiers to obtain multiple block identifier groups.

[0101] Since the data write timestamps of each data block in the same stripe of a RAID should be the same, if the comparison results show that there is a mapping relationship between the same stripe identifier and multiple block identifiers, and the data write timestamps corresponding to the multiple block identifiers are not completely the same, it can be determined that there is a stripe redistribution anomaly in the RAID, that is, the same stripe identifier has been assigned to multiple different stripes.

[0102] For each block identifier among multiple block identifiers, the data write-to-disk timestamp in the pre-embedded information to which the block identifier belongs is used as the corresponding data write-to-disk timestamp. Then, the multiple block identifiers are grouped according to their corresponding data write-to-disk timestamps, resulting in multiple block identifier groups. Within the same block identifier group, the data write-to-disk timestamps of each block identifier are the same, while the data write-to-disk timestamps of block identifiers in different block identifier groups are different. Based on this, the data blocks corresponding to the block identifiers within the same block identifier group belong to the same stripe, and the data blocks corresponding to the block identifiers in different block identifier groups belong to different stripes.

[0103] S402, retain the mapping relationship between any block identifier group in multiple block identifier groups and the same strip identifier.

[0104] Optionally, select the block identifier group with the largest or smallest data write-to-disk timestamp among multiple block identifier groups, and retain the mapping relationship between the selected block identifier group and the same strip identifier.

[0105] Optionally, any block identifier group can be randomly selected from multiple block identifier groups, and the mapping relationship between the selected block identifier group and the same strip identifier can be preserved.

[0106] It should be noted that the above embodiments are illustrative examples of determining the retained mapping relationship, and not limitations. Any specific implementation that can retain the mapping relationship between any block identifier group among multiple block identifier groups and the same strip identifier is within the protection scope of the embodiments of this application.

[0107] S403, assign different stripe identifiers that are not currently occupied to the remaining block identifier groups other than the block identifier group among the multiple block identifier groups, to obtain the first stripe.

[0108] For each remaining block identifier group other than the block identifier group in the reserved mapping relationship among multiple block identifiers, a currently unoccupied stripe identifier can be assigned to that block identifier group, and the stripe identifiers assigned to different remaining block identifier groups are different. Therefore, after assigning stripe identifiers to each remaining block identifier group, it can be considered that a new stripe has been reconstructed, thus obtaining each reconstructed first stripe.

[0109] In one optional embodiment, since the number of data blocks in different stripes of RAID is fixed and the same, when the number of block identifiers included in each block identifier group is less than the fixed number of data blocks in the RAID stripe, a data block in an available state is selected from the RAID disk as a data block in the first stripe, and pre-embedded information is recorded in the selected data block. The stripe identifier in the pre-embedded information is the stripe identifier of the allocated first stripe, and the data disk write timestamp is the data disk write timestamp corresponding to the block identifier in the block identifier group.

[0110] In one optional embodiment, the preset stripe allocation table and the preset data block allocation table are updated according to the mapping relationship between the stripe identifier and the block identifier of each first stripe. Optionally, the mapping relationship between the block identifier of each first stripe and the stripe identifier in the retained mapping relationship is deleted from the preset stripe allocation table and the preset data block allocation table. For each first stripe, the mapping relationship between the stripe identifier and the block identifier of the first stripe is added to the preset stripe allocation table, and the mapping relationship between each block identifier of the first stripe and the stripe identifier of the first stripe is added to the preset data block allocation table.

[0111] In one optional embodiment, if the strip identifier in the embedded information of each data block of each first stripe is updated to the strip identifier of the first stripe, then the actual mapping relationship is updated accordingly.

[0112] In this embodiment, stripe redistribution anomalies in RAID can be repaired, expanding the types of RAID faults that can be repaired, thereby broadening the application scenarios of RAID repair and filling the gap in RAID repair methods for complex phenomena.

[0113] Based on the above embodiments, in an exemplary embodiment, the RAID stripe repair is further refined. Optionally, when the comparison results indicate that the same identifier has a mapping relationship with multiple stripe identifiers, the following steps may be included:

[0114] 1. If the first strip identifier exists among multiple strip identifiers, retain the strip corresponding to the first strip identifier and delete the strips corresponding to the other strip identifiers besides the first strip identifier.

[0115] In this case, the data blocks in the stripe corresponding to the first stripe have the same data disk timestamp.

[0116] Since each data block in a RAID should belong to only one stripe, if the comparison results show that the same block identifier has a mapping relationship with multiple stripe identifiers, it can be determined that there is a data block redistribution anomaly in the RAID, that is, the same data block has been assigned to multiple different stripes.

[0117] Furthermore, since the data write-to-disk timestamps of all data blocks within the same stripe in a RAID array should be identical, for each stripe identifier among multiple stripe identifiers, it is determined whether the data write-to-disk timestamps of all data blocks within that stripe identifier are identical. If the data write-to-disk timestamps of all data blocks within that stripe identifier are identical, that stripe identifier is designated as the first stripe identifier. Thus, if a first stripe identifier exists among multiple stripe identifiers, the stripe corresponding to the first stripe identifier is retained, and the stripes corresponding to the other stripe identifiers besides the first stripe identifier are deleted. Deleting a stripe means releasing the actual storage space corresponding to each data block in that stripe on the RAID disk. This makes the actual storage space corresponding to each data block in that stripe available, and the data blocks in that stripe can be allocated to a new stripe to store new data, overwriting the data currently stored in the data blocks in that stripe. The data blocks in that stripe can be allocated to the same or different new stripes. Optionally, in the actual mapping relationship, delete the correspondence between the other strip identifiers and block identifiers except for the first strip identifier among multiple strip identifiers.

[0118] 2. If the first stripe identifier is not found among multiple stripe identifiers, perform stripe reconstruction on data blocks with the same data disk timestamp in the data blocks to be reconstructed to obtain the second stripe, and assign the currently unoccupied stripe identifier to the second stripe.

[0119] The data blocks to be reconstructed include data blocks in the strips corresponding to each strip identifier among multiple strip identifiers.

[0120] Accordingly, when a first stripe identifier is absent among multiple stripe identifiers, the data blocks within the stripes corresponding to each of the multiple stripe identifiers can be considered as data blocks to be reconstructed. These data blocks are then grouped according to their disk persistence timestamps, resulting in multiple data block groups. Within the same data block group, the disk persistence timestamps of the data blocks are identical, while those in different data block groups are different. Based on this, data blocks within the same data block group belong to the same stripe, and data blocks in different data block groups belong to different stripes. Furthermore, stripe reconstruction is performed on each data block group within each data block group to obtain a second stripe. Each reconstructed second stripe is assigned an unused stripe identifier, and different stripe identifiers are assigned to different second stripes.

[0121] In one optional embodiment, since the number of data blocks in different stripes of the RAID is fixed and the same, if the number of data blocks with the same data write-to-disk timestamp in the data block to be reconstructed is less than the fixed number of data blocks in the RAID stripe, a data block in an available state is selected from the RAID disk as a data block in the second stripe, and pre-embedded information is recorded in the selected data block. The stripe identifier in the pre-embedded information is the stripe identifier of the allocated second stripe, and the data write-to-disk timestamp is the same data write-to-disk timestamp.

[0122] In one optional embodiment, the preset stripe allocation table and the preset data block allocation table are updated according to the mapping relationship between the stripe identifier and the block identifier of each second stripe. Optionally, the mapping relationship between the block identifier and the stripe identifier of each data block to be reconstructed is deleted from the preset stripe allocation table and the preset data block allocation table, and for each second stripe, the mapping relationship between the stripe identifier and the block identifier of the second stripe is added to the preset stripe allocation table, and the mapping relationship between each block identifier of the second stripe and the stripe identifier of the second stripe is added to the preset data block allocation table.

[0123] In one optional embodiment, if the strip identifier in the embedded information of each data block of each second stripe is updated to the strip identifier of that second stripe, then the actual mapping relationship is updated accordingly.

[0124] In this embodiment, data block redistribution anomalies in RAID can be repaired, expanding the types of RAID faults that can be repaired, thereby broadening the application scenarios of RAID repair and filling the gap in RAID repair methods for complex phenomena.

[0125] Based on the above embodiments, in an exemplary embodiment, such as Figure 5 As shown, the stripe repair method for this RAID may include the following steps:

[0126] S501 performs deduplication on each data block based on the pre-embedded information of each data block in the RAID to obtain the target data block.

[0127] S502, compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and stripe identifier stored in the RAID metadata.

[0128] Based on the comparison results, the S503 performs stripe repair on the RAID.

[0129] The specific implementation methods of S501-S503 are the same as those of S101-S103 mentioned above, and will not be repeated here.

[0130] S504, based on the actual mapping relationship, determines each data block in each stripe.

[0131] Optionally, the updated actual mapping relationship is obtained when stripe repair is performed on the RAID, and then each data block in each stripe of the RAID is determined based on the current true correspondence between stripes and data blocks in the RAID as represented by the updated actual mapping relationship.

[0132] S505: For each stripe, if the data disk timestamps of each data block in the stripe are not completely the same, the stripe is reconstructed for the data block with the largest data disk timestamp, resulting in a third stripe, and an unused stripe identifier is assigned to the third stripe.

[0133] Since the data write timestamps of all data blocks within the same stripe of a RAID array should be identical, if the data write timestamps of the data blocks within that stripe are not completely identical, it can be assumed that there is garbage data in that stripe. Furthermore, since a larger write timestamp indicates newer data within the block, only the data block with the largest write timestamp in that stripe is retained. Then, the data blocks with the largest write timestamps in that stripe are selected, and stripe reconstruction is performed on these selected data blocks to create a third stripe. An unused stripe identifier is then assigned to the reconstructed third stripe.

[0134] In one optional embodiment, since the number of data blocks in different stripes of the RAID is fixed and the same, if the number of data blocks with the largest data write-to-disk timestamp in the stripe is less than the fixed number of data blocks in the RAID stripe, a data block in an available state is selected from the RAID disk as a data block in the third stripe, and pre-embedded information is recorded in the selected data block. The stripe identifier in the pre-embedded information is the stripe identifier of the allocated third stripe, and the data write-to-disk timestamp is the data write-to-disk timestamp of the data block with the largest data write-to-disk timestamp in the stripe.

[0135] S506, delete all data blocks except the data block with the largest data write-to-disk timestamp, and update the preset mapping relationship according to the stripe identifier of the third stripe and the block identifier of each data block in the third stripe.

[0136] Optionally, delete the mapping relationship between the stripe identifier and the block identifier of the third stripe in the preset stripe allocation table and the preset data block allocation table, add the mapping relationship between the stripe identifier of the third stripe and each block identifier in the preset stripe allocation table, and add the mapping relationship between each block identifier of the third stripe and the stripe identifier of the third stripe in the preset data block allocation table.

[0137] In one optional embodiment, if the strip identifier in the embedded information of each data block of the third strip is updated to the strip identifier of the third strip, then the actual mapping relationship is updated accordingly.

[0138] In this embodiment, garbage data in the RAID stripes can be deleted, reducing the storage space occupied by garbage data on the RAID disk, improving the utilization rate of the storage space on the RAID disk, and expanding the types of RAID faults that can be repaired, thereby expanding the application scenarios of RAID repair and filling the gap in RAID repair methods for complex phenomena.

[0139] Based on the above embodiments, in an exemplary embodiment, the RAID stripe repair method may further include, for each reconstructed stripe, reconstructing the stripe bitmap according to the usage of data blocks in the stripe, and adding the bitmap to a preset bitmap.

[0140] A stripe bitmap is a binary data structure used to mark the status of data blocks within a stripe. It uses bits of "0" or "1" to indicate the status of the corresponding data block. The number of bits in the stripe bitmap is the same as the number of data blocks in the stripe. Each bit corresponds to one data block; a bit of "1" indicates that the corresponding data block is used, and a bit of "0" indicates that the corresponding data block is not used. Optionally, a stripe bitmap can be persistently mapped to a stripe identifier, i.e., the mapping relationship between the stripe bitmap and the stripe identifier can be persistently stored. For example, the mapping relationship between the bitmap and the stripe identifier for each stripe in a RAID array can be stored in the RAID metadata.

[0141] During RAID stripe repair, the first, second, and third stripes are all reconstructed stripes. For each reconstructed stripe, its bitmap can be reconstructed based on the usage of data blocks within the stripe, and this bitmap is added to a preset bitmap. Optionally, the preset bitmap stores the mapping relationship between stripe identifiers and bitmaps. Additionally, the preset bitmap is optionally stored in the RAID metadata.

[0142] Optionally, delete the bitmap of the preset bitmap that disappeared during the reconstruction of the first, second, and third stripes due to deletion or data blocks being distributed among the reconstructed stripes.

[0143] In one alternative embodiment, upon receiving a stripe request for RAID, and determining the usage of each data block in the allocated stripe in response to the stripe request, a bitmap of the allocated stripe is constructed and added to a preset bitmap.

[0144] In this embodiment, by updating the preset bitmap, the usage of each data block in the RAID stripe can be accurately recorded, improving the efficiency of understanding the true situation of the RAID. Furthermore, based on the preset bitmap and the preset stripe allocation table and preset data block allocation table in the preset mapping relationship, new RAID stripe repair ideas can be provided to improve the efficiency of RAID stripe repair.

[0145] Based on the above embodiments, in an exemplary embodiment, such as Figure 6 As shown, the stripe repair method for this RAID may include the following steps;

[0146] S601, upon receiving a stripe request for RAID, obtains the stripe identifier of the stripe allocated in response to the stripe request and the block identifier of each data block in the allocated stripe.

[0147] S602, add the obtained strip identifier and block identifier mapping relationship to the preset mapping relationship, and add the bitmap of the assigned strip to the preset bitmap.

[0148] The S603 scans the RAID disks using the data size of each data block as the scan step size to obtain the pre-embedded information for each data block.

[0149] S604: Identify multiple data blocks in the pre-embedded information that have the same block identifier and stripe identifier, and perform deduplication processing on the other data blocks except for the data block with the largest data disk timestamp to obtain the target data block.

[0150] S605: Based on the original data stored in each data block of each strip, determine the check value of the original data, and compare the check value with the check data stored in each data block of the strip.

[0151] S606: In the event of inconsistency between the check value and the check data, data repair is performed on the stripe based on the original data and the check data.

[0152] S607. Based on the block identifier and stripe identifier in the pre-embedded information of the target data block, construct a multi-level page table as the actual mapping relationship, and search for each mapping relationship in the multi-level page table from the preset mapping relationship between block identifier and stripe identifier stored in the RAID metadata to obtain the comparison result; wherein, the preset mapping relationship includes a preset stripe allocation table and a preset data block allocation table.

[0153] S608, when the comparison results show that there is a mapping relationship between the same strip identifier and multiple block identifiers, and the data write timestamps corresponding to the multiple block identifiers are not completely the same, the block identifiers with the same data write timestamps are grouped together to obtain multiple block identifier groups;

[0154] S609, retain the mapping relationship between any block identifier group in multiple block identifier groups and the same stripe identifier, and assign different stripe identifiers that are not currently occupied to the remaining block identifier groups in multiple block identifier groups other than the block identifier group, to obtain the first stripe.

[0155] S610, if the comparison results indicate that there is a mapping relationship between the same block identifier and multiple stripe identifiers, if the first stripe identifier exists among the multiple stripe identifiers, then the stripe corresponding to the first stripe identifier is retained, and the stripes corresponding to the other stripe identifiers besides the first stripe identifier are deleted; if the first stripe identifier does not exist among the multiple stripe identifiers, then the data blocks with the same data disk timestamp in the data blocks to be reconstructed are striped to obtain the second stripe, and the currently unoccupied stripe identifier is allocated to the second stripe.

[0156] S611, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset stripe allocation table, reconstruct the mapping relationship between the second stripe identifier and each block identifier according to the multi-level page table, and update the reconstructed mapping relationship to the preset stripe allocation table; the second stripe identifier is the stripe identifier in the mapping relationship; and / or, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset data block allocation table, update the mapping relationship to the preset data block allocation table.

[0157] S612, determine the data blocks in each stripe based on the multi-level page table;

[0158] S613, for each stripe, if the data disk timestamps of each data block in the stripe are not completely the same, the stripe is reconstructed for the data block with the largest data disk timestamp among the data blocks to obtain the third stripe, and the currently unoccupied stripe identifier is assigned to the third stripe.

[0159] S614, delete all data blocks except the data block with the largest data write-to-disk timestamp, and update the preset mapping relationship according to the stripe identifier of the third stripe and the block identifier of each data block in the third stripe.

[0160] S615: For each strip to be reconstructed, the bitmap of the strip is reconstructed according to the usage of data blocks in the strip, and the bitmap is added to a preset bitmap.

[0161] The specific implementation methods of S601-S615 are the same as those in the above method embodiments, and will not be repeated here.

[0162] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0163] Based on the same inventive concept, this application also provides a RAID stripe repair apparatus for implementing the RAID stripe repair method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more RAID stripe repair apparatus embodiments provided below can be found in the limitations of the RAID stripe repair method described above, and will not be repeated here.

[0164] In one exemplary embodiment, such as Figure 7As shown, a RAID stripe repair device is provided, wherein the data blocks of the stripes in the Independent Disk Redundancy Array (RAID) record pre-embedded information. The pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier of the stripe to which the data block belongs, and the data write-to-disk timestamp of the data block. The RAID stripe repair device includes: a data block deduplication module 710, a mapping relationship comparison module 720, and a stripe repair module 730, wherein:

[0165] The data block deduplication module 710 is used to deduplicatize each data block according to the pre-embedded information of each data block in the RAID to obtain the target data block.

[0166] The mapping relationship comparison module 720 is used to compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; wherein, the actual mapping relationship is the mapping relationship between the block identifier and the stripe identifier in the embedded information of the target data block;

[0167] The stripe repair module 730 is used to repair stripes on the RAID based on comparison results.

[0168] In an exemplary embodiment, the data block deduplication module 710 is specifically used to: scan the RAID disk with the data volume of the data block as the scan step size to obtain the pre-embedded information of each data block; determine multiple data blocks in the pre-embedded information that have the same block identifier and stripe identifier, and perform deduplication processing on the other data blocks among the multiple data blocks except for the data block with the largest data disk timestamp to obtain the target data block.

[0169] In an exemplary embodiment, the mapping comparison module 720 is specifically used to: construct a multi-level page table as the actual mapping relationship based on the block identifier and stripe identifier in the pre-embedded information of the target data block; wherein, the multi-level page table includes a first-level page table indexed by the stripe identifier and indexed by the address of the second-level page table corresponding to the stripe identifier, and a second-level page table including the block identifier; and search for each mapping relationship in the multi-level page table from the preset mapping relationship between the block identifier and the stripe identifier stored in the RAID metadata; wherein, the preset mapping relationship includes a preset stripe allocation table indexed by the stripe identifier and indexed by the block identifier, and a preset data block allocation table indexed by the block identifier and indexed by the stripe identifier.

[0170] In an exemplary embodiment, when the comparison results indicate that there is a mapping relationship between the same stripe identifier and multiple block identifiers, and the data write-to-disk timestamps corresponding to the multiple block identifiers are not completely the same, the stripe repair module 730 is specifically used to: divide the block identifiers with the same data write-to-disk timestamps among the multiple block identifiers into a group to obtain multiple block identifier groups; retain the mapping relationship between any block identifier group in the multiple block identifier groups and the same stripe identifier; and allocate different stripe identifiers that are not currently occupied to the remaining block identifier groups other than the block identifier group in the multiple block identifier groups to obtain the first stripe.

[0171] In an exemplary embodiment, when the comparison results indicate that the same identifier has a mapping relationship with multiple stripe identifiers, the stripe repair module 730 is specifically used to: retain the stripe corresponding to the first stripe identifier when the first stripe identifier exists among the multiple stripe identifiers, and delete the stripes corresponding to other stripe identifiers besides the first stripe identifier among the multiple stripe identifiers; wherein, the data disk timestamps of each data block in the stripe corresponding to the first stripe identifier are the same; when the first stripe identifier does not exist among the multiple stripe identifiers, perform stripe reconstruction on the data blocks with the same data disk timestamps in the data blocks to be reconstructed to obtain a second stripe, and allocate currently unoccupied stripe identifiers to the second stripe; wherein, the data blocks to be reconstructed include the data blocks in the stripes corresponding to each stripe identifier among the multiple stripe identifiers.

[0172] In an exemplary embodiment, the RAID stripe repair device further includes: a relationship addition module, configured to, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset stripe allocation table, reconstruct the mapping relationship between the second stripe identifier and each block identifier according to the multi-level page table, and update the reconstructed mapping relationship to the preset stripe allocation table; wherein the second stripe identifier is the stripe identifier in the mapping relationship; and / or, for each mapping relationship in the multi-level page table, if no mapping relationship is found in the preset data block allocation table, update the mapping relationship to the preset data block allocation table.

[0173] In an exemplary embodiment, the RAID stripe repair device further includes: a data block determination module, used to determine each data block in each stripe according to the actual mapping relationship; a stripe reconstruction module, used to perform stripe reconstruction on the data block with the largest data disk timestamp in each data block when the data disk timestamps of each data block in the stripe are not completely the same, to obtain a third stripe, and to allocate a currently unoccupied stripe identifier to the third stripe; and a relationship update module, used to delete each data block except the data block with the largest data disk timestamp in each data block, and update the preset mapping relationship according to the stripe identifier of the third stripe and the block identifier of each data block in the third stripe.

[0174] In an exemplary embodiment, the RAID stripe repair device further includes a bitmap reconstruction module, which is used to reconstruct the bitmap of each stripe according to the usage of data blocks in the stripe, and add the bitmap to a preset bitmap.

[0175] In an exemplary embodiment, the RAID stripe repair device further includes: an identifier acquisition module, configured to acquire, upon receiving a stripe application for the RAID, the stripe identifier allocated in response to the stripe application and the block identifier of each data block in the allocated stripe; and an information addition module, configured to add the obtained mapping relationship between the stripe identifier and each block identifier to a preset mapping relationship, and to add the bitmap of the allocated stripe to a preset bitmap.

[0176] In an exemplary embodiment, the RAID stripe repair device further includes: a data comparison module, configured to determine the check value of the original data based on the original data stored in each data block of each stripe, and compare the check value with the check data stored in each data block of the stripe; and a data repair module, configured to repair the stripe based on the original data and the check data when the check value and the check data are inconsistent.

[0177] The modules in the aforementioned RAID stripe repair device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0178] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores data blocks in the RAID stripes. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a RAID stripe repair method.

[0179] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a RAID stripe repair method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0180] Those skilled in the art will understand that Figure 8 and Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0181] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0182] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0183] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0184] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0185] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0186] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for stripe repair in RAID, characterized in that, The data blocks of a RAID (Redundant Array of Independent Disks) stripe contain pre-embedded information. The pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier of the stripe to which the data block belongs, and the data write-to-disk timestamp of the data block. The method includes: Based on the pre-embedded information of each data block in the RAID, the data blocks are deduplicated to obtain the target data block; The actual mapping relationship corresponding to the target data block is compared with the preset mapping relationship between the block identifier and the stripe identifier stored in the metadata of the RAID; wherein, the actual mapping relationship is the mapping relationship between the block identifier and the stripe identifier in the embedded information of the target data block; Based on the comparison results, stripe repair was performed on the RAID.

2. The method according to claim 1, characterized in that, The step of deduplicating each data block according to the pre-embedded information of each data block in the RAID to obtain the target data block includes: The RAID disks are scanned using the data size of each data block as the scan step size to obtain the pre-embedded information of each data block. Identify multiple data blocks in the pre-embedded information that have the same block identifier and stripe identifier, and perform deduplication processing on the other data blocks except for the data block with the largest data disk timestamp to obtain the target data block.

3. The method according to claim 1, characterized in that, The comparison of the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and stripe identifier stored in the RAID metadata includes: Based on the block identifier and stripe identifier in the pre-embedded information of the target data block, a multi-level page table is constructed as the actual mapping relationship; wherein, the multi-level page table includes a first-level page table indexed by the stripe identifier and the second-level page table address corresponding to the stripe identifier as the index value, and a second-level page table including the block identifier; From the preset mapping relationship between block identifiers and stripe identifiers stored in the metadata of the RAID, each mapping relationship in the multi-level page table is searched; wherein, the preset mapping relationship includes a preset stripe allocation table indexed by stripe identifiers and block identifiers, and a preset data block allocation table indexed by block identifiers and stripe identifiers.

4. The method according to claim 3, characterized in that, When the comparison results indicate that the same stripe identifier has a mapping relationship with multiple block identifiers, and the data write timestamps corresponding to the multiple block identifiers are not completely identical, the stripe repair of the RAID based on the comparison results includes: Among the multiple block identifiers, the block identifiers with the same corresponding data disk erasure timestamp are grouped together to obtain multiple block identifier groups; Retain the mapping relationship between any one of the multiple block identifier groups and the same strip identifier; For the remaining block identifier groups other than the block identifier group, assign different stripe identifiers that are not currently occupied to obtain the first stripe.

5. The method according to claim 3, characterized in that, When the comparison results indicate that the same identifier has a mapping relationship with multiple stripe identifiers, the stripe repair of the RAID based on the comparison results includes: If a first stripe identifier exists among the multiple stripe identifiers, the stripe corresponding to the first stripe identifier is retained, and the stripes corresponding to the other stripe identifiers besides the first stripe identifier are deleted; wherein, the data disk timestamps of each data block in the stripe corresponding to the first stripe identifier are the same; If the first stripe identifier is not present among the plurality of stripe identifiers, stripe reconstruction is performed on data blocks with the same data disk timestamp in the data block to be reconstructed to obtain a second stripe, and an unused stripe identifier is assigned to the second stripe; wherein, the data block to be reconstructed includes the data block in the stripe corresponding to each of the plurality of stripe identifiers.

6. The method according to claim 3, characterized in that, The method further includes: For each mapping relationship in the multi-level page table, if the mapping relationship is not found in the preset stripe allocation table, the mapping relationship between the second stripe identifier and each block identifier is reconstructed according to the multi-level page table, and the reconstructed mapping relationship is updated to the preset stripe allocation table; wherein, the second stripe identifier is the stripe identifier in the mapping relationship; and / or, For each mapping relationship in the multi-level page table, if the mapping relationship is not found in the preset data block allocation table, the mapping relationship is updated to the preset data block allocation table.

7. The method according to claim 1, characterized in that, The method further includes: Based on the actual mapping relationship, determine the data blocks in each strip; For each stripe, if the data timestamps of each data block in the stripe are not completely the same, the data block with the largest data timestamp is reconstructed to obtain the third stripe, and an unoccupied stripe identifier is assigned to the third stripe. Delete all data blocks except the data block with the largest data disk timestamp, and update the preset mapping relationship according to the stripe identifier of the third stripe and the block identifier of each data block in the third stripe.

8. The method according to claim 4, 5 or 7, characterized in that, The method further includes: For each reconstructed strip, the bitmap of the strip is reconstructed according to the usage of data blocks in the strip, and the bitmap is added to a preset bitmap.

9. The method according to any one of claims 1-7, characterized in that, The method further includes: Upon receiving a stripe request for the RAID, obtain the stripe identifier of the stripe allocated in response to the stripe request and the block identifier of each data block in the allocated stripe; The obtained strip identifier and block identifier mapping relationship are added to the preset mapping relationship, and the bitmap of the assigned strip is added to the preset bitmap.

10. The method according to any one of claims 1-7, characterized in that, The method further includes: Based on the original data stored in each data block of each strip, determine the check value of the original data, and compare the check value with the check data stored in each data block of the strip. If the verification value and the verification data are inconsistent, the stripe is repaired based on the original data and the verification data.

11. A stripe repair device for RAID, characterized in that, The data blocks of a RAID (Redundant Array of Independent Disks) stripe record pre-embedded information. The pre-embedded information recorded in each data block includes at least the block identifier of the data block, the stripe identifier of the stripe to which the data block belongs, and the data write-to-disk timestamp of the data block; the device includes: The data block deduplication module is used to deduplicatize each data block according to the pre-embedded information of each data block in the RAID to obtain the target data block. The mapping relationship comparison module is used to compare the actual mapping relationship corresponding to the target data block with the preset mapping relationship between the block identifier and the stripe identifier stored in the metadata of the RAID; wherein, the actual mapping relationship is the mapping relationship between the block identifier and the stripe identifier in the embedded information of the target data block; The stripe repair module is used to repair the RAID based on the comparison results.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 10.