Data recovery method and device, computer equipment and storage medium
By using the verification information in the APP domain strip in the storage system controller to verify the APP domain information, the damaged BST information is directly restored, which solves the problem of long data recovery process in the prior art and improves the data recovery efficiency.
Patent Information
- Application Number
- CN202311755062.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
When existing data recovery methods deal with the corruption of bad sector marking (BST) information, they need to interact with the hard disk and calculate large replica data blocks, resulting in a long data recovery process and low efficiency.
By using the verification information in the APP domain strip in the storage system controller, the APP domain information is checked, and the damaged BST information is directly restored, reducing the data recovery process.
This method reduces the data recovery process of BST information, improves data recovery efficiency, avoids multiple interactions with the hard disk, and improves the efficiency of data reading.
Smart Images

Figure CN120179455A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data storage, and in particular, to a data recovery method, apparatus, computer device, storage medium, and computer program product. Background Art
[0002] When a storage system controller reads target data from a hard disk, it needs to first read the BST (Bad Sector Tag) information corresponding to the sector where the target data is located from the hard disk to determine the status of the sector. When the BST information is damaged, a data recovery method is required to recover the BST information.
[0003] In the current data recovery method, the storage system controller needs to determine the copy data block corresponding to the sector in the hard disk, perform data calculation on the copy data block to obtain the recovered sector, and then determine the recovered BST information based on the recovered sector.
[0004] However, in the current data recovery method, the storage system controller needs to interact with the hard disk and perform data calculation on the copy data block with a large amount of data, resulting in a long data recovery process and low data recovery efficiency. Summary of the Invention
[0005] Based on this, it is necessary to provide a data recovery method, apparatus, computer device, computer-readable storage medium, and computer program product for the above technical problems.
[0006] In a first aspect, the present application provides a data recovery method, which is applied to a storage system controller; the storage system controller includes a logical block application program tag APP domain stripe, and the method includes:
[0007] Receiving a data reading command and determining the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes the bad sector tag BST information corresponding to the sector where the target data is located;
[0008] In the case where the BST information is damaged, determining the check information corresponding to the APP domain information in the APP domain stripe;
[0009] Checking the APP domain information according to the check information to obtain the recovered APP domain information; the recovered APP domain information includes the recovered 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 according to the APP domain verification information in the APP domain strip to obtain the recovered BST information, reducing the data recovery process of the BST information and improving the 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] Obtaining 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 the status detection result of each sector, determining the BST information of the sector corresponding to the status detection result;
[0014] Storing the BST information of the sector into the APP domain in 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 domain of the PI information, reasonably using the 2-byte space of the APP domain to store the marker information indicating whether the flash sector is damaged, making full use of the space, avoiding using additional space in the metadata to record this information, saving the metadata and cache space, and improving the program running 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] When the BST information is not damaged, judging whether the status of the sector corresponding to the BST information is normal according to the BST information;
[0018] If the status of the sector corresponding to the BST information is abnormal, constructing the read result corresponding to the data read command according to the information of the abnormal status of the sector and the marker of the sector, and sending the read result to the host.
[0019] In this embodiment, when the status of the sector corresponding to the BST information is abnormal, directly constructing and returning the read result, avoiding data interaction with the hard disk, reducing the IO process, and improving the data read efficiency.
[0020] In one embodiment, before determining the verification information corresponding to the APP domain information in the APP domain strip when the BST information is damaged, 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] Perform data processing on 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;
[0023] Encode the new APP domain information and 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;
[0024] Update the APP domain stripe according to the new APP domain information and the check information corresponding to the new APP domain information.
[0025] In this embodiment, in the case of data update, the protection information corresponding to the data is updated in real time, and the APP domain stripe is updated, which is convenient for subsequent data verification according to the updated protection information and improves the accuracy of data reading.
[0026] In one embodiment, the check is erasure code EC check, and the step of checking the APP domain information according to the check information to obtain the restored APP domain information includes:
[0027] Perform reverse encoding processing on the check information to obtain the decoded check information;
[0028] Check the APP domain information based on the decoded check information to obtain a check result;
[0029] In the case where the check result is incorrect, perform error correction processing on the error bits in the check result to obtain the restored APP domain information.
[0030] In this embodiment, by performing EC check on the APP domain information, the restored BST information is obtained, which is convenient for determining the reading result according to the restored BST information and improves the efficiency of data reading.
[0031] In one embodiment, after the step of checking the APP domain information according to the check information to obtain the restored APP domain information, the method further includes:
[0032] Determine the restored BST information in the restored APP domain information, and judge whether the status of the sector corresponding to the restored BST information is normal according to the restored BST information;
[0033] If the status of the sector corresponding to the restored BST information is normal, obtain 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 a target verification result;
[0034] When the target verification result is normal, determine the target data as the read result corresponding to the data read command, and send the read result to the host.
[0035] In this embodiment, based on the restored BST information, the target data corresponding to the data read command is determined, and the data reading is completed, improving the success rate of data reading.
[0036] In a second aspect, the present application further provides a data recovery device, including:
[0037] A receiving module, configured 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 the bad sector mark BST information corresponding to the sector where the target data is located;
[0038] A determining module, configured to determine the check information corresponding to the APP domain information in the APP domain strip when the BST information is damaged;
[0039] A verification module, configured to verify the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[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 the bad sector mark BST information corresponding to the sector where the target data is located;
[0042] When the BST information is damaged, determine the check information corresponding to the APP domain information in the APP domain strip;
[0043] Verify the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0045] Receive a data reading command and determine the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes bad sector tag BST information corresponding to the sector where the target data is located.
[0046] In the case where the BST information is damaged, determine the check information corresponding to the APP domain information in the APP domain strip.
[0047] Check the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.
[0048] In a fifth aspect, the present application further provides a computer program product, including a computer program, which when executed by a processor implements the following steps:
[0049] Receive a data reading command and determine the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes bad sector tag BST information corresponding to the sector where the target data is located.
[0050] In the case where the BST information is damaged, determine the check information corresponding to the APP domain information in the APP domain strip.
[0051] Check the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.
[0052] The above data recovery method, device, computer device, storage medium and computer program product receive a data reading command and determine the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes bad sector tag BST information corresponding to the sector where the target data is located; in the case where the BST information is damaged, determine the check information corresponding to the APP domain information in the APP domain strip; check the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information. By using this method, in the case where the BST information in the APP domain information is damaged, directly check the APP domain information according to the APP domain check information in the APP domain strip to obtain the restored BST information, reducing the data recovery process of the BST information and improving the data recovery efficiency. Description of the Drawings
[0053] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the accompanying drawings required for the description of the embodiments or related technologies. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0054] Figure 1 It is an application environment diagram of the data recovery method in an embodiment;
[0055] Figure 2 It is a schematic structural diagram of a kind of PI information in an embodiment;
[0056] Figure 3 It is a schematic diagram of adding a 16-bit storage space in the metadata corresponding to the 8KB management block to store BST information in an embodiment;
[0057] Figure 4 It is a schematic flowchart of the data recovery method in an embodiment;
[0058] Figure 5 It is a schematic structural diagram of a kind of APP domain stripe in an embodiment;
[0059] Figure 6 It is a schematic flowchart of the step of storing BST information in an embodiment;
[0060] Figure 7 It is a schematic structural diagram of a kind of PI information in another embodiment;
[0061] Figure 8 It is a schematic diagram of storing BST information in the protection information corresponding to the 8KB management block in another embodiment;
[0062] Figure 9 It is a schematic flowchart of the step of determining the read result according to the BST information in an embodiment;
[0063] Figure 10 It is a schematic flowchart of the step of updating the APP domain stripe in an embodiment;
[0064] Figure 11 It is a schematic flowchart of the step of performing EC encoding on the APP domain information in an embodiment;
[0065] Figure 12 It is a schematic flowchart of the step of determining the read result according to the restored BST information in an embodiment;
[0066] Figure 13 It is a schematic flowchart of the step of reading data in an embodiment;
[0067] Figure 14 Schematic diagram of PI information repair operation in an embodiment
[0068] Figure 15 Block diagram of the structure of a data recovery device in an embodiment
[0069] Figure 16 Internal structure diagram of a computer device in an embodiment Specific implementation manners
[0070] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] The data recovery method provided by the embodiments of the present application can be applied to a data recovery system 100 as shown in Figure 1 The data recovery system 100 includes a host 110, a storage system controller 120, and each solid-state drive (hereinafter referred to as a hard disk) 130. The host 110 and the storage system controller 120 are communicatively connected, and the storage system controller 120 and each hard disk 130 are communicatively connected. The host 110 performs data interaction with each hard disk 130 through the storage system controller.
[0072] Before elaborating on the specific processing procedure of the data recovery method, some abbreviations and proprietary terms in the present application are explained herein. Specifically:
[0073] 1. DIF, the full name is Data Integrity Field. It is a format and method defined by ANSI (American National Standards Institute) T10 to ensure data consistency. The DIF format in the present application is all in the format of 512 + 8.
[0074] 2. CRC16, CRC stands for Cyclic Redundancy Check. It is one of the most commonly used error-checking codes in the field of data communication and belongs to a type of hash. CRC16 refers to a 16-bit CRC value.
[0075] 3. PI, the full name is Protection Information. It is information used to protect data consistency in storage, and means such as DIF and CRC are used in its design.
[0076] 4. GRD is the name of the first two-byte space in PI, Logical Block Guard, abbreviated as the GRD field.
[0077] 5. APP is the name of the middle two-byte space in PI, Logical Block Application Tag, abbreviated as the APP domain.
[0078] 6. REF is the name of the last four-byte space in PI, Logical Block Reference Tag, abbreviated as the REF domain.
[0079] 7. LBA, full name Logical Block Addressing, is a method used to access and address data in computer storage devices (such as hard disk drives).
[0080] 8. BST, full name Bad Sector, represents the mark of a damaged sector, that is, the bad sector mark.
[0081] 9. NVMe, full name "Non-Volatile Memory Express", means Non-Volatile Memory Fast Lane. NVMe is a protocol and interface standard for connecting computer systems to non-volatile storage devices (such as solid-state drives SSD).
[0082] 10. NAND, full name "NAND Flash Memory", means "NAND flash memory". NAND is a non-volatile storage technology commonly used in the manufacture of various digital storage devices.
[0083] 11. RAID, full name "Redundant Array of Independent Disks", means "Redundant Array of Independent Disks" or "Redundant Combination of Independent Disks". RAID is a data storage technology designed to improve data availability, reliability, and performance. It combines multiple hard disk drives to create a logical drive, thereby achieving data redundancy and / or striping to meet different storage requirements.
[0084] 12. EC, EC (Erasure Code) erasure code is an advanced error correction coding technology used to protect data from multiple storage node or drive failures. 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 code 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 usually refers to the abbreviation of "Kilobyte". KB is a unit of data storage and transmission capacity, equal to 1024 bytes. One byte is equal to 8 bits, and 1KB is equal to 1024 bytes, that is, 8192 bits.
[0086] To make the purpose, technical solution and advantages of this application clearer and more understandable, the technical background of this application is elaborated in more detail here. Specifically: A storage array is a high-performance and low-latency storage solution, composed of a large number of storage units, and each storage unit can store 1-bit binary data (0, 1). Usually, the storage units are arranged in the form of an N (N is a non-zero natural number) row × M (M is a non-zero natural number) column matrix. Combining multiple hard disks into an array and using it as a single hard disk, they have higher performance, reliability and efficiency compared with traditional hard disks.
[0087] In the storage array, data integrity inside the storage system is ensured by supporting ANSI T10. The T10 standard protects data integrity by adding protection information (PI, Protection Information), also known as the Data Integrity Field (DIF), to each data block. 8 bytes of protection information are added to each logical sector (512 bytes) to ensure data consistency. The 8 bytes include: 2 bytes of Logical Block Guard, abbreviated as the GRD field; 2 bytes of Logical Block Application Tag, abbreviated as the APP field; 4 bytes of Logical Block Reference Tag, abbreviated as the REF field. Figure 2 It is a schematic diagram of the structure of PI information in an embodiment. In Figure 2 LSB (Least Significant Bit) is the least significant bit, and MSB (Most Significant Bit) is the most significant bit. Here, it means that the PI data is stored in big-endian.
[0088] Inside the storage array, the smallest unit of storage space is a sector, that is, 512 bytes, and it is usually managed in sizes such as 8KB, 16KB, 32KB, etc., which is called a management block here. Due to the nature of the medium, flash memory cells have a lifespan, and with increased use, some bad blocks will appear. If a cell in a sector is damaged, then the sector cannot be used normally, and the BST information needs to be recorded in the metadata of the management block. Figure 3 It is a schematic diagram of adding 16-bit storage space to store BST information in the metadata corresponding to the 8KB management block in an embodiment. As Figure 3As shown, the 8KB management block has a total of 16 sectors, and the BST information of each sector is stored with 1 bit, so a total of 16-bit metadata storage space needs to be added. The metadata is frequently read, and increasing the size of the metadata will affect the system's bandwidth overhead and the size of the cache space.
[0089] Moreover, during data reading, when the BST information corresponding to the sector where the target data is located is damaged, the storage system controller needs to determine the copy data block corresponding to the sector in the hard disk, perform data calculation on the copy data block to obtain the restored sector, and then determine the restored BST information based on the restored sector. The data recovery process is long, resulting in low efficiency of recovering data.
[0090] Based on the above traditional technology, the embodiments of the present application provide a data recovery method. When the BST information in the APP domain information is damaged, directly perform EC check on the APP domain information according to the APP domain check information in the APP domain stripe to obtain the restored BST information, reducing the data recovery process and improving the data recovery efficiency.
[0091] In an exemplary embodiment, as Figure 4 shown, a data recovery method is provided. Taking the method applied to the storage system controller 120 (hereinafter abbreviated as the storage system controller for short by omitting the label) in Figure 1 as an example for illustration, the storage system controller contains a logical block application program label APP domain stripe, including the following steps 402 to step 406. Among them:
[0092] Step 402, receive a data reading command and determine the protection information of the target data corresponding to the data reading command.
[0093] Among them, the APP domain information in the protection information contains the bad sector mark BST information corresponding to the sector where the target data is located.
[0094] In implementation, the protection information corresponding to each data in the hard disk is preset in the storage controller. When the host needs to read data, the host sends a data reading command to the storage system controller. Then, the storage system controller receives the data reading command and determines the protection information (PI information) corresponding to the target data according to the target data identifier in the data reading command. The storage system controller determines whether the BST information in the protection information is damaged. When the BST information is damaged, the storage system controller executes step 404. When the BST information is not damaged, the storage system controller executes step 902.
[0095] Step 404, when the BST information is damaged, determine the check information corresponding to the APP domain information in the APP domain stripe.
[0096] Among them, the APP domain stripe is constructed based on each APP domain information and the verification information of the APP domain information in the PI information.
[0097] In implementation, when the BST information is damaged, the storage system controller traverses the APP domain stripe to determine the verification information corresponding to the APP domain information.
[0098] In an optional embodiment, as Figure 5 shown, Figure 5 is a schematic structural diagram of an APP domain stripe (also referred to as an APP domain EC stripe). Among them, in Figure 5 , taking the EC stripe composed of 4 data blocks and 2 parity blocks as an example, the DATA#0, DATA#1, DATA#2, DATA#3 represented by the squares are data blocks with a size of 4MB, DATA#P and DATA#Q are the corresponding parity blocks, and the internal data (data in the hard disk) is managed in units of 8KB. For the APP domain group EC stripe in the PI information corresponding to the management block, the verification information of PI.APP (representing the APP domain information in the PI information) is stored in the parity block. When no more than 2 PI.APPs are damaged, the damaged PI.APP can be calculated and recovered through the verification information APP.P, APP.Q of the APP and the remaining valid PI.APPs.
[0099] Step 406: Verify the APP domain information according to the verification information to obtain the recovered APP domain information.
[0100] Among them, the recovered APP domain information contains the recovered BST information.
[0101] In implementation, the storage system controller performs EC verification on the APP domain information according to the verification information to obtain the verified APP domain information. Then, the storage system controller determines the verified APP domain information as the recovered APP domain information and determines the recovered BST information in the recovered APP domain information. The storage system controller continues to execute the data read command according to 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 according to the APP domain verification information in the APP domain stripe to obtain the recovered BST information, reducing the data recovery process of the BST information and improving the data recovery efficiency.
[0103] In an exemplary embodiment, before recovering the BST information, the BST information needs to be written into the PI information first. As Figure 6 shown, before step 402 is executed, the specific processing process of this data recovery method further includes steps 602 to 606. Among them:
[0104] Step 602, obtain the status detection results of each sector.
[0105] Among them, the status detection results are obtained by the host performing status detection on the sectors in the hard disk.
[0106] In implementation, the host performs status detection on each sector in the hard disk according to a preset time period to obtain the status detection results of each sector. Then, the storage system controller obtains the status detection results of each sector.
[0107] Step 604, for the status detection result of each sector, determine the BST information of the sector corresponding to the status detection result.
[0108] In implementation, for the status detection result of each sector, if the status detection result indicates that the status of the sector is abnormal, the storage system controller determines that the BST information is 0. If the status detection result indicates that the status of the sector is normal, the storage system controller determines that the BST information is 1.
[0109] Step 606, store the BST information of the sector into the APP domain in the protection information corresponding to the sector.
[0110] Among them, the BST information occupies 1 bit of its storage space, and the remaining space in the APP domain stores the LBA value.
[0111] In implementation, the storage system controller stores the BST information of the sector into the APP domain in the protection information corresponding to the sector.
[0112] In an exemplary embodiment, Figure 7 is a schematic structural diagram of a kind of PI information in another embodiment. In Figure 7 , PI.GRD represents the GRD information in the PI information, with a size of 2 Byte, which is used to store the CRC16 check value of the data block. PI.REF represents the REF information in the PI information, with a size of 4 Byte, which is used to store the LBA value of the host. PI.APP represents the APP information in the PI information, with a size of 2 Byte, which is generally used to store the lower two bytes of the LBA. In the storage array, the RAID block size is generally 4MB (Mega Bytes), and only 13-bit LBA value is required to represent the offset of the data in the RAID block. Therefore, after removing the 1 bit of space reserved for BST in the APP domain, the remaining space for storing the LBA value is still sufficient to represent the offset situation of the LBA.
[0113] In an exemplary embodiment, Figure 8 is a schematic diagram of storing BST information in the protection information corresponding to an 8KB management block in another embodiment. In Figure 8In this case, 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 an exemplary embodiment, during the inspection process, if the BST information changes, it means that the APP domain information where the BST information is located changes. The storage system controller will recalculate the check information corresponding to the APP domain information according to the changed APP domain information to obtain new check information. Then, the storage system controller updates the check information corresponding to the APP domain information according to the new check 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 domain of the PI information, reasonably using the 2-byte space of the APP domain to store the marker information indicating whether the flash sector is damaged, making full use of the space, avoiding using additional space in the metadata to record this information, saving metadata and cache space, and improving the program running performance.
[0116] In an exemplary embodiment, when the BST information is not damaged, it is necessary to determine the read result of the data read command according to the BST information and feedback it to the host. As Figure 9 shown, after step 402 is executed, the specific processing process of this data recovery method further includes steps 902 to 904. Among them:
[0117] Step 902, when the BST information is not damaged, according to the BST information, determine whether the status of the sector corresponding to the BST information is normal.
[0118] In practice, when the BST information is not damaged, the storage system controller determines whether the BST information is 1. When the BST information is 1, the storage system control determines that the status of the sector corresponding to the BST information is normal. When the BST information is not 1, the storage system control determines that the status of the sector corresponding to the BST information is abnormal.
[0119] In an alternative embodiment, if the status of the sector corresponding to the BST information is normal, 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. When 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 status of the sector corresponding to the BST information is abnormal, then construct the read result corresponding to the data read command according to the information that the status of the sector is abnormal and the marker of the sector, and send the read result to the host.
[0121] In implementation, if the status of the sector corresponding to the BST information is abnormal, the storage system controller constructs a read result corresponding to the data read command based on the information of the abnormal status of the sector, the read failure, and the label of the sector. Then, the storage system controller sends the read result to the host.
[0122] In this embodiment, when the status of the sector corresponding to the BST information is abnormal, the read result is directly constructed and returned, avoiding data interaction with the hard disk, reducing the IO process, and improving the data read efficiency.
[0123] In an exemplary embodiment, in the case of data update, it is necessary to update the APP domain stripe. As Figure 10 shown, before step 404 is executed, the specific processing procedure of this data recovery method further includes steps 1002 to 1008. Among them:
[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] Among them, the data update command contains the updated data.
[0126] In implementation, when the host needs to update data, the host issues a data update command to the storage system controller. The storage system controller receives the data update command sent by the host and issues a data update command to the hard disk. The hard disk receives and executes the data update command, and updates the data to be updated in the hard disk to the updated data.
[0127] Step 1004, perform data processing on 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.
[0128] In implementation, a protection information algorithm is preset in the storage system controller. The storage system controller performs data processing on the updated data according to the preset protection information algorithm to obtain new protection information. Then, the storage system controller updates the protection information corresponding to the data to be updated according to 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, redundancy data and a checksum algorithm are preset in the storage system controller. The storage system controller encodes the new APP domain information and the preset redundancy data to obtain encoded data. Then, the storage system controller calculates the checksum of the encoded data according to the preset checksum algorithm to obtain the check 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 check information corresponding to the new APP domain information.
[0132] In implementation, the storage system controller updates the APP stripe based on the new APP domain information and the check information corresponding to the new APP domain information.
[0133] In this embodiment, in the case of data update, the protection information corresponding to the data is updated in real time, and the APP domain stripe is updated, which facilitates subsequent data verification according to the updated protection information and improves the accuracy of data reading.
[0134] In an exemplary embodiment, the check is an erasure code EC check. As Figure 11 shown, the specific processing procedure of step 406 further includes steps 1102 to 1106. Among them:
[0135] Step 1102: Perform reverse encoding processing on the check information to obtain the decoded check information.
[0136] In implementation, the storage system controller processes the check information according to the preset checksum encoding algorithm to obtain encoded data, and performs reverse encoding processing on the encoded data to obtain the decoded check information.
[0137] Step 1104: Verify the APP domain information based on the decoded check information to obtain a verification result.
[0138] In implementation, the storage system controller performs parity check on the decoded check information and the APP domain information to obtain a verification result.
[0139] Step 1106: In the case where the verification result is incorrect, perform error correction processing on the error bits in the verification result to obtain the restored APP domain information.
[0140] In implementation, in the case where the verification result is incorrect, the storage system controller performs error correction processing on the error bits in the verification result to obtain the restored APP domain information.
[0141] In this embodiment, by performing EC check on the APP domain information, the restored BST information is obtained, which facilitates determining the reading result according to the restored BST information and improves the efficiency of data reading.
[0142] In an exemplary embodiment, after obtaining the restored BST information, data in the hard disk is read according to the restored BST information. As Figure 12 shown, after step 406 is executed, the specific processing procedure of this data recovery method further includes steps 1202 to 1206. Among them:
[0143] Step 1202, determine the restored BST information in the restored APP domain information, and according to the restored BST information, judge whether the status of the sector corresponding to the restored BST information is normal.
[0144] In implementation, the storage system controller determines the restored BST information in the restored APP domain information. Then, the storage system controller judges whether the restored BST information is 1. When the restored BST information is 1, the storage system control determines that the status of the sector corresponding to the restored BST information is normal. When the restored BST information is not 1, the storage system control determines that the status of the sector corresponding to the restored BST information is abnormal.
[0145] In an alternative embodiment, if the status of the sector corresponding to the restored BST information is abnormal, the storage system controller executes the above step 904. Among them, the specific processing procedure of step 904 has been elaborated in detail in the above embodiment, and the embodiments of the present application will not repeat it here.
[0146] Step 1204, if the status of the sector corresponding to the restored BST information is normal, obtain the target data corresponding to the data read command from the hard disk, and perform verification on the target data according to the protection information to obtain a target verification result.
[0147] In implementation, if the status of the sector corresponding to the restored BST information is normal, the storage system controller sends the data read command to the hard disk. The hard disk receives and executes the data read command to obtain the target data, and sends the target data to the storage system controller. The storage system controller receives the target data and performs verification on the target data according to the protection information to obtain a target verification result.
[0148] Step 1206, when the target verification result is normal, determine the target data as the read result corresponding to the data read command, and send the read result to the host.
[0149] In implementation, when the target verification result is normal, the storage controller in Xiyong determines the target data as the read result corresponding to the data read command, and sends the read result to the host.
[0150] In an exemplary embodiment, for the operation of writing data, when the data to be written arrives from the host at the storage array (storage system controller). The storage array receives the data to be written, and after receiving the data to be written, inserts 8-byte PI information into every 512 bytes of the data to be written. Then, the storage system controller performs internal processing and distributes 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 data can be verified when there is a skip list or rewriting during the period from receiving (inserting PI) at the front end to being written to the disk.
[0151] When the host reads data, to prevent data from jumping on the hard disk, the hard disk performs verification on the data after reading the data, as Figure 13 shown. Figure 13 It is a schematic diagram of the data reading process in an embodiment. In Figure 13 , before the hard disk returns the target data corresponding to the data read command, it performs verification on the data. Once the verification fails, it will notify the upper-layer controller software to recover the data before the jump through RAID redundancy. To prevent problems in the path between the hard disk and the front end of the storage array from returning, and, before the storage system controller returns the target data, it will verify the target data again. Once the verification fails, it will perform a degraded read, calculate the data on the faulty disk through other member disks of the RAID, and recover the faulty data, thus ensuring the data reliability from the front end to the back end of the array end-to-end.
[0152] In the storage array (storage system controller) internally for the scenario of reading bad blocks, it is necessary to perform a degraded read to recover the corresponding damaged data block. The degraded read recovers data through the internal RAID, but the PI information corresponding to the data cannot be recovered and needs to be re-obtained. Specifically, Figure 14 It is a schematic diagram of the PI information repair action in an embodiment. As Figure 14 shown, for the Guard field of PI, recalculate the CRC16 of the sector data and fill it. For the REF field of PI, the LBA information can be obtained by reading the metadata. For the APP field information, the storage system controller needs to perform EC verification on the APP field information according to the verification information in the APP field stripe to obtain the recovered APP field information.
[0153] In this embodiment, based on the recovered BST information, the target data corresponding to the data read command is determined, the data reading is completed, and the success rate of data reading is improved.
[0154] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed 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 executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0155] Based on the same inventive concept, an embodiment of the present application further provides a data recovery device for implementing the data recovery method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the data recovery device provided below can refer to the limitations on the data recovery method in the above text, and will not be repeated here.
[0156] In an exemplary embodiment, as Figure 15 shown, a data recovery device 1500 is provided, including: a receiving module 1501, a determining module 1502, and a verification module 1503, where:
[0157] The receiving module 1501 is configured to receive a data reading command and determine the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes the bad sector tag BST information corresponding to the sector where the target data is located.
[0158] The determining module 1502 is configured to determine the verification information corresponding to the APP domain information in the APP domain stripe when the BST information is damaged.
[0159] The verification module 1503 is configured 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.
[0160] In an exemplary embodiment, the data recovery device 1500 further includes:
[0161] An obtaining module, configured to obtain the status detection result of each sector; the status detection result is obtained by the host performing a status detection on the sectors in the hard disk.
[0162] A second determining module, configured to determine the BST information of the sector corresponding to the status detection result for the status detection result of each sector.
[0163] A first storage module, configured to store the BST information of a sector into the APP domain in the protection information corresponding to the sector.
[0164] In an exemplary embodiment, the data recovery device 1500 further includes:
[0165] A first determination module, configured to determine whether the status of the sector corresponding to the BST information is normal according to the BST information when the BST information is not damaged.
[0166] A first construction module, configured to construct a read result corresponding to a data read command according to the information of the abnormal status of the sector and the label of the sector, and send the read result to the host if the status of the sector corresponding to the BST information is abnormal.
[0167] In an exemplary embodiment, the data recovery device 1500 further includes:
[0168] A first update module, configured to 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 updated data.
[0169] A second update module, configured to perform data processing on 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] A first encoding module, configured to encode the new APP domain information and preset redundant data to obtain encoded data, and calculate a check code corresponding to the encoded data to obtain check information corresponding to the new APP domain information.
[0171] A third update module, configured to update the APP domain stripe according to the new APP domain information and the check information corresponding to the new APP domain information.
[0172] In an exemplary embodiment, the check is an erasure code EC check, and the check module 1406 includes:
[0173] A first processing sub-module, configured to perform reverse encoding processing on the check information to obtain decoded check information.
[0174] A first check sub-module, configured to check the APP domain information based on the decoded check information to obtain a check result.
[0175] A second processing sub-module, configured to perform error correction processing on the error bits in the check result to obtain restored APP domain information if the check result is in error.
[0176] In an exemplary embodiment, the data recovery device 1500 further includes:
[0177] A second judgment module, configured to determine the restored BST information in the restored APP domain information, and determine whether the status of the sector corresponding to the restored BST information is normal according to the restored BST information.
[0178] A second verification module, configured to, if the status of the sector corresponding to the restored BST information is normal, obtain target data corresponding to the data reading command from the hard disk, and verify the target data according to the protection information to obtain a target verification result.
[0179] A first sending module, configured to, when the target verification result is normal, determine the target data as the reading result corresponding to the data reading command, and send the reading result to the host.
[0180] Each module in the above data recovery device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.
[0181] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 16 shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program, when executed by the processor, implements a data recovery method. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0182] Those skilled in the art can understand that Figure 16 The structure shown in Figure 16 is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0183] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0184] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0185] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0186] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. 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), magnetoresistive 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 be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0187] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope recorded in this specification.
[0188] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data recovery method, characterized in that, 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: Receiving a data read command and determining protection information of target data corresponding to the data read command; the APP domain information in the protection information includes bad sector tag BST information corresponding to the sector where the target data is located; In the case where the BST information is damaged, determining check information corresponding to the APP domain information in the APP domain stripe; Checking the APP domain information according to the check information to obtain the restored APP domain information; the restored APP domain information includes the restored BST information.
2. The method according to claim 1, characterized in that, 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: Obtaining a status detection result of each sector; the status detection result is obtained by the host performing a status detection on the sector in the hard disk; For the status detection result of each sector, determining the BST information of the sector corresponding to the status detection result; Storing the BST information of the sector into the APP domain in 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: In the case where the BST information is not damaged, judging whether the status of the sector corresponding to the BST information is normal according to the BST information; If the status of the sector corresponding to the BST information is abnormal, constructing a read result corresponding to the data read command according to the information of the abnormal status of the sector and the tag of the sector, and sending the read result to the host.
4. The method according to claim 1, characterized in that, Before determining the check information corresponding to the APP domain information in the APP domain stripe in the case where the BST information is damaged, the method further includes: Receiving a data update command sent by the host and updating the data to be updated in the hard disk according to the data update command to obtain updated data; Performing data processing on the updated data according to a preset protection information algorithm to obtain new protection information, and updating 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; Encoding the new APP domain information and preset redundant data to obtain encoded data, and calculating a check code corresponding to the encoded data to obtain the check information corresponding to the new APP domain information; Updating the APP domain stripe according to the new APP domain information and the check information corresponding to the new APP domain information.
5. The method according to claim 1, characterized in that, The check is an erasure code EC check, and checking the APP domain information according to the check information to obtain the restored APP domain information includes: Performing reverse encoding processing on the check information to obtain decoded check information; Checking the APP domain information based on the decoded check information to obtain a check result; In the case where the verification result is incorrect, error correction processing is performed on the error bits in the verification result to obtain the restored APP domain information.
6. The method according to claim 1, characterized in that, After verifying the APP domain information according to the verification information to obtain the restored APP domain information, the method further includes: Determining the restored BST information in the restored APP domain information, and judging whether the status of the sector corresponding to the restored BST information is normal according to the restored BST information; If the status of the sector corresponding to the restored BST information is normal, obtaining the target data corresponding to the data reading command from the hard disk, and verifying the target data according to the protection information to obtain a target verification result; When the target verification result is normal, determining the target data as the reading result corresponding to the data reading command, and sending the reading result to the host.
7. A data recovery device, characterized in that, The device includes: A receiving module, configured to receive a data reading command and determine the protection information of the target data corresponding to the data reading command; the APP domain information in the protection information includes the bad sector tag BST information corresponding to the sector where the target data is located; A determining module, configured to determine the verification information corresponding to the APP domain information in the APP domain stripe in the case where the BST information is damaged; A verification module, configured 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.
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, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
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
Cited By
RAID data processing method and device, chip, electronic equipment, storage medium and computer program product
CN120704957A
RAID data processing method and device, chip, electronic equipment, storage medium and computer program product
CN120704958A