RAID stripe data error correction method, device, equipment and readable storage medium
By reading redundant data in the RAID stripe error correction method and selecting appropriate rereading method according to the number of erases, the failure of the RAID stripe error correction method when reading redundant data is solved, and the error correction ability is improved and Efficiency extends the service life of the SSD.
Patent Information
- Application Number
- CN202411009021.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-07-26
AI Technical Summary
RAID stripe error correction methods are prone to read failures when reading redundant data, resulting in error correction failures. In some cases, existing hard decoding and soft decoding methods are inefficient and have insufficient error correction capabilities.
By reading the data of non-target storage units on the RAID strip except the target storage unit that needs to be corrected, and selecting hard decoding methods or soft decoding methods for rereading according to the number of erasing times of the super block, finally filling the target through XOR operation 存储单元的数据。
It improves the success rate and efficiency of RAID striped data error correction, extends the service life of solid-state drives, and enhances the ability to recover data.
Smart Images

Figure CN118535374B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage, and in particular to a RAID stripe data error correction method, device, equipment and readable storage medium. Background Art
[0002] When a solid state drive (SSD) is used in various complex environments, read errors caused by internal and external factors will inevitably occur, so error correction capabilities are particularly important. Hard Decode and Soft Decode are common physical error correction methods, among which Hard Decode is also called Read-Retry. In addition, the Redundant Arrays of Independent Disks (RAID) error correction method is also often used as the last line of defense. It is a logical error correction method based on the Exclusive OR (XOR) principle and uses redundant data to achieve the purpose of error correction.
[0003] RAID stripe error correction needs to read one or more storage unit data before performing XOR with one or more stripe (storage unit) data. At this time, read failure is very likely to occur. Once a read failure occurs and there is no hard decoding and soft decoding operations, RAID error correction will fail and the RAID error correction capability is weak. Summary of the invention
[0004] In order to solve the above technical problems, the embodiments of the present application provide a RAID stripe data error correction method, device, equipment and readable storage medium.
[0005] In a first aspect, an embodiment of the present application provides a RAID stripe data error correction method, the method comprising:
[0006] Read the data of the non-target storage units on the RAID stripe except the target storage unit that needs error correction;
[0007] If there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the erasure count of the super block, and the non-target storage unit is re-read according to the hard decoding method;
[0008] If the number of failed rereading of the data of the non-target storage unit reaches a preset number of rereading times, rereading the non-target storage unit according to a soft decoding method;
[0009] If rereading the data of the non-target storage unit is successful, performing an XOR operation on the data of the non-target storage unit that has been read;
[0010] The result of the XOR operation is filled into the location of the target storage unit.
[0011] In one embodiment, after reading the data of the non-target storage units other than the target storage unit to be corrected on the RAID stripe, the method further comprises:
[0012] If there is no failure in reading the data of the non-target storage unit, performing an XOR operation on the data of the non-target storage unit that has been read;
[0013] The result of the XOR operation is filled into the location of the target storage unit.
[0014] In one embodiment, selecting a hard decoding method according to the number of erasures of the super block, and rereading the non-target storage unit according to the hard decoding method, includes:
[0015] Obtaining a maximum erasure count of the solid state drive where the super block is located, and determining an erasure count threshold of the super block according to the maximum erasure count;
[0016] If the number of erasures of the super block is less than or equal to the erasure number threshold, selecting the hard decoding mode as concurrent rereading, and rereading the non-target storage unit according to the concurrent rereading;
[0017] If the erasure count of the super block is greater than the erasure count threshold, the hard decoding mode is selected as serial rereading, and the non-target storage unit is reread according to the serial rereading.
[0018] In one embodiment, the solid state drive includes a flash memory controller, and the rereading of the non-target storage unit according to the concurrent rereading includes:
[0019] Synchronously sending a plurality of reread commands to the flash memory controller according to all addresses of the non-target storage units, each reread command corresponding to one of the non-target storage units;
[0020] The flash memory controller rereads the non-target storage units in sequence according to the reread command;
[0021] The flash memory controller is polled to sequentially obtain the reread progress of each of the non-target storage units until the reread progress of all the non-target storage units is completed, thereby terminating the rereading.
[0022] In one embodiment, rereading the non-target storage unit according to the serial reread comprises:
[0023] Sending a reread command to the flash memory controller according to the address of the first non-target storage unit;
[0024] After waiting for the first non-target storage unit to be reread successfully, a reread command is sent to the flash memory controller according to the address of the second non-target storage unit until the reread of the last non-target storage unit is completed, thereby terminating the reread.
[0025] In one embodiment, before reading data of non-target storage units other than the target storage unit to be corrected on the RAID stripe, the method further includes:
[0026] Apply for cache space from the flash controller;
[0027] If rereading the data of the non-target storage unit fails, the cache space is released, and a RAID stripe error correction termination command is sent to the flash memory controller.
[0028] In one embodiment, rereading the non-target storage unit according to the soft decoding method includes:
[0029] Performing soft reading on the non-target storage cell by selecting offset voltages with different voltage magnitudes to obtain soft read data;
[0030] The soft read data is soft-decoded and then re-read.
[0031] In a second aspect, an embodiment of the present application provides a RAID stripe data error correction device, the RAID stripe data error correction device comprising:
[0032] A reading module, used for reading data of non-target storage units on the RAID stripe except the target storage unit to be corrected;
[0033] A first re-reading module, configured to determine if there is a failure in reading the data of the non-target storage unit, select a hard decoding method according to the number of erasures of the super block, and re-read the non-target storage unit according to the hard decoding method;
[0034] A second rereading module, configured to determine if the number of failed rereadings of the data of the non-target storage unit reaches a preset number of rereadings, and then reread the non-target storage unit according to a soft decoding method;
[0035] An XOR module, used for determining if rereading the data of the non-target storage unit is successful, and then performing an XOR operation on the data of the non-target storage unit that has been read;
[0036] The filling module is used to fill the result of the XOR operation into the position of the target storage unit.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and when the computer program is run by the processor, the RAID stripe data error correction method provided in the first aspect is executed.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which executes the RAID stripe data error correction method provided in the first aspect when running on a processor.
[0039] The RAID stripe data error correction method provided by the present application reads the data of the non-target storage units on the RAID stripe except the target storage unit to be corrected; if there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the number of erasures of the super block, and the non-target storage unit is reread according to the hard decoding method; if the number of failures in rereading the data of the non-target storage unit reaches a preset number of rereads, the non-target storage unit is reread according to the soft decoding method; if the rereading of the data of the non-target storage unit is successful, an XOR operation is performed on the data of the non-target storage unit that has been read; and the result of the XOR operation is filled into the position of the target storage unit. The present application selects a hard decoding method according to the number of erasures and performs a rereading in a soft decoding method according to the rereading situation of the hard decoding method, and performs an XOR operation on the data of the storage unit after the data is successfully reread, thereby improving the data error correction capability. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope of protection of the present application. In each of the drawings, similar components are numbered similarly.
[0041] Figure 1 A schematic diagram of a process of a RAID stripe data error correction method provided by an embodiment of the present application is shown;
[0042] Figure 2 Another schematic diagram of the process of the RAID stripe data error correction method provided by the embodiment of the present application is shown;
[0043] Figure 3 Another schematic diagram of a process of the RAID stripe data error correction method provided by an embodiment of the present application is shown;
[0044] Figure 4 Another schematic diagram of a process of the RAID stripe data error correction method provided by an embodiment of the present application is shown;
[0045] Figure 5A structural schematic diagram of a RAID stripe data error correction device provided in an embodiment of the present application is shown.
[0046] Icons: 500 - RAID stripe data error correction device, 501 - reading module, 502 - first re-reading module, 503 - second re-reading module, 504 - XOR module, 505 - filling module. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0048] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0049] Hereinafter, the terms "including", "having" and their cognates, which may be used in various embodiments of the present application, are intended only to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing items or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations of the foregoing items.
[0050] Furthermore, the terms “first”, “second”, “third”, etc. are merely used for distinguishing descriptions and are not to be understood as indicating or implying relative importance.
[0051] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.
[0052] Example 1
[0053] An embodiment of the present application provides a RAID stripe data error correction method, which is applied to an error correction module of firmware in a solid-state drive. The error correction module and the flash memory controller of the solid-state drive will use the method proposed in the present application to cooperate with each other to achieve rereading of erroneous data in the RAID stripe and complete data error correction.
[0054] See also Figure 1 ,RAID stripe data error correction methods include:
[0055] S101: Read data of non-target storage units on the RAID stripe except the target storage unit that needs error correction.
[0056] In this embodiment, the solid-state drive is composed of multiple super blocks, one super block corresponds to one stripe, and one stripe is composed of multiple storage unit data blocks. In the redundant array of independent disks (RAID) error correction system, when an uncorrectable (UNC) error occurs in the data of a storage unit, the RAID error correction module needs to traverse and read the data on all storage units (non-target storage units) except the storage unit to be corrected (target storage unit) in the RAID stripe during data recovery, and determine whether the data on other storage units can be read successfully.
[0057] It should be noted that the area granularity where the erroneous data appears may be all the data on a storage unit, or may be a part of the area (one or more storage planes) on a storage unit where the erroneous data appears. In this embodiment, the RAID error correction area granularity is not limited. Moreover, only one storage unit on the RAID stripe can have data that cannot be corrected, and the RAID error correction module can perform RAID error correction on the target storage unit. If there is more than one storage unit on the RAID stripe that cannot be corrected, the RAID error correction module cannot perform an exclusive OR (XOR) operation.
[0058] S102: If there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the erasure count of the super block, and the non-target storage unit is re-read according to the hard decoding method.
[0059] In this embodiment, RAID error correction depends on the correct reading back of data of all other non-target storage units on the RAID stripe except the target storage unit to be corrected. If the data reading of any non-target storage unit fails, the RAID error correction module cannot calculate the correct data through XOR to replace the erroneous target storage unit data block to be corrected, and the error correction process will end. If there is a data reading failure of a non-target storage unit in the RAID stripe, in order to ensure that the RAID error correction process continues, the hard decoding (HardDecode) method will be selected according to the Program / Erase (PE) number of the super block, and the non-target storage unit that failed to read will be re-read through different hard decoding methods.
[0060] See also Figure 2 In one embodiment, the selecting of a hard decoding method according to the number of erasures of the super block and rereading the non-target storage unit according to the hard decoding method include:
[0061] S1021: Obtain a maximum erasure count of the solid state drive where the super block is located, and determine an erasure count threshold of the super block according to the maximum erasure count.
[0062] In this embodiment, in order to extend the service life of the SSD, the firmware includes a wear leveling algorithm to ensure that the PE times of all super blocks are basically the same, thereby avoiding the problem of premature wear of some super blocks. Due to the existence of the wear leveling algorithm, the PE times of all super blocks in the SSD are basically the same. Therefore, by checking the PE times of the solid-state drive, it can represent the PE times of the super block corresponding to the RAID stripe where the current non-target storage unit is located. Specifically, through the information provided by the manufacturer, the maximum PE times of the NAND particles of the solid-state drive are checked and obtained. Furthermore, the erasure count threshold of the super block where the non-target storage unit where the read failed is located is determined based on the maximum PE times of the NAND particles of the solid-state drive.
[0063] S1022: If the erasure count of the super block is less than or equal to the erasure count threshold, select the hard decoding mode as concurrent rereading, and reread the non-target storage unit according to the concurrent rereading.
[0064] In this embodiment, the firmware of the SSD records the information of each super block (BlockInform), which includes the PE times of each super block. In order to maximize the success rate of data recovery and reduce the potential risk of data loss, the RAID error correction module will dynamically select different reread (Read-Retry) methods for non-target storage units that fail to read according to the PE times threshold of the super block.
[0065] Specifically, if the number of erases is less than or equal to the erase threshold, it means that the super block is still in a relatively healthy state and the storage unit has a strong data retention capability. In this case, the system will select the concurrent read-retry mode. This mode allows the error correction module to send a reread command to the flash controller at the same time, and try to re-read data from multiple erroneous non-target storage units, thereby improving the speed and efficiency of data recovery.
[0066] S1023: If the erasure count of the super block is greater than the erasure count threshold, selecting the hard decoding mode as serial rereading, and rereading the non-target storage unit according to the serial rereading.
[0067] In this embodiment, if the current number of erasures of the super block is greater than the erasure threshold, it means that the super block has entered a stage of greater wear and tear, and the data on the storage unit is more prone to read errors. In this case, the RAID error correction module selects the hard decoding method as the serial reread method (Serial Read-Retry). This method will try to read data from each erroneous non-target storage unit in turn. If the reading of a non-target storage unit fails, it will immediately enter the higher-level error recovery mechanism soft decoding (Soft Decode). Instead of waiting for the reading results of other non-target storage units like the parallel reread method, it will directly enter the soft decoding and reread. In this way, those non-target storage units that cannot be successfully read can be identified and processed more quickly, reducing the time and resource consumption of the overall error correction process.
[0068] See also Figure 3 In one embodiment, the solid state drive includes a flash memory controller, and the rereading of the non-target storage unit according to the concurrent rereading includes:
[0069] S10221: Synchronously send multiple reread commands to the flash memory controller according to all addresses of the non-target storage units, each reread command corresponding to one of the non-target storage units.
[0070] In this embodiment, the error correction module of the SSD identifies whether there is a data read failure of a non-target storage unit by checking an error check code (such as ECC). If there is a data read failure or an error in a non-target storage unit, the non-target storage unit will be marked as a non-target storage unit that needs to be reread, and all addresses of the non-target storage units where the read failure occurs will be queried. When the addresses and number of non-target storage units that need to be reread are determined, the error correction module will synchronously send multiple reread commands to the flash memory controller (Flash Controller, FC), and each reread command corresponds to a non-target storage unit that needs to be reread.
[0071] S10222: The flash memory controller rereads the non-target storage units in sequence according to the reread command.
[0072] In this embodiment, the flash memory controller rereads the non-target storage units in order according to the received reread command. For example, when the granularity of the non-target storage unit where the read error occurs is Die, assuming that a RAID stripe has a total of 32 Dies, they can be numbered Die1, Die2...Die32 in sequence. If an uncorrectable error occurs in Die1, RAID error correction needs to be performed on Die1 at this time. The error correction module will read the data of other non-target storage unit Dies. For example, when Die3-14 and Die20-31 data are read incorrectly, a Read-Retry operation will be performed on the Die with the error. When the concurrent Read-Retry mode is selected, the error correction module will send all the reread commands of Die3-14 and Die20-31 to the flash memory controller at one time, and then reread Die3-14 and Die20-31 in sequence.
[0073] S10223: Poll the flash memory controller to sequentially obtain the reread progress of each of the non-target storage units until the reread progress of all the non-target storage units is completed, and then the rereading ends.
[0074] In this embodiment, after the reread command is sent, although all reread commands are sent to the FC at the same time, the processing capacity inside the FC is limited, and it has only one decoder, which decodes the data of the reread non-target storage units one by one according to the order of the non-target storage units in the super block. The error correction module polls the flash memory controller and receives the reread progress information of the data of each non-target storage unit in turn. By understanding the data reread progress of each non-target storage unit, it is determined that all non-target storage units that need to be reread have been reread, and the parallel reread process ends.
[0075] See also Figure 4 In one embodiment, rereading the non-target storage unit according to the serial reread comprises:
[0076] S10231: Send a reread command to the flash memory controller according to the address of the first non-target storage unit.
[0077] In this embodiment, similar to the above-mentioned use of the concurrent reread method to obtain the non-target storage unit that needs to be reread, the error correction module completes the identification of the first non-target storage unit with a read error through ECC, obtains the address of the first non-target storage unit, and marks it as a storage unit that needs to be reread. The error correction module will first send a reread command for the first non-target storage unit to FC.
[0078] S10232: After waiting for the first non-target storage unit to be reread successfully, a reread command is sent to the flash memory controller according to the address of the second non-target storage unit until the reread of the last non-target storage unit is completed, thereby terminating the reread.
[0079] In this embodiment, the error correction module will wait for FC to complete the data rereading of the first non-target storage unit, and obtain the processing result returned by FC through the status register of FC. When receiving the processing result of FC on the first non-target storage unit, the error correction module will check whether the data is successfully reread. If the data is successfully reread, the error correction module will continue to issue the reread command of the second non-target storage unit. If the reread fails, the error correction module will immediately perform soft decoding (Soft Decode) and reread it, and repeat the above steps until all non-target storage units that need to be reread are processed, and the serial reread process ends.
[0080] It should be noted that before sending a new reread command each time, the error correction module will wait for the processing result of the previous target storage unit. This serial reread method of waiting for the results and issuing commands in turn is more time-consuming than the concurrent reread method, but it will not waste time on rereading the data of other target storage units due to the failure of rereading a certain target storage unit. The serial reread method can end the Read-Retry of the target storage unit more quickly, thereby entering the Soft Decode error correction step of the non-target storage unit.
[0081] S103: If the number of failed rereading of the data of the non-target storage unit reaches a preset number of rereading times, reread the non-target storage unit according to a soft decoding method.
[0082] In this embodiment, in the error correction process of the solid state drive, when the data reread of the non-target storage unit fails, the data of the non-target storage unit contains errors that cannot be directly recovered. In this case, the RAID error correction will use a more complex error recovery mechanism to try to repair the data.
[0083] Specifically, the error correction module applies LDPC coding to the storage unit data, adding additional check bits to the original data. The data with the added check bits will be more robust when written. Since the non-target storage unit data now contains additional check information, the error correction module can use this information for error detection and correction when reading. If the number of errors in the data is small and these errors can be corrected by LDPC coding, then rereading may successfully recover the data. If the number of errors in the data exceeds the error correction capability of the LDPC coding, then even if LDPC coding is applied, the data may not be recovered after rereading.
[0084] In one embodiment, rereading the non-target storage unit according to the soft decoding method includes: performing soft reading on the non-target storage unit by selecting offset voltages with different voltage magnitudes to obtain soft read data; and rereading the soft read data after soft decoding.
[0085] In this embodiment, when the data reread of the non-target storage unit fails, the error correction module will adopt a soft read (SoftRead) method. Soft read provides more information to the error correction module than the traditional hard read (Hard Read). By adjusting the offset voltage during reading, soft read can obtain the 0 / 1 confidence information of each bit and provide it to the flash memory controller for decoding.
[0086] Specifically, the error correction module will select a certain number of offset voltages for soft reading. The size of each offset voltage is different, and finally the confidence information of 0 / 1 corresponding to each bit can be obtained. The soft read data obtained by soft reading will be passed to the decoder of the flash memory controller to execute the LDPC decoding algorithm. The error correction module receives the decoded data from the flash memory controller. If the decoding is successful, then the data can be reread successfully. After the reread is successful, the rereading of the next non-target storage unit data will continue.
[0087] S104: If the re-reading of the non-target storage unit is successful, performing an XOR operation on the data of the non-target storage unit that has been read.
[0088] In this embodiment, if the rereading of the non-target storage unit is successful, that is, all the data of the non-target storage unit that needs to be read has been successfully read, then the data of the read non-target storage unit will be subjected to an XOR operation. The XOR operation is a binary bit operation, which executes the logic of "same is 0, different is 1" for each bit. In RAID, the data of all non-target storage units (the data block of each non-target unit is a long binary number) are traversed, and the data of the non-target storage unit is XORed with the result of the current XOR operation continuously, and finally the result of the XOR operation is obtained.
[0089] S105: Fill the result of the XOR operation into the position of the target storage unit.
[0090] In this embodiment, the result of the XOR operation is filled to the position of the storage unit that originally needs error correction, maintaining the integrity and continuity of the data stripe, while ensuring that when a data read or write request occurs in the future, the RAID storage unit that has been corrected can be transparently used to replace the original faulty storage unit. Before the RAID storage unit is filled to the position of the storage unit that needs error correction, the integrity and correctness of the RAID storage unit need to be verified. If the correctness of the RAID storage unit has been verified and the storage unit that needs error correction is marked as unavailable, the error correction module fills the RAID storage unit to the position of the storage unit that originally needs error correction through the internal address mapping table. After filling the RAID storage unit, the metadata and information of the stripe are updated to reflect that the storage unit has been replaced. At this time, the storage unit position that was originally unavailable due to data damage has now been replaced by a valid RAID storage unit, and the integrity and availability of the RAID data stripe have been restored.
[0091] In one embodiment, before reading the data of non-target storage units on the RAID stripe except the target storage unit that needs error correction, the method also includes: applying for cache space from a flash memory controller; if rereading the data of the non-target storage unit fails, releasing the cache space and sending a RAID stripe error correction termination command to the flash memory controller.
[0092] In this embodiment, before the error correction module starts to read the data of non-target storage units on the RAID stripe except the target storage unit to be corrected, the error correction module will apply for a predetermined size of cache space from the flash controller, and the FC of the SSD will allocate cache space according to the data size of the storage unit. This cache space will be used to temporarily store the RAID storage unit generated by the error correction. Optionally, if the error correction module still fails to reread, the error correction module will release the cache space previously applied for, and at the same time, issue an error correction termination command to end the RAID stripe error correction process.
[0093] In one embodiment, after reading the data of the remaining non-target storage units on the RAID strip except the target storage unit that needs error correction, the method also includes: if there is no failure in reading the data of the non-target storage unit, performing an XOR operation on the data of the non-target storage unit that has been read; and filling the result of the XOR operation into the position of the target storage unit.
[0094] In this embodiment, if the data of all non-target storage units except the target storage unit that needs error correction are read successfully from the RAID stripe, and there is no failure in reading the data of the non-target storage unit, then the data of the non-target storage unit that has been read is processed using an exclusive OR (XOR) operation, and the result of the XOR operation is filled into the position of the target storage unit, and the integrity and availability of the RAID data stripe are restored.
[0095] The RAID stripe data error correction method provided by the present embodiment reads the data of the non-target storage units on the RAID stripe except the target storage unit to be corrected; if there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the number of erasures of the super block, and the non-target storage unit is reread according to the hard decoding method; if the number of failures in rereading the data of the non-target storage unit reaches a preset number of rereads, the non-target storage unit is reread according to the soft decoding method; if the rereading of the data of the non-target storage unit is successful, an XOR operation is performed on the data of the non-target storage unit that has been read; and the result of the XOR operation is filled into the position of the target storage unit. The present application selects a hard decoding method according to the number of erasures and performs a rereading in a soft decoding method according to the rereading situation of the hard decoding method, and performs an XOR operation on the data of the storage unit after the data is successfully reread, thereby improving the data error correction capability.
[0096] Example 2
[0097] In addition, an embodiment of the present application provides a RAID stripe data error correction device, which is applied to an electronic device.
[0098] like Figure 5 As shown, the RAID stripe data error correction device 500 includes:
[0099] A reading module 501 is used to read data of non-target storage units on the RAID stripe except the target storage unit that needs error correction;
[0100] A first re-reading module 502, configured to determine if there is a failure in reading the data of the non-target storage unit, select a hard decoding method according to the erasure count of the super block, and re-read the non-target storage unit according to the hard decoding method;
[0101] A second rereading module 503, configured to reread the non-target storage unit according to a soft decoding method if the number of failed rereading of the data of the non-target storage unit reaches a preset number of rereading times;
[0102] An XOR module 504 is used to determine if rereading the data of the non-target storage unit is successful, and then perform an XOR operation on the data of the non-target storage unit that has been read;
[0103] The padding module 505 is used to fill the result of the XOR operation into the position of the target storage unit.
[0104] Optionally, the XOR module 504 is further configured to perform an XOR operation on the data of the non-target storage unit that has been read if there is no failure in reading the data of the non-target storage unit.
[0105] Optionally, the first reread module 502 is also used to obtain the maximum number of erase times of the solid-state hard disk where the super block is located, and determine the erase time threshold of the super block based on the maximum number of erase times; if the erase time of the super block is less than or equal to the erase time threshold, the hard decoding method is selected as concurrent reread, and the non-target storage unit is reread according to the concurrent reread; if the erase time of the super block is greater than the erase time threshold, the hard decoding method is selected as serial reread, and the non-target storage unit is reread according to the serial reread.
[0106] The solid-state hard disk includes a flash memory controller. Optionally, the first reread module 502 is also used to synchronously send multiple reread commands to the flash memory controller according to all addresses of the non-target storage units, and each reread command corresponds to one non-target storage unit; the flash memory controller rereads the non-target storage units in turn according to the reread commands; and polls the flash memory controller to sequentially obtain the reread progress of each non-target storage unit until the reread progress of all the non-target storage units is completed, thereby ending the reread.
[0107] Optionally, the first reread module 502 shown is also used to send a reread command to the flash memory controller according to the address of the first non-target storage unit; after waiting for the first non-target storage unit to be reread successfully, a reread command is sent to the flash memory controller according to the address of the second non-target storage unit until the reread of the last non-target storage unit is completed, thereby ending the reread.
[0108] Optionally, the RAID stripe data error correction device further includes an application module for applying for cache space from the flash memory controller; if rereading the data of the non-target storage unit fails, the cache space is released and a RAID stripe error correction termination command is sent to the flash memory controller.
[0109] Optionally, the second re-read module 503 is further used to perform soft reading on the non-target storage unit by selecting offset voltages with different voltage magnitudes to obtain soft read data; and re-read the soft read data after soft decoding.
[0110] The RAID stripe data error correction device 500 provided in this embodiment can implement the RAID stripe data error correction method provided in Embodiment 1, and will not be described again here to avoid repetition.
[0111] The RAID stripe data error correction device provided in this embodiment reads the data of the non-target storage units on the RAID stripe except the target storage unit to be corrected; if there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the number of erasures of the super block, and the non-target storage unit is reread according to the hard decoding method; if the number of failures in rereading the data of the non-target storage unit reaches a preset number of rereads, the non-target storage unit is reread according to the soft decoding method; if the rereading of the data of the non-target storage unit is successful, an XOR operation is performed on the data of the non-target storage unit that has been read; and the result of the XOR operation is filled into the position of the target storage unit. The present application selects a hard decoding method according to the number of erasures and performs a rereading in a soft decoding method according to the rereading situation of the hard decoding method, and performs an XOR operation on the data of the storage unit after the data is successfully reread, thereby improving the data error correction capability.
[0112] Example 3
[0113] In addition, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the RAID stripe data error correction method provided in Embodiment 1 is executed.
[0114] The electronic device provided in the embodiment of the present invention can execute the steps of the RAID stripe data error correction method provided in the above method embodiment 1, which will not be described again here to avoid repetition.
[0115] Example 4
[0116] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the RAID stripe data error correction method provided in Example 1 is implemented.
[0117] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0118] The computer-readable storage medium provided in this embodiment can implement the RAID stripe data error correction method provided in Embodiment 1, and will not be described again here to avoid repetition.
[0119] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including 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 terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0121] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A RAID stripe data error correction method, characterized in that: The method comprises: Read the data of the non-target storage units on the RAID stripe except the target storage unit that needs error correction; If there is a failure in reading the data of the non-target storage unit, a hard decoding method is selected according to the erasure count of the super block, and the non-target storage unit is re-read according to the hard decoding method; If the number of failed rereading of the data of the non-target storage unit reaches a preset number of rereading times, rereading the non-target storage unit according to a soft decoding method; If rereading the data of the non-target storage unit is successful, performing an XOR operation on the data of the non-target storage unit that has been read; Fill the result of the XOR operation into the position of the target storage unit; The selecting a hard decoding method according to the number of erasures of the super block, and rereading the non-target storage unit according to the hard decoding method, comprises: Obtaining a maximum erasure count of the solid state drive where the super block is located, and determining an erasure count threshold of the super block according to the maximum erasure count; If the number of erasures of the super block is less than or equal to the erasure number threshold, the hard decoding mode is selected as concurrent rereading, and the non-target storage unit is reread according to the concurrent rereading, and the concurrent rereading includes simultaneously rereading a plurality of non-target storage units that have failed to read, obtaining rereading results of the plurality of non-target storage units that have failed to read, and if there are non-target storage units that have failed to reread in the rereading results and the number of rereading failures reaches the preset number of rereading, then the soft decoding mode is switched to; If the erasure times of the super block is greater than the erasure times threshold, the hard decoding mode is selected as serial rereading, and the non-target storage unit is reread according to the serial rereading, wherein the serial rereading includes sequentially rereading each non-target storage unit that fails to read, and if the current non-target storage unit fails to reread and the number of reread failures reaches the preset number of rereading times, the soft decoding mode is immediately switched to; The soft decoding method includes selecting an offset voltage of a non-target storage unit whose number of read reread failures reaches the preset number of reread failures, and obtaining confidence information that each bit of the non-target storage unit whose number of reread failures reaches the preset number of reread failures is 0 or 1.
2. The method according to claim 1, characterized in that After reading the data of the non-target storage units on the RAID stripe except the target storage unit to be corrected, the method further comprises: If there is no failure in reading the data of the non-target storage unit, performing an XOR operation on the data of the non-target storage unit that has been read; The result of the XOR operation is filled into the location of the target storage unit.
3. The method according to claim 1, characterized in that The solid state drive includes a flash memory controller, and the rereading of the non-target storage unit according to the concurrent rereading includes: Synchronously sending a plurality of reread commands to the flash memory controller according to all addresses of the non-target storage units, each reread command corresponding to one of the non-target storage units; The flash memory controller rereads the non-target storage units in sequence according to the reread command; The flash memory controller is polled to sequentially obtain the reread progress of each of the non-target storage units until the reread progress of all the non-target storage units is completed, thereby terminating the rereading.
4. The method according to claim 3, characterized in that The rereading of the non-target storage unit according to the serial rereading comprises: Sending a reread command to the flash memory controller according to the address of the first non-target storage unit; After waiting for the first non-target storage unit to be reread successfully, a reread command is sent to the flash memory controller according to the address of the second non-target storage unit until the reread of the last non-target storage unit is completed, thereby terminating the reread.
5. The method according to claim 1, characterized in that Before reading the data of the non-target storage units other than the target storage unit to be corrected on the RAID stripe, the method further comprises: Apply for cache space from the flash controller; If rereading the data of the non-target storage unit fails, the cache space is released, and a RAID stripe error correction termination command is sent to the flash memory controller.
6. The method according to claim 1, characterized in that The rereading of the non-target storage unit according to the soft decoding method includes: Performing soft reading on the non-target storage cell by selecting offset voltages with different voltage magnitudes to obtain soft read data; The soft read data is soft-decoded and then re-read.
7. A RAID stripe data error correction device, characterized in that: The device comprises: A reading module, used for reading data of non-target storage units on the RAID stripe except the target storage unit to be corrected; A first re-reading module, configured to determine if there is a failure in reading the data of the non-target storage unit, select a hard decoding method according to the number of erasures of the super block, and re-read the non-target storage unit according to the hard decoding method; A second rereading module, configured to reread the non-target storage unit according to a soft decoding method if the number of failed rereading of the data of the non-target storage unit reaches a preset number of rereading times; An XOR module, used for determining if rereading the data of the non-target storage unit is successful, and then performing an XOR operation on the data of the non-target storage unit that has been read; A filling module, used for filling the result of the XOR operation into the position of the target storage unit; The selecting a hard decoding method according to the number of erasures of the super block, and rereading the non-target storage unit according to the hard decoding method, comprises: Obtaining a maximum erasure count of the solid state drive where the super block is located, and determining an erasure count threshold of the super block according to the maximum erasure count; If the number of erasures of the super block is less than or equal to the erasure number threshold, the hard decoding mode is selected as concurrent rereading, and the non-target storage unit is reread according to the concurrent rereading, and the concurrent rereading includes simultaneously rereading a plurality of non-target storage units that have failed to read, obtaining rereading results of the plurality of non-target storage units that have failed to read, and if there are non-target storage units that have failed to reread in the rereading results and the number of rereading failures reaches the preset number of rereading, then the soft decoding mode is switched to; If the erasure times of the super block is greater than the erasure times threshold, the hard decoding mode is selected as serial rereading, and the non-target storage unit is reread according to the serial rereading, wherein the serial rereading includes sequentially rereading each non-target storage unit that fails to read, and if the current non-target storage unit fails to reread and the number of reread failures reaches the preset number of rereading times, the soft decoding mode is immediately switched to; The soft decoding method includes selecting an offset voltage of a non-target storage unit whose number of read reread failures reaches the preset number of reread failures, and obtaining confidence information that each bit of the non-target storage unit whose number of reread failures reaches the preset number of reread failures is 0 or 1.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program, the RAID stripe data error correction method according to any one of claims 1 to 6 is executed.
9. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is run on a processor, the RAID stripe data error correction method according to any one of claims 1 to 6 is executed.
Citation Information
Patent Citations
Method for improving reliability of solid state disk based on error correction codes with variable code rates
CN106484558A
Data recovery method and device, readable storage medium and electronic equipment
CN114610542A
Solid state disk read performance optimization method and device, equipment and storage medium
CN116860174A
Decoding System and Method for Electronic Non-Volatile Computer Storage Apparatus
US20150227403A1
