Storage medium asynchronous reread error correction method
By adopting asynchronous error correction methods in flash memory devices, the rereading task of each chip is independently handled, and the problem of low error correction efficiency under the synchronous error correction mechanism is solved, achieving more efficient error correction speed and performance.
Patent Information
- Application Number
- CN202510143177.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-02-10
AI Technical Summary
In the prior art, under the synchronous error correction mechanism, multi-chip flash memory devices need to wait for RB signal preparation when multiple chips are incorrect, resulting in low error correction efficiency and unable to fully utilize the advantages of multi-chip parallel operation.
The asynchronous error correction method is adopted to create independent reread task queues and variables, and independently process the reread operation of each chip according to the ECC results, reducing the time to wait for the RB signal and improving error correction efficiency.
In multi-chip flash memory devices, independent rereading operations between each chip are realized, which reduces the time to wait for the RB signal, and improves the error correction speed and overall error correction performance.
Smart Images

Figure CN119905131B_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 related technologies, as flash memory density gradually increases, its reliability has declined. The most critical reliability is the integrity and correctness of user data. The smallest unit of flash memory read operation is the page. The smallest unit of encoding and decoding in the current mainstream LDPC engine is the codeword. A codeword occupies 4K bytes, so a page can store multiple codewords. When a page is read and an ECC error occurs in a codeword contained in that page, a common solution is to use the specified command provided by the flash memory manufacturer, combined with the data provided by the feature analysis, to change the flash memory's threshold voltage offset and then reread 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] Most multi-CE products currently on the market use a synchronous error correction mechanism for reread operations. This means that when an ECC error occurs in a read operation on a CE, all other CE operations are interrupted or paused until the page with the ECC error is corrected. While this error correction process is simple, it sacrifices the advantage of parallel operation of multiple CEs. When ECC errors occur simultaneously on multiple CEs, the synchronous error correction mechanism uses a single read command to reread all pages with ECC errors one by one. Each single read command requires waiting for the RB signal to transition from busy to ready before data can be retrieved from the flash memory. This wait time is typically 30 to 60 μs. Therefore, with the synchronous error correction mechanism, some time is spent waiting for the RB to be 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. This method enables the reread process of each CE in a multi-CE flash firmware device to be relatively independent, reducing the impact of each CE on the other and improving the efficiency and speed of ECC error correction.
[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. 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, a physical page where an ECC error occurs and needs to be reread is determined, and a first array, a second array, a first variable, a plurality of first queues, and a third array are updated; the first array is used to record 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;
[0008] Creating a reread task based on the ECC result;
[0009] According to the reread task, traverse the first queues of all the CEs, and update a fourth array according to the traversal result; the fourth array is used to record the physical page 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 reread operations are completed.
[0012] According to some embodiments of the present invention, creating a reread task according to the ECC result includes:
[0013] Determine the CE that needs to be reread according to the ECC result, and create a reread task;
[0014] Wait until all operations on the flash memory device in the current system are completed, and give priority to entering the reread 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 includes:
[0016] Selecting a first element from the first array, and saving 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 reread 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 CE and rereading a physical page of the fourth array according to the threshold voltage offset includes:
[0026] Obtaining 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 each CE in the threshold voltage offset array when the error correction of the last successful reread operation was performed;
[0027] If the threshold voltage offset is a default offset, rereading the physical pages of the fourth array starting from the first set of the threshold voltage offsets;
[0028] If the threshold voltage offset is a non-default offset, the physical pages of the fourth array are reread starting from the current set of threshold voltage offsets. If the reread fails, the physical pages are reread starting from the first set of 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 pages 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 reread operations are completed. The method includes:
[0034] If the corresponding CE is not the last CE, return to the step of traversing the first queues of all the CEs, and when there are physical pages waiting to be reread in the first queues, determine, based on the fourth array, whether there is a task being reread in the corresponding CE;
[0035] If the corresponding CE is the last CE, wait for all 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 element 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 ended.
[0042] The asynchronous reread error correction method for storage media according to an 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 based on the ECC result of the flash memory device, a reread task is created and the variables required for the reread task are updated, thereby achieving 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, thereby achieving 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.
[0043] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by 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, in which:
[0045] Figure 1 This 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 This 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] The following describes embodiments of the present invention in detail. Examples of the embodiments 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 intended only to explain the present invention and are not to be construed 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., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings. They 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. Therefore, they cannot be understood as limitations on the present invention.
[0049] In the description of the present invention, "several" means more than one, "plurality" means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, while "above," "below," and "within" are understood to include the number itself. The use of "first" and "second" in the description is solely for the purpose of distinguishing technical features and should not be construed as indicating or implying relative importance, implicitly specifying the number of the indicated technical features, or implicitly specifying the order of the indicated technical features.
[0050] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, and connecting 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, reference to terms such as "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 exemplary expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[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: Based on the ECC result, determine the physical page that has an ECC error 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 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: Create a reread task based on the ECC result;
[0056] Step S400: traverse the first queues of all CEs according to the reread 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 rereading a physical page of a fourth array according to the threshold voltage offset;
[0058] Step S600: After the reread operation is completed, the first variable and the second array are updated, and the process returns to step S400: according to the reread task, the first queues of all CEs are traversed, and according to the traversal result, the fourth array is updated until all the 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 and detects that ECC errors have occurred 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] Multiple first queues, i.e., multiple CE waiting reread queues, denoted as queue A, corresponding one-to-one to multiple CEs in the flash memory device, and used to record pointers to physical page information of corresponding CEs waiting to be reread;
[0061] The third array, namely the end node array of the CE waiting reread queue, is recorded as array A, which is used to record the end node pointer of each CE waiting reread queue;
[0062] The fourth array, namely the physical page array being reread by 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, namely the total number of reread physical pages, is denoted 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, i.e., the values of the elements in the second array E, are random and depend on the number of ECC errors detected by the system. The sum of the elements in the second array E equals the first variable A. The first, third, fourth, second, and fifth arrays each contain a copy of data for each CE in the flash firmware device.
[0068] The asynchronous reread error correction method for storage media of this embodiment then proceeds to step S100: obtaining the ECC result of the flash memory device, and step S200: determining, based on the ECC result, the physical page that has an ECC error and needs to be reread, and updating the first array, the second array, the first variable, the plurality of first queues, and the third array. The ECC result includes information corresponding to the aforementioned variables, and the ECC result is automatically updated by the hardware (i.e., the flash memory controller). The read operation is performed in units of code words, each code word being 4KB in size. Each code word is associated with an ECC result buffer. Based on the ECC result information returned by the storage hardware, the software can determine 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 corresponding reread task is created, i.e., step S300 is executed: creating a reread task based on the ECC result. For example, assuming an ECC error is detected in CE0, the software will select an element x from the first array C and save all the codeword information corresponding to this 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 A corresponding to CE0 to element x; update the value corresponding to CE0 in the third array A to the pointer to element x, indicating that element x is the last node in the first queue A corresponding to CE0; increase the value of the first 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, it prioritizes the reread process in the next task processing loop, waits for all operations on the flash memory device in the current system to complete, and then executes step S400: traverse the first queues of all CEs based on the reread task and update the fourth array B based on the traversal results. Specifically, it first checks whether the current value of the first variable is 0. If it is 0, it indicates that there are no physical pages waiting to be reread in the current flash memory device, and the reread process is terminated without further reread operations. If it is not 0, it indicates that there are physical pages waiting to be reread in the current flash memory device, and the reread process continues. Then, starting from CE0, it traverses the first queue A of each CE. If there is a task currently waiting to be reread, it is recorded in the corresponding element of the fourth array B.
[0070] Then, step S500 is executed: determining the threshold voltage offset of each CE and rereading the physical pages of the fourth array based on the threshold voltage offset. Specifically, the threshold voltage offset of the CE that successfully corrected the error in the last reread operation is obtained from the fifth array D. If the threshold voltage offset is a default offset, the physical pages recorded in the fourth array B are reread starting from the first set of threshold voltage offsets. If the threshold voltage offset is a non-default offset, which is recorded as index x, the physical pages recorded in the fourth array B are first reread using the xth set of threshold voltage offsets. If the reread still fails, the physical pages are reread starting from the first set of threshold voltage offsets. After configuring different reread methods for each CE in the software, the software system implements control and configures the flash memory controller at the hardware level to perform the different types of reread operations set above on 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 corresponds 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 most likely in a high temperature scenario. When the CE has a read error again later, the probability of successfully rereading using 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 loop 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 element in arrayB corresponding to the reread is cleared. 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 in array D, and then the reread process is exited; otherwise, the process jumps back to step S400 to 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 further 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 is continued. More specifically, all reread operations can be divided into two steps: pre-read command and data out command. This is a 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 it. The software can know whether the corresponding command has been executed based on the register and the execution result buffer. Waiting for the operation to end here means 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 in 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 synchronous error correction process is as follows:
[0074] ① After setting the threshold voltage offset of CE0, send the single read command for CE0 page 0. After waiting for the RB signal to be ready, send the data out command to retrieve the data.
[0075] ② Check the ECC result of the data. If the ECC is correct or the threshold voltage parameter table has been used and the error still cannot be corrected, continue. If the ECC error is still present, obtain the next set of threshold voltage parameters and jump to ①.
[0076] ③ After setting the threshold voltage offset of CE1, send the single read command for CE1 page 3. After waiting for the RB signal to be ready, send the data out command to retrieve the data.
[0077] ④ Check the ECC result of the data. If the ECC is correct or the threshold voltage parameter table has been used and the error still cannot be corrected, continue. If the ECC error is still present, obtain the next set of threshold voltage parameters and jump to ③.
[0078] ⑤ After setting the threshold voltage offset of CE2, send the single read command for CE2 page 5. After waiting for the RB signal to be ready, send the data out command to retrieve the data.
[0079] ⑥ Check the ECC results of the data. If the ECC is correct or the threshold voltage parameter table has been used and still cannot be corrected, exit. If there is still an ECC error, obtain 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 threshold voltage offset is set using the set feature command 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 be overlapped, 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 based on the ECC result of the flash memory device, thereby achieving 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, completely independent reread operations between each CE are achieved 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 Furthermore, in some embodiments of the present invention, step S300: creating a reread task according to the ECC result includes:
[0091] 3.1 Based on the ECC results, 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 the hardware (i.e., the flash memory controller), and the read operation is based on the code word. The size of each code word is 4K bytes, and each code word is equipped with an ECC result buffer. Based on the ECC result information returned by the storage hardware, the software can know whether an ECC error occurs in the corresponding code word read operation based on the ECC result buffer. If an ECC error occurs, 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 Furthermore, 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 includes:
[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 C, and then save the codeword information corresponding to this 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 to 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.
[0101] Reference Figure 1 and Figure 2Furthermore, in some embodiments of the present invention, step S400: traversing the first queues of all CEs according to the reread task, and updating the fourth array according to the traversal result, includes:
[0102] 4.1 Determine whether to continue rereading based on 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, the fourth array is used to determine whether there is a task being reread in the corresponding CE.
[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, the first step is to check whether the current value of the first variable is 0. If it is 0, it indicates that there are no physical pages waiting to be reread in the current flash memory device, and the reread process is terminated without further reread operations. If it is not 0, it indicates that there are physical pages waiting to be reread in the current flash memory device, and the reread process is continued. Then, starting from CE0, the first queue A of each CE is traversed. If there is a task currently waiting to be reread, it is recorded in the corresponding element of the fourth array B.
[0106] Reference Figure 1 and Figure 2 Furthermore, in some embodiments of the present invention, step S500: determining a threshold voltage offset of each CE, and rereading a physical page of the fourth array according to the threshold voltage offset, includes:
[0107] 5.1 Obtaining the threshold voltage offset of the last successful error correction in the reread operation of the corresponding CE from the fifth array; the fifth array is used to record the threshold voltage offset of the last successful error correction in the reread operation of each CE and the index 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 reread 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 pages of the fourth array are reread starting from the current set of threshold voltage offsets. If the reread fails, the physical pages are reread starting from the first set of threshold voltage offsets.
[0110] Specifically, in this embodiment, the threshold voltage offset for the last successful error correction during a reread operation on the CE is obtained from the fifth array D. If the threshold voltage offset is a default offset, the physical page recorded in the fourth array B is reread starting from the first set of threshold voltage offsets. If the threshold voltage offset is a non-default offset, which is recorded as index x, the physical page recorded in the fourth array B is first reread using the xth set of threshold voltage offsets. If the reread still fails, the physical page is reread starting from the first set of threshold voltage offsets. After configuring different reread methods for each CE in software, the software system implements control and configures the flash memory controller at the hardware level to perform the different types of reread operations configured above on each CE in the flash memory device. Specifically, if the threshold voltage offset is a default offset, it indicates that the current CE has not undergone a reread operation or the system has been restarted, so it is necessary to traverse the threshold voltage parameters starting from the first set. If the threshold voltage offset is a non-default offset, it indicates that the current set of parameters resulted in a successful reread of the previous ECC read error, and the probability of successfully rereading the current read error using this set of threshold voltage offsets is the highest. The background of this step is that 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, and parameter 3 for read disturb. If a CE successfully rereads using parameter 1, it indicates that the current chip is likely in a high-temperature scenario. If a read error occurs again in the future, the probability of rereading successfully using parameter 1 is the highest. Therefore, parameter 1 is used for rereading first. If parameter 1 fails to reread, the reread parameter list is traversed again from the beginning.
[0111] Reference Figure 1 and Figure 2 Furthermore, in some embodiments of the present invention, step S500: determining a threshold voltage offset of each CE, and rereading a 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, determine 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 2Furthermore, in some embodiments of the present invention, step S600: after the reread operation is completed, updating the first variable and the second array, and returning to the step of traversing the first queue of all CEs according to the reread task and updating the fourth array according to the traversal result until all 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. When there is a physical page waiting to be reread in the first queue, determine whether there is a task being reread in the corresponding CE based on the fourth array;
[0117] 6.2 If the corresponding CE is the last CE, wait for all CE reread operations to be completed, check the ECC results generated after the reread, 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 for all CEs in the current loop is completed. The ECC result is then checked. Based on the ECC result, the fourth array B, the first variable A, and the second array E are updated. If the ECC result is OK, the reread is successful, the element in array B corresponding to the reread is cleared, variable A is decremented by 1, and the element in array E corresponding to the CE is decremented by 1. Finally, a check is performed to determine whether all reread tasks have been completed. There are two criteria for completion: successful error correction and failure to correct all threshold voltage offsets. If so, the index of the threshold voltage offset that was successfully corrected is recorded in array D, and the reread process exits. Otherwise, the process returns to step S400 to check whether the current value of the first variable is 0. If so, it indicates that no physical pages are currently waiting to be reread in the flash memory device, and the reread process ends immediately without further reread operations. If not, it indicates that a physical page is currently waiting to be reread in the flash memory device, and the reread process continues. More specifically, all reread operations can be broken down into two steps: a pre-read command and a data-out command. This involves data exchange between the flash memory controller and the flash memory. Software simply configures the relevant command parameters and sends them to the flash memory controller, which then executes them. Software then determines whether the corresponding command has completed based on registers and the execution result buffer. Waiting for the operation to complete means waiting for the flash memory controller to return a flag indicating the end of execution. Detecting this flag indicates that all pre-read and data-out commands have completed execution, and the data has been transferred to the designated data buffer.
[0119] Reference Figure 1 and Figure 2Furthermore, 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 element 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 an ECC result buffer address.
[0122] Reference Figure 1 and Figure 2 Furthermore, in some embodiments of the present invention, step 4.1: determining whether to continue rereading according to the value of the first variable, includes:
[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] While the embodiments of the present invention have been described in detail above with reference to the accompanying drawings, the present invention is not limited to the embodiments described above. Various modifications may be made within the scope of knowledge possessed by a person skilled in the art without departing from the spirit of the present invention. Furthermore, the embodiments of the present invention and the features thereof may be combined with one another unless there is a 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 includes: Obtaining an ECC result of the flash memory device; According to the ECC result, a physical page where an ECC error occurs and needs to be reread is determined, and a first array, a second array, a first variable, a plurality of first queues, and a third array are updated; the first array is used to record 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; Creating a reread task based on the ECC result; According to the reread task, traverse the first queues of all the CEs, and update a fourth array according to the traversal result; the fourth array is used to record the physical page 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 reread operations are completed.
2. The storage medium asynchronous reread error correction method according to claim 1, characterized in that: The step of creating a reread task according to the ECC result includes: Determine the CE that needs to be reread according to the ECC result, and create a reread task; Wait until all operations on the flash memory device in the current system are completed, and give priority to entering the reread 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 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 a threshold voltage offset of each of the CEs and rereading the physical page of the fourth array according to the threshold voltage offset includes: Obtaining 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 each CE in the threshold voltage offset array when the error correction of the last successful reread operation was performed; If the threshold voltage offset is a default offset, rereading the physical pages of the fourth array starting from the first set of the threshold voltage offsets; If the threshold voltage offset is a non-default offset, the physical pages of the fourth array are reread starting from the current set of threshold voltage offsets. If the reread fails, the physical pages are reread starting from the first set of threshold voltage offsets.
6. The storage medium asynchronous reread error correction method according to claim 5, characterized in that: The determining of a threshold voltage offset of each of the CEs and rereading the physical pages 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 reread operations are completed, including: If the corresponding CE is not the last CE, return to the step of traversing the first queues of all the CEs, and when there are physical pages waiting to be reread in the first queues, determine, based on the fourth array, whether there is a task being reread in the corresponding CE; If the corresponding CE is the last CE, wait for all 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 includes: 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 element 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 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 ended.
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