Data recovery methods, apparatus, computer equipment and storage media

By using the check information of the APP domain stripe to perform EC check on the APP domain information in the storage system controller, the damaged BST information can be directly recovered, which solves the problem of low data recovery efficiency in the existing technology and achieves more efficient data recovery.

CN120179455BActive Publication Date: 2026-11-17DAWNING INFORMATION IND (BEIJING) CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311755062.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-19
Publication Date
2026-11-17
Estimated Expiration
2043-12-19

AI Technical Summary

Technical Problem

Existing data recovery methods require interaction with the hard drive and data calculations when the BST information in the hard drive sector is damaged, resulting in low recovery efficiency.

Method used

In the storage system controller, the check information in the APP domain stripe is used to perform EC check on the APP domain information, directly recovering the damaged BST information and reducing the data recovery process.

Benefits of technology

It improves data recovery efficiency, reduces the interaction process with the hard drive, and increases the success rate and efficiency of data reading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179455B_ABST
    Figure CN120179455B_ABST
Patent Text Reader

Abstract

This application relates to a data recovery method, apparatus, computer equipment, storage medium, and computer program product. The method includes: receiving a data read command and determining the protection information of the target data corresponding to the data read command; the APP field information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located; if the BST information is damaged, determining the verification information corresponding to the APP field information in the APP field stripe; verifying the APP field information according to the verification information to obtain the recovered APP field information; the recovered APP field information contains the recovered BST information. This method can improve data recovery efficiency.
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 data recovery method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] When the storage system controller reads target data from the hard drive, it first needs to read the BST (Bad Sector) information corresponding to the sector where the target data is located to determine the sector's status. If the BST information is corrupted, it needs to be recovered using data recovery methods.

[0003] Current data recovery methods require the storage system controller to identify the corresponding copy data block of the sector on the hard drive, perform data calculations on the copy data block to obtain the recovered sector, and then determine the recovered BST information based on the recovered sector.

[0004] However, current data recovery methods require the storage system controller to interact with the hard drive and perform data calculations on large copies of data blocks, resulting in a lengthy data recovery process and low data recovery efficiency. Summary of the Invention

[0005] Therefore, it is necessary to provide a data recovery method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0006] In a first aspect, this application provides a data recovery method applied to a storage system controller; the storage system controller includes logical block application programming mark (APP) domain stripes, and the method includes:

[0007] Receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located;

[0008] In the event that the BST information is corrupted, the verification information corresponding to the APP domain information is determined in the APP domain stripe;

[0009] The APP domain information is verified based on the verification information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.

[0010] In the above data recovery method, when the BST information in the APP domain information is damaged, the APP domain information is directly verified based on the APP domain verification information in the APP domain stripe to obtain the recovered BST information. This reduces the data recovery process for BST information and improves data recovery efficiency.

[0011] In one embodiment, before receiving the data read command and determining the protection information of the target data corresponding to the data read command, the method further includes:

[0012] Obtain the status detection results of each sector; the status detection results are obtained by the host performing status detection on the sectors in the hard disk;

[0013] For each sector's status detection result, determine the BST information of the sector corresponding to the status detection result;

[0014] The BST information of the sector is stored in the APP field of the protection information corresponding to the sector.

[0015] In this embodiment, by inspecting the status of each sector, the BST information representing the status of each sector is stored in the APP field of the PI information. The 2-byte space of the APP field is used to store the marking information used to represent whether the flash memory sector is damaged. This makes full use of the space and avoids using extra space in the metadata to record this information, thus saving metadata and cache space and improving program performance.

[0016] In one embodiment, after receiving the data read command and determining the protection information of the target data corresponding to the data read command, the method further includes:

[0017] If the BST information is not corrupted, determine whether the status of the sector corresponding to the BST information is normal based on the BST information;

[0018] If the sector corresponding to the BST information is in an abnormal state, then based on the abnormal state information of the sector and the sector's marker, the read result corresponding to the data read command is constructed, and the read result is sent to the host.

[0019] In this embodiment, when the sector corresponding to the BST information is in an abnormal state, the read result is directly constructed and returned, avoiding data interaction with the hard disk, reducing the IO process, and improving data reading efficiency.

[0020] In one embodiment, before determining the verification information corresponding to the APP domain information in the APP domain stripe in the event that the BST information is corrupted, the method further includes:

[0021] Receive the data update command sent by the host, and update the data to be updated in the hard disk according to the data update command to obtain the updated data;

[0022] According to a preset protection information algorithm, the updated data is processed to obtain new protection information, and the protection information corresponding to the data to be updated is updated according to the new protection information; the new protection information includes new APP domain information.

[0023] The new APP domain information and preset redundant data are encoded to obtain encoded data, and the check code corresponding to the encoded data is calculated to obtain the check information corresponding to the new APP domain information.

[0024] The APP domain stripe is updated based on the new APP domain information and the corresponding verification information.

[0025] In this embodiment, when data is updated, the protection information corresponding to the data is updated in real time, and the APP domain stripe is also updated. This facilitates subsequent data verification based on the updated protection information and improves the accuracy of data reading.

[0026] In one embodiment, the verification is erasure coding (EC) verification, and the step of verifying the APP domain information based on the verification information to obtain the recovered APP domain information includes:

[0027] The verification information is reverse encoded to obtain the decoded verification information;

[0028] The APP domain information is verified based on the decoded verification information to obtain the verification result;

[0029] If the verification result is incorrect, the error bits in the verification result are corrected to obtain the restored APP domain information.

[0030] In this embodiment, the recovered BST information is obtained by performing EC verification on the APP domain information, which facilitates the determination of the reading result based on the recovered BST information and improves the efficiency of data reading.

[0031] In one embodiment, after verifying the APP domain information based on the verification information to obtain the recovered APP domain information, the method further includes:

[0032] The recovered BST information is determined from the recovered APP domain information, and the status of the sector corresponding to the recovered BST information is determined based on the recovered BST information.

[0033] If the sector corresponding to the restored BST information is in normal condition, the target data corresponding to the data read command is obtained from the hard disk, and the target data is verified according to the protection information to obtain the target verification result.

[0034] If the target verification result is normal, the target data is identified as the read result corresponding to the data read command, and the read result is sent to the host.

[0035] In this embodiment, the target data corresponding to the data read command is determined based on the recovered BST information, thus completing the data read and improving the success rate of data read.

[0036] Secondly, this application also provides a data recovery apparatus, comprising:

[0037] The receiving module is used to receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located;

[0038] The determination module is used to determine the verification information corresponding to the APP domain information in the APP domain stripe when the BST information is corrupted.

[0039] The verification module is used to verify the APP domain information according to the verification information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.

[0040] 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 perform the following steps:

[0041] Receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located;

[0042] In the event that the BST information is corrupted, the verification information corresponding to the APP domain information is determined in the APP domain stripe;

[0043] The APP domain information is verified based on the verification information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.

[0044] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0045] Receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located;

[0046] In the event that the BST information is corrupted, the verification information corresponding to the APP domain information is determined in the APP domain stripe;

[0047] The APP domain information is verified based on the verification information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.

[0048] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0049] Receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located;

[0050] In the event that the BST information is corrupted, the verification information corresponding to the APP domain information is determined in the APP domain stripe;

[0051] The APP domain information is verified based on the verification information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.

[0052] The aforementioned data recovery method, apparatus, computer equipment, storage medium, and computer program product receive a data read command and determine the protection information of the target data corresponding to the data read command. The APP domain information in the protection information includes Bad Sector Marker (BST) information corresponding to the sector where the target data is located. If the BST information is corrupted, verification information corresponding to the APP domain information is determined from the APP domain stripe. The APP domain information is verified according to the verification information to obtain the recovered APP domain information. The recovered APP domain information contains the recovered BST information. Using this method, even when the BST information in the APP domain information is corrupted, the APP domain information is directly verified based on the APP domain verification information in the APP domain stripe to obtain the recovered BST information, reducing the data recovery process for BST information and improving data recovery efficiency. Attached Figure Description

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

[0054] Figure 1 This is a diagram illustrating the application environment of a data recovery method in one embodiment;

[0055] Figure 2 This is a schematic diagram of the structure of PI information in one embodiment;

[0056] Figure 3 This is a schematic diagram illustrating how to add 16 bits of storage space to the metadata corresponding to an 8KB management block to store BST information in one embodiment.

[0057] Figure 4 This is a flowchart illustrating a data recovery method in one embodiment;

[0058] Figure 5 This is a schematic diagram of the structure of an APP domain stripe in one embodiment;

[0059] Figure 6 This is a flowchart illustrating the steps for storing BST information in one embodiment;

[0060] Figure 7 This is a schematic diagram of the structure of PI information in another embodiment;

[0061] Figure 8 This is a schematic diagram illustrating the storage of BST information in the protection information corresponding to an 8KB management block in another embodiment;

[0062] Figure 9 This is a flowchart illustrating the steps for determining the reading result based on BST information in one embodiment;

[0063] Figure 10 This is a flowchart illustrating the steps for updating the APP domain stripe in one embodiment;

[0064] Figure 11 This is a flowchart illustrating the EC encoding steps for APP domain information in one embodiment;

[0065] Figure 12 This is a flowchart illustrating the steps for determining the reading result based on the recovered BST information in one embodiment.

[0066] Figure 13 This is a schematic diagram of the data reading process in one embodiment;

[0067] Figure 14 This is a schematic diagram of the PI information repair action in one embodiment;

[0068] Figure 15 This is a structural block diagram of a data recovery device in one embodiment;

[0069] Figure 16 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0070] 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.

[0071] The data recovery method provided in this application embodiment can be applied to, for example, Figure 1 The data recovery system 100 shown includes a host 110, a storage system controller 120, and various solid-state drives (hereinafter referred to as hard drives) 130. The host 110 and the storage system controller 120 are communicatively connected, and the storage system controller 120 is communicatively connected to each hard drive 130. The host 110 interacts with each hard drive 130 through the storage system controller.

[0072] Before describing the specific processing steps of the data recovery method, some abbreviations and proper nouns used in this application are explained here, specifically:

[0073] 1. DIF stands for Data Integrity Field. It is a format and method defined by ANSI (American National Standards Institute) T10 to ensure data consistency. The DIF format used in this application is 512+8.

[0074] 2. CRC16, CRC stands for Cyclic Redundancy Check. It is one of the most commonly used error-checking codes in data communication and belongs to the category of hash codes. CRC16 refers to a 16-bit CRC value.

[0075] 3. PI stands for Protection Information. In storage, this information is used to protect data consistency, and its design methods include DIF and CRC.

[0076] 4. GRD is the name of the first two bytes of space in PI, Logical Block Guard, or GRD field for short.

[0077] 5. APP is the name of the middle two-byte space in PI, namely Logical Block Application Tag, or APP field for short.

[0078] 6. REF is the name of the last four bytes of space in PI, Logical Block Reference Tag, or REF field for short.

[0079] 7. LBA, short for Logical Block Addressing, is a method used in computer storage devices (such as hard disk drives) to access and address data.

[0080] 8. BST, short for Bad Sector, indicates a mark of a damaged sector, i.e. a bad sector mark.

[0081] 9. NVMe, short for "Non-Volatile Memory Express," is a protocol and interface standard used to connect computer systems to non-volatile storage devices such as solid-state drives (SSDs).

[0082] 10. NAND, short for "NAND Flash Memory," is a non-volatile memory technology commonly used in the manufacture of various digital storage devices.

[0083] 11. RAID, short for "Redundant Array of Independent Disks," is a data storage technology designed to improve data availability, reliability, and performance. It achieves data redundancy and / or striping by combining multiple hard drives to create a single logical drive, thus meeting diverse storage needs.

[0084] 12. EC (Erasure Code) is an advanced error correction coding technique used to protect data from the failure of multiple storage nodes or drives. It is particularly suitable for distributed storage systems and cloud storage, where data is distributed across multiple physical locations or devices. The main goal of EC erasure coding is to provide high availability and data redundancy to ensure that data is not lost and can be recovered even if multiple storage nodes fail.

[0085] 13. KB, KB usually stands for "Kilobyte". KB is a unit of data storage and transmission capacity, equal to 1024 bytes. One byte (Byte) equals 8 bits, and 1KB equals 1024 bytes, or 8192 bits.

[0086] To make the objectives, technical solutions, and advantages of this application clearer, the technical background of this application is described in more detail below. Specifically: a storage array is a high-performance, low-latency storage solution composed of a large number of storage units, each capable of storing one bit of binary data (0,1). Typically, the storage units are arranged in an N (N is a non-zero natural number) row × M (M is a non-zero natural number) column matrix. Multiple hard drives are combined into an array and used as a single hard drive, offering higher performance, reliability, and efficiency compared to traditional hard drives.

[0087] In storage arrays, ANSI T10 is supported to ensure data integrity within the storage system. The T10 standard protects data integrity by adding Protection Information (PI), also known as Data Integrity Field (DIF), to each data block. Each logical sector (512 bytes) is extended with 8 bytes of protection information to ensure data consistency. These 8 bytes include: a 2-byte Logical Block Guard (GRD) field; a 2-byte Logical Block Application Tag (APP) field; and a 4-byte Logical Block Reference Tag (REF) field. Figure 2 This is a schematic diagram of the structure of PI information in one embodiment. Figure 2 In this context, LSB (Least Significant Bit) is the least significant bit, and MSB (Most Significant Bit) is the most significant bit. This indicates that the PI data is stored in the most endian format.

[0088] Within a storage array, the smallest unit of storage space is a sector, which is 512 bytes. These are typically managed in sizes such as 8KB, 16KB, and 32KB, and are referred to as management blocks. Due to the nature of the media itself, flash memory cells have a limited lifespan; as usage increases, bad blocks will appear. If a cell in a sector is damaged, that sector becomes unusable, and BST information needs to be recorded in the management block's metadata. Figure 3 This is a schematic diagram illustrating an embodiment where an additional 16-bit storage space is added to the metadata corresponding to an 8KB management block to store BST information. Figure 3As shown, an 8KB management block will have 16 sectors, and the BST information of each sector will be stored using 1 bit, requiring a total of 16 bits of additional metadata storage space. Metadata will be read frequently, and increasing the size of the metadata will affect the system's bandwidth overhead and cache space size.

[0089] Furthermore, during data reading, when the BST information corresponding to the sector where the target data is located is corrupted, the storage system controller needs to determine the corresponding copy data block in the hard disk, perform data calculations on the copy data block to obtain the recovered sector, and then determine the recovered BST information based on the recovered sector. The data recovery process is lengthy, resulting in low data recovery efficiency.

[0090] Based on the aforementioned traditional technologies, this application provides a data recovery method. In the case of damaged BST information in the APP domain information, EC verification is directly performed on the APP domain information according to the APP domain verification information in the APP domain stripe to obtain the recovered BST information, thereby reducing the data recovery process and improving data recovery efficiency.

[0091] In one exemplary embodiment, such as Figure 4 As shown, a data recovery method is provided, which can be applied to... Figure 1 Taking the storage system controller 120 (hereinafter referred to as the storage system controller) as an example, the storage system controller contains a logical block application tag (APP) domain stripe, including the following steps 402 to 406. Wherein:

[0092] Step 402: Receive the data read command and determine the protection information of the target data corresponding to the data read command.

[0093] Among them, the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located.

[0094] In implementation, the storage controller is pre-configured with protection information corresponding to each piece of data on the hard drive. When the host needs to read data, it sends a data read command to the storage system controller. The storage system controller then receives the data read command and, based on the target data identifier in the data read command, determines the protection information (PI information) corresponding to the target data. The storage system controller then checks whether the BST information in the protection information is corrupted. If the BST information is corrupted, the storage system controller executes step 404. If the BST information is not corrupted, the storage system controller executes step 902.

[0095] Step 404: In the case of corrupted BST information, determine the verification information corresponding to the APP domain information in the APP domain stripe.

[0096] Among them, the APP domain stripe is constructed based on the APP domain information and the verification information of the APP domain information in the PI information.

[0097] In practice, if the BST information is corrupted, the storage system controller traverses the APP domain stripes to determine the verification information corresponding to the APP domain information.

[0098] In an optional embodiment, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of an APP domain stripe (also known as an APP domain EC stripe). In this diagram... Figure 5 Taking an EC stripe consisting of 4 data blocks and 2 parity blocks as an example, the boxes indicate DATA#0, DATA#1, DATA#2, and DATA#3 as 4MB data blocks, and DATA#P and DATA#Q as corresponding parity blocks. Internal data (data on the hard drive) is managed in 8KB blocks. For the EC stripe of the APP domain group in the PI information corresponding to the management block, the parity block stores the parity information of PI.APP (representing the APP domain information in the PI information). If no more than 2 PI.APPs are damaged, recovery can be calculated using the APP parity information APP.P, APP.Q, and the remaining valid PI.APPs.

[0099] Step 406: Verify the APP domain information based on the verification information to obtain the restored APP domain information.

[0100] The restored APP domain information includes the restored BST information.

[0101] In implementation, the storage system controller performs EC verification on the APP domain information based on the verification information to obtain the verified APP domain information. Then, the storage system controller identifies the verified APP domain information as the recovered APP domain information and determines the recovered BST information within the recovered APP domain information. The storage system controller then continues to execute data read commands based on the recovered BST information.

[0102] In the above data recovery method, when the BST information in the APP domain information is damaged, the APP domain information is directly verified based on the APP domain verification information in the APP domain stripe to obtain the recovered BST information. This reduces the data recovery process for BST information and improves data recovery efficiency.

[0103] In an exemplary embodiment, before restoring the BST information, the BST information needs to be written into the PI information, such as... Figure 6 As shown, before step 402 is executed, the specific processing procedure of this data recovery method further includes steps 602 to 606. Wherein:

[0104] Step 602: Obtain the status detection results of each sector.

[0105] The status detection results are obtained by the host performing status detection on the sectors of the hard drive.

[0106] In practice, the host performs status checks on each sector of the hard drive at preset time intervals, obtaining the status check results for each sector. Then, the storage system controller acquires the status check results for each sector.

[0107] Step 604: For the status detection results of each sector, determine the BST information of the sector corresponding to the status detection results.

[0108] In implementation, for each sector's status detection result, if the status detection result indicates that the sector's status is abnormal, the storage system controller determines the BST information to be 0. If the status detection result indicates that the sector's status is normal, the storage system controller determines the BST information to be 1.

[0109] Step 606: Store the BST information of the sector into the APP field of the protection information corresponding to the sector.

[0110] The BST information occupies 1 bit of storage space, and the remaining space in the APP field stores the LBA value.

[0111] In practice, the storage system controller stores the BST information of a sector into the APP field of the protection information corresponding to the sector.

[0112] In one exemplary embodiment, Figure 7 This is a schematic diagram of the structure of PI information in another embodiment. Figure 7 In the PI information, PI.GRD represents the GRD information within the PI information, with a size of 2 bytes, used to store the CRC16 checksum of the data block. PI.REF represents the REF information within the PI information, with a size of 4 bytes, used to store the host's LBA value. PI.APP represents the APP information within the PI information, with a size of 2 bytes, typically used to store the lower two bytes of the LBA. In a storage array, the RAID block size is typically 4MB (Mega Bytes), requiring only 13 bits of LBA value to represent the data offset within the RAID block. Therefore, after removing the 1 bit of space reserved for the BST in the APP field, the remaining space still contains sufficient LBA values ​​to represent the LBA offset.

[0113] In one exemplary embodiment, Figure 8 This is a schematic diagram illustrating the storage of BST information in the protection information corresponding to an 8KB management block, as shown in another embodiment. Figure 8In this system, the BST information corresponding to each management block (sector) is stored in the PI information, so that the BST information of the sector no longer occupies additional metadata space.

[0114] In one exemplary embodiment, during the inspection process, if the BST information changes, it indicates a change in the APP domain information where the BST information resides. The storage system controller recalculates the verification information corresponding to the APP domain information based on the changed APP domain information, obtaining new verification information. Then, the storage system controller updates the verification information corresponding to the APP domain information based on the new verification information.

[0115] In this embodiment, by inspecting the status of each sector, the BST information representing the status of each sector is stored in the APP field of the PI information. The 2-byte space of the APP field is used to store the marking information used to represent whether the flash memory sector is damaged. This makes full use of the space and avoids using extra space in the metadata to record this information, thus saving metadata and cache space and improving program performance.

[0116] In an exemplary embodiment, assuming the BST information is intact, it is necessary to determine the read result of the data read command based on the BST information and report it back to the host, such as... Figure 9 As shown, after step 402 is executed, the specific processing procedure of this data recovery method further includes steps 902 to 904. Wherein:

[0117] Step 902: If the BST information is not corrupted, determine whether the status of the sector corresponding to the BST information is normal based on the BST information.

[0118] In implementation, if the BST information is not corrupted, the storage system controller determines whether the BST information is 1. If the BST information is 1, the storage system controller determines that the sector corresponding to the BST information is in a normal state. If the BST information is not 1, the storage system controller determines that the sector corresponding to the BST information is in an abnormal state.

[0119] In an optional embodiment, if the sector corresponding to the BST information is in a normal state, the storage system controller reads the target data corresponding to the data read command from the hard disk according to the data read command. Then, the storage system controller verifies the target data according to the protection information of the target data. If the verification passes, the storage system controller determines the target data as the read result of the data read command and sends the read result to the host.

[0120] Step 904: If the sector corresponding to the BST information is in an abnormal state, construct the read result corresponding to the data read command based on the abnormal sector state information and the sector's marker, and send the read result to the host.

[0121] In implementation, if the sector corresponding to the BST information is in an abnormal state, the storage system controller constructs the read result corresponding to the data read command based on the abnormal sector state information, read failure, and sector marker. Then, the storage system controller sends the read result to the host.

[0122] In this embodiment, when the sector corresponding to the BST information is in an abnormal state, the read result is directly constructed and returned, avoiding data interaction with the hard disk, reducing the IO process, and improving data reading efficiency.

[0123] In one exemplary embodiment, when data is updated, the APP domain stripe needs to be updated, such as... Figure 10 As shown, before step 404 is executed, the specific processing procedure of this data recovery method further includes steps 1002 to 1008. Wherein:

[0124] Step 1002: Receive the data update command sent by the host, and update the data to be updated in the hard disk according to the data update command to obtain the updated data.

[0125] The data update command contains the updated data.

[0126] In implementation, when the host needs to update data, it sends a data update command to the storage system controller. The storage system controller receives the data update command from the host and sends a data update command to the hard disk. The hard disk receives and executes the data update command, updating the data on the hard disk with the updated data.

[0127] Step 1004: According to the preset protection information algorithm, the updated data is processed to obtain new protection information, and the protection information corresponding to the data to be updated is updated according to the new protection information.

[0128] In implementation, a protection information algorithm is pre-configured in the storage system controller. The storage system controller processes the updated data according to this algorithm to obtain new protection information. Then, the storage system controller updates the protection information corresponding to the data to be updated based on the new protection information.

[0129] Step 1006: Encode the new APP domain information and the preset redundant data to obtain encoded data, and calculate the check code corresponding to the encoded data to obtain the check information corresponding to the new APP domain information.

[0130] In implementation, the storage system controller is pre-configured with redundant data and a checksum algorithm. The storage system controller encodes the new APP domain information and the pre-configured redundant data to obtain encoded data. Then, based on the pre-configured checksum algorithm, the storage system controller calculates the checksum of the encoded data to obtain the checksum information corresponding to the new APP domain information.

[0131] Step 1008: Update the APP domain stripe according to the new APP domain information and the corresponding verification information.

[0132] In implementation, the storage system controller updates the APP stripe based on the new APP domain information and the corresponding verification information.

[0133] In this embodiment, when data is updated, the protection information corresponding to the data is updated in real time, and the APP domain stripe is also updated. This facilitates subsequent data verification based on the updated protection information and improves the accuracy of data reading.

[0134] In one exemplary embodiment, the verification is an erasure coding (EC) verification, such as... Figure 11 As shown, the specific processing procedure of step 406 also includes steps 1102 to 1106. Wherein:

[0135] Step 1102: Perform reverse encoding on the verification information to obtain the decoded verification information.

[0136] In implementation, the storage system controller processes the verification information according to the preset verification code encoding algorithm to obtain encoded data, and then performs reverse encoding processing on the encoded data to obtain the decoded verification information.

[0137] Step 1104: Verify the APP domain information based on the decoded verification information to obtain the verification result.

[0138] In practice, the storage system controller performs a co-location check on the decoded verification information and the APP domain information to obtain the verification result.

[0139] Step 1106: If the verification result is incorrect, the error bits in the verification result are corrected to obtain the restored APP domain information.

[0140] In practice, if the verification result is incorrect, the storage system controller performs error correction on the erroneous bits in the verification result to obtain the restored APP domain information.

[0141] In this embodiment, the recovered BST information is obtained by performing EC verification on the APP domain information, which facilitates the determination of the reading result based on the recovered BST information and improves the efficiency of data reading.

[0142] In one exemplary embodiment, after obtaining the recovered BST information, data is read from the hard disk based on the recovered BST information. For example... Figure 12 As shown, after step 406 is executed, the specific processing procedure of this data recovery method further includes steps 1202 to 1206. Wherein:

[0143] Step 1202: Determine the recovered BST information from the recovered APP domain information, and determine whether the status of the sector corresponding to the recovered BST information is normal based on the recovered BST information.

[0144] In implementation, the storage system controller determines the recovered BST information from the recovered APP domain information. Then, the storage system controller checks if the recovered BST information is 1. If the recovered BST information is 1, the storage system controller determines that the sector corresponding to the recovered BST information is in a normal state. If the recovered BST information is not 1, the storage system controller determines that the sector corresponding to the recovered BST information is in an abnormal state.

[0145] In an optional embodiment, if the state of the sector corresponding to the recovered BST information is abnormal, the storage system controller executes step 904 as described above. The specific processing procedure of step 904 has been described in detail in the above embodiments, and will not be repeated here.

[0146] Step 1204: If the sector corresponding to the recovered BST information is in normal condition, retrieve the target data corresponding to the data read command from the hard disk, and verify the target data according to the protection information to obtain the target verification result.

[0147] During implementation, if the sector corresponding to the recovered BST information is in a normal state, the storage system controller sends a data read command to the hard disk. The hard disk receives and executes the data read command, obtains the target data, and sends the target data to the storage system controller. The storage system controller receives the target data and verifies it according to the protection information to obtain the target verification result.

[0148] Step 1206: If the target verification result is normal, the target data is identified as the read result corresponding to the data read command, and the read result is sent to the host.

[0149] In practice, if the target verification result is normal, the storage controller will identify the target data as the read result corresponding to the data read command and send the read result to the host.

[0150] In one exemplary embodiment, for a data write operation, the data to be written is sent from the host to the storage array (storage system controller). The storage array receives the data to be written and, upon receiving the data, inserts 8 bytes of PI information for every 512 bytes of data to be written. Then, the storage system controller performs internal processing and sends the data to be written to the hard disk. After the data to be written arrives at the hard disk, the hard disk itself performs PI verification on the data to ensure that any skip lists or rewrites that occur during the time from when the data is received from the front end (inserting PI) to when it is sent to the hard disk can be detected.

[0151] When the host reads data, to prevent data jumps on the hard drive, the hard drive will verify the data after reading it, such as... Figure 13 As shown. Figure 13 This is a schematic diagram illustrating the data reading process in one embodiment. Figure 13 In this system, the hard drive verifies the data before returning the target data corresponding to the data read command. If the verification fails, the upper-level controller software is notified to recover the data before the jump using RAID redundancy. To prevent problems in the data path between the hard drive and the storage array front end, the storage system controller verifies the target data again before returning it. If the verification fails, a degraded read is performed, calculating the data on the faulty disk using other member disks in the RAID array to recover the faulty data, thus ensuring end-to-end data reliability from the array front end to the back end.

[0152] Within a storage array (storage system controller), when bad blocks are encountered, degraded reads are needed to recover the corresponding damaged data blocks. Degraded reads recover data using internal RAID, but the corresponding PI information cannot be recovered and needs to be reacquired. Specifically, Figure 14 This is a schematic diagram of the PI information repair action in one embodiment. For example... Figure 14 As shown, for the PI's Guard field, the CRC16 of the sector data is recalculated and filled in. For the PI's REF field, LBA information can be obtained by reading metadata. For the APP field information, the storage system controller needs to perform EC verification on the APP field information based on the check information in the APP field stripe to obtain the recovered APP field information.

[0153] In this embodiment, the target data corresponding to the data reading command is determined based on the recovered BST information, and the data reading is completed, thereby improving the success rate of data reading.

[0154] It should be understood that although the steps in the flowcharts of the embodiments described above 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 embodiments described above 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 of other steps.

[0155] Based on the same inventive concept, this application also provides a data recovery apparatus for implementing the data recovery 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 data recovery apparatus embodiments provided below can be found in the limitations of the data recovery method described above, and will not be repeated here.

[0156] In one exemplary embodiment, such as Figure 15 As shown, a data recovery device 1500 is provided, including: a receiving module 1501, a determining module 1502, and a verification module 1503, wherein:

[0157] The receiving module 1501 is used to receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP field information in the protection information includes the bad sector marker (BST) information corresponding to the sector where the target data is located.

[0158] The determination module 1502 is used to determine the verification information corresponding to the APP domain information in the APP domain stripe when the BST information is corrupted.

[0159] The verification module 1503 is used to verify the APP domain information based on the verification information to obtain the restored APP domain information; the restored APP domain information contains the restored BST information.

[0160] In one exemplary embodiment, the data recovery apparatus 1500 further includes:

[0161] The acquisition module is used to obtain the status detection results of each sector; the status detection results are obtained by the host performing status detection on the sectors in the hard drive.

[0162] The second determination module is used to determine the BST information of the sector corresponding to the status detection result for each sector.

[0163] The first storage module is used to store the BST information of the sector into the APP field of the protection information corresponding to the sector.

[0164] In one exemplary embodiment, the data recovery apparatus 1500 further includes:

[0165] The first judgment module is used to determine whether the status of the sector corresponding to the BST information is normal based on the BST information, provided that the BST information is not damaged.

[0166] The first construction module is used to construct the read result corresponding to the data read command based on the abnormal status information of the sector corresponding to the BST information and the sector's mark if the sector status is abnormal, and then send the read result to the host.

[0167] In one exemplary embodiment, the data recovery apparatus 1500 further includes:

[0168] The first update module is used to receive data update commands sent by the host, update the data to be updated in the hard disk according to the data update commands, and obtain the updated data.

[0169] The second update module is used to process the updated data according to a preset protection information algorithm to obtain new protection information, and update the protection information corresponding to the data to be updated according to the new protection information; the new protection information includes new APP domain information.

[0170] The first encoding module is used to encode the new APP domain information and the preset redundant data to obtain encoded data, and calculate the check code corresponding to the encoded data to obtain the check information corresponding to the new APP domain information.

[0171] The third update module is used to update the APP domain stripe based on the new APP domain information and the corresponding verification information.

[0172] In an exemplary embodiment, the verification is an erasure coding (EC) verification, and the verification module 1406 includes:

[0173] The first processing submodule is used to perform reverse encoding on the verification information to obtain the decoded verification information.

[0174] The first verification submodule is used to verify the APP domain information based on the decoded verification information and obtain the verification result.

[0175] The second processing submodule is used to correct the error bits in the verification result when the verification result is incorrect, so as to obtain the restored APP domain information.

[0176] In one exemplary embodiment, the data recovery apparatus 1500 further includes:

[0177] The second judgment module is used to determine the recovered BST information in the recovered APP domain information, and to determine whether the status of the sector corresponding to the recovered BST information is normal based on the recovered BST information.

[0178] The second verification module is used to retrieve the target data corresponding to the data read command from the hard disk if the status of the sector corresponding to the recovered BST information is normal, and to verify the target data according to the protection information to obtain the target verification result.

[0179] The first sending module is used to determine the target data as the read result corresponding to the data read command when the target verification result is normal, and to send the read result to the host.

[0180] Each module in the aforementioned data recovery 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 operations corresponding to each module.

[0181] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 16 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 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, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data recovery 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.

[0182] Those skilled in the art will understand that Figure 16 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.

[0183] In one embodiment, a computer device is also 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 method embodiments.

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

[0185] 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.

[0186] Those skilled in the art will understand that all or part of the processes in 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. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile 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, etc., and are not limited to these.

[0187] 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 specification.

[0188] 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 data recovery method characterized by, The method is applied to a storage system controller; The storage system controller includes a logical block application tag (APP) domain stripe, and the method includes: Receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located; In the event of BST information corruption, the verification information corresponding to the APP domain information is determined in the APP domain stripe; the APP domain stripe is an erasure code EC stripe composed of each data block and each verification block, and the verification block stores the verification information of the APP domain information in the protection information, which can recover the corrupted APP domain information by calculating the remaining valid APP domain information and the verification information when no more than two copies of APP domain information are corrupted; The APP domain information is verified based on the verification information to obtain the restored APP domain information; the verification is erasure coding (EC) verification, and the restored APP domain information contains the restored BST information.

2. The method of claim 1, wherein, Before receiving the data read command and determining the protection information of the target data corresponding to the data read command, the method further includes: Obtain the status detection results of each sector; the status detection results are obtained by the host performing status detection on the sectors in the hard disk, and are used as a judgment conclusion to characterize whether the status of the corresponding sector is normal or abnormal. For each sector's status detection result, determine the BST information of the sector corresponding to the status detection result; the BST information is sector status marker information, with a value of 1 or 0; The BST information of the sector is stored in the APP field of the protection information corresponding to the sector.

3. The method according to claim 1, characterized in that, After receiving the data read command and determining the protection information of the target data corresponding to the data read command, the method further includes: If the BST information is not corrupted, determine whether the status of the sector corresponding to the BST information is normal based on the BST information; If the sector corresponding to the BST information is in an abnormal state, then based on the abnormal state information of the sector and the sector's marker, the read result corresponding to the data read command is constructed, and the read result is sent to the host.

4. The method according to claim 1, characterized in that, In the event that the BST information is corrupted, before determining the verification information corresponding to the APP domain information in the APP domain stripe, the method further includes: Receive a data update command sent by the host, and update the data to be updated in the hard disk according to the data update command to obtain the updated data; According to a preset protection information algorithm, the updated data is processed to obtain new protection information, and the protection information corresponding to the data to be updated is updated according to the new protection information; the new protection information includes new APP domain information. The new APP domain information and preset redundant data are encoded to obtain encoded data, and the check code corresponding to the encoded data is calculated to obtain the check information corresponding to the new APP domain information. The APP domain stripe is updated based on the new APP domain information and the corresponding verification information.

5. The method of claim 1, wherein, The step of verifying the APP domain information based on the verification information to obtain the recovered APP domain information includes: The verification information is reverse encoded to obtain the decoded verification information; The APP domain information is verified based on the decoded verification information to obtain the verification result; If the verification result is incorrect, the error bits in the verification result are corrected to obtain the restored APP domain information.

6. The method of claim 1, wherein, After verifying the APP domain information based on the verification information to obtain the recovered APP domain information, the method further includes: The recovered BST information is determined from the recovered APP domain information, and the status of the sector corresponding to the recovered BST information is determined based on the recovered BST information. If the sector corresponding to the restored BST information is in normal condition, the target data corresponding to the data read command is obtained from the hard disk, and the target data is verified according to the protection information to obtain the target verification result. If the target verification result is normal, the target data is identified as the read result corresponding to the data read command, and the read result is sent to the host.

7. A data recovery apparatus, characterized by comprising: The device includes: The receiving module is used to receive a data read command and determine the protection information of the target data corresponding to the data read command; the APP domain information in the protection information includes bad sector marker (BST) information corresponding to the sector where the target data is located; The determination module is used to determine the verification information corresponding to the APP domain information in the APP domain stripe when the BST information is damaged; the APP domain stripe is an erasure code EC stripe composed of each data block and each verification block, and the verification block stores the verification information of the APP domain information in the protection information, which can recover the damaged APP domain information by calculating the remaining valid APP domain information and the verification information when no more than two copies of APP domain information are damaged. The verification module is used to verify the APP domain information according to the verification information to obtain the restored APP domain information; the verification is erasure coding (EC) verification, and the restored APP domain information contains the restored BST information.

8. A computer device comprising a memory and a processor, the memory storing 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 6.

9. A computer readable storage medium having stored thereon 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 6.

10. 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 6.

Citation Information

Patent Citations

  • Reading-writing method of data in redundant arrays of inexpensive disks (RAID) and equipment thereof

    CN101527142A

  • Method of, and apparatus for, improved data integrity

    US20130198585A1