Abnormal block determination method, device and equipment and readable storage medium
By calculating and comparing the verification information on the abnormal strip, the problem of the inability to determine the abnormal blocking on the abnormal strip is solved, and the accurate repair and efficiency of the abnormal strip are achieved.
Patent Information
- Application Number
- CN202411736911.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-29
AI Technical Summary
The prior art cannot determine the abnormal blocking on the abnormal strip, resulting in the inability to accurately repair.
By calculating the first verification information of each granularity on the abnormal band and the second verification information obtained from the verification area, the verification codes are compared to determine the abnormal blocking.
Accurate positioning and repair of abnormal blocks on abnormal strips is achieved, and the accuracy and efficiency of abnormal strip repair is improved.
Smart Images

Figure CN119576238A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to an abnormal block determination method, device, equipment and a readable storage medium. Background Art
[0002] When a RAID (Redundant Array of Independent Disks) array inspection finds data inconsistency, it can only determine which stripe is inconsistent, but cannot determine which block on the inconsistent stripe has a problem. Therefore, the existing technology can only detect stripe anomalies, but cannot determine which block on the stripe is abnormal.
[0003] Therefore, how to determine the abnormal blocks on the abnormal strip is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, equipment and readable storage medium for determining abnormal blocks, which solve the problem that the abnormal blocks on the abnormal stripes cannot be determined in the prior art.
[0005] In order to solve the above technical problems, the present invention provides a method for determining abnormal blocks, comprising:
[0006] The first verification information of each granularity on the abnormal stripe is calculated according to the data on the abnormal stripe; the granularity is less than or equal to the block granularity;
[0007] Acquire second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated according to the written information when writing data;
[0008] Determine abnormal blocks according to the first verification information and the second verification information.
[0009] On the one hand, the granularity setting process includes:
[0010] Taking a storage sector as a granularity, the abnormal stripe includes multiple blocks, and each block includes multiple storage sectors.
[0011] On the one hand, determining abnormal blocks according to the first verification information and the second verification information includes:
[0012] Comparing the verification codes of the first verification information and the second verification information;
[0013] The blocks with inconsistent check codes are determined as erroneous blocks.
[0014] On the one hand, the verification code calculation process of the second verification information includes:
[0015] When writing data, the check code of each granularity on the abnormal stripe is calculated according to the writing position and the writing data.
[0016] On the one hand, after comparing the verification codes of the first verification information and the second verification information, the method further includes:
[0017] If the check codes are consistent, the total number of times the abnormal stripe writes data, the first bitmap of the first check information, the processing sequence number and the second bitmap of the second check information are obtained;
[0018] Determine whether a block is missed based on the total number of times, the first bitmap, the processing sequence number and the second bitmap.
[0019] On the one hand, determining whether a missing block occurs according to the total number of times, the first bitmap, the processing sequence number and the second bitmap includes:
[0020] Determine the target block according to the total number of times and the processing sequence number;
[0021] Obtaining a new bitmap according to the number of the target block and the first bitmap;
[0022] If the new bitmap is inconsistent with the second bitmap in the second verification information, the missing block is determined according to the difference between the new bitmap and the second bitmap.
[0023] On the one hand, the calculation process of the processing sequence number in the second verification information includes:
[0024] When writing data, the processing sequence number of each granularity on the stripe is determined based on the write position and the number of writes.
[0025] The present invention also provides an abnormal block determination device, comprising:
[0026] A first check information calculation module, used for calculating first check information of each granularity on the abnormal stripe according to the data on the abnormal stripe; the granularity is less than or equal to the block granularity;
[0027] A second verification information acquisition module is used to obtain second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated according to the written information when writing data;
[0028] An abnormal block determination module is used to determine abnormal blocks according to the first verification information and the second verification information.
[0029] The present invention also provides an abnormal block determination device, comprising:
[0030] Memory for storing computer programs;
[0031] A processor is used to implement the steps of the abnormal block determination method as described above when executing the computer program.
[0032] The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the steps of the abnormal block determination method as described above are implemented.
[0033] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above-mentioned abnormal block determination method when executed by a processor.
[0034] It can be seen from the above technical scheme that the present invention obtains the first verification information of each granularity on the abnormal stripe by calculating according to the data on the abnormal stripe; the granularity is less than or equal to the block granularity; the second verification information of each granularity on the abnormal stripe is obtained from the verification area; the second verification information is the information calculated according to the write information when writing data; the abnormal block is determined according to the first verification information and the second verification information. The beneficial effect of the present invention is that the present invention calculates the verification information according to the write information when writing data and records it in the verification area. In this way, when the stripe is abnormal, the verification information of each granularity calculated based on the data on the abnormal stripe is combined with the verification information of each granularity recorded when writing data to determine which block has a problem. The problem of being unable to determine which block of the abnormal stripe is abnormal is solved, so that the subsequent targeted and accurate repair of the abnormal stripe can be achieved, and the accuracy and efficiency of the abnormal stripe repair are improved.
[0035] In addition, the present invention also provides an abnormal block determination device, equipment and readable storage medium, which also have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0037] Figure 1 This is an example diagram of a RAID;
[0038] Figure 2 A flowchart of a method for determining abnormal blocks provided by an embodiment of the present invention;
[0039] Figure 3 A position diagram provided for an embodiment of the present invention;
[0040] Figure 4An example flow chart of a method for generating information in a data writing process provided by an embodiment of the present invention;
[0041] Figure 5 An example flow chart of a method for determining an error block provided by an embodiment of the present invention;
[0042] Figure 6 An example flow chart of a method for determining a missed block provided by an embodiment of the present invention;
[0043] Figure 7 A schematic diagram of the structure of an abnormal block determination device provided by an embodiment of the present invention;
[0044] Figure 8 A schematic diagram of the structure of an abnormal block determination device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] First, some terms used in this application are explained:
[0047] IO: Input / Output, input / output.
[0048] Write IO: write data.
[0049] Sector: storage sector.
[0050] Bit: binary bit.
[0051] Bitmap: A bitmap formed by bits.
[0052] Lba: Logical Block Address, logical address.
[0053] Data striping and parity checking are two main basic features of RAID. Data striping is to divide a continuous IO (Input / Output) data sent by the host into many blocks and store them on different disks. Figure 1As shown in the figure, each row is a stripe. Parity check is that RAID uses the data blocks on the stripe to calculate the corresponding parity block through the XOR algorithm and write it to the specified disk. When the data on a disk of RAID is damaged, the damaged data can be restored using the remaining data blocks and parity blocks. Figure 1 As shown, P and Q are check blocks, and the others are data blocks. It should be made clear here that the data block belongs to the user and can be read and written by the user; while the check block only belongs to the RAID module and is used to ensure the security of the data block and is invisible to the user.
[0054] Since the P and Q check blocks on each stripe are calculated by the XOR algorithm using the data blocks on the stripe, the new P and Q check blocks are recalculated using the data blocks on the stripe and compared with the P and Q check blocks stored on the disk. The comparison results should be completely consistent. If they are inconsistent, it means that there is an error in the block data on the stripe. This detection process is the RAID inspection task. The inspection task detects the entire RAID at a preset period to ensure the consistency of the data on the RAID. If there is a problem with the block data on the stripe, then when the disk fails, the faulty block data reconstructed using the remaining data blocks on the stripe and the P and Q check blocks is wrong, which undoubtedly leads to customer data loss and affects the reliability of the storage system.
[0055] At present, when data inconsistency is found, only an alarm will be issued to indicate which stripe is inconsistent (i.e., an abnormal stripe is prompted). It is impossible to determine which block on the stripe has an error. It may be an error in the check block or a data block. To repair the consistency of the stripe and eliminate the data error, it is necessary to confirm which block on the stripe has an error. In theory, the customer can confirm whether the data block is normal. If the customer is sure that the data block is normal, then there is an error in the P and Q check blocks; if the data block is wrong, the customer needs to confirm which data block on the stripe has an error. However, it is undoubtedly like looking for a needle in a haystack to confirm whether a certain block is wrong in a massive amount of data. Therefore, the current method of repairing the stripe is to assume that all data blocks are correct and calculate and rewrite the P and Q check blocks. This repair method has great disadvantages. If there is a problem with the data block on the stripe, not only will the wrong data not be repaired, but the correct P and Q check blocks will also have errors. If a disk failure occurs after the repair, the reconstructed data will also be wrong, causing the wrong data to spread further, greatly reducing the reliability of the storage device, failing to ensure the security of customer storage data, and seriously affecting the user experience.
[0056] The present invention proposes a method for determining abnormal blocks, which can determine which block on the abnormal stripe is wrong, and then accurately repair the erroneous data to ensure the security of customer storage data. Figure 2 , Figure 2A flowchart of a method for determining abnormal blocks provided by an embodiment of the present invention. The method may include:
[0057] S101: Calculate first verification information of each granularity on the abnormal stripe according to data on the abnormal stripe; the granularity is less than or equal to the block granularity.
[0058] The execution subject of this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as the operation of the abnormal block determination method can be completed. The abnormal stripe in this embodiment is a stripe with inconsistent check blocks. Specifically, it is a stripe whose new P and Q check blocks recalculated based on the data blocks on the stripe are found through the RAID inspection task, and the comparison results of the P and Q check blocks stored on the disk are inconsistent. When the stripe is found to be abnormal through the RAID inspection task, the check information of each granularity on the stripe is calculated based on the data on the abnormal stripe. It should be noted that the granularity is used to describe the size of the processing unit. For example, this embodiment can use blocks as granularity; or storage sectors can also be used as granularity. It can be understood that this embodiment needs to determine which block on the abnormal stripe is abnormal, so the granularity in this embodiment needs to be less than or equal to the block. This embodiment does not limit the blocks. That is to say, this method can determine both abnormal check blocks and abnormal data blocks. This embodiment does not limit the check information. For example, the verification information may include a verification code calculated based on the data on the stripe; or may be other verification information calculated based on the data on the stripe that can verify data consistency.
[0059] Furthermore, the process of setting the granularity may specifically include the following steps:
[0060] Taking a storage sector as a granularity, the abnormal stripe includes multiple blocks, and each block includes multiple storage sectors.
[0061] Specifically, there are multiple blocks on a stripe, and each block is composed of storage sectors. For example, there are up to 16 blocks on each stripe, each block is composed of 512 sectors (storage sectors), and each sector can store 512 bytes of data. Since the size of write IO (write data) is different, the space occupied by the data written to the block each time is also different. Therefore, in order to improve the accuracy of the calculation of the verification information, the minimum granularity sector is used as the granularity in this embodiment.
[0062] S102: Acquire second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated based on the write information when writing data.
[0063] Specifically, during the write IO process, the verification information of each granularity on the stripe can be obtained based on the write information and recorded in the verification area. The location of the verification area is not limited in this embodiment. For example, the verification information of each granularity is placed in the same position as the verification area. It is also possible that each verification area is closely followed by each granularity. In order to facilitate the acquisition of verification information and the accuracy of the storage of verification information, this embodiment adds the verification information of each granularity to the end of the data area of each granularity. Taking the storage sector as the granularity, please refer to Figure 3 , Figure 3 The verification area in is used to store the second verification information.
[0064] S103: Determine abnormal blocks according to the first verification information and the second verification information.
[0065] The abnormal blocks in this embodiment can be understood as problematic blocks. The judgment process can be that when the verification information is inconsistent, the block is considered abnormal; when the verification information is consistent, the block is considered normal. This embodiment does not limit the abnormal blocks. For example, abnormal blocks can include error blocks and missed blocks. Then the process of using the verification information to determine the abnormal blocks can include: determining whether there is an error block based on the error block verification information, and if not, further determining whether there is a missed block based on the missed block verification information. It can be understood that the verification information content of the error block verification information and the missed block verification information is inconsistent. This embodiment determines whether each block is abnormal by comprehensively detecting each block, and further determines the abnormal type of the abnormal block.
[0066] The second check information is the information stored when writing data. For example, the second check information may include a data CRC check code (check code for short), which is used to detect whether there are erroneous blocks in the abnormal stripe and locate the erroneous blocks; the second check information may also include a processing sequence number and a bitmap (Bitmap, a bitmap formed by bits), which is used to detect whether there are missed blocks in the abnormal stripe and locate the missed blocks. When writing data, the check code of each granularity on the abnormal stripe is calculated based on the write position and the write data; the processing sequence number and bitmap of each granularity on the abnormal stripe are obtained based on the write position and the number of writes. In this way, when the storage sector is used as the granularity, the check information of the check area includes a 4-byte check code, a 4-byte processing sequence number, and a 2-byte bitmap. Since there are a maximum of 16 blocks on each stripe, 16 bits can be used to represent all the blocks on the stripe, so the bitmap only takes up two bytes. The checksum is the result of XORing 512 bytes in the storage sector; the processing sequence number indicates the number of write IOs processed by the stripe when the storage sector was last written with data; and the bitmap indicates which blocks have data written to them in a certain write IO.
[0067] The data writing process and recorded information (processing sequence number, checksum, bitmap and total number of stripe write data) can be referred to Figure 4 . (1) After creating RAID, metadata will be created to manage the number of times each stripe of RAID processes write IO. After the metadata is created, it is all initialized to 0, indicating that each stripe of the created RAID has not processed write IO. (2) After receiving a write IO, RAID first calculates which stripe it falls on based on the lba of the IO, and reads the metadata to obtain the number of times the stripe processes write IO, adds one to the number of times the stripe writes data, and then updates the metadata information (i.e., the total number of times the stripe writes data). (3) Calculate which blocks on the stripe the write IO will write data to, and generate a bitmap of the IO processing blocks based on the block numbers that need to be written to the disk, recording which block the write IO has written data to. (4) Loop through the blocks that need to be written, and calculate the checksum information for each storage sector on each block: first, perform XOR on the 512 bytes on the storage sector to obtain the checksum; then update the checksum information together with the number of write IOs (i.e., the processing sequence number) obtained in (2) and the bitmap of the IO processing blocks obtained in (3), and write it to the disk together with the data content to be written. The relationship between the processing sequence number and the total number of times the stripe writes data can be referred to the following example: if the processing sequence number of storage sector A is 50, and the write data falls on the A storage sector position of block A of stripe A, and the total number of times the write data falls on stripe A is 66, then the processing sequence number of storage sector A is updated to 66.
[0068] Furthermore, the above-mentioned determination of abnormal blocks according to the first verification information and the second verification information may specifically include the following steps:
[0069] Step 21: Compare the verification codes of the first verification information and the second verification information;
[0070] Step 22: Determine the blocks with inconsistent check codes as erroneous blocks.
[0071] The verification information in this embodiment may be a verification code, and whether there is an erroneous block in the abnormal stripe is determined by whether the verification code is consistent. It should be noted that the verification code is the result of XOR calculation of the data in each granularity. For example, the result of XOR calculation of 512 bytes of data in each storage sector. For details, please refer to Figure 5 , Figure 5A flowchart of an error block determination method provided by an embodiment of the present invention. When the RAID inspection finds that the stripe data is inconsistent, all the block data on the stripe are first read into the memory. Each block on the stripe is traversed one by one, and the 512 storage sectors of each block are traversed one by one. The data of the 512 bytes of the storage sector are XORed to obtain the current check code (i.e., the check code of the first check information). Then the calculated check code is compared with the check code stored in the check area (i.e., the check code of the second check information). If the two are inconsistent, it means that the data in the storage sector is wrong, so it can be confirmed which block on the inconsistent stripe is wrong, and it can also be confirmed which storage sector on the block has error data; if the two are consistent, it means that there is no error data in the storage sector, and then continue to traverse the next storage sector of the block until all storage sectors of the block are traversed, and then continue to traverse the next block on the stripe until all blocks on the stripe are traversed. If all traversals are completed and no erroneous data is found, it means that the stripe inconsistency is not caused by data errors, but by data errors caused by missed blocks when processing write IO.
[0072] Furthermore, after comparing the check codes of the first check information and the second check information, the following steps may be further included:
[0073] Step 31: If the verification codes are relatively consistent, the total number of times the abnormal stripe writes data, the first bitmap of the first verification information, the processing sequence number of the second verification information, and the second bitmap are obtained;
[0074] Step 41: Determine whether a block is missed based on the total number of times, the first bitmap, the processing sequence number and the second bitmap.
[0075] It can be understood that the total number of times data is written is calculated cumulatively based on the number of stripes written during the write IO process. The first bitmap of the first verification information is a bitmap formed based on the current bit of the abnormal stripe. The processing sequence number and the second bitmap in the second verification information are both data calculated when writing data. When the verification code is relatively consistent, it means that there is no erroneous block in the abnormal stripe, then there may be a missed block, and which block is missed is determined based on the total number of times, the first bitmap, the processing sequence number and the second bitmap.
[0076] Further, determining whether a block is missed according to the total number of times, the first bitmap, the processing sequence number and the second bitmap may specifically include the following steps:
[0077] Step 411: Determine the target block according to the total number of times and the processing sequence number;
[0078] Step 412: Obtain a new bitmap according to the number of the target block and the first bitmap;
[0079] Step 413: If the new bitmap is inconsistent with the second bitmap in the second verification information, the missing blocks are determined according to the difference between the new bitmap and the second bitmap.
[0080] Specifically, the total number of write IOs of the abnormal stripe can be obtained from the metadata, and the processing sequence number of each granularity can be obtained from the check area. The block corresponding to the processing sequence number equal to the total number of times is used as the target block. The target block is the last write IO overwrite position processed by the abnormal stripe. A new bitmap is calculated based on the target block number and the first bitmap, and the new bitmap is compared with the bitmap of the target block pre-stored in the check area to see if they are consistent. If they are inconsistent, the difference between the two bitmaps can be used to determine which block has been missed. For details, please refer to Figure 6 , Figure 6 The following is a flowchart of a method for determining a missed write block provided by an embodiment of the present invention. (1) The number of times the inconsistent stripe processes write IO (i.e., the total number of times) is obtained from metadata. (2) Each block on the stripe is traversed one by one, and the 512 storage sectors of each block are traversed one by one, and the number of times the write IO is processed (i.e., the processing sequence number) is obtained from the verification information of the storage sector. Compare the obtained write IO processing times with the write IO processing times in the sector verification information (i.e., compare the total times and the processing sequence number). If the two are consistent, it means that the storage sector is the last write IO coverage position of the stripe processing, then the block where the storage sector is located is the target block, and the IO processing block bitmap (i.e., the pre-recorded target block bitmap) is obtained from the verification information of the storage sector, and the block number of the block is recorded for calculating the new IO processing block bitmap (i.e., the new bitmap); if the two are inconsistent, it means that the storage sector is not the last write IO coverage position of the stripe processing, then continue to traverse the next storage sector of the block until all storage sectors of the block are traversed, and then continue to traverse the next block on the stripe until all blocks on the stripe are traversed. (3) According to the recorded block number, calculate the new IO processing block bitmap and compare it with the IO processing block bitmap obtained from the verification information of the storage sector. If the two are consistent, it means that no block is missed; if the two are inconsistent, which block is missed can be confirmed based on the difference between the two bitmaps.
[0081] Furthermore, in order to improve the detection efficiency of abnormal blocks, after determining the blocks with inconsistent check codes as erroneous blocks, the following may also be included:
[0082] Perform data recovery on the error block to obtain the recovery stripe;
[0083] Determine whether the recovery strip is abnormal;
[0084] If so, obtain the total number of times the recovery stripe writes data, calculate the third bitmap of each granularity based on the data on the recovery stripe, and calculate the processing sequence number and fourth bitmap of each granularity on the recovery stripe based on the write calculation information when writing data; determine the missed blocks on the recovery stripe based on the total number of times the recovery stripe writes data, the third bitmap, the processing sequence number of each granularity on the recovery stripe, the fourth bitmap and the fourth bitmap.
[0085] When the present embodiment detects that there is an error block in the abnormal stripe, the error block is promptly recovered, and after the data is recovered. The RAID inspection task can be used to detect whether there are still problems in the recovery stripe. If there are, it means that the abnormal stripe not only has error blocks, but also has missed blocks. Therefore, the above-mentioned missed blocks determination method can be used to detect each block on the recovery stripe to determine the missed blocks position. In this way, the abnormal stripe with only error blocks is promptly recovered, and it can also be quickly detected whether there are other problems in the abnormal stripe, such as missed blocks. In this way, the abnormal stripe with both error blocks and missed blocks is recovered in many aspects to ensure that the data recovery is complete and the stripe is repaired correctly.
[0086] Furthermore, this embodiment determines the abnormal block of the abnormal stripe in the RAID based on the verification information. It can be further extended to other levels, such as expanding the host write IO data structure and adding verification information, so that end-to-end data protection can be achieved. When the content of the write IO is tampered through each module of the storage stack, the problem can be quickly and effectively discovered to avoid wrong data from being stored on the disk, resulting in customer data errors.
[0087] The abnormal block determination method provided by the embodiment of the present invention is applied, and the first verification information of each granularity on the abnormal stripe is obtained by calculation based on the data on the abnormal stripe; the granularity is less than or equal to the block granularity; the second verification information of each granularity on the abnormal stripe is obtained from the verification area; the second verification information is information calculated based on the write information when writing data; the abnormal block is determined based on the first verification information and the second verification information. The present invention calculates verification information based on the write information when writing data and records it in the verification area. In this way, when the stripe is abnormal, the verification information of each granularity calculated based on the data on the abnormal stripe is combined with the verification information of each granularity recorded when writing data to determine which block has a problem. The problem of being unable to determine which block of the abnormal stripe is abnormal is solved, so that the subsequent targeted and accurate repair of the abnormal stripe can be achieved, and the accuracy and efficiency of the abnormal stripe repair are improved. In addition, the storage and comparison of verification information using the smallest granularity storage sector as a unit can ensure the accuracy of the comparison result. In addition, the verification code is used to determine whether there is an erroneous block in the abnormal stripe and to confirm which block is the erroneous block (i.e., the location of the erroneous block). The processing sequence number and bitmap are used to determine whether there is a missed block in the abnormal stripe and to confirm which block is the missed block (i.e., the location of the missed block). This can achieve precise positioning and can also realize multiple abnormal block detection.
[0088] The abnormal block determination device provided by an embodiment of the present invention is introduced below. The abnormal block determination device described below and the abnormal block determination method described above can be referred to each other.
[0089] Please refer to Figure 7 , Figure 7 A schematic diagram of a structure of an abnormal block determination device provided by an embodiment of the present invention may include:
[0090] A first check information calculation module 100 is used to calculate the first check information of each granularity on the abnormal stripe according to the data on the abnormal stripe; the granularity is less than or equal to the block granularity;
[0091] The second verification information acquisition module 200 is used to obtain the second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated according to the written information when writing data;
[0092] The abnormal block determination module 300 is used to determine the abnormal block according to the first verification information and the second verification information.
[0093] Based on the above embodiment, the first verification information calculation module 100 may include:
[0094] The granularity setting unit is used to set a storage sector as a granularity, the abnormal stripe includes multiple blocks, and each block includes multiple storage sectors.
[0095] Based on the above embodiment, the abnormal block determination module 300 may include:
[0096] A verification code comparison unit, used to compare the verification codes of the first verification information and the second verification information;
[0097] The error block determination unit is used to determine the blocks with inconsistent check codes as error blocks.
[0098] Based on the above embodiment, the check code comparison unit may include:
[0099] The check code calculation subunit is used to calculate the check code of each granularity on the abnormal stripe according to the write position and the write data when writing data.
[0100] Based on the above embodiment, the abnormal block determination device may further include:
[0101] An information acquisition module, configured to acquire, if the check codes are relatively consistent, the total number of times the abnormal stripe writes data, the first bitmap of the first check information, the processing sequence number and the second bitmap of the second check information;
[0102] A missed block determination module is used to determine whether a missed block occurs according to the total number of times, the first bitmap, the processing sequence number and the second bitmap.
[0103] Based on the above embodiment, the missing block determination module may include:
[0104] A target block determination unit, configured to determine a target block according to the total number of times and the processing sequence number;
[0105] A new bitmap acquisition unit, used for obtaining a new bitmap according to the number of the target block and the first bitmap;
[0106] A bitmap comparison unit is used to determine the missing block according to the difference between the new bitmap and the second bitmap if the new bitmap is inconsistent with the second bitmap in the second verification information.
[0107] Based on the above embodiment, the information acquisition module may include:
[0108] The processing sequence number acquisition unit is used to determine the processing sequence number of each granularity on the stripe according to the write position and the write number when writing data.
[0109] It should be noted that the order of the modules and units in the above-mentioned abnormal block determination device can be changed without affecting the logic.
[0110] The abnormal block determination device provided by the embodiment of the present invention is applied, through the first verification information calculation module 100, which is used to calculate the first verification information of each granularity on the abnormal stripe according to the data on the abnormal stripe; the granularity is less than or equal to the block granularity; the second verification information acquisition module 200 is used to obtain the second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is the information calculated according to the write information when writing data; the abnormal block determination module 300 is used to determine the abnormal block according to the first verification information and the second verification information. This device calculates the verification information according to the write information when writing data and records it in the verification area. In this way, when the stripe is abnormal, the verification information of each granularity calculated based on the data on the abnormal stripe is combined with the verification information of each granularity recorded when writing data to determine which block has a problem. The problem of being unable to determine which block of the abnormal stripe is abnormal is solved, so that the subsequent targeted and accurate repair of the abnormal stripe can be achieved, and the accuracy and efficiency of the abnormal stripe repair are improved. In addition, the storage and comparison of verification information using the smallest granularity storage sector as a unit can ensure the accuracy of the comparison result. In addition, the verification code is used to determine whether there is an erroneous block in the abnormal stripe and to confirm which block is the erroneous block (i.e., the location of the erroneous block). The processing sequence number and bitmap are used to determine whether there is a missed block in the abnormal stripe and to confirm which block is the missed block (i.e., the location of the missed block). This can achieve precise positioning and can also realize multiple abnormal block detection.
[0111] Figure 8 A schematic diagram of a structure of an abnormal block determination device provided by an embodiment of the present invention, such as Figure 8 As shown, the abnormal block determination device includes:
[0112] A memory 60, for storing computer programs;
[0113] The processor 61 is used to implement the steps of the abnormal block determination method in the above embodiment when executing the computer program.
[0114] The abnormal block determination device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0115] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0116] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the abnormal block determination method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include but is not limited to data determined by abnormal block, etc.
[0117] In some embodiments, the abnormal block determination device may further include a display screen 62 , an input / output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0118] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the abnormal block determination device, and may include more or less components than those shown in the figure.
[0119] It is understandable that if the abnormal block determination method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the contribution to the current technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.
[0120] Based on this, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned abnormal block determination method are implemented.
[0121] A computer program product provided in an embodiment of the present application is introduced below. The computer program product described below can be cross-referenced with other embodiments described in this document.
[0122] A computer program product includes a computer program / instruction, which implements the steps of the abnormal block determination method disclosed above when executed by a processor.
[0123] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0124] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0125] Finally, it should be noted that, in this article, relationships such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0126] The above is a detailed introduction to an abnormal block determination method, device, equipment and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for determining abnormal blocks, characterized in that: include: Obtaining first verification information of each granularity on the abnormal stripe by calculation according to the data on the abnormal stripe; The granularity is less than or equal to the block granularity; Acquire second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated according to the written information when writing data; Determine abnormal blocks according to the first verification information and the second verification information.
2. The abnormal block determination method according to claim 1 is characterized in that: The process of setting the granularity includes: Taking a storage sector as a granularity, the abnormal stripe includes multiple blocks, and each block includes multiple storage sectors.
3. The abnormal block determination method according to claim 1, characterized in that: Determining abnormal blocks according to the first verification information and the second verification information includes: Comparing the verification codes of the first verification information and the second verification information; The blocks with inconsistent check codes are determined as erroneous blocks.
4. The abnormal block determination method according to claim 3, characterized in that: The verification code calculation process of the second verification information includes: When writing data, the check code of each granularity on the abnormal stripe is calculated according to the writing position and the writing data.
5. The abnormal block determination method according to claim 3, characterized in that: After comparing the verification codes of the first verification information and the second verification information, the method further includes: If the check codes are consistent, the total number of times the abnormal stripe writes data, the first bitmap of the first check information, the processing sequence number and the second bitmap of the second check information are obtained; Determine whether a block is missed based on the total number of times, the first bitmap, the processing sequence number and the second bitmap.
6. The abnormal block determination method according to claim 5, characterized in that: Determining whether a missing block occurs according to the total number of times, the first bitmap, the processing sequence number, and the second bitmap includes: Determine the target block according to the total number of times and the processing sequence number; Obtaining a new bitmap according to the number of the target block and the first bitmap; If the new bitmap is inconsistent with the second bitmap in the second verification information, the missing block is determined according to the difference between the new bitmap and the second bitmap.
7. The abnormal block determination method according to claim 6, characterized in that: The calculation process of the processing sequence number in the second verification information includes: When writing data, the processing sequence number of each granularity on the stripe is determined based on the write position and the number of writes.
8. An abnormal block determination device, characterized in that: include: A first verification information calculation module, used for calculating the first verification information of each granularity on the abnormal stripe according to the data on the abnormal stripe; The granularity is less than or equal to the block granularity; A second verification information acquisition module is used to obtain second verification information of each granularity on the abnormal stripe from the verification area; the second verification information is information calculated according to the written information when writing data; An abnormal block determination module is used to determine abnormal blocks according to the first verification information and the second verification information.
9. An abnormal block determination device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the abnormal block determination method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by the processor, the steps of the abnormal block determination method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Anti-interference semantic encoding transmission method for patent search
CN105468622A
Data degradation storage method and device
CN108932176A
A method, a system and a terminal for calculating blocking strips of a disk, and a storage medium
CN112463036A
Method and system for repairing inconsistent stripe data in RAID
CN113626248A
Strip detection method, device and equipment and readable storage medium
CN117437967A
Cited By
Upgrading exception processing method and device
CN120353490A
Upgrade abnormality processing method and device
CN120353490B
Control method of disk array and electronic equipment
CN120929347A