A method, device, equipment and medium for locating bad data blocks

By performing RAID checks and CRC checks on the main storage array and combining the comparison verification mechanism of the sub-storage array, the problem of difficult to locate bad data blocks caused by read and write offsets in the prior art is solved, and accurate and rapid positioning of bad blocks in the storage system is achieved, and the reliability and fault tolerance of the system are improved.

CN119763644APending Publication Date: 2025-04-04DAWNING INFORMATION IND (BEIJING) CO LTD +2
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411844465.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

It is difficult to accurately and quickly locate bad blocks of data in storage systems due to read and write offsets.

Method used

By performing RAID verification on the main memory array, the target strip where there are bad blocks is determined, and the first CRC verification result of each data block in the target strip is sent to the second controller of the secondary memory array. The second controller obtains the address information of the candidate bad block by comparing the second CRC verification result with the first CRC verification result of the corresponding data block in the secondary storage array, thereby accurately positioning the bad block of the data in the primary storage array.

Benefits of technology

It realizes accurate and fast positioning of bad blocks caused by read and write offsets in the storage system, improves the accuracy and efficiency of bad block detection and positioning, and enhances the reliability and fault tolerance of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119763644A_ABST
    Figure CN119763644A_ABST
Patent Text Reader

Abstract

The present application relates to the field of storage technology, and in particular to a method, device, equipment and medium for locating bad data blocks, which are used to accurately and quickly locate damaged data blocks. The method includes: performing independent disk redundant array RAID check on the main storage array to determine the target stripe where the bad block exists; sending the first cyclic redundancy CRC check result of each data block in the target stripe to the second controller in the cluster, so that the second controller obtains the address information of the candidate bad block by comparing the second CRC check result and the first CRC check result of the corresponding data block in the secondary storage array; the secondary storage array is a copy obtained by synchronously writing data with the main storage array; and locating the bad data block in the main storage array according to the received address information.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] As the demand for data storage continues to increase, storage systems, especially Redundant Array of Independent Disks (RAID) systems, are widely used in enterprise-level data centers, cloud storage platforms, and personal storage devices. RAID systems can achieve high availability, high fault tolerance, and data recovery capabilities by dividing and distributing data to multiple hard disks and combining redundancy technologies such as parity and mirroring. In particular, the RAID 6 system uses dual parity technology to ensure data integrity and recoverability in the event of two hard disk failures, and has become the preferred configuration for many companies in high-availability storage solutions.

[0003] In the prior art. First, the stripe data is detected to be normal through the verification mechanism of the RAID system, and the bad data blocks in the abnormal stripe are determined by performing CRC verification on each data block in the abnormal stripe where bad data blocks exist. However, when data offset (such as read offset or write offset) occurs, the CRC verification of the data block is normal. This is because the data is not actually damaged during read offset or write offset, but the data read or written may not be consistent with expectations due to alignment problems or offset errors in the storage process. In this case, the bad blocks cannot be accurately located by only performing CRC verification on each data block in the abnormal stripe, because the CRC verification can only detect data integrity problems and cannot directly identify deviations in data position.

[0004] In summary, how to accurately and quickly locate damaged data blocks is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a bad data block location method, device, electronic device and storage medium for accurately and quickly locating damaged data blocks.

[0006] A method for locating a bad data block provided in an embodiment of the present application is applied to a first controller in a cluster, including:

[0007] Perform RAID check on the primary storage array to determine the target stripe with bad blocks;

[0008] sending the first CRC check result of each data block in the target stripe to the second controller in the cluster, so that the second controller obtains the address information of the candidate bad block by comparing the second CRC check result of the corresponding data block in the secondary storage array with the first CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0009] The bad data blocks in the main storage array are located according to the received address information.

[0010] Optionally, if it is determined that each of the data blocks is normal according to the first CRC check result of each of the data blocks, obtaining a first physical address of each of the data blocks in the main storage array;

[0011] According to the first physical address of each data block and the preset address mapping relationship, the logical block address of each data block is obtained; the logical block address of each data block is used to determine the second physical address of the data block in the secondary storage array, so that the second controller performs CRC check on the corresponding data block according to the second physical address;

[0012] A consistency check request generated according to the first CRC check result and the logic block address is sent to a second controller in the cluster.

[0013] Through the above process, the first physical address in the main storage array is converted into a logical block address by using the address mapping relationship, and further mapped to the second physical address in the secondary storage array, so that the second controller of the secondary storage array can accurately locate the corresponding data block and perform CRC check. By generating a consistency check request and distributing it to each second controller, the data check result of the secondary storage array can be fully utilized and compared with the check result of the main storage array, so as to accurately locate the specific position of the stripe of the bad data block in the stripe. This effectively utilizes the association between the main storage array and the secondary storage array, and improves the accuracy and efficiency of bad block detection and positioning.

[0014] Optionally, the second controller has at least one; the first CRC check result of the candidate bad block is inconsistent with the corresponding at least one second CRC check result;

[0015] Determine the consistency ratio according to the address information returned by each second controller; the consistency ratio represents: the proportion of target second controllers whose address information of each candidate bad block returned is the same among the second controllers;

[0016] If the consistency ratio reaches a preset ratio, the bad data block in the target stripe is located according to the address information returned by the target second controller, and the bad data block in the target stripe is repaired according to the secondary storage array corresponding to the target second controller;

[0017] If the consistency ratio does not reach the preset ratio, it is determined that the address information returned by each second controller is unreliable.

[0018] Through the above process, the address information returned by each second controller can be used to calculate the consistency ratio, so as to determine the reliability of the candidate bad block. If the consistency ratio reaches the preset ratio, it means that the address information returned by most of the second controllers is consistent, and the data bad blocks in the target stripe can be reliably located and repaired using the corresponding secondary storage array, thereby improving the accuracy and efficiency of data repair. When the consistency ratio does not reach the preset ratio, the returned address information is determined to be unreliable, avoiding misjudgment or erroneous repair caused by a few abnormal second controllers, effectively enhancing the overall fault tolerance and data integrity protection.

[0019] Optionally, performing periodic RAID check on each stripe of the primary storage array to determine a target stripe where bad data blocks exist;

[0020] Alternatively, after receiving a data read request, the stripe where the read data is located is determined, and a RAID check is performed on the stripe; if the RAID check result is inconsistent, the stripe is determined to be a target stripe with bad data blocks.

[0021] Through the above process, RAID verification is periodically performed on each stripe of the main storage array, which can effectively detect data anomalies caused by write deviation, thereby timely locating the problematic stripe and preventing bad blocks from further affecting data integrity. When a data read request is received, RAID verification is performed on the target stripe to detect bad blocks caused by read deviation or write deviation. Write deviation may cause the written data to be inconsistent with the expected verification result, while read deviation may cause the read data to be inconsistent with the actual stored data. At the same time, it combines the advantages of active prevention and real-time detection, and comprehensively captures data problems caused by abnormal read and write operations, thereby significantly improving the detection capability and fault tolerance of data anomalies, and ensuring data reliability and consistency.

[0022] A method for locating a bad data block provided in an embodiment of the present application is applied to a second controller in a cluster, including:

[0023] receiving a first CRC check result of each data block in a target stripe sent by a first controller in the cluster; the target stripe is a stripe with bad blocks determined by performing RAID check on a primary storage array;

[0024] Performing CRC check on corresponding data blocks in the secondary storage array to obtain a second CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0025] By comparing the first CRC check result and the second CRC check result, address information of the candidate bad block is determined, and the address information is sent to the first controller, so that the first controller locates the bad data block in the main storage array according to the address information.

[0026] Optionally, the first CRC check result is sent by the first controller through a consistency check request, and the consistency check request also includes a logical block address of each data block; for each data block, the following operations are performed respectively:

[0027] Determine a second physical address of the data block in the secondary storage array according to the logical block address of the data block; the logical block address is obtained by the first controller through the first physical address of the corresponding data block in the primary storage array and a preset address mapping relationship;

[0028] Performing a CRC check on the data block according to the second physical address to obtain a second CRC check result of the data block;

[0029] If the first CRC check result and the second CRC check result of the data block are inconsistent, the data block is determined to be a candidate bad block, and address information of the candidate bad block is determined.

[0030] Through the above process, the problematic data blocks in the main storage array can be further accurately located, and reliable candidate bad block address information can be provided. Specifically, the logical block address is included in the consistency check request, so that the second controller can quickly determine the physical address of the corresponding data block in the secondary storage array through the address mapping relationship. This operation ensures the efficiency and accuracy of the verification process. Subsequently, the second controller performs a CRC check on the corresponding data block in the secondary storage array, obtains a second CRC check result, and compares it with the first CRC check result. If the two are inconsistent, the data block is determined to be a candidate bad block, and the address information is returned to the first controller. Through the introduction of this logical block address and the verification and comparison process, consistency checks and bad block positioning across storage arrays are achieved, the accuracy of bad block detection is effectively improved, and the fault tolerance and data integrity maintenance capabilities are further enhanced.

[0031] A bad data block location device provided in an embodiment of the present application is applied to a first controller in a cluster, including:

[0032] A determination unit, used to perform RAID verification on the main storage array to determine a target stripe where a bad block exists;

[0033] a sending unit, configured to send a first CRC check result of each data block in the target stripe to a second controller in the cluster, so that the second controller obtains address information of a candidate bad block by comparing a second CRC check result of a corresponding data block in a secondary storage array with the first CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0034] A positioning unit is used to locate bad data blocks in the main storage array according to the received address information.

[0035] A bad data block location device provided in an embodiment of the present application is applied to a second controller in a cluster, including:

[0036] A receiving unit, configured to receive a first CRC check result of each data block in a target stripe sent by a first controller in the cluster; the target stripe is a stripe with bad blocks determined by performing RAID check on a primary storage array;

[0037] A calculation unit, configured to perform a CRC check on a corresponding data block in a secondary storage array to obtain a second CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0038] The address sending unit is used to determine the address information of the candidate bad block by comparing the first CRC check result with the second CRC check result, and send the address information to the first controller, so that the first controller locates the data bad block in the main storage array according to the address information. An electronic device provided by an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the above-mentioned data bad block location methods.

[0039] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the above-mentioned methods for locating bad data blocks.

[0040] An embodiment of the present application provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the above-mentioned data bad block locating methods.

[0041] The beneficial effects of this application are as follows:

[0042] The embodiments of the present application provide a method, device, electronic device and storage medium for locating bad data blocks. First, RAID is used to verify the main storage array to quickly determine the target stripe where the bad block exists.

[0043] Next, for the target stripe with bad data blocks, it is necessary to locate the specific position of the bad blocks. The present application performs a CRC check on each data block in the target stripe and obtains a first CRC check result. When a CRC check is performed to obtain the first CRC check result for a bad data block caused by a read bias or a write bias of the main storage array, the offset problem will not be reflected. This is because the CRC check value is usually calculated based on the data content, and the read bias or the write bias only changes the order or position of the data blocks, but does not change the content of a single data block. Therefore, even if there is a read-write offset, the first CRC check result may still show that the data block is correct, resulting in the main storage array check being unable to detect such problems.

[0044] Then, the present application sends the first CRC check result of the main storage array to the second controller in the cluster, and the second controller performs a CRC check on the data block in the corresponding secondary storage array to obtain a second CRC check result. Since the secondary storage array writes data synchronously with the main storage array, its storage state is usually not affected by the read bias or write bias in the main storage array. By comparing the first CRC check result and the second CRC check result, each second controller in the cluster can independently compare the first CRC check result and the second CRC check result. If a second controller finds that the results of the two are inconsistent, the second controller will use the data block with inconsistent results as a candidate bad block and return the address information of the candidate bad block to the first controller. By comparing the second controllers, potential data anomalies or bad block problems caused by offset can be quickly discovered and located. This method improves the accuracy of bad block positioning and makes up for the shortcomings of traditional RAID in handling data offset problems, thereby enhancing the reliability and fault tolerance of the storage system.

[0045] Finally, the bad block with problems in the main storage array is accurately located according to the bad block address information returned by the secondary storage array.

[0046] In summary, the solution of the present application quickly screens the target stripes through RAID verification, and combines the comparison and verification mechanism of the secondary storage array to solve the problem of difficult detection of bad data blocks due to read-write offset, and can accurately and quickly locate damaged data blocks.

[0047] Other features and advantages of the present application will be described in the subsequent description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0049] Figure 1 A schematic diagram of an application scenario of an embodiment of the present application;

[0050] Figure 2 An implementation flow chart of a method for locating a bad data block provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of stripe data of a RAID6 storage array provided in an embodiment of the present application;

[0052] Figure 4 A flowchart of a candidate bad block repair provided in an embodiment of the present application;

[0053] Figure 5 A flowchart of another method for locating a bad data block provided in an embodiment of the present application;

[0054] Figure 6 An overall flow chart of a method for locating a bad data block provided in an embodiment of the present application;

[0055] Figure 7 This is a structural schematic diagram of a bad data block location device in an embodiment of the present application;

[0056] Figure 8 It is a structural schematic diagram of another bad data block locating device in an embodiment of the present application;

[0057] Fig. 9 The figure is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the technical solution of the present application, rather than all of the embodiments. Based on the embodiments recorded in the application documents, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the technical solution of the present application.

[0059] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application may be combined with each other if there is no conflict.

[0060] like Figure 1 As shown, it is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes a terminal device 110 and a storage array cluster 120, and the storage array cluster includes a primary storage array 1201 and three secondary storage arrays 1202.

[0061] Among them, the terminal device 110 can communicate with the primary storage array 1201 and the secondary storage array 1202 included in the storage array cluster 120 (hereinafter referred to as the cluster) through the network. The primary storage array 1201 is a storage device responsible for storing data and performing major operations, and the secondary storage array 1202 is a data copy obtained by synchronously writing data with the primary storage array 1201. Its function is to ensure high availability and redundant backup of data to prevent data loss when the primary storage array fails.

[0062] Each storage array has a controller for managing the storage array, for example, the first controller of the primary storage array 1201 is used to manage the primary storage array 1201, and the second controller of the secondary storage array 1202 is used to manage each secondary storage array 1202. The terminal 102 can send a data read request to the storage array cluster, and return the target data corresponding to the data read request through data interaction between the storage arrays included in the storage system.

[0063] In the embodiment of the present application, the terminal device 110 includes but is not limited to mobile phones, tablet computers, laptop computers, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, car terminals and other devices.

[0064] It should be noted that Figure 1 The figure is only an example. In fact, the number of terminal devices, the number of storage array clusters, and the number of primary storage arrays and secondary storage arrays in the storage array cluster are not limited and are not specifically limited in the embodiments of the present application.

[0065] The following describes the method for locating bad data blocks provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation methods of the present application are not limited in this regard.

[0066] See also Figure 2As shown, it is an implementation flow chart of a method for locating a bad data block provided by an embodiment of the present application, which is applied to a first controller in a cluster, and the first controller is used to manage a main storage array. The specific implementation process of the method is as follows:

[0067] S21: Perform RAID check on the main storage array to determine the target stripe with bad blocks.

[0068] Among them, a storage array refers to a storage system composed of multiple storage units for data storage and retrieval.

[0069] RAID verification refers to the redundant storage of data in the storage array through different RAID levels (such as RAID 1, RAID 5, RAID 6, etc.), and the use of technologies including but not limited to parity verification or mirroring to ensure data integrity. When a storage unit fails, RAID recovers the lost data or identifies the failed storage unit by verifying the redundant information of the data.

[0070] A bad block is a storage unit that cannot be read or written correctly due to hardware failure, physical damage, data corruption or other abnormal conditions in the storage system. It is usually a data block in the storage device. Specifically, bad blocks include not only completely damaged storage blocks, but also data corruption that may be caused by read bias, write bias and other problems. These situations usually cannot be directly recovered through standard read operations.

[0071] In RAID, striping is the process of dividing the data in the storage array into blocks and writing them sequentially to multiple storage units (i.e., disks) to improve storage efficiency and data access speed. Specifically, data is divided into multiple data blocks, and these data blocks are distributed sequentially to different disks. Each data block is stored in a predetermined order on different disks to form a stripe. Multiple data blocks form a stripe, and a stripe spans multiple disks, speeding up the reading and writing of data by accessing these disks in parallel.

[0072] In the embodiment of the present application, taking RAID 6 as an example, RAID 6 uses two independent verification methods (such as P+Q verification), and requires at least N+2 hard disks to form a storage array. Even if two disks fail at the same time, data can be restored through these two verification information. Figure 3 , which is a schematic diagram of a RAID 6 stripe data structure of a storage array provided in an embodiment of the present application.

[0073] like Figure 3 As shown in FIG. 1 , it is a schematic diagram of stripe data of a RAID6 storage array provided in an embodiment of the present application. The data blocks in the RAID6 stripe are divided into two parts: a data area and two check areas. Figure 3In the RAID6 storage array, there are three stripes, each stripe contains six data blocks, of which the first four data blocks store data information and belong to the data area, and the last two data blocks store check information and belong to the check area. Specifically, each stripe includes four data blocks (such as D1, D2, D3, D4) and two check blocks (such as P1 and Q1). Among them, the P check block and the Q check block are used to ensure the integrity and recovery capability of the data through redundant information.

[0074] In the embodiment of the present application, the P check block can be calculated by XOR operation, which is based on the data blocks on the same stripe. The Q check block is generated by XOR operation and is calculated by more complex finite field operations (such as GF (2^8) operations). For the stripes involved in this application, the specific calculation method of P check and Q check is not specifically limited, and different algorithms (such as common XOR check or more complex finite field operations) can be selected according to different RAID6 implementation methods.

[0075] In RAID6, data is stored in stripes, and each stripe contains multiple data blocks and two check blocks (P and Q). When storing data, RAID6 generates P and Q check blocks to ensure data redundancy. When reading or writing data, the P and Q check blocks are recalculated and compared with the stored check blocks. If the calculation result is inconsistent with the stored check blocks, it means that there are one or more bad blocks in the stripe.

[0076] If it is known that any two data blocks (such as D2 and D8) in a stripe are damaged, the lost data blocks can be recovered through P check and Q check.

[0077] The specific recovery process is as follows: Use P check to recover data blocks. By performing XOR operations on other data blocks (such as D1, D3, and D4), the damaged D2 data block can be recovered. Use Q check to recover data blocks. If a data block is damaged and involves the recovery of multiple stripes, the Q check can be used to further recover the information of the missing data block. To recover data, when two data blocks are lost at the same time, RAID6's redundant information (P and Q check) can effectively provide the information needed to recover data.

[0078] In the embodiment of the present application, the redundant check mechanism of RAID6 ensures that even if multiple data blocks fail, the system can still recover the lost data through redundant check information (P and Q check), thereby ensuring high reliability and integrity of the data.

[0079] The above describes how to determine the target stripe with bad blocks by performing RAID verification on the main storage array. The following describes how to find the target stripe with bad blocks during data reading or writing.

[0080] In an optional implementation, a periodic RAID check is performed on each stripe of the main storage array to determine the target stripe where the bad data block exists; or, after receiving a data read request, the stripe where the read data is located is determined, and a RAID check is performed on the stripe; if the RAID check results are inconsistent, the stripe is determined to be a target stripe where the bad data block exists.

[0081] Specifically, RAID verification can be performed periodically to detect and determine the stripe containing bad blocks. In addition, when a terminal device initiates a data read request, the stripe where the read data is located is verified. If the verification results are inconsistent, the stripe is determined to be a target stripe with bad blocks.

[0082] Inconsistent RAID check results mean that when reading or writing data, the check result obtained by calculating the data block in a stripe and the corresponding check block (such as the P check block and Q check block in RAID 6) does not match the pre-stored check value stored on the stripe. Specifically, when the data block in a stripe is inconsistent with the value calculated by the check block, it means that at least one data block in the stripe is damaged, resulting in inconsistent RAID check results.

[0083] Through the above calculation process, we can only determine that the stripe has bad blocks, but we cannot determine the exact location and number of bad blocks. Specifically, although RAID verification can confirm that the verification results of a stripe are inconsistent, and then infer that there is at least one damaged data block in the stripe, further analysis is needed to accurately identify the specific location and number of bad blocks. The following will specifically introduce how to identify the specific location and number of bad blocks.

[0084] The prior art identifies the specific location and number of bad blocks by assuming the number of bad blocks, and gradually determines the bad block problem by continuously generating redundant blocks through a combination scheme and comparing them with real redundant blocks.

[0085] The formula for determining the bad block combination is shown in Formula 1, where n represents the number of data in a stripe, and n-2 means that n-2 data blocks must be selected from n data blocks for RAID calculation.

[0086]

[0087] As shown in Formula 1, as the number of RAID stripes increases, the amount of calculation will also increase exponentially, and the difficulty of data recovery will also increase exponentially.

[0088] The specific steps of verifying the secondary storage array in this application will be described in detail below.

[0089] S22: Send the first CRC check result of each data block in the target stripe to the second controller in the cluster, so that the second controller obtains the address information of the candidate bad block by comparing the second CRC check result and the first CRC check result of the corresponding data block in the secondary storage array; the secondary storage array is a copy obtained by writing data synchronously with the primary storage array.

[0090] In an embodiment of the present application, a CRC check is performed on each data block in the target stripe, and a first CRC check result obtained is sent to at least one second controller in the cluster through a request; the address information of the candidate bad block is obtained by comparing the first CRC check result with the second CRC check result; the second CRC check result is obtained by: the second controller performs a CRC check on the corresponding data block in the managed secondary storage array; each secondary storage array is: a copy obtained by synchronously writing data with the main storage array.

[0091] Among them, CRC check is a method for detecting data integrity. It generates a checksum by executing an algorithm on a data block to detect whether the data is erroneous. CRC check can effectively identify errors in data and locate damaged parts. In RAID systems, CRC check is widely used to verify whether the stored data is damaged or changed.

[0092] The first CRC check result refers to the check result obtained after performing CRC check on each data block in the target stripe of the main storage array. Specifically, firstly, CRC operation is performed on each data block to obtain the check code of the data block. Then, the calculated CRC value is compared with the original CRC value generated when the data block is stored to see if they are consistent. If they are consistent, the data block is normal; if they are inconsistent, it means that the data block is damaged.

[0093] In the embodiment of the present application, sending to at least one second controller in the cluster means that it can be sent to one second controller in the cluster, or it can be sent to some second controllers in the cluster, and of course it can be sent to all second controllers in the cluster. The present application does not specifically limit the number of second controllers in the cluster to which the request is sent.

[0094] In an embodiment of the present application, if there is a data block with an inconsistent first CRC check result in the target stripe of the primary storage array, the data block is directly determined to be a bad block, and can be repaired through RAID6 in the above process, or can be repaired through the corresponding data block of the secondary storage array. If the repair of the bad block is directly determined by the first CRC check result, the present application does not make any specific limitations.

[0095] If the first CRC check result of each data block in the target stripe of the main storage array is normal, it means that the contents of all data blocks are not damaged. However, this does not rule out the possibility of bad blocks caused by read or write deviations, that is, although the data is not actually damaged, the read or written data may not be consistent with expectations due to alignment problems or offset errors in the storage process. In this case, the bad blocks cannot be accurately located by only performing CRC checks on each data block in the target stripe of the main storage array, because CRC checks can only detect data integrity problems and cannot directly identify deviations in data position.

[0096] Optionally, in order to accurately read or write the bad blocks caused by the deviation, the first CRC check result of each data block in the target stripe of the primary storage array can be sent to at least one second controller in the cluster through a consistency check request, and the data in the primary storage array and the secondary storage array can be compared through the consistency check request. The specific process of generating the consistency check is introduced below:

[0097] If it is determined that all data blocks are normal based on the first CRC check result of each data block, the first physical address of each data block in the main storage array is obtained; the logical block address of each data block is obtained based on the first physical address of each data block and a preset address mapping relationship; the logical block address of each data block is used to determine the second physical address of the data block in the secondary storage array, so that the second controller performs a CRC check on the corresponding data block according to the second physical address; and a consistency check request generated based on the first CRC check result and the logical block address is sent to the second controller in the cluster.

[0098] The first physical address refers to the specific storage location of each data block in the main storage array on the physical storage medium (such as a magnetic disk or a solid state drive), and uniquely identifies the storage location of the data in the main storage array.

[0099] The preset address mapping relationship refers to the mapping rule between the logical block address and the physical address. The address mapping relationship mainly includes a reverse mapping table and a mapping table. The reverse mapping table is used to find the corresponding logical block address according to the physical address in the storage array. That is, given the physical address of a data block, the logical block address of the data block in the storage array can be found through the reverse mapping table. The mapping table is used to find the corresponding physical address of the data block according to the logical block address. That is, given the logical block address of a data block, the physical position of the data block in the storage array can be found through the mapping table.

[0100] Logical Block Address (LBA) refers to the logical identifier assigned by the storage system to the same data block in the primary storage array and the secondary storage array according to certain mapping rules, ensuring that the physical addresses of the same data blocks in the primary and secondary arrays are different, but the logical block addresses are the same.

[0101] The second physical address refers to the physical storage location of the corresponding data block in the secondary storage array, which is different from the physical address of the primary storage array, but because the logical block addresses are consistent, the data contents are also consistent.

[0102] In the implementation of this application, by analyzing the first CRC check result of each data block, if the check results are normal, it means that the data blocks themselves are not damaged. However, in order to confirm the specific location of the bad block caused by read bias or write bias in the target stripe, it is necessary to analyze through the following steps.

[0103] First, you need to obtain the first physical address of each data block in the main storage array. The physical address in the main storage array is a unique identifier that indicates the specific storage location of the data block on the storage medium (such as a hard disk or solid-state drive). This address is automatically assigned by the storage system when data is stored and is used to accurately locate the physical storage location of the data block.

[0104] Next, the logical block address corresponding to the first physical address of each data block on the target stripe can be queried through a preset address mapping relationship (here, a reverse mapping table).

[0105] Then, when it is determined that the first CRC check result of the data block is normal and not damaged, a consistency check request is generated. The request includes the serial number of the target stripe of the main storage array, the serial number of each data block on the target stripe of the main storage array, the first CRC check result of each data block and the set of corresponding LBA addresses. The first physical address can be determined by the serial number of the target stripe and the serial number of each data block. Then, this request is sent to each second controller in the cluster so that the second controller performs a CRC check on the corresponding data block according to the second physical address in the secondary storage array to obtain a second CRC check result. Then, by comparing the first CRC check result with each second CRC check result, the address information of the candidate bad block is obtained.

[0106] The present application finds inconsistent candidate bad blocks by comparing the first CRC check result and the second CRC check result independently through each second controller, and returns its address information to the first controller. Specifically, assuming that the target stripe contains 6 data blocks D1-D6, there are five secondary storage arrays B1-B5 in the cluster, and each second controller in the cluster returns the following candidate bad block address information respectively: the second controller of B1 returns data blocks D2, D4, D6; the second controller of B2 returns data blocks D2, D4, D5; the second controller of B3 returns data blocks D2, D4, D6; the second controller of B4 returns data blocks D2, D4; the second controller of B5 returns data blocks D2, D4, D5.

[0107] It should be noted here that the candidate bad blocks determined by each second controller in the cluster are obtained by performing CRC check on the corresponding data blocks at the second physical addresses of each secondary storage array. In order to accurately locate the candidate bad blocks in the main storage array, the second physical addresses of the candidate bad blocks in each secondary storage array must be converted into logical block addresses.

[0108] This conversion process is achieved by querying the reverse mapping table, which stores the mapping relationship between the physical address and the logical block address. Each second controller needs to convert the second physical address in the secondary storage array determined by it into the corresponding logical block address according to the reverse mapping table. Finally, the second controller can return the location information of the candidate bad block in the primary storage array, that is, the logical block address.

[0109] According to the candidate bad block address information returned by each second controller, a CRC check is performed in the secondary storage array to obtain each second CRC check result, and it is verified whether each second CRC check result of the data block in the secondary storage array is consistent with the data block in the primary storage array. The secondary storage array is specifically introduced and will not be repeated here.

[0110] The above describes how to obtain the address information of the candidate bad block through consistency check and comparison with the secondary storage array. The following describes in detail how to locate the data bad block in the primary storage array according to the received address information.

[0111] S23: Locate the bad data block in the main storage array according to the received address information.

[0112] In the embodiment of the present application, when a potential data bad block is determined to occur by comparing the first CRC check result with the second CRC check result, the received address information will be used to locate the bad block position in the main storage array. The specific positioning process ensures the accuracy of bad block positioning by judging the consistency ratio. Through the candidate bad block address information returned by each second controller, the data bad block in the main storage array can be found more accurately, ensuring the efficiency and accuracy of the data recovery process, while effectively reducing the data calculation pressure of the main array and improving the bad block positioning rate.

[0113] like Figure 4 As shown, it is a flowchart of candidate bad block repair provided in an embodiment of the present application.

[0114] Optionally, there is at least one second controller; if the first CRC check result of the candidate bad block is inconsistent with the corresponding at least one second CRC check result, then for each candidate bad block, the following steps S41 to S43 are performed respectively:

[0115] S41: determining a consistency ratio according to the address information returned by each second controller; the consistency ratio indicates: the proportion of target second controllers whose address information of each candidate bad block returned is the same among the second controllers.

[0116] The consistency ratio is calculated by comparing the address information of the candidate bad blocks returned by each second controller and calculating the proportion of the address information returned by all second controllers that is consistent. The consistency ratio can evaluate the credibility of the candidate bad block address information returned by different second controllers. If multiple second controllers consistently return the same address, the credibility of this information is higher, so the consistency ratio is also higher.

[0117] In the embodiment of the present application, if sent to all second controllers in the cluster, the consistency ratio represents: the proportion of target second controllers whose returned address information of candidate bad blocks is the same among all second controllers in the cluster.

[0118] If sent to some second controllers in the cluster, the consistency ratio indicates: among some second controllers in the cluster, the proportion of target second controllers whose address information of each candidate bad block returned is the same.

[0119] S42: Determine whether the consistency ratio reaches a preset ratio, if so, execute S43, otherwise execute S44.

[0120] It should be noted here that the preset ratio can be adjusted according to specific needs, usually depending on the fault tolerance requirements of the storage array, the storage architecture and the requirements for bad block location accuracy. This application does not specifically limit the preset ratio setting of the consistency ratio, and allows flexible configuration according to different environments and needs. Different application scenarios may require different preset ratios. For example, in some scenarios with extremely high requirements for data integrity, the preset ratio may be set to a higher 80% or 90%; and in other scenarios with strong fault tolerance, the preset ratio may be lower, which is convenient for improving repair efficiency and reducing the waste of computing resources.

[0121] S43: Locate the bad data block in the target stripe according to the address information returned by the target second controller, and repair the bad data block in the target stripe according to the secondary storage array corresponding to the target second controller.

[0122] In an embodiment of the present application, the bad blocks are accurately located and repaired through the secondary storage array based on the address information returned by the second controller. The repair process includes using the redundant data on the secondary storage array to restore the damaged data blocks in the primary storage array. For example, still taking the above as an example, the second controllers of B1, B3, and B5 return consistent data blocks D2, D4, and D6, and the consistency ratio is 60%, so D2, D4, and D6 will be located as bad blocks, and the corresponding data will be restored from the secondary storage array to ensure the data integrity in the primary storage array.

[0123] S44: Determine that the address information returned by each second controller is not credible.

[0124] In an optional implementation, still taking the above data block and secondary storage array as an example, it is assumed that the returned candidate bad block addresses are as follows: the second controller of B1 returns D2, the second controller of B2 returns D3, the second controller of B3 returns D4, the second controller of B4 returns D5, and the second controller of B5 returns D6. In this case, the bad blocks returned by each secondary storage array are different, and the consistency ratio is 0%, which is lower than the preset ratio (e.g., 50%), so these address information will be judged as unreliable.

[0125] At this time, the target stripe can be broadcast as hyper-redundancy. Hyper-redundancy in data storage systems refers to the risk of data loss or severe performance degradation when the number of bad blocks exceeds the range that the system can tolerate or repair through the redundancy mechanism. Usually, the redundancy mechanism (such as RAID configuration) can tolerate a small number of bad blocks or failures and recover and repair them through the secondary storage array. However, if the number of bad blocks is too large and exceeds the carrying capacity of the redundant system, the lost data may not be recovered or a performance bottleneck may occur. In this case, the redundancy mechanism cannot effectively protect the data, and the reliability and stability of the storage array will be seriously threatened. Therefore, when it is found that the consistency ratio is too low, it will be determined that the data stripe has a hyper-redundancy problem, and by broadcasting the hyper-redundancy information of the target stripe, more diagnosis and repair processes will be triggered, such as requesting more secondary storage arrays to participate in verification or resynchronization of data to avoid data loss or further performance problems.

[0126] How to locate the data bad block by sending a consistency check request and the address information of the candidate bad block, and how to verify the credibility of the candidate bad block by the consistency ratio, and finally repair the bad block or determine that the data is unreliable according to the judgment result. Next, the specific process of how the second controller receives the consistency check request, and obtains the address information of the candidate bad block based on the first CRC check result and the second CRC check result will be introduced.

[0127] See also Figure 5 As shown, it is an implementation flow chart of another method for locating bad data blocks provided by an embodiment of the present application, which is applied to a second controller in a cluster, and the second controller is used to manage a secondary storage array. The specific implementation process of the method is as follows:

[0128] S51: receiving a first CRC check result of each data block in a target stripe sent by a first controller in the cluster; the target stripe is a stripe with bad blocks determined by performing RAID check on a primary storage array.

[0129] In an embodiment of the present application, a consistency check request is received from a first controller in a cluster; a first CRC check result in the consistency check request is obtained by performing a CRC check on each data block in a target stripe on a primary storage array managed by the first controller; and the target stripe is a stripe with bad blocks determined by performing a RAID check on the primary storage array.

[0130] In an embodiment of the present application, the first controller identifies the target stripe in the main storage array through RAID verification, and then performs CRC verification on each data block on the target stripe to obtain a first CRC verification result for each data block, which is sent to the second controller in the cluster through a consistency check request.

[0131] It should be noted here that the CRC check on each data block in the target stripe on the main storage array and the RAID check on the main storage array have been introduced in the above content and will not be repeated here.

[0132] S52: Perform CRC check on the corresponding data block in the secondary storage array to obtain a second CRC check result; the secondary storage array is a copy obtained by writing data synchronously with the primary storage array.

[0133] Specifically, in the embodiment of the present application, based on the consistency check request, a CRC check is performed on the corresponding data block in the secondary storage array to obtain a second CRC check result; the secondary storage array is: a copy obtained by synchronously writing data with the primary storage array.

[0134] In the embodiment of the present application, the second controller performs a CRC check on the data block in the secondary storage array according to the logical block address included in the consistency check request, thereby obtaining a second CRC check result. Since the secondary storage array is a copy of data written synchronously with the primary storage array, it can be used as a redundant data source of the primary storage array, providing a basis for verification and comparison.

[0135] The process of performing CRC check on the corresponding data blocks in the secondary storage array will be described in detail below and will not be repeated here.

[0136] S53: Determine address information of the candidate bad block by comparing the first CRC check result with the second CRC check result, and send the address information to the first controller, so that the first controller locates the bad data block in the main storage array according to the address information.

[0137] In the embodiment of the present application, by comparing the CRC check results of the primary storage array and the secondary storage array, the second controller can identify data blocks whose first CRC check results are inconsistent with the second CRC check results, and determine these data blocks as candidate bad blocks, and then feed back the address information of these candidate bad blocks to the first controller to help it locate the data bad blocks in the primary storage array.

[0138] The second controller returns to the first controller the address information of the candidate bad block, including the serial number of the stripe where the candidate bad block is located, the serial number of the candidate bad block, and whether the first verification result is consistent with the second verification result. Based on the above information, the first controller determines the specific location of the candidate bad block.

[0139] The above describes how the second controller processes the consistency check request, compares the first CRC check result with the second CRC check result according to the consistency check request, and finally returns the address information of the candidate bad block. In an optional implementation, the processing process of the consistency check request is as follows:

[0140] The consistency check request also includes: the logical block address of each data block; for each data block, the following steps S5301 to S5303 are performed respectively ( Figure 5 Not shown):

[0141] Step S5301: Determine the second physical address of the data block in the secondary storage array according to the logical block address of the data block; the logical block address is obtained by the first controller through the first physical address of the corresponding data block in the primary storage array and a preset address mapping relationship.

[0142] In the embodiment of the present application, the logical block address is used by the storage system to identify the data blocks stored in the primary storage array and the secondary storage array. In the primary storage array and the secondary storage array, although the physical address of each array is different, the LBA address will point to the same data block. The primary storage array and the secondary storage array synchronously store the same data through a mapping relationship, but their physical addresses (for example, the physical address of the primary storage array and the physical address of the secondary storage array) are different.

[0143] The logical block address is mapped to the second physical address, and then the corresponding second physical address of the data block can be found in the secondary storage array. For example, assuming that the first physical address of the data block D1 in the primary storage array is PA1, the first controller can query the logical block address LBA1 of D1 through the mapping relationship (i.e., the inverse mapping table), and then the second controller queries the second physical address PA2 of D1 in the secondary storage array through the mapping relationship (i.e., the mapping table).

[0144] Step S5302: Perform CRC check on the data block according to the second physical address to obtain a second CRC check result of the data block.

[0145] In the embodiment of the present application, the second physical address is the location of the corresponding data block in the secondary storage array. After receiving the consistency check request, the second controller reads the corresponding data block from the secondary storage array according to the second physical address of the data block and performs a CRC check on it. By calculating the CRC check value of the data block, a second CRC check result is obtained, which is used to compare with the CRC check result of the same data block in the main storage array, so as to detect potential bad blocks or inconsistencies.

[0146] Step S5303: If the first CRC check result and the second CRC check result of the data block are inconsistent, the data block is determined to be a candidate bad block, and the address information of the candidate bad block is determined.

[0147] In an optional implementation, if there are 6 data blocks in the target stripe of the main storage array, assuming that these data blocks are D1, D2, D3, D4, D5, and D6, when the main storage array performs CRC check on these data blocks, the first CRC check results obtained are: D1, D2, D3, D4, D5, and D6 CRC values ​​are: 0x1234, 0x5678, 0x9abc, 0xdef0, 0x1111, and 0x2222. Then, the second controller performs CRC check on the corresponding data blocks in the auxiliary storage array, and obtains the second CRC check results, which are 0x1234, 0x5678, 0x9abc, 0x1234, 0x1111, and 0x3333. By comparing the first CRC check result and the second CRC check result, it can be found that the CRC values ​​of D4 and D6 are inconsistent. Specifically, the CRC values ​​of D4 of the first storage array and the second storage array are 0xdef0 and 0x1234 respectively, and the CRC values ​​of D6 are 0x2222 and 0x3333 respectively, so D4 and D6 are determined as candidate bad blocks. At this time, the second controller returns the address information of the data blocks of D4 and D6 to the first controller, so that the first controller can locate the bad data blocks in the main storage array and perform the repair operation.

[0148] The above process is a processing flow of the second controller of a secondary storage array. If there are multiple secondary storage arrays, the second controller of each secondary storage array will perform the same operation, perform CRC check on the corresponding data blocks in each secondary storage array, and compare it with the first CRC check result of the main storage array. If some controllers in the multiple secondary storage arrays find that the first CRC check result is inconsistent with the second CRC check result, they will identify the candidate bad blocks and return the corresponding address information to the first controller, so that the main storage array can locate the specific bad block address and repair or further process it. The second controller of each secondary storage array executes the process independently and returns the address information of the candidate bad blocks of each second controller to the first controller. The first controller locates the specific bad blocks and repairs them according to the address information of these candidate bad blocks. The specific process is as mentioned above, and this application will not repeat it here.

[0149] See also Figure 6 As shown, it is an overall flow chart of a method for locating a bad data block provided by an embodiment of the present application, and the specific process is as follows:

[0150] The specific description is as follows: First, when the main storage array receives a data read request from the user, the bad block location process is started. Then, the RAID check is performed on the main storage array to detect whether there is an abnormal target stripe. If the check result of a stripe is inconsistent, it is determined that the stripe may have a bad block. Subsequently, CRC check is performed on each data block in the target stripe to obtain the first CRC check result of each data block. This step ensures that the check value of each data block of the main storage array can be used as the basis for subsequent comparison.

[0151] Next, the main storage array generates a consistency check request and sends the first CRC check result of each data block in the target stripe to the second controller corresponding to the secondary storage array. The request also includes the logical block address information of the data block so that the secondary storage array can correctly match the corresponding data block. After receiving the request, the second controller of the secondary storage array determines the physical location of the data block in the secondary storage array according to the logical block address, performs a CRC check on the target data block, and calculates the second CRC check result. Then, the second controller compares the calculated second CRC check result with the first CRC check result provided by the main storage array. The comparison result is used to identify the address information of the candidate bad blocks in the target stripe, and feeds this address information back to the first controller of the main storage array.

[0152] Afterwards, the main storage array calculates the consistency ratio based on the candidate bad block address information returned from multiple secondary storage arrays. The consistency ratio indicates the consistency level of the returned candidate bad block address information in all secondary storage arrays. If the consistency ratio does not reach the preset ratio, the main storage array determines that the returned candidate bad block information is unreliable and notifies the relevant data block that it cannot be repaired; if the consistency ratio reaches the preset ratio, the main storage array locates the bad block in the main storage array based on the consistent candidate bad block address information, and notifies the repair function module to perform the repair operation. When the consistency ratio reaches the preset value, the repair module calls the data copy in the secondary storage array based on the specific address information of the candidate bad block to complete the repair operation of the bad block in the main storage array.

[0153] In summary, the present application overcomes the limitations of the traditional single storage array CRC check on problems such as read and write offsets through the coordinated verification of the main storage array and the secondary storage array, effectively reduces the data calculation pressure of the main array, and improves the bad block positioning rate.

[0154] Optionally, repairing the bad data blocks in the target stripe according to the secondary storage array corresponding to the target second controller further includes:

[0155] After the consistency ratio reaches a preset ratio, the first controller notifies the secondary storage array corresponding to the target second controller to repair the bad data blocks in the target stripe.

[0156] In an optional implementation, the full combination method can also be used to deal with the complex situation when there are two or more bad blocks in a stripe. Based on the idea of ​​full combination, the accuracy of bad block location is further improved by constructing and comparing possible check block data. Specifically, when the RAID check detects that a stripe has data corruption, if the preliminary consistency check cannot locate the only bad block through the CRC check result, the system can assume that there may be two data blocks in the stripe that are abnormal. On this basis, the data block combinations in the stripe are selected one by one in the full combination method, and the check block data is constructed for each combination.

[0157] Based on the same inventive concept, the embodiment of the present application also provides a bad data block locating device 700 .

[0158] like Figure 7 As shown, it is a schematic diagram of the structure of a bad data block location device, which may include:

[0159] A determination unit 701 is used to perform a RAID check on the primary storage array to determine a target stripe with bad blocks;

[0160] The sending unit 702 is used to send the first CRC check result of each data block in the target stripe to the second controller in the cluster, so that the second controller obtains the address information of the candidate bad block by comparing the second CRC check result of the corresponding data block in the secondary storage array with the first CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0161] The positioning unit 703 is used to locate the bad data block in the main storage array according to the received address information.

[0162] Optionally, the sending unit 702 is specifically configured to:

[0163] If it is determined that each data block is normal according to the first CRC check result of each data block, then obtaining the first physical address of each data block in the main storage array;

[0164] According to the first physical address of each data block and the preset address mapping relationship, the logical block address of each data block is obtained; the logical block address of each data block is used to determine the second physical address of the data block in the secondary storage array, so that the second controller performs CRC check on the corresponding data block according to the second physical address;

[0165] A consistency check request generated according to the first CRC check result and the logic block address is sent to a second controller in the cluster.

[0166] Optionally, the second controller has at least one; the first CRC check result of the candidate bad block is inconsistent with the corresponding at least one second CRC check result; the sending unit 702 is specifically used to:

[0167] Determine the consistency ratio according to the address information returned by each second controller; the consistency ratio represents: the proportion of target second controllers whose address information of each candidate bad block returned is the same among the second controllers;

[0168] If the consistency ratio reaches a preset ratio, the bad data block in the target stripe is located according to the address information returned by the target second controller, and the bad data block in the target stripe is repaired according to the secondary storage array corresponding to the target second controller;

[0169] If the consistency ratio does not reach the preset ratio, it is determined that the address information returned by each second controller is unreliable.

[0170] Optionally, the determining unit 701 is specifically configured to:

[0171] Perform periodic RAID checks on each stripe of the main storage array to determine the target stripe with bad data blocks;

[0172] Alternatively, after receiving a data read request, the stripe where the read data is located is determined, and a RAID check is performed on the stripe; if the RAID check result is inconsistent, the stripe is determined to be a target stripe with bad data blocks.

[0173] Based on the same inventive concept, the embodiment of the present application also provides another bad data block location device 800. Figure 8 As shown, it is a schematic diagram of the structure of a bad data block location device, which may include:

[0174] The receiving unit 801 is used to receive a first CRC check result of each data block in a target stripe sent by a first controller in the cluster; the target stripe is a stripe with bad blocks determined by performing RAID check on a primary storage array;

[0175] A calculation unit 802 is used to perform a CRC check on a corresponding data block in a secondary storage array to obtain a second CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array;

[0176] The address sending unit 803 is used to determine the address information of the candidate bad block by comparing the first CRC check result with the second CRC check result, and send the address information to the first controller, so that the first controller can locate the bad data block in the main storage array according to the address information. Optionally, the first CRC check result is sent by the first controller through a consistency check request, and the consistency check request also includes the logical block address of each data block; the address sending unit 803 is specifically used to:

[0177] For each data block, perform the following operations:

[0178] Determine the second physical address of the data block in the secondary storage array according to the logical block address of the data block; the logical block address is obtained by the first controller through the first physical address of the corresponding data block in the primary storage array and a preset address mapping relationship;

[0179] Performing a CRC check on the data block according to the second physical address to obtain a second CRC check result of the data block;

[0180] If the first CRC check result of the data block is inconsistent with the second CRC check result, the data block is determined to be a candidate bad block, and address information of the candidate bad block is determined.

[0181] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0182] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0183] After introducing the data bad block location method and device according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0184] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0185] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a storage array cluster, such as Figure 1 The storage array cluster 120 is shown. In this embodiment, the structure of the electronic device can be as follows Fig. 9 As shown, it includes a memory 901 , a communication module 903 and one or more processors 902 .

[0186] The memory 901 is used to store computer programs executed by the processor 902. The memory 901 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0187] The memory 901 may be a volatile memory, such as a random-access memory (RAM); the memory 901 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 901 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 901 may be a combination of the above memories.

[0188] The processor 902 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 902 is used to implement the above-mentioned bad data block location method when calling the computer program stored in the memory 901 .

[0189] The communication module 903 is used to communicate with terminal devices and other servers.

[0190] The specific connection medium between the memory 901, the communication module 903 and the processor 902 is not limited in the embodiment of the present application. Fig. 9In the embodiment, the memory 901 and the processor 902 are connected via a bus 904. The bus 904 is connected to the processor 902 via a bus 904. Fig. 9 The connections between the other components are only for illustration and are not intended to be limiting. The bus 904 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig. 9 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0191] The memory 901 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the data bad block location method of the embodiment of the present application. The processor 902 is used to execute the above-mentioned data bad block location method, such as Figure 2 or Figure 5 shown.

[0192] In some possible implementations, various aspects of the data bad block location method provided in the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the data bad block location method according to various exemplary implementations of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 2 Medium or Figure 5 Steps shown.

[0193] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0194] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0195] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.

[0196] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program commands. These computer program commands can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the commands executed by the processor of the computer or other programmable data processing device generate commands for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0197] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0198] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for locating a bad data block, applied to a first controller in a cluster, the method comprising: Perform a RAID check on the primary storage array to determine the target stripe with bad blocks; sending the first cyclic redundancy CRC check result of each data block in the target stripe to the second controller in the cluster, so that the second controller obtains the address information of the candidate bad block by comparing the second CRC check result of the corresponding data block in the secondary storage array with the first CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array; The bad data blocks in the main storage array are located according to the received address information.

2. The method according to claim 1, characterized in that The step of sending the first cyclic redundancy CRC check result of each data block in the target stripe to the second controller in the cluster includes: If it is determined that each of the data blocks is normal according to the first CRC check result of each of the data blocks, obtaining a first physical address of each of the data blocks in the main storage array; According to the first physical address of each data block and the preset address mapping relationship, the logical block address of each data block is obtained; the logical block address of each data block is used to determine the second physical address of the data block in the secondary storage array, so that the second controller performs CRC check on the corresponding data block according to the second physical address; A consistency check request generated according to the first CRC check result and the logic block address is sent to a second controller in the cluster.

3. The method according to claim 1, characterized in that The second controller has at least one; the first CRC check result of the candidate bad block is inconsistent with the corresponding at least one second CRC check result; Locating bad data blocks in the main storage array according to the received address information also includes: Determine the consistency ratio according to the address information returned by each second controller; the consistency ratio represents: the proportion of target second controllers whose address information of each candidate bad block returned is the same among the second controllers; If the consistency ratio reaches a preset ratio, the bad data block in the target stripe is located according to the address information returned by the target second controller, and the bad data block in the target stripe is repaired according to the secondary storage array corresponding to the target second controller; If the consistency ratio does not reach the preset ratio, it is determined that the address information returned by each second controller is unreliable.

4. The method according to claim 1, characterized in that The performing of a RAID check on the primary storage array to determine a target stripe with bad data blocks includes: Performing periodic RAID checks on each stripe of the primary storage array to determine a target stripe where bad data blocks exist; Alternatively, after receiving a data read request, the stripe where the read data is located is determined, and a RAID check is performed on the stripe; if the RAID check result is inconsistent, the stripe is determined to be a target stripe with bad data blocks.

5. A method for locating a bad data block, applied to a second controller in a cluster, the method comprising: receiving a first CRC check result of each data block in the target stripe sent by a first controller in the cluster; The target stripe is: a stripe with bad blocks determined by performing RAID check on the main storage array; Performing CRC check on the corresponding data block in the secondary storage array to obtain a second CRC check result; The secondary storage array is a copy obtained by writing data synchronously with the primary storage array; By comparing the first CRC check result and the second CRC check result, address information of the candidate bad block is determined, and the address information is sent to the first controller, so that the first controller locates the bad data block in the main storage array according to the address information.

6. The method according to claim 5, characterized in that The first CRC check result is sent by the first controller through a consistency check request, and the consistency check request also includes a logical block address of each data block; The determining address information of the candidate bad block according to the first CRC check result and the second CRC check result includes: For each data block, perform the following operations: Determine a second physical address of the data block in the secondary storage array according to the logical block address of the data block; the logical block address is obtained by the first controller through the first physical address of the corresponding data block in the primary storage array and a preset address mapping relationship; Performing a CRC check on the data block according to the second physical address to obtain a second CRC check result of the data block; If the first CRC check result and the second CRC check result of the data block are inconsistent, the data block is determined to be a candidate bad block, and address information of the candidate bad block is determined.

7. A bad data block location device, applied to the first controller of a cluster, characterized in that: include: A determination unit, used to perform RAID verification on the main storage array to determine a target stripe where a bad block exists; a sending unit, configured to send a first CRC check result of each data block in the target stripe to a second controller in the cluster, so that the second controller obtains address information of a candidate bad block by comparing a second CRC check result of a corresponding data block in a secondary storage array with the first CRC check result; the secondary storage array is a copy obtained by synchronously writing data with the primary storage array; A positioning unit is used to locate bad data blocks in the main storage array according to the received address information.

8. A bad data block location device, applied to the second controller of a cluster, characterized in that: include: A receiving unit, configured to receive a first CRC check result of each data block in a target stripe sent by a first controller in the cluster; The target stripe is: a stripe with bad blocks determined by performing RAID check on the main storage array; A calculation unit, configured to perform a CRC check on a corresponding data block in the secondary storage array to obtain a second CRC check result; The secondary storage array is a copy obtained by writing data synchronously with the primary storage array; The address sending unit is used to determine the address information of the candidate bad block by comparing the first CRC check result and the second CRC check result, and send the address information to the first controller so that the first controller locates the data bad block in the main storage array according to the address information.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 6.

Citation Information

Cited By

  • Control method of disk array and electronic equipment

    CN120929347A

  • Method for controlling a disk array and electronic device

    CN120929347B

  • Dynamic fault tolerance and replacement system and method for bad block of flash memory

    CN121918769A