1. Field of the Invention
The present invention relates to a method of writing data in a non-volatile memory and a non-volatile storage device using the same, and more particularly, to a method of writing data in a non-volatile memory capable of enhancing the reliability and endurance of the non-volatile memory and a non-volatile storage device using the same.
2. Description of the Prior Art
A memory controller is commonly utilized for task management in a memory system, especially in a non-volatile memory system. In general, since data stored in a non-volatile memory system may not be lost after electric power of the non-volatile memory system is cut off, the non-volatile memory system becomes an important means to store system data. Among those non-volatile memory systems, the NAND flash memory, which has advantages of low power and high speed, becomes popular with the popularization of portable devices in recent years.
In order to reduce cost and area of the NAND flash memory, the storage capacity per unit of area in the NAND flash memory keeps increasing by using advanced process, increasing bit numbers per cell, and using 3D storage structures. Such evolution causes severe disturbances on the data stored in the NAND flash memory, and thus reliability of the data is reduced.
The memory controller plays an important role in enhancing the reliability. Error correcting codes (ECC) and threshold voltage tuning are techniques commonly utilized for correcting the data. These techniques always recover data when reading the data. Even if the ECC or voltage tuning capability is powerful, there is still a possibility that data may not be recovered. If the data recovery process fails, the accurate data may be lost, such that the reliability of the NAND flash memory will be reduced. Thus, there is a need for improvement over the prior art.
It is therefore an objective of the present invention to provide a method of writing data in a non-volatile memory capable of enhancing the reliability and endurance of the non-volatile memory.
The present invention discloses a method of writing data in a non-volatile memory. The method comprises writing data from a first memory unit to a second memory unit of the non-volatile memory; checking a health of the second memory unit to generate a health result; and reserving the data in the first memory unit and mapping information corresponding to the first memory unit when the health result indicates that the second memory unit is unhealthy.
The present invention further discloses a non-volatile storage device. The non-volatile storage device comprises a non-volatile memory and a memory controller. The memory controller, coupled to the non-volatile memory, is utilized for writing data in the non-volatile memory by executing the following steps: writing data from a first memory unit to a second memory unit of the non-volatile memory; checking a health of the second memory unit to generate a health result; and reserving the data in the first memory unit and mapping information corresponding to the first memory unit when the health result indicates that the second memory unit is unhealthy.
The present invention further discloses a method of writing data in a non-volatile memory. The method comprises writing data from a first memory unit to a second memory unit of the non-volatile memory according to a writing strategy; checking a health of the second memory unit to generate a health result; reserving the data in the first memory unit and mapping information corresponding to the first memory unit when the health result indicates that the second memory unit is unhealthy; and modifying the writing strategy according to the health result.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Please refer to
Please refer to
Step 200: Start.
Step 202: Write data from a first memory unit to a second memory unit of the non-volatile memory.
Step 204: Check a health of the second memory unit to generate a health result.
Step 206: Determine whether the second memory unit is healthy according to the health result. If yes, go to 208; otherwise, go to 210.
Step 208: Discard the data in the first memory unit or the mapping information corresponding to the first memory unit.
Step 210: Reserve the data in the first memory unit and the mapping information corresponding to the first memory unit.
Step 212: End.
In general, the data in the first memory unit or the mapping information corresponding to the first memory unit is always discarded after the data is written into the second memory unit, but in the writing process 20, the data in the first memory unit or the mapping information corresponding to the first memory unit is discarded only when the data is written into the second memory unit and the second memory unit is determined to be healthy.
In Step 202, there is data moved from a first memory unit to a second memory unit of the non-volatile memory. The data may be moved inside the non-volatile memory 100 or moved from external memories. Please refer to
In Step 204, a health of the second memory unit is checked and a health result is generated. As shown in
In Step 206, whether the second memory unit is healthy is determined according to the health result. In an embodiment, the health status of a memory unit may be determined according to an error rate of the memory unit. The memory controller 102 may determine whether the error rate of the memory unit is greater than a threshold, in order to check the health status of the memory unit. If the error rate of the memory unit is greater than a threshold, the memory unit is determined to be unhealthy; if the error rate of the memory unit is smaller than the threshold, the memory unit is determined to be healthy. It is intuitive to consider the error rate as a number of error bit in the memory unit, and the threshold may be determined to be a specific error bit number that can still be recovered by an available ECC technique. For example, if the available ECC engine is capable of correcting up to 20 error bits in a memory unit, the threshold may be determined to be an error bit number less than 20, e.g. 14 or 16, according to reliability requirements. In another embodiment, the health of a memory unit may be determined according to an iteration number of an ECC technique for the data written in a memory unit. For example, if a specific ECC technique can recover data within 20 iterations, the threshold may be determined to be a number of iterations smaller than 20, e.g. 14. In such a condition, if the data stored in the memory unit can be recovered by the specific ECC technique within 14 iterations, the memory unit will be determined to be healthy; otherwise, if the data cannot be recovered within 14 iterations, the memory unit will be determined to be unhealthy.
In Steps 208 and 210, the data is discarded or reserved according to whether the second memory unit is healthy. As shown in
Please note that, the present invention provides a method of writing data in a non-volatile memory capable of enhancing the reliability and endurance of the non-volatile memory by reserving the data in the source memory unit and mapping information corresponding to the source memory unit when the destination memory unit is unhealthy. Those skilled in the art can make modifications and alternations accordingly. For example, in order to achieve the balance between reliability and writing performance, the writing process 20 may be incorporated with different writing strategies according to the health result of the memory unit.
Please refer to
Step 400: Start.
Step 402: Write data from a first memory unit to a second memory unit of the non-volatile memory according to a writing strategy.
Step 404: Check a health of the second memory unit to generate a health result.
Step 406: Determine whether the second memory unit is healthy according to the health result. If yes, go to 408; otherwise, go to 410.
Step 408: Discard the data in the first memory unit or the mapping information corresponding to the first memory unit, and go to Step 402.
Step 410: Reserve the data in the first memory unit and the mapping information corresponding to the first memory unit.
Step 412: Modify the writing strategy according to the health result, and go to Step 402.
According to the writing process 40, a writing strategy may be applied to write data into the second memory unit of the non-volatile memory, and the writing strategy may be modified according to the health result. When data is written from the first memory unit to the second memory unit of the non-volatile memory 100 according to a writing strategy, the memory controller 102 checks the health of the second memory unit to generate a health result or finds the health result recorded in a management table. The memory controller 102 then determines whether the second memory unit is healthy according to the health result. If the second memory unit is healthy, the data in the first memory unit or the mapping information corresponding to the first memory unit may be discarded. If the second memory unit is unhealthy, the data in the first memory unit and the mapping information corresponding to the first memory unit should be reserved, in order to keep access to the data in the first memory unit. The memory controller 102 then modifies the writing strategy for the second memory unit, in order to enhance the reliability of subsequent data in the second memory unit. If the reliability is enhanced due to a powerful writing strategy, when there is new data written into the second memory unit via this powerful writing strategy, reservation of the source data may not be required.
Please note that, different writing strategies are applied in response to different health status. When the health status of a memory unit becomes worse, a more powerful writing strategy for enhancing reliability should be applied to compensate for the health status of the memory unit. Different writing strategies may include different ECC capabilities such as BCH codes and low-density parity-check (LDPC) codes. For example, a basic ECC engine, BCH40, may be applied when a memory unit starts to be in use and the error rate of the memory unit is low. The basic ECC engine may achieve higher writing speed, lower power consumption, lower memory space occupation and better performance when providing enough reliability. When the health status of the memory unit gets worse and the error rate increases to be higher than a threshold, a powerful ECC engine such as BCH70 or BCH100 may be utilized for enhancing reliability and endurance. Furthermore, if the memory unit wears out and includes more error bits, a higher level ECC engine such as BCH140 or LDPC may be utilized for correcting more error bits. It is worth mentioned that the threshold for determining the health of the memory unit may be varied according to different writing strategies. For example, if an ECC engine is capable of correcting 20 error bits in the memory unit, the corresponding threshold may be 14 error bits; if an ECC engine is capable of correcting 40 error bits in the memory unit, the corresponding threshold may be 28 error bits.
Noticeably, when the higher level ECC is applied, more buffer space is required for storing the parity codes for error correction. Sometimes the parity codes are longer than whole storage space of the memory unit; hence it is desirable to reserve a memory space for storing these parity codes. When the memory unit 100 is healthy, the reserved memory space may be used as extra read/write buffer to enhance system throughput. When the health status of the memory unit 100 gets worse, this reserved memory space may be utilized for storing the parity bits required for enhancing the reliability and endurance.
Please note that the step of reserving data in the source memory unit (Step 410) and the step of modifying the writing strategy (Step 412) are both capable of enhancing reliability. Only the step of reserving data in the source memory unit is feasible for enhancing reliability of the present data. Since data is already written into the memory unit before the health of this memory unit is checked, the new strategy should be applied for subsequent writing process in this memory unit.
In an embodiment, the writing strategies may include different level numbers of a multi-level cell (MLC) configuration. For example, if a memory unit having MLC configuration is determined to be unhealthy, the memory controller may reconfigure this memory unit to store data using single-level cell (SLC) configuration. The reliability and endurance can therefore be achieved since the voltage different for data determination is enlarged, but storage capacity of the memory unit may be sacrificed. In another embodiment, the writing strategies may also include programming dummy data in at least one page of a memory unit. For example, if a memory unit with MLC configuration has two memory pages and the memory unit is determined to be unhealthy, the memory controller may program dummy data in the most significant bit (MSB) page or the least significant bit (LSB) page of the memory unit. The reliability and endurance can therefore be achieved since data is not easily interfered with by the other page of data. Please note that, different writing strategies, including but not limited to different ECC engines, different cell configurations, dummy data programming, and other possible reliability enhancing strategies, may be applied together to achieve different levels of reliability enhancing capabilities according to system requirements.
In the prior art, ECC and threshold voltage tuning techniques always recover data when reading the data. Even if the ECC or voltage tuning capability is powerful, it is still a possibility that data may not be recovered. If the data recovery process fails, the accurate data may be lost, such that the reliability and endurance of the non-volatile memory will be reduced. In comparison, the present invention provides a method of writing data in a non-volatile memory and a non-volatile storage device capable of reserving data in the source memory unit and mapping information corresponding to the source memory unit when writing data into the destination memory unit and determining that the destination memory unit is unhealthy. When the correct data cannot be recovered since the health of destination memory unit is poor, it can still be found in the source memory unit, which enhances the reliability and endurance of the non-volatile memory.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application claims the benefit of U.S. Provisional Application No. 61/890,860, filed on Oct. 14, 2013 and entitled “Method to Enhance the Reliability in a Non-volatile Memory System”, the contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61890860 | Oct 2013 | US |