Asynchronous rereading error correction method for storage medium
By adopting asynchronous rereading error correction methods in multi-CE flash memory devices, the rereading tasks of each CE are independently handled, and the efficiency and speed reduction caused by synchronous error correction is solved, and more efficient ECC error correction and faster error correction speed are achieved.
Patent Information
- Application Number
- CN202510143177.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-10
AI Technical Summary
In the prior art, when multi-CE flash memory firmware devices perform synchronous error correction, the efficiency and speed of rereading operations will decrease. Especially when multiple CEs experience ECC errors at the same time, the synchronization error correction mechanism will reread all pages where ECC errors occur one by one, resulting in an increase in the time waiting for RB ready.
A storage medium asynchronous rereading error correction method is proposed. By obtaining the ECC result of the flash memory device, determining the physical page that needs to be reread, and updating the relevant arrays and queues, creating reread tasks, traversing the first queue of all CEs, updating the fourth array, and performing independent reread operations according to the threshold voltage offset of each CE until all reread operations are completed.
The rereading process of each CE in multiple CE flash memory devices is achieved relatively independent, reducing mutual influence, improving ECC error correction efficiency and speed, and reducing the time to wait for the prepared signal, thereby greatly improving the overall error correction performance of the firmware.
Smart Images

Figure CN119905131A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of reread error correction of storage media, and in particular to a storage medium asynchronous reread error correction method. Background Art
[0002] In the related technology, as the density of flash memory gradually increases, the reliability of flash memory has decreased. The most critical reliability is the integrity and correctness of user data. The minimum unit of flash memory read operation is page. The minimum unit of encoding and decoding of the current mainstream LDPC engine is codeword. The space occupied by a codeword is 4K bytes, so multiple codewords can be stored in a page. When a page is read, and an ECC error occurs in a codeword contained in the page, the common solution is to use the specified command provided by the flash memory manufacturer, combined with the data provided by the characteristic analysis, to change the threshold voltage offset of the flash memory, and then re-read the page until the ECC is correct or all error correction methods are exhausted, that is, the read is correct or an uncorrectable ECC error occurs.
[0003] At present, most multi-CE products on the market use a synchronous error correction mechanism for rereading, that is, when an ECC error occurs in a certain read operation of a certain CE, the operations being executed by all other CEs will be interrupted or paused until the page with the ECC error is corrected. Although this error correction process is simple, it sacrifices the advantage of multiple CEs being able to operate in parallel. When ECC errors occur in multiple CEs at the same time, the synchronous error correction mechanism will use the single read command to reread all pages with ECC errors one by one. Each single read command needs to wait for the RB signal to change from busy to ready before it is allowed to retrieve data from the flash memory. This waiting time is usually 30us to 60us. Therefore, in the synchronous error correction mechanism, each reread will consume part of the time waiting for RB ready. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes a storage medium asynchronous reread error correction method, which can make the reread process of each CE in a multi-CE flash firmware device relatively independent, reduce the influence between each other, and improve the ECC error correction efficiency and speed.
[0005] A storage medium asynchronous reread error correction method according to an embodiment of the present invention is applied to a flash memory device having multiple CEs, and the storage medium asynchronous reread error correction method includes:
[0006] Obtaining an ECC result of the flash memory device;
[0007] According to the ECC result, the physical page where the ECC error occurs and needs to be reread is determined, and the first array, the second array, the first variable, the plurality of first queues and the third array are updated; the first array is used to record the information of all the physical pages that need to be reread, the first variable is used to record the total number of all the physical pages that need to be reread, each of the CEs has a corresponding first queue, the first queue is used to record the physical pages that the corresponding CE needs to reread, the second array is used to record the total number of physical pages that each of the CEs needs to reread; the third array is used to record the end node of each of the first queues;
[0008] Creating a reread task according to the ECC result;
[0009] According to the rereading task, traverse the first queues of all the CEs, and update the fourth array according to the traversal result; the fourth array is used to record the physical pages being reread by each of the first queues;
[0010] determining a threshold voltage offset of each of the CEs, and rereading a physical page of the fourth array according to the threshold voltage offset;
[0011] After the reread operation is completed, the first variable and the second array are updated, and the step of traversing the first queues of all the CEs according to the reread task and updating the fourth array according to the traversal result is returned until all the reread operations are completed.
[0012] According to some embodiments of the present invention, creating a reread task according to the ECC result includes:
[0013] According to the ECC result, determine the CE that needs to be reread, and create a reread task;
[0014] Wait for all operations on the flash memory device in the current system to be completed, and give priority to entering the rereading process in the next task processing cycle.
[0015] According to some embodiments of the present invention, updating the first array, the second array, the first variable, the plurality of first queues and the third array comprises:
[0016] Selecting a first element from the first array, and saving the codeword information corresponding to the ECC error in the CE into the first element;
[0017] Set the next node pointer of the last element of the first queue to point to the first element;
[0018] Update the value corresponding to the CE in the third array to the pointer of the first element;
[0019] The value of the first variable is increased by one;
[0020] In the second array, the value of the element corresponding to the current CE is increased by one.
[0021] According to some embodiments of the present invention, traversing the first queues of all the CEs according to the rereading task, and updating the fourth array according to the traversal result, includes:
[0022] Determining whether to continue rereading according to the value of the first variable;
[0023] If it is determined to continue rereading, the first queues of all the CEs are traversed, and when there are physical pages waiting to be reread in the first queues, it is determined according to the fourth array whether there is a task being reread in the corresponding CE;
[0024] If there is no task being reread in the corresponding CE, the physical page information of the task waiting to be reread is recorded in the fourth array.
[0025] According to some embodiments of the present invention, determining a threshold voltage offset of each of the CEs, and rereading a physical page of the fourth array according to the threshold voltage offset, comprises:
[0026] Obtain the threshold voltage offset corresponding to the last successful error correction of the reread operation of the corresponding CE from the fifth array; the fifth array is used to record the index of the threshold voltage offset of the last successful error correction of the reread operation of each CE in the threshold voltage offset array;
[0027] If the threshold voltage offset is a default offset, the physical pages of the fourth array are re-read starting from the first set of the threshold voltage offsets;
[0028] If the threshold voltage offset is a non-default offset, the physical page of the fourth array is re-read starting from the current group of the threshold voltage offsets, and if the re-reading fails, the physical page is re-read starting from the first group of the threshold voltage offsets.
[0029] According to some embodiments of the present invention, determining a threshold voltage offset of each of the CEs, and rereading the physical page of the fourth array according to the threshold voltage offset, further includes:
[0030] If there is a task being reread in the corresponding CE, determining whether the threshold voltage offset being reread is the last group in the physical page being reread;
[0031] If the threshold voltage offset being reread is the last group in the physical page being reread, updating the fourth array, the first variable and the second array;
[0032] If the threshold voltage offset of the corresponding CE is not the last group, the next group of threshold voltage offsets is selected.
[0033] According to some embodiments of the present invention, after the reread operation is completed, the first variable and the second array are updated, and the step of traversing the first queues of all the CEs according to the reread task and updating the fourth array according to the traversal result is returned until all the reread operations are completed, including:
[0034] If the corresponding CE is not the last CE, return to the step: traverse the first queues of all the CEs, and when there are physical pages waiting to be reread in the first queues, determine whether there is a task being reread in the corresponding CE according to the fourth array;
[0035] If the corresponding CE is the last CE, wait for all the CE reread operations to be completed, check the ECC results generated after rereading, update the fourth array, the first variable and the second array according to the ECC results, and return to step: determine whether to continue rereading according to the value of the first variable.
[0036] According to some embodiments of the present invention, updating the fourth array, the first variable and the second array according to the ECC result includes:
[0037] If the ECC result of the CE is OK, it means that the corresponding reread operation of the CE is successful, the elements of the CE in the fourth array are cleared, the value of the first variable is reduced by one, and the value of the elements of the CE in the second array is reduced by one.
[0038] According to some embodiments of the present invention, the codeword information includes: a physical address, a data buffer address, and a buffer address of the ECC result.
[0039] According to some embodiments of the present invention, determining whether to continue rereading according to the value of the first variable includes:
[0040] If the value of the first variable is not zero, it is determined to continue rereading;
[0041] If the value of the first variable is zero, the rereading is terminated.
[0042] The storage medium asynchronous reread error correction method according to the embodiment of the present invention has at least the following beneficial effects: by determining the information of the physical pages that need to be reread in each CE of the flash memory device according to the ECC result of the flash memory device, a reread task is created and the variables required for the reread task are updated, thereby realizing the precision and efficiency of the flash memory device reread process; by updating the independent variables of each CE respectively, and performing different types of physical page reread operations according to the threshold voltage offset of each CE respectively, thereby realizing completely independent reread operations between each CE when the flash memory device is reread, so that in a flash memory device with multiple CEs, the reread processes of each CE are relatively independent when rereading, reducing the influence between each other, better playing the advantages of parallel operation of multiple CEs, reducing the time waiting for the preparation signal, thereby improving the ECC error correction efficiency, accelerating the error correction speed, and greatly improving the overall error correction performance of the firmware.
[0043] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:
[0045] Figure 1 It is a flowchart of the overall steps of the storage medium asynchronous reread error correction method according to an embodiment of the present invention;
[0046] Figure 2 The figure is a detailed flow chart of the storage medium asynchronous reread error correction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0047] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0048] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.
[0049] In the description of the present invention, "several" means more than one, "many" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0050] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.
[0051] In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0052] Reference Figure 1 and Figure 2 The present invention proposes a storage medium asynchronous reread error correction method, which is applied to a flash memory device with multiple CEs. The storage medium asynchronous reread error correction method includes the following steps:
[0053] Step S100: Obtaining the ECC result of the flash memory device;
[0054] Step S200: According to the ECC result, determine the physical page where the ECC error occurs and needs to be reread, and update the first array, the second array, the first variable, multiple first queues and the third array; the first array is used to record the information of all physical pages that need to be reread, the first variable is used to record the total number of all physical pages that need to be reread, each CE has a corresponding first queue, the first queue is used to record the physical pages that the corresponding CE needs to reread, the second array is used to record the total number of physical pages that each CE needs to reread; the third array is used to record the end node of each first queue;
[0055] Step S300: creating a reread task according to the ECC result;
[0056] Step S400: traverse the first queues of all CEs according to the rereading task, and update the fourth array according to the traversal result; the fourth array is used to record the physical page being reread by each first queue;
[0057] Step S500: determining a threshold voltage offset of each CE, and re-reading a physical page of a fourth array according to the threshold voltage offset;
[0058] Step S600: after the reread operation is completed, update the first variable and the second array, and return to step S400: according to the reread task, traverse the first queues of all CEs, and update the fourth array according to the traversal result until all reread operations are completed.
[0059] Specifically, in this embodiment, when the software system checks the execution results of all current operations at a certain time, if it is detected that ECC errors occur in multiple read operations, the storage medium asynchronous reread error correction method of this embodiment is adopted. Before entering the storage medium asynchronous reread error correction method of this embodiment, the following resources are first allocated in the global variable space:
[0060] A plurality of first queues, namely, a plurality of CE waiting reread queues, denoted as queue A, corresponding to a plurality of CEs in the flash memory device one by one, and used to record pointers of physical page information of corresponding CEs waiting to be reread;
[0061] The third array, i.e., the end node array of the CE waiting rereading queue, is denoted as array A, and is used to record the end node pointer of each CE waiting rereading queue;
[0062] The fourth array, namely the array of physical pages being reread by the CE, is denoted as array B, and is used to record the physical page information being reread by each CE;
[0063] The first array, namely the physical page information storage array, is denoted as array C, and is used to store the physical page information that needs to be reread in the flash firmware device;
[0064] The first variable, i.e., the total number of reread physical pages, is recorded as variable A, and is used to record the total number of physical pages that need to be reread in the flash firmware device;
[0065] The second array, namely the total number of physical pages reread by CE, is recorded as array E, which is used to record the total number of physical pages that each CE needs to reread;
[0066] The fifth array, namely the threshold voltage offset index recording array of the last successful reread of the CE, is recorded as array D, and is used to record the index of the threshold voltage offset of the last successful error correction of the reread operation of each CE in the threshold voltage offset array.
[0067] The total number of physical pages that each CE needs to reread, that is, the element values in the second array E, are all random, depending on how many ECC errors the system detects, and the sum of the elements in the second array E is equal to the first variable A. The first queue, the third array, the fourth array, the second array, and the fifth array are data corresponding to each CE in the flash firmware device.
[0068] Then, the storage medium asynchronous reread error correction method of this embodiment is entered, and step S100 is executed: obtaining the ECC result of the flash memory device, and step S200 is executed: according to the ECC result, the physical page where the ECC error occurs and needs to be reread is determined, and the first array, the second array, the first variable, the multiple first queues and the third array are updated. Among them, the ECC result includes the information corresponding to the above variables, and the ECC result is automatically updated by the hardware (i.e., the flash memory controller). The read operation is based on the code word (code word), and the size of each code word is 4K bytes. Each code word will be equipped with an ECC result buffer. According to the ECC result information returned by the storage hardware, the software can know whether the corresponding code word read operation has an ECC error according to the ECC result buffer. If an ECC error occurs, a reread task must be created accordingly, that is, step S300 is executed: according to the ECC result, a reread task is created. For example, assuming that an ECC error is detected in CE0, the software will select an element x from the first array C, and then save the codeword information corresponding to the ECC error, such as the physical address, data buffer address, ECC result buffer address and other related information, to element x; point the next_node of the last element of the first queue queue A corresponding to CE0 to element x; update the value corresponding to CE0 in the third array A to the pointer of element x, indicating that element x is the last node in the first queue queue A corresponding to CE0; increase the value of the first variable variable A by one; and increase the value of the element corresponding to CE0 in the second array E by one.
[0069] After the system software creates and completes the reread task, the software will first enter the reread process in the next task processing cycle, wait for all operations on the flash memory device in the current system to be completed, and then execute step S400: according to the reread task, traverse the first queues of all CEs, and update the fourth array array B according to the traversal results. Specifically, first, check whether the current value of the first variable is 0. If it is 0, it means that there are no physical pages waiting to be reread in the current flash memory device, and the reread process is directly terminated without subsequent reread operations; if it is not 0, it means that there are physical pages waiting to be reread in the current flash memory device, and the reread process continues. Then, starting from CE0, traverse the first queue queue A of each CE, and if there is a task waiting to be reread, it is recorded in the corresponding element of the fourth array array B.
[0070] Then, step S500 is executed: determine the threshold voltage offset of each CE, and reread the physical page of the fourth array according to the threshold voltage offset. That is, obtain the threshold voltage offset of the last successful error correction of the CE reread operation from the fifth array array D. If the threshold voltage offset is a default offset, the physical page recorded in the fourth array array B is reread from the first group of threshold voltage offsets; if the threshold voltage offset is a non-default offset, it is recorded as index x, and the physical page recorded in the fourth array array B is first reread with the xth group of threshold voltage offsets. If the rereading still fails, it is reread from the first group of threshold voltage offsets. After the different rereading methods for each CE are configured in the software, the software system implements control, configures the flash memory controller at the hardware level, and performs the above-mentioned different types of rereading operations set for each CE in the flash memory device. Specifically, if the threshold voltage offset is the default offset, it means that the current CE has not performed a reread operation or the system has been restarted, so it is necessary to traverse the threshold voltage parameters from the first position at this time; if the threshold voltage offset is a non-default offset, it means that the current set of parameters makes the last ECC read error reread successfully, and the current read error has the highest probability of successfully rereading using this set of threshold voltage offsets. The background of this step is: there are many groups of parameters that need to be reread, and each group of parameters that need to be reread will correspond to a scenario, such as parameter 1 corresponding to high temperature, parameter 2 corresponding to low temperature, parameter 3 corresponding to read interference, etc. If a CE successfully rereads with parameter 1, it means that the current chip is likely to be in a high temperature scenario. When the CE has a read error again later, the probability of successfully rereading with parameter 1 is the highest, so parameter 1 is used for rereading first. If parameter 1 fails to reread, the reread parameter list is traversed again from the beginning.
[0071] Finally, execute step S600: after the reread operation is completed, update the first variable and the second array, and return to the first queue of all CEs according to the reread task, and update the fourth array according to the traversal result, until all reread operations are completed. Specifically, wait for the reread operation of all CEs in the current cycle to be completed, then check the ECC result, and update the fourth array array B, the first variable variable A and the second array array E according to the ECC result. That is, if ECC is OK, it means that the reread is successful, and the elements in arrayB corresponding to the reread are cleared, and at the same time variableA is reduced by 1, and the element value in arrayE corresponding to the CE is reduced by 1. Finally, check whether all reread tasks have been completed? There are two criteria for completion, one is successful error correction, and the other is that all threshold voltage offsets cannot be corrected successfully. If yes, the index of the threshold voltage offset of the current successful error correction is recorded to array D, and then the reread process is exited; otherwise, the process jumps back to step S400 to check whether the value of the current first variable is 0. If it is 0, it means that there is no physical page waiting to be reread in the current flash memory device, and the reread process is directly terminated without subsequent reread operations; if it is not 0, it means that there is a physical page waiting to be reread in the current flash memory device, and the reread process continues. More specifically, all reread operations can be divided into two steps: pre-read command and data out command. This belongs to the data interaction between the flash memory controller and the flash memory. The software only needs to configure the relevant command parameters to the flash memory controller, and the flash memory controller will execute. The software can know whether the corresponding command has been executed according to the register and the execution result buufer. Here, waiting for the operation to end is waiting for the flash memory controller to return the execution end flag. If the software finds this flag, it means that all pre-read commands and data out commands have been executed and the data has been transferred to the specified data buffer.
[0072] Compared with the existing synchronous error correction process, the asynchronous error correction process proposed by the present invention has the following advantages: For example, assuming that at a certain moment, ECC errors are detected in CE0 page0, CE1 page3, and CE2 page5 at the same time, the firmware needs to reread these three pages.
[0073] (1) The existing synchronization error correction process is as follows:
[0074] ① After setting the threshold voltage offset of CE0, send the single read command of CE0 page0. After waiting for the RB signal ready, send the data out command to get the data.
[0075] ② Check the ECC result of the data. If the ECC is correct or the threshold voltage parameter table is used up and still cannot be corrected, continue. If there is still an ECC error, take the next set of threshold voltage parameters and jump to ①.
[0076] ③ After setting the threshold voltage offset of CE1, send the single read command of CE1 page 3. After waiting for the RB signal ready, send the data out command to get the data.
[0077] ④ Check the ECC result of the data. If the ECC is correct or the threshold voltage parameter table is used up and still cannot be corrected, continue. If there is still an ECC error, take the next set of threshold voltage parameters and jump to ③.
[0078] ⑤ After setting the threshold voltage offset of CE2, send the single read command of CE2 page 5. After waiting for the RB signal ready, send the data out command to get the data.
[0079] ⑥ Check the ECC result of the data. If the ECC is correct or the threshold voltage parameter table is used up and still cannot be corrected, exit. If there is still an ECC error, take the next set of threshold voltage parameters and jump to ⑤.
[0080] (2) The asynchronous error correction process used in the present invention is as follows:
[0081] ① After setting the threshold voltage offset of CE0, send the single read command of CE0 page0.
[0082] ②After setting the threshold voltage offset of CE1, send the single read command of CE1 page3.
[0083] ③After setting the threshold voltage offset of CE2, send the single read command of CE2 page5.
[0084] ④Send the data out command to get the data of CE0 page0.
[0085] ⑤Send the data out command to obtain the data of CE1 page3.
[0086] ⑥Send the data out command to obtain the data of CE2 page5.
[0087] ⑦ Check the ECC result of each data. If the ECC is correct or the threshold voltage parameter table has been used up and still cannot be corrected, exit. If there is still an ECC error, take the next set of threshold voltage parameters and then jump to ①. In addition, the set feature command is used to set the threshold voltage offset in this embodiment. Set feature, single read and data out are all basic operation timings provided by the flash memory device. You only need to configure the relevant parameters of the flash memory controller to perform corresponding operations on the flash memory. The RBs of CE0, CE1, and CE2 in this embodiment can overlap, while the RBs of the prior art are serial, so compared with the prior art, this embodiment reduces some of the time waiting for RBs. RB refers to the RB signal of the flash memory. When the single read command is issued, the RB signal will be in a busy state. Only when the RB signal is ready can the data out command be sent to retrieve data.
[0088] Therefore, when ECC errors occur in multiple CEs at the same time, the asynchronous error correction mechanism proposed in the embodiment of the present invention can better take advantage of the parallel operation of multiple CEs compared to the existing synchronous error correction mechanism, reduce the time waiting for the RB signal ready, speed up the error correction speed, and greatly improve the overall error correction performance of the firmware.
[0089] This embodiment creates a reread task and updates the variables required for the reread task by determining the information of the physical pages that need to be reread in each CE of the flash memory device according to the ECC result of the flash memory device, thereby realizing the precision and efficiency of the flash memory device reread process; by updating the independent variables of each CE respectively, and performing different types of physical page reread operations according to the threshold voltage offset of each CE, it is possible to achieve completely independent reread operations between each CE when the flash memory device is reread, so that in a flash memory device with multiple CEs, the reread processes of each CE are relatively independent when rereading, reducing the influence between each other, better leveraging the advantages of parallel operation of multiple CEs, reducing the time waiting for the preparation signal, thereby improving the ECC error correction efficiency, accelerating the error correction speed, and greatly improving the overall error correction performance of the firmware.
[0090] Reference Figure 1 and Figure 2 , further, in some embodiments of the present invention, step S300: creating a reread task according to the ECC result, includes:
[0091] 3.1 According to the ECC result, determine the CE that needs to be reread and create a reread task;
[0092] 3.2 Wait for all operations on the flash memory device in the current system to be completed, and give priority to entering the reread process in the next task processing cycle.
[0093] Specifically, in this embodiment, the ECC result is automatically updated by hardware (i.e., the flash memory controller), and the read operation is based on code words. The size of each code word is 4K bytes, and each code word is equipped with an ECC result buffer. According to the ECC result information returned by the storage hardware, the software can know whether an ECC error has occurred in the corresponding code word read operation based on the ECC result buffer. If an ECC error has occurred, a reread task must be created accordingly. After the system software creates and completes the reread task, the software will prioritize entering the reread process in the next task processing cycle, waiting for all operations on the flash memory device in the current system to be completed.
[0094] Reference Figure 1 and Figure 2 Further, in some embodiments of the present invention, in step S200: updating the first array, the second array, the first variable, the plurality of first queues and the third array comprises:
[0095] 2.1 Select the first element from the first array and save the codeword information corresponding to the ECC error in the CE into the first element;
[0096] 2.2 Set the next node pointer of the last element of the first queue to point to the first element;
[0097] 2.3 Update the value corresponding to CE in the third array to the pointer of the first element;
[0098] 2.4 The value of the first variable is increased by one;
[0099] 2.5 In the second array, the value of the element corresponding to the current CE is increased by one.
[0100] Specifically, in this embodiment, for example, assuming that an ECC error is detected in CE0, the software will select an element x from the first array array C, and then save all the codeword information corresponding to the ECC error, such as the physical address, data buffer address, ECC result buffer address and other related information, to the element x; point the next_node of the last element of the first queue queue A corresponding to CE0 to the element x; update the value corresponding to CE0 in the third array array A to the pointer of element x, indicating that element x is the last node in the first queue queue A corresponding to CE0; increase the value of the first variable variable A by one; and increase the value of the element corresponding to CE0 in the second array array E by one.
[0101] Reference Figure 1 and Figure 2Further, in some embodiments of the present invention, step S400: traversing the first queues of all CEs according to the rereading task, and updating the fourth array according to the traversal result, includes:
[0102] 4.1 Determine whether to continue rereading according to the value of the first variable;
[0103] 4.2 If it is determined to continue rereading, the first queues of all CEs are traversed. When there are physical pages waiting to be reread in the first queues, it is determined whether there is a task being reread in the corresponding CE according to the fourth array;
[0104] 4.3 If there is no task being reread in the corresponding CE, the physical page information of the task waiting to be reread is recorded in the fourth array.
[0105] Specifically, in this embodiment, first, check whether the current value of the first variable is 0. If it is 0, it means that there is no physical page waiting to be reread in the current flash memory device, and the reread process is directly terminated without subsequent reread operations. If it is not 0, it means that there is a physical page waiting to be reread in the current flash memory device, and the reread process continues. Then, starting from CE0, traverse the first queue queue A of each CE, and if there is a task waiting to be reread, it is recorded in the corresponding element of the fourth array array B.
[0106] Reference Figure 1 and Figure 2 , further, in some embodiments of the present invention, step S500: determining the threshold voltage offset of each CE, and rereading the physical page of the fourth array according to the threshold voltage offset, comprises:
[0107] 5.1 Obtain the threshold voltage offset of the last successful error correction of the corresponding CE reread operation from the fifth array; the fifth array is used to record the index of the threshold voltage offset of the last successful error correction of the reread operation of each CE in the threshold voltage offset array;
[0108] 5.2.1 If the threshold voltage offset is the default offset, the physical pages of the fourth array are re-read starting from the first set of threshold voltage offsets;
[0109] 5.2.2 If the threshold voltage offset is a non-default offset, the physical page of the fourth array is reread starting from the current group of threshold voltage offsets. If the reread fails, the physical page is reread starting from the first group of threshold voltage offsets.
[0110] Specifically, in this embodiment, the threshold voltage offset of the last successful error correction of the reread operation of the CE is obtained from the fifth array array D. If the threshold voltage offset is a default offset, the physical page recorded in the fourth array array B is reread from the first group of threshold voltage offsets; if the threshold voltage offset is a non-default offset, it is recorded as index x, and the physical page recorded in the fourth array array B is first reread using the xth group of threshold voltage offsets. If the reread still fails, it is reread from the first group of threshold voltage offsets. After the different reread methods of each CE are configured in the software, the software system implements control, configures the flash controller at the hardware level, and performs the above-set different types of reread operations on each CE in the flash memory device. Specifically, if the threshold voltage offset is a default offset, it means that the current CE has not performed a reread operation or the system has been restarted, so it is necessary to traverse the threshold voltage parameters from the first position at this time; if the threshold voltage offset is a non-default offset, it means that the current group of parameters makes the last ECC read error reread successfully, and the probability of the current read error being successfully reread using this group of threshold voltage offsets is the highest. The background of this step is: there are many groups of parameters that need to be reread, and each group of parameters that need to be reread corresponds to a scenario, such as parameter 1 for high temperature, parameter 2 for low temperature, parameter 3 for read interference, etc. If a CE successfully rereads with parameter 1, it means that the current chip is likely to be in a high temperature scenario. When a read error occurs again in the future, the probability of successfully rereading with parameter 1 is the highest, so parameter 1 is used for rereading first. If parameter 1 fails to be reread, the reread parameter list is traversed again from the beginning.
[0111] Reference Figure 1 and Figure 2 , further, in some embodiments of the present invention, step S500: determining the threshold voltage offset of each CE, and rereading the physical page of the fourth array according to the threshold voltage offset, further includes:
[0112] 5.3 If there is a task being reread in the corresponding CE, it is determined whether the threshold voltage offset being reread is the last group in the physical page being reread;
[0113] 5.4.1 If the threshold voltage offset being reread is the last group in the physical page being reread, updating the fourth array, the first variable and the second array;
[0114] 5.4.2 If the threshold voltage offset of the corresponding CE is not the last group, the next group of threshold voltage offsets is selected.
[0115] Reference Figure 1 and Figure 2, further, in some embodiments of the present invention, step S600: after the reread operation is completed, the first variable and the second array are updated, and the step of returning to the first queue of all CEs according to the reread task and updating the fourth array according to the traversal result until all the reread operations are completed includes:
[0116] 6.1 If the corresponding CE is not the last CE, return to step: traverse the first queue of all CEs, and when there are physical pages waiting to be reread in the first queue, determine whether there is a task being reread in the corresponding CE according to the fourth array;
[0117] 6.2 If the corresponding CE is the last CE, wait for all CE reread operations to end, check the ECC results generated after rereading, update the fourth array, the first variable and the second array according to the ECC results, and return to step: determine whether to continue rereading according to the value of the first variable.
[0118] Specifically, in this embodiment, the reread operation of all CEs in the current cycle is waited to be completed, and then the ECC result is checked. According to the ECC result, the fourth array array B, the first variable variable A and the second array array E are updated, that is, if ECC OK, it means that the reread is successful, and the elements in arrayB corresponding to the reread are cleared, and at the same time variableA is reduced by 1, and the element value in arrayE corresponding to the CE is reduced by 1. Finally, check whether all reread tasks have been completed? There are two standards for completion, one is successful error correction, and the other is that all threshold voltage offsets cannot be corrected successfully. If yes, the index of the threshold voltage offset that has been successfully corrected is recorded to array D, and then the reread process is exited; otherwise, jump back to step S400 to check whether the value of the current first variable is 0. If it is 0, it means that there is no physical page waiting to be reread in the current flash memory device, and the reread process is directly terminated without subsequent reread operations; if it is not 0, it means that there is a physical page waiting to be reread in the current flash memory device, and the reread process continues. More specifically, all reread operations can be divided into two steps: pre-read command and data out command. This is the data interaction between the flash controller and the flash memory. The software only needs to configure the relevant command parameters to the flash controller, and the flash controller will execute it. The software can know whether the corresponding command has been executed according to the register and the execution result buffer. Waiting for the end of the operation here means waiting for the flash controller to return the execution end flag. If the software finds this flag, it means that all pre-read commands and data out commands have been executed and the data has been transferred to the specified data buffer.
[0119] Reference Figure 1 and Figure 2Further, in some embodiments of the present invention, in step 6.2, updating the fourth array, the first variable, and the second array according to the ECC result includes:
[0120] If the ECC result of CE is OK, it means that the reread operation of the corresponding CE is successful, the elements of CE in the fourth array are cleared, the value of the first variable is reduced by one, and the value of the elements of CE in the second array is reduced by one.
[0121] Reference Figure 1 and Figure 2 Furthermore, in some embodiments of the present invention, the codeword information includes: a physical address, a data buffer address, and a buffer address of an ECC result.
[0122] Reference Figure 1 and Figure 2 Further, in some embodiments of the present invention, step 4.1: determining whether to continue rereading according to the value of the first variable, comprises:
[0123] If the value of the first variable is not zero, it is determined to continue rereading;
[0124] If the value of the first variable is zero, the rereading ends.
[0125] Specifically, in this embodiment, it is checked whether the current value of the first variable is 0. If it is 0, it means that there are no physical pages waiting to be reread in the current flash memory device, and the reread process is directly terminated without performing subsequent reread operations. If it is not 0, it means that there are physical pages waiting to be reread in the current flash memory device, and the reread process continues.
[0126] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
Claims
1. A storage medium asynchronous reread error correction method, characterized in that: Applied to a flash memory device having multiple CEs, the storage medium asynchronous reread error correction method comprises: Obtaining an ECC result of the flash memory device; According to the ECC result, the physical page where the ECC error occurs and needs to be reread is determined, and the first array, the second array, the first variable, the plurality of first queues and the third array are updated; the first array is used to record the information of all the physical pages that need to be reread, the first variable is used to record the total number of all the physical pages that need to be reread, each of the CEs has a corresponding first queue, the first queue is used to record the physical pages that the corresponding CE needs to reread, the second array is used to record the total number of physical pages that each of the CEs needs to reread; the third array is used to record the end node of each of the first queues; Creating a reread task according to the ECC result; According to the rereading task, traverse the first queues of all the CEs, and update the fourth array according to the traversal result; the fourth array is used to record the physical pages being reread by each of the first queues; determining a threshold voltage offset of each of the CEs, and rereading a physical page of the fourth array according to the threshold voltage offset; After the reread operation is completed, the first variable and the second array are updated, and the step of traversing the first queues of all the CEs according to the reread task and updating the fourth array according to the traversal result is returned until all the reread operations are completed.
2. The storage medium asynchronous reread error correction method according to claim 1, characterized in that: The creating a reread task according to the ECC result includes: According to the ECC result, determine the CE that needs to be reread, and create a reread task; Wait for all operations on the flash memory device in the current system to be completed, and give priority to entering the rereading process in the next task processing cycle.
3. The storage medium asynchronous reread error correction method according to claim 1, characterized in that: The updating of the first array, the second array, the first variable, the plurality of first queues and the third array comprises: Selecting a first element from the first array, and saving the codeword information corresponding to the ECC error in the CE into the first element; Set the next node pointer of the last element of the first queue to point to the first element; Update the value corresponding to the CE in the third array to the pointer of the first element; The value of the first variable is increased by one; In the second array, the value of the element corresponding to the current CE is increased by one.
4. The storage medium asynchronous reread error correction method according to claim 1, characterized in that: The step of traversing the first queues of all the CEs according to the rereading task and updating the fourth array according to the traversal result includes: Determining whether to continue rereading according to the value of the first variable; If it is determined to continue rereading, the first queues of all the CEs are traversed, and when there are physical pages waiting to be reread in the first queues, it is determined according to the fourth array whether there is a task being reread in the corresponding CE; If there is no task being reread in the corresponding CE, the physical page information of the task waiting to be reread is recorded in the fourth array.
5. The storage medium asynchronous reread error correction method according to claim 4, characterized in that: The determining of the threshold voltage offset of each of the CEs and rereading the physical page of the fourth array according to the threshold voltage offset comprises: Obtain the threshold voltage offset corresponding to the last successful error correction of the reread operation of the corresponding CE from the fifth array; the fifth array is used to record the index of the threshold voltage offset of the last successful error correction of the reread operation of each CE in the threshold voltage offset array; If the threshold voltage offset is a default offset, the physical pages of the fourth array are re-read starting from the first set of the threshold voltage offsets; If the threshold voltage offset is a non-default offset, the physical page of the fourth array is re-read starting from the current group of the threshold voltage offsets, and if the re-reading fails, the physical page is re-read starting from the first group of the threshold voltage offsets.
6. The storage medium asynchronous reread error correction method according to claim 5, characterized in that: The determining of the threshold voltage offset of each of the CEs and rereading the physical page of the fourth array according to the threshold voltage offset further includes: If there is a task being reread in the corresponding CE, determining whether the threshold voltage offset being reread is the last group in the physical page being reread; If the threshold voltage offset being reread is the last group in the physical page being reread, updating the fourth array, the first variable and the second array; If the threshold voltage offset of the corresponding CE is not the last group, the next group of threshold voltage offsets is selected.
7. The storage medium asynchronous reread error correction method according to claim 6, characterized in that: After the reread operation is completed, the first variable and the second array are updated, and the step of traversing the first queues of all the CEs according to the reread task and updating the fourth array according to the traversal result is returned until all the reread operations are completed, including: If the corresponding CE is not the last CE, return to the step: traverse the first queues of all the CEs, and when there are physical pages waiting to be reread in the first queues, determine whether there is a task being reread in the corresponding CE according to the fourth array; If the corresponding CE is the last CE, wait for all the CE reread operations to be completed, check the ECC results generated after rereading, update the fourth array, the first variable and the second array according to the ECC results, and return to step: determine whether to continue rereading according to the value of the first variable.
8. The storage medium asynchronous reread error correction method according to claim 7, characterized in that: The updating of the fourth array, the first variable and the second array according to the ECC result comprises: If the ECC result of the CE is OK, it means that the corresponding reread operation of the CE is successful, the elements of the CE in the fourth array are cleared, the value of the first variable is reduced by one, and the value of the elements of the CE in the second array is reduced by one.
9. The storage medium asynchronous reread error correction method according to claim 3, characterized in that: The codeword information includes: a physical address, a data buffer address, and a buffer address of the ECC result.
10. The storage medium asynchronous reread error correction method according to claim 4, characterized in that: The step of determining whether to continue rereading according to the value of the first variable includes: If the value of the first variable is not zero, it is determined to continue rereading; If the value of the first variable is zero, the rereading is terminated.
Citation Information
Patent Citations
Method of reading data from a non-volatile memory and devices and systems to implement same
CN103035294A
Flash memory system
CN103946923A
Method for re-reading data of page
CN110502185A
Method, system and equipment for improving reading speed of flash memory and storage medium
CN112992236A
Methods and apparatuses for proactive ECC failure handling
US20190095274A1