Average wear method, memory storage device and memory control circuit unit

By adopting a phased average wear method in rewriteable nonvolatile memory modules, combining the number of open bits and erasing times, the wear problem of memory modules in artificial intelligence training is solved, and the service life of the memory is extended.

CN118915966APending Publication Date: 2024-11-08PHISON ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410984007.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The prior art cannot effectively extend the service life of rewriteable nonvolatile memory modules, especially during artificial intelligence training, the wear problem caused by tunneling oxide layer degradation is difficult to effectively solve by traditional average wear method.

Method used

Using a phased average wear method, by obtaining the open number of bits and average erasing times of the solid erasing unit, we judge whether it exceeds the threshold, and perform targeted wear operations to avoid severe wear and extend the service life of the memory module.

Benefits of technology

Through a comprehensive judgment based on the number of open bits and erasing times, effective management of the wear status of the rewriteable non-volatile memory module is achieved, severe wear is avoided and the service life of the memory module is extended.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118915966A_ABST
    Figure CN118915966A_ABST
Patent Text Reader

Abstract

The invention provides a wear averaging method, a memory storage device and a memory control circuit unit. The average wear method comprises the following steps of: obtaining an open bit number of each entity erasing unit; judging whether a first entity erasing unit of which the open bit number is greater than a first threshold value exists or not; and in response to the existence of the first entity erasing unit of which the open bit number is greater than the first threshold value, executing a first average wear operation on the first entity erasing unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a memory management technology, and in particular to a wear leveling method, a memory storage device and a memory control circuit unit. Background Art

[0002] Portable electronic devices such as mobile phones and notebook computers have grown rapidly in recent years, resulting in a rapid increase in consumer demand for storage media. Rewritable non-volatile memory modules (e.g., flash memory) are very suitable for being built into the various portable electronic devices listed above because they have the characteristics of data non-volatility, power saving, small size, and no mechanical structure.

[0003] With the development of artificial intelligence (AI) technology, during AI training, rewritable non-volatile memory modules are constantly accessed in a short period of time, which greatly shortens the service life of rewritable non-volatile memory modules. In addition, high erase times will also cause serious tunneling oxide degradation to the storage unit, thereby wearing out the rewritable non-volatile memory module.

[0004] Generally speaking, in order to extend the service life of a rewritable non-volatile memory module, a wear leveling method is used to evenly use the physical erase unit in the rewritable non-volatile memory module. Traditional wear leveling methods mostly use the number of erases (P / Ecount) and / or error bits (errorbit) of the physical erase unit as the basis for implementing the wear leveling method. However, the wear leveling method based on the number of erases cannot effectively improve the wear condition of the rewritable non-volatile memory module. On the other hand, since the SLC mode is mostly used to access data during AI training, in the SLC mode, if the number of erases is low (for example, less than 120k times), almost no error bits will be generated. Therefore, the error bits cannot be used as the basis for implementing the wear leveling method. In addition, if the number of erases is high (for example, more than 120k times), the error bits increase rapidly. At this time, the rewritable non-volatile memory module has a certain degree of wear. Therefore, the wear leveling method based on error bits cannot effectively improve the wear condition of the rewritable non-volatile memory module.

[0005] Based on the above, how to extend the service life of the rewritable non-volatile memory module and solve the adverse effects caused by the degradation of the tunnel oxide layer are problems that those skilled in the art are eager to solve. Summary of the invention

[0006] The present invention provides a wear leveling method, a memory storage device and a memory control circuit unit, which can provide a staged wear leveling operation. When performing the wear leveling operation, the degree of wear of a rewritable non-volatile memory module is taken into consideration, so as to avoid the situation where the rewritable non-volatile memory module is severely worn and the service life of the rewritable non-volatile memory module is extended.

[0007] An exemplary embodiment of the present invention provides a wear leveling method for a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of physical erase units. The wear leveling method includes: obtaining the number of open bits of each of the plurality of physical erase units; determining whether there is a first physical erase unit whose number of open bits is greater than a first threshold; and in response to the presence of the first physical erase unit whose number of open bits is greater than the first threshold, performing a first wear leveling operation on the first physical erase unit.

[0008] In an exemplary embodiment of the present invention, the step of obtaining the number of open bits of each of the plurality of physical erasing units includes: performing a status read operation on each of the plurality of physical erasing units to obtain the number of open bits.

[0009] In an exemplary embodiment of the present invention, the step of performing the state reading operation includes: applying a reading voltage to a plurality of memory cells in a written state in each of the plurality of physical erasing units to obtain the number of open bits.

[0010] In an exemplary embodiment of the present invention, during the execution of the status reading operation, no error checking and correction operation is performed.

[0011] In an exemplary embodiment of the present invention, the wear leveling method further includes: obtaining an average number of erase times of the plurality of physical erase units; determining whether the average number of erase times is greater than a switching threshold; and in response to the average number of erase times being not greater than the switching threshold, performing a second wear leveling operation based on the number of erase times of each of the plurality of physical erase units.

[0012] In an exemplary embodiment of the present invention, the wear leveling method further includes: in response to the average erase count being greater than the switching threshold, performing the first wear leveling operation based on the number of open bits of each of the plurality of physical erase units.

[0013] In an exemplary embodiment of the present invention, the wear leveling method further includes: in response to the average erase count being greater than the switching threshold, performing the first wear leveling operation based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units.

[0014] In an exemplary embodiment of the present invention, the number of open bits is used to indicate the degree of wear of each of the plurality of physical erasure units.

[0015] In an exemplary embodiment of the present invention, the wear leveling method further comprises: in response to the number of the physical erase units whose open bit number is greater than the warning threshold being greater than a threshold value, outputting a warning signal.

[0016] An exemplary embodiment of the present invention further provides a memory storage device, which includes a connection interface unit, a rewritable non-volatile memory module and a memory control circuit unit. The memory control circuit unit is coupled to the connection interface unit and the rewritable non-volatile memory module. The connection interface unit is used to couple to a host system. The rewritable non-volatile memory module includes a plurality of physical erase units. The memory control circuit unit includes an error checking and correction circuit. The memory control circuit unit is used to obtain the number of open bits of each of the plurality of physical erase units. The memory control circuit unit is also used to determine whether there is a first physical erase unit whose number of open bits is greater than a first threshold. In response to the existence of the first physical erase unit whose number of open bits is greater than the first threshold, the memory control circuit unit is also used to perform a first wear leveling operation on the first physical erase unit.

[0017] In an exemplary embodiment of the present invention, the memory control circuit unit is further configured to perform a status reading operation on each of the plurality of physical erasing units to obtain the number of open bits.

[0018] In an exemplary embodiment of the present invention, the memory control circuit unit is further used to apply a read voltage to a plurality of memory cells in a write state in each of the plurality of physical erase units to obtain the number of open bits.

[0019] In an exemplary embodiment of the present invention, during the process in which the memory control circuit unit performs the status reading operation, the ECC circuit is not activated.

[0020] In an exemplary embodiment of the present invention, the memory control circuit unit is further used to obtain an average number of erasure times of the plurality of physical erasure units. The memory control circuit unit is further used to determine whether the average number of erasure times is greater than a switching threshold. In response to the average number of erasure times not being greater than the switching threshold, the memory control circuit unit is further used to perform a second wear leveling operation based on the number of erasure times of each of the plurality of physical erasure units.

[0021] In an exemplary embodiment of the present invention, in response to the average erase count being greater than the switching threshold, the memory control circuit unit is further configured to perform the first wear leveling operation based on the number of open bits of each of the plurality of physical erase units.

[0022] In an exemplary embodiment of the present invention, in response to the average erase count being greater than the switching threshold, the memory control circuit unit is further configured to perform the first wear leveling operation based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units.

[0023] In an exemplary embodiment of the present invention, in response to the number of the physical erase units whose open bit number is greater than the warning threshold being greater than a threshold value, the memory control circuit unit is further configured to output a warning signal.

[0024] The exemplary embodiment of the present invention further provides a memory control circuit unit, which is used to control a rewritable non-volatile memory module. The rewritable non-volatile memory module includes a plurality of physical erase units. The memory control circuit unit includes a host interface, a memory interface, an error checking and correction circuit, and a memory management circuit. The memory management circuit is coupled to the host interface, the memory interface, and the error checking and correction circuit. The host interface is used to couple to a host system. The memory interface is used to couple to the rewritable non-volatile memory module. The memory management circuit is used to obtain the number of open bits of each of the plurality of physical erase units. The memory management circuit is also used to determine whether there is a first physical erase unit whose number of open bits is greater than a first threshold. In response to the existence of the first physical erase unit whose number of open bits is greater than the first threshold, the memory management circuit is also used to perform a first wear leveling operation on the first physical erase unit.

[0025] In an exemplary embodiment of the present invention, the memory management circuit is further configured to perform a status read operation on each of the plurality of physical erasing units to obtain the number of open bits.

[0026] In an exemplary embodiment of the present invention, the memory management circuit is further used to apply a read voltage to a plurality of memory cells in a write state in each of the plurality of physical erasing units to obtain the number of open bits.

[0027] In an exemplary embodiment of the present invention, during the process in which the memory management circuit performs the status reading operation, the error checking and correction circuit is not activated.

[0028] In an exemplary embodiment of the present invention, the memory management circuit is further used to obtain an average number of erase times of the plurality of physical erase units. The memory management circuit is further used to determine whether the average number of erase times is greater than a switching threshold. In response to the average number of erase times not being greater than the switching threshold, the memory management circuit is further used to perform a second wear leveling operation based on the number of erase times of each of the plurality of physical erase units.

[0029] In an exemplary embodiment of the present invention, in response to the average erase count being greater than the switching threshold, the memory management circuit is further configured to perform the first wear leveling operation based on the number of open bits of each of the plurality of physical erase units.

[0030] In an exemplary embodiment of the present invention, in response to the average erase count being greater than the switching threshold, the memory management circuit is further configured to perform the first wear leveling operation based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units.

[0031] In an exemplary embodiment of the present invention, in response to the number of the physical erase units whose open bit number is greater than a warning threshold being greater than a threshold value, the memory management circuit is further configured to output a warning signal.

[0032] Based on the above, the wear leveling method, memory storage device and memory control circuit unit of the present invention, when the average number of erase times is greater than the switching threshold, that is, under the condition of high erase times, performs a first wear leveling operation according to the number of open bits used to indicate the degree of wear of the physical erase unit, so as to avoid serious wear of the physical erase unit in the rewritable non-volatile memory module and extend the service life of the rewritable non-volatile memory module. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a schematic diagram of a host system, a memory storage device, and an input / output (I / O) device according to an exemplary embodiment of the present invention;

[0034] Figure 2 is a schematic diagram of a host system, a memory storage device, and an I / O device according to an exemplary embodiment of the present invention;

[0035] Figure 3 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment of the present invention;

[0036] Figure 4 is a schematic diagram of a memory storage device according to an exemplary embodiment of the present invention;

[0037] Figure 5is a schematic diagram of a memory control circuit unit according to an exemplary embodiment of the present invention;

[0038] Figure 6 is a schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention;

[0039] Figure 7 is a flow chart of a wear leveling method according to an exemplary embodiment of the present invention;

[0040] Figure 8 is a flow chart of a wear leveling method according to an exemplary embodiment of the present invention;

[0041] Fig. 9 is a flow chart illustrating a wear leveling method according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0042] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.

[0043] Generally speaking, a memory storage device (also known as a memory storage system) includes a rewritable non-volatile memory module and a controller (also known as a control circuit). The memory storage device can be used together with a host system so that the host system can write data to the memory storage device or read data from the memory storage device.

[0044] Figure 1 is a schematic diagram of a host system, a memory storage device, and an input / output (I / O) device according to an exemplary embodiment of the present invention. Figure 2 is a schematic diagram of a host system, a memory storage device, and an I / O device according to an exemplary embodiment of the present invention.

[0045] Please refer to Figure 1 and Figure 2 The host system 11 may include a processor 111, a random access memory (RAM) 112, a read only memory (ROM) 113, and a data transmission interface 114. The processor 111, the random access memory 112, the read only memory 113, and the data transmission interface 114 may be connected to a system bus 110.

[0046] In an exemplary embodiment, the host system 11 may be connected to the memory storage device 10 via the data transmission interface 114. For example, the host system 11 may store data to the memory storage device 10 or read data from the memory storage device 10 via the data transmission interface 114. In addition, the host system 11 may be connected to the I / O device 12 via the system bus 110. For example, the host system 11 may transmit an output signal to the I / O device 12 or receive an input signal from the I / O device 12 via the system bus 110.

[0047] In an exemplary embodiment, the processor 111, the random access memory 112, the read-only memory 113 and the data transmission interface 114 may be disposed on the motherboard 20 of the host system 11. The number of the data transmission interface 114 may be one or more. Through the data transmission interface 114, the motherboard 20 may be connected to the memory storage device 10 via a wired or wireless manner.

[0048] In an exemplary embodiment, the memory storage device 10 may be, for example, a USB flash drive 201, a memory card 202, a solid state drive (SSD) 203, or a wireless memory storage device 204. The wireless memory storage device 204 may be, for example, a near field communication (NFC) memory storage device, a wireless fax (WiFi) memory storage device, a Bluetooth memory storage device, or a low power Bluetooth memory storage device (e.g., iBeacon) and other memory storage devices based on various wireless communication technologies. In addition, the motherboard 20 may also be connected to various I / O devices such as a global positioning system (GPS) module 205, a network interface card 206, a wireless transmission device 207, a keyboard 208, a screen 209, a speaker 210, etc. through the system bus 110. For example, in an exemplary embodiment, the motherboard 20 may access the wireless memory storage device 204 through the wireless transmission device 207.

[0049] In one exemplary embodiment, the host system 11 is a computer system. In one exemplary embodiment, the host system 11 can be any system that can substantially cooperate with the memory storage device to store data. In one exemplary embodiment, the memory storage device 10 and the host system 11 can respectively include Figure 3 A memory storage device 30 and a host system 31.

[0050] Figure 3 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment of the present invention. Figure 3, the memory storage device 30 can be used in conjunction with a host system 31 to store data. For example, the host system 31 can be a system such as a digital camera, a video camera, a communication device, an audio player, a video player, or a tablet computer. For example, the memory storage device 30 can be various non-volatile memory storage devices such as a Secure Digital (SD) card 32, a Compact Flash (CF) card 33, or an embedded storage device 34 used by the host system 31. The embedded storage device 34 includes various types of embedded storage devices that directly connect the memory module to the substrate of the host system, such as an embedded Multi Media Card (eMMC) 341 and / or an embedded Multi Chip Package (eMCP) storage device 342.

[0051] Figure 4 is a schematic diagram of a memory storage device according to an exemplary embodiment of the present invention. Figure 4 The memory storage device 10 includes a connection interface unit 41, a memory control circuit unit 42 and a rewritable non-volatile memory module 43.

[0052] The connection interface unit 41 is used to connect to the host system 11. The memory storage device 10 can communicate with the host system 11 via the connection interface unit 41. In an exemplary embodiment, the connection interface unit 41 is compatible with the Peripheral Component Interconnect Express (PCI Express) standard. However, it should be understood that the present invention is not limited thereto, and the connection interface unit 41 may also comply with the Serial Advanced Technology Attachment (SATA) standard, the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, the Universal Serial Bus (USB) standard, the SD interface standard, the Ultra High Speed-I (UHS-I) interface standard, the Ultra High Speed-II (UHS-II) interface standard, the Memory Stick (MS) interface standard, the MCP interface standard, the MMC interface standard, the eMMC interface standard, the Universal Flash Storage (UFS) interface standard, the eMCP interface standard, the CF interface standard, the Integrated Device Electronics (IDE) standard or other suitable standards. The connection interface unit 41 and the memory control circuit unit 42 may be packaged in one chip, or the connection interface unit 41 may be disposed outside a chip including the memory control circuit unit 42 .

[0053] The memory control circuit unit 42 is connected to the connection interface unit 41 and the rewritable non-volatile memory module 43. The memory control circuit unit 42 is used to execute a plurality of logic gates or control instructions implemented in hardware or firmware and to perform operations such as writing, reading and erasing data in the rewritable non-volatile memory module 43 according to the instructions of the host system 11.

[0054] The rewritable non-volatile memory module 43 is used to store data written by the host system 11. The rewritable non-volatile memory module 43 may include a single-level cell (SLC) NAND flash memory module (i.e., a flash memory module that can store 1 bit in one storage cell), a multi-level cell (MLC) NAND flash memory module (i.e., a flash memory module that can store 2 bits in one storage cell), a triple-level cell (TLC) NAND flash memory module (i.e., a flash memory module that can store 3 bits in one storage cell), a quad-level cell (QLC) NAND flash memory module (i.e., a flash memory module that can store 4 bits in one storage cell), other flash memory modules, or other memory modules with the same characteristics.

[0055] Each memory cell in the rewritable non-volatile memory module 43 stores one or more bits by changing the voltage (hereinafter also referred to as the critical voltage). Specifically, there is a charge trapping layer between the control gate and the channel of each memory cell. By applying a write voltage (also referred to as a programming voltage) to the control gate, the amount of electrons in the charge trapping layer can be changed, thereby changing the critical voltage of the memory cell. This operation of changing the critical voltage of the memory cell is also referred to as "writing data into the memory cell" or "programming the memory cell". The critical voltage can be used to reflect the data storage state of the memory cell. As the critical voltage changes, each memory cell in the rewritable non-volatile memory module 43 has multiple storage states. By applying a read voltage, it is possible to determine which storage state a memory cell belongs to, thereby obtaining one or more bits stored in this memory cell.

[0056] In an exemplary embodiment, the memory cells of the rewritable non-volatile memory module 43 may constitute a plurality of physical programming units, and these physical programming units may constitute a plurality of physical erasing units. Specifically, the memory cells on the same word line may constitute one or more physical programming units. If each memory cell can store more than 2 bits, the physical programming units on the same word line may be classified into at least a lower physical programming unit and an upper physical programming unit. For example, the least significant bit (LSB) of a memory cell belongs to the lower physical programming unit, and the most significant bit (MSB) of a memory cell belongs to the upper physical programming unit. Generally speaking, in an MLC NAND flash memory, the write speed of the lower physical programming unit is greater than the write speed of the upper physical programming unit, and / or the reliability of the lower physical programming unit is higher than the reliability of the upper physical programming unit.

[0057] In an exemplary embodiment, the physical programming unit is the smallest unit of programming. That is, the physical programming unit is the smallest unit for writing data. For example, the physical programming unit may be a physical page or a physical sector. If the physical programming unit is a physical page, these physical programming units may include a data bit area and a redundancy bit area. The data bit area includes a plurality of physical sectors for storing user data, and the redundancy bit area is used to store system data (for example, management data such as error correction codes). In an exemplary embodiment, the data bit area includes 32 physical sectors, and the size of a physical sector is 512 bytes (byte, B). However, in other exemplary embodiments, the data bit area may also include 8, 16 or more or less physical sectors, and the size of each physical sector may also be larger or smaller. On the other hand, the physical erasure unit is the smallest unit of erasure. That is, each physical erasure unit contains the minimum number of storage cells that are erased together. For example, the physical erasure unit is a physical block.

[0058] In an exemplary embodiment, a status read operation can be performed on each physical erase unit of the rewritable non-volatile memory module 43 to obtain the number of open bits of each physical erase unit. Specifically, a read voltage can be applied to a memory cell in a physical programming unit that is in a write state (i.e., data is written or programmed) in each physical erase unit to obtain the number of open bits of each physical erase unit. As the data access operation of the memory cell increases, that is, the rewritable non-volatile memory module 43 is in a state of high erase times, the electrons stored in the charge capture layer will partially flow to the tunneling oxide layer of the memory cell, thereby causing a shift in the threshold voltage. A read voltage is applied to the control gate of the memory cell to determine whether the threshold voltage of the memory cell is greater than the read voltage. If the threshold voltage of a memory cell is greater than the read voltage, the memory cell is a memory cell with a severe voltage shift, and the bit stored in the memory cell is an open bit. Accordingly, the number of open bits of a physical erasing unit can be used to indicate the wear level of the physical erasing unit. In other words, the number of open bits of all physical erasing units can be used to indicate the wear level of the rewritable non-volatile memory module 43.

[0059] Figure 5 is a schematic diagram of a memory control circuit unit according to an exemplary embodiment of the present invention. Figure 5 The memory control circuit unit 42 includes a memory management circuit 51 , a host interface 52 and a memory interface 53 .

[0060] The memory management circuit 51 is used to control the overall operation of the memory control circuit unit 42. Specifically, the memory management circuit 51 has a plurality of control instructions, and when the memory storage device 10 operates, these control instructions are executed to perform operations such as writing, reading and erasing data. The following description of the operation of the memory management circuit 51 is equivalent to the description of the operation of the memory control circuit unit 42.

[0061] In an exemplary embodiment, the control instructions of the memory management circuit 51 are implemented in the form of firmware. For example, the memory management circuit 51 has a microprocessor unit (not shown) and a read-only memory (not shown), and these control instructions are burned into the read-only memory. When the memory storage device 10 is operating, these control instructions are executed by the microprocessor unit to perform operations such as writing, reading and erasing data.

[0062] In an exemplary embodiment, the control instructions of the memory management circuit 51 can also be stored in a specific area of ​​the rewritable non-volatile memory module 43 (for example, a system area in the memory module dedicated to storing system data) in the form of program code. In addition, the memory management circuit 51 has a microprocessor unit (not shown), a read-only memory (not shown) and a random access memory (not shown). In particular, the read-only memory has a boot code, and when the memory control circuit unit 42 is enabled, the microprocessor unit will first execute the boot code to load the control instructions stored in the rewritable non-volatile memory module 43 into the random access memory of the memory management circuit 51. Afterwards, the microprocessor unit will run these control instructions to perform operations such as writing, reading and erasing data.

[0063] In an exemplary embodiment, the control instructions of the memory management circuit 51 can also be implemented in a hardware form. For example, the memory management circuit 51 includes a microcontroller, a storage unit management circuit, a memory write circuit, a memory read circuit, a memory erase circuit and a data processing circuit. The storage unit management circuit, the memory write circuit, the memory read circuit, the memory erase circuit and the data processing circuit are connected to the microcontroller. The storage unit management circuit is used to manage the storage unit or storage unit group of the rewritable non-volatile memory module 43. The memory write circuit is used to issue a write instruction sequence to the rewritable non-volatile memory module 43 to write data into the rewritable non-volatile memory module 43. The memory read circuit is used to issue a read instruction sequence to the rewritable non-volatile memory module 43 to read data from the rewritable non-volatile memory module 43. The memory erase circuit is used to issue an erase instruction sequence to the rewritable non-volatile memory module 43 to erase data from the rewritable non-volatile memory module 43. The data processing circuit is used to process data to be written to the rewritable non-volatile memory module 43 and data to be read from the rewritable non-volatile memory module 43. The write command sequence, the read command sequence and the erase command sequence may each include one or more program codes or command codes and are used to instruct the rewritable non-volatile memory module 43 to perform corresponding write, read and erase operations. In an exemplary embodiment, the memory management circuit 51 may also issue other types of command sequences to the rewritable non-volatile memory module 43 to instruct the execution of corresponding operations.

[0064] The host interface 52 is connected to the memory management circuit 51. The memory management circuit 51 can communicate with the host system 11 through the host interface 52. The host interface 52 can be used to receive and identify instructions and data transmitted by the host system 11. For example, the instructions and data transmitted by the host system 11 can be transmitted to the memory management circuit 51 through the host interface 52. In addition, the memory management circuit 51 can transmit data to the host system 11 through the host interface 52. In this exemplary embodiment, the host interface 52 is compatible with the PCI Express standard. However, it should be understood that the present invention is not limited to this, and the host interface 52 can also be compatible with the SATA standard, the PATA standard, the IEEE 1394 standard, the USB standard, the SD standard, the UHS-I standard, the UHS-II standard, the MS standard, the MMC standard, the eMMC standard, the UFS standard, the CF standard, the IDE standard or other suitable data transmission standards.

[0065] The memory interface 53 is connected to the memory management circuit 51 and is used to access the rewritable non-volatile memory module 43. For example, the memory management circuit 51 can access the rewritable non-volatile memory module 43 through the memory interface 53. That is, the data to be written to the rewritable non-volatile memory module 43 will be converted into a format acceptable to the rewritable non-volatile memory module 43 through the memory interface 53. Specifically, if the memory management circuit 51 wants to access the rewritable non-volatile memory module 43, the memory interface 53 will transmit a corresponding instruction sequence. For example, these instruction sequences may include a write instruction sequence indicating writing data, a read instruction sequence indicating reading data, an erase instruction sequence indicating erasing data, and corresponding instruction sequences for indicating various memory operations (for example, changing the read voltage level or performing a garbage collection (GC) operation, etc.). These instruction sequences are, for example, generated by the memory management circuit 51 and transmitted to the rewritable non-volatile memory module 43 through the memory interface 53. These instruction sequences may include one or more signals, or data on the bus. These signals or data may include instruction codes or program codes. For example, in a read instruction sequence, information such as a read identification code and a memory address may be included.

[0066] In an exemplary embodiment, the memory control circuit unit 42 further includes an error checking and correction circuit 54 , a buffer memory 55 , and a power management circuit 56 .

[0067] The error checking and correction circuit 54 is connected to the memory management circuit 51 and is used to perform error checking and correction operations to ensure the correctness of data. Specifically, when the memory management circuit 51 receives a write command from the host system 11, the error checking and correction circuit 54 generates a corresponding error correction code (ECC) and / or error detecting code (EDC) for the data corresponding to the write command, and the memory management circuit 51 writes the data corresponding to the write command and the corresponding error correction code and / or error checking code into the rewritable non-volatile memory module 43. Afterwards, when the memory management circuit 51 reads data from the rewritable non-volatile memory module 43, the error correction code and / or error checking code corresponding to the data will be read at the same time, and the error checking and correction circuit 54 will perform error checking and correction operations on the read data according to the error correction code and / or error checking code.

[0068] In an exemplary embodiment, the memory management circuit 51 obtains a status read command from the host system 11, and accordingly performs a status read operation on each physical erase unit in the rewritable non-volatile memory module 43 to obtain the number of open bits of each physical erase unit. For example, the memory management circuit 51 may apply a read voltage to a plurality of memory cells in a write state in each physical erase unit to obtain the number of open bits of each physical erase unit. Since the status read operation is used to check the offset state of the threshold voltage of the memory cell, rather than to check whether an error occurs in the read data, the error check and correction circuit 54 is not activated during the execution of the status read operation, that is, the error check and correction circuit 54 does not perform the above-mentioned error check and correction operation. For example, the number of open bits of each physical erase unit can be used to indicate the degree of wear of each physical erase unit. Therefore, if the number of physical erase units whose open bit number is greater than the warning threshold is greater than a threshold value, it means that the rewritable non-volatile memory module 43 is seriously worn out, and the memory management circuit 51 can output a warning signal to inform the user that the service life of the rewritable non-volatile memory module 43 is limited. The warning threshold value and the threshold value can be designed by the user according to actual needs, and the present invention is not limited thereto.

[0069] The buffer memory 55 is connected to the memory management circuit 51 and is used to cache data. The power management circuit 56 is connected to the memory management circuit 51 and is used to control the power of the memory storage device 10 .

[0070] In an exemplary embodiment, Figure 4The rewritable non-volatile memory module 43 may include a flash memory module. In an exemplary embodiment, Figure 4 The memory control circuit unit 42 may include a flash memory controller. In an exemplary embodiment, Figure 5 The memory management circuit 51 may include a flash memory management circuit.

[0071] Figure 6 FIG. 1 is a schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment of the present invention. Figure 6 The memory management circuit 51 may logically group the physical units 610 ( 0 ) to 610 (B) in the rewritable non-volatile memory module 43 into a storage area 601 and a spare area 602 .

[0072] In an exemplary embodiment, a physical unit refers to a physical address or a physical programming unit. In an exemplary embodiment, a physical unit may also be composed of multiple continuous or discontinuous physical addresses. In an exemplary embodiment, a physical unit may also refer to a virtual block (VB). A virtual block may include multiple physical addresses or multiple physical programming units. In an exemplary embodiment, a virtual block may include one or more physical erase units.

[0073] The physical units 610(0)-610(A) in the storage area 601 are used to store user data (e.g. Figure 1 The user data of the host system 11 of the storage area 601). For example, the physical units 610(0)~610(A) in the storage area 601 can store valid data and invalid data. The physical units 610(A+1)~610(B) in the idle area 602 do not store data (such as valid data). For example, if a physical unit does not store valid data, this physical unit can be associated (or added) to the idle area 602. In addition, the physical units in the idle area 602 (or the physical units that do not store valid data) can be erased. When writing new data, one or more physical units can be extracted from the idle area 602 to store the new data. In an exemplary embodiment, the idle area 602 is also called a free pool.

[0074] The memory management circuit 51 can configure the logical units 612(0)-612(C) to map the physical units 610(0)-610(A) in the storage area 601. In an exemplary embodiment, each logical unit corresponds to a logical address. For example, a logical address may include one or more logical block addresses (LBAs) or other logical management units. In an exemplary embodiment, a logical unit may also correspond to a logical programming unit or be composed of multiple continuous or discontinuous logical addresses.

[0075] It should be noted that a logical unit can be mapped to one or more physical units. If a physical unit is currently mapped by a logical unit, it means that the data currently stored in the physical unit includes valid data. On the contrary, if a physical unit is not currently mapped by any logical unit, it means that the data currently stored in the physical unit is invalid data.

[0076] The memory management circuit 51 may record management data describing the mapping relationship between the logical unit and the physical unit (also referred to as logical-to-physical mapping information) in at least one logical-to-physical mapping table. When the host system 11 wishes to read data from the memory storage device 10 or write data to the memory storage device 10, the memory management circuit 51 may access the rewritable non-volatile memory module 43 according to the information in the logical-to-physical mapping table.

[0077] Figure 7 is a flow chart of a wear leveling method according to an exemplary embodiment of the present invention. Figure 7 In step S701, the memory management circuit 51 may obtain the average number of erase times of multiple physical erase units. For example, the memory management circuit 51 may obtain the average number of erase times of all physical erase units in the rewritable non-volatile memory module 43. Next, in step S702, the memory management circuit 51 may determine whether the average number of erase times obtained from step S701 is greater than a switching threshold (for example, 50k times). If the average number of erase times is greater than the switching threshold, proceed to step S703. On the contrary, if the average number of erase times is less than or equal to the switching threshold, proceed to step S704. The switching threshold may be designed by the user according to actual needs and / or the specifications of the memory storage device 10, and the present invention is not limited thereto.

[0078] The conventional wear leveling method, for example, exchanges a physical erase unit with a lower erase count (also referred to as a source physical erase unit) in the storage area 601 with a physical erase unit with a higher erase count (also referred to as a target physical erase unit) in the idle area 602 to average the erase counts of all physical erase units in the rewritable non-volatile memory module 43. The wear leveling method of the present invention uses the number of open bits as an implementation basis to perform a wear leveling operation (i.e., a first wear leveling operation) when the average erase count of all physical erase units in the rewritable non-volatile memory module 43 exceeds the switching threshold.

[0079] In step S703, the memory management circuit 51 may perform a first wear leveling operation based on the number of open bits of each physical erasing unit. When the average erase count is greater than the switching threshold (i.e., when the rewritable non-volatile memory module 43 is in a high erase count state), the memory management circuit 51 may perform the first wear leveling operation based on the number of open bits indicating the wear degree of the physical erasing unit.

[0080] Specifically, the memory management circuit 51 can obtain the number of open bits of each physical erase unit. For example, the memory management circuit 51 can perform a status read operation on each physical erase unit in the background mode to obtain the number of open bits of each physical erase unit. For example, the memory management circuit 51 can first perform a status read operation on a part of the physical erase units among the multiple physical erase units in the background mode, and after a period of time, perform a status read operation on another part of the physical erase units to obtain the number of open bits of all the physical erase units. For example, the memory management circuit 51 can perform a status read operation on multiple physical erase units at one time in the background mode to obtain the number of open bits of all the physical erase units. The implementation details of the memory management circuit 51 performing the status read operation have been described in detail in the aforementioned embodiments, so they will not be repeated here.

[0081] Next, the memory management circuit 51 may determine whether there is a first physical erase unit with an open bit number greater than the first threshold in the rewritable non-volatile memory module 43. If there is a first physical erase unit with an open bit number greater than the first threshold, the memory management circuit 51 may perform a first wear leveling operation on the first physical erase unit. In detail, the memory management circuit 51 may obtain the open bit number of each physical erase unit. Each open bit number may be used to indicate the degree of wear of the corresponding physical erase unit. Accordingly, the memory management circuit 51 may use the first physical erase unit with an open bit number greater than the first threshold (i.e., a seriously worn physical erase unit) as a target physical erase unit to complete the first wear leveling operation. For example, the memory management circuit 51 may use the first physical erase unit with an open bit number greater than the first threshold as a target physical erase unit, and select another physical erase unit with an open bit number less than the first threshold as a source physical erase unit to complete the first wear leveling operation. The first threshold may be designed by the user according to actual needs and / or the specifications of the memory storage device 10, and the present invention is not limited thereto.

[0082] In addition, if there is no first physical erase unit whose open bit number is greater than the first threshold, that is, the open bit number of each physical erase unit in the rewritable non-volatile memory module 43 is less than or equal to the first threshold, the memory management circuit 51 may not perform the first wear leveling operation first, and after a period of time, re-obtain the open bit number of each physical erase unit, and again determine whether there is a first physical erase unit whose open bit number is greater than the first threshold. Until there is a first physical erase unit, the first wear leveling operation can be performed.

[0083] On the other hand, in step S704, the memory management circuit 51 may perform a second wear leveling operation based on the number of erase times of each physical erase unit. When the average number of erase times is less than or equal to the switching threshold (i.e., when the rewritable non-volatile memory module 43 is in a low number of erase times condition), the memory management circuit 51 may not consider the wear degree of the rewritable non-volatile memory module 43, and use the second wear leveling operation based on the number of erase times.

[0084] Specifically, the memory management circuit 51 can obtain the erasure count of each physical erasure unit, select a source physical erasure unit and a target physical erasure unit according to the erasure count of each physical erasure unit, and copy the valid data in the source physical erasure unit to the target physical erasure unit to complete the second wear leveling operation.

[0085] According to the above, the wear leveling method of the present invention can provide a staged wear leveling operation through the average number of erasures of the rewritable non-volatile memory module 43. When the average number of erasures is greater than the switching threshold, a first wear leveling operation is implemented based on the number of open bits indicating the degree of wear of the physical erasure unit, thereby avoiding the situation where the rewritable non-volatile memory module 43 is severely worn and extending the service life of the rewritable non-volatile memory module 43.

[0086] Figure 8 is a flow chart of a wear leveling method according to an exemplary embodiment of the present invention. Figure 8 In step S801, the memory management circuit 51 may obtain the average number of erasure times of the plurality of physical erasure units. In step S802, the memory management circuit 51 may determine whether the average number of erasure times obtained from step S801 is greater than the switching threshold. If the average number of erasure times is greater than the switching threshold, the process proceeds to step S803. On the contrary, if the average number of erasure times is less than or equal to the switching threshold, the process proceeds to step S804.

[0087] In step S803, the memory management circuit 51 may perform a first wear leveling operation based on the number of erasures of each physical erasure unit and the number of open bits of each physical erasure unit. Each open bit number may be used to indicate the degree of wear of the corresponding physical erasure unit. For example, the memory management circuit 51 may obtain the number of erasures and the number of open bits of all physical erasure units in the rewritable non-volatile memory module 43. Next, the memory management circuit 51 may select a source physical erasure unit and a target physical erasure unit according to the number of erasures and the number of open bits of all physical erasure units in the rewritable non-volatile memory module 43, and copy the valid data in the source physical erasure unit to the target physical erasure unit to complete the first wear leveling operation.

[0088] On the other hand, in step S804, the memory management circuit 51 may perform a second wear leveling operation based on the erasure count of each physical erasure unit. For example, the memory management circuit 51 may select a source physical erasure unit and a target physical erasure unit according to the erasure counts of all physical erasure units in the rewritable non-volatile memory module 43, and copy the valid data in the source physical erasure unit to the target physical erasure unit to complete the second wear leveling operation.

[0089] According to the above, the wear leveling method of the present invention can provide a staged wear leveling operation through the average number of erasures of the rewritable non-volatile memory module 43. When the average number of erasures is greater than the switching threshold, in addition to the number of erasures, the number of open bits used to indicate the degree of wear of the physical erasure unit is further considered to perform the first wear leveling operation, which can avoid the rewritable non-volatile memory module 43 from being severely worn and extend the service life of the rewritable non-volatile memory module 43.

[0090] Fig. 9 is a flow chart of a wear leveling method according to an exemplary embodiment of the present invention. Fig. 9 In step S901, the number of open bits of each physical erasing unit is obtained. In step S902, it is determined whether there is a first physical erasing unit whose number of open bits is greater than a first threshold. In step S903, in response to the existence of a first physical erasing unit whose number of open bits is greater than the first threshold, a first wear leveling operation is performed on the first physical erasing unit.

[0091] However, Fig. 9 The steps in the above are described in detail, so I will not repeat them here. It is worth noting that Fig. 9 Each step can be implemented as multiple program codes or circuits, which is not limited in this case. Fig. 9 The method can be used in conjunction with the above exemplary embodiments or can be used alone, and this case is not limited thereto.

[0092] In summary, the wear leveling method, memory storage device and memory control circuit unit provided in the exemplary embodiments of the present invention can provide a phased wear leveling operation. By adopting the number of open bits as the basis for implementing the wear leveling operation, it is possible to avoid severe wear of the rewritable non-volatile memory module and extend the service life of the rewritable non-volatile memory module.

[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A wear leveling method, characterized in that: For a rewritable non-volatile memory module, the rewritable non-volatile memory module includes a plurality of physical erasing units, and the wear leveling method includes: Obtaining the number of open bits of each of the plurality of physical erasure units; Determine whether there is a first physical erasure unit having a number of open bits greater than a first threshold; and In response to the existence of the first physical erasing unit having the number of open bits greater than the first threshold, a first wear leveling operation is performed on the first physical erasing unit.

2. The wear leveling method according to claim 1, wherein the step of obtaining the number of open bits of each of the plurality of physical erase units comprises: A status reading operation is performed on each of the plurality of physical erasing units to obtain the number of open bits.

3. The wear leveling method according to claim 2, wherein the step of performing the status reading operation comprises: A read voltage is applied to a plurality of memory cells in a write state in each of the plurality of physical erasing units to obtain the number of open bits.

4. The wear leveling method according to claim 2, wherein during the status reading operation, no error checking and correction operation is performed.

5. The wear leveling method according to claim 1, further comprising: Obtaining an average number of erasure times of the plurality of physical erasure units; Determining whether the average number of erasures is greater than a switching threshold; as well as In response to the average erase count being not greater than the switching threshold, a second wear leveling operation is performed based on the erase counts of each of the plurality of physical erase units.

6. The wear leveling method according to claim 5, further comprising: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the number of open bits of each of the plurality of physical erase units.

7. The wear leveling method according to claim 5, further comprising: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units. 8 . The wear leveling method according to claim 1 , wherein the number of open bits is used to indicate a degree of wear of each of the plurality of physical erase units.

9. The wear leveling method according to claim 1, further comprising: In response to the number of the physical erase units whose open bit number is greater than the warning threshold being greater than the threshold value, a warning signal is output.

10. A memory storage device, characterized in that: include: A connection interface unit for coupling to a host system; A rewritable non-volatile memory module, wherein the rewritable non-volatile memory module comprises a plurality of physical erasing units; as well as A memory control circuit unit is coupled to the connection interface unit and the rewritable non-volatile memory module. The memory control circuit unit is used to: Obtaining the number of open bits of each of the plurality of physical erasure units; Determine whether there is a first physical erasure unit whose open bit number is greater than a first threshold; and In response to the existence of the first physical erasing unit having the number of open bits greater than the first threshold, a first wear leveling operation is performed on the first physical erasing unit.

11. The memory storage device according to claim 10, wherein the memory control circuit unit is further configured to: A status reading operation is performed on each of the plurality of physical erasing units to obtain the number of open bits.

12. The memory storage device according to claim 11, wherein the memory control circuit unit is further configured to: A read voltage is applied to a plurality of memory cells in a write state in each of the plurality of physical erasing units to obtain the number of open bits.

13. The memory storage device according to claim 11, wherein an error checking and correction operation is not performed during the state reading operation performed by the memory control circuit unit.

14. The memory storage device according to claim 10, wherein the memory control circuit unit is further configured to: Obtaining an average number of erasure times of the plurality of physical erasure units; Determining whether the average number of erasures is greater than a switching threshold; and In response to the average erase count being not greater than the switching threshold, a second wear leveling operation is performed based on the erase counts of each of the plurality of physical erase units.

15. The memory storage device according to claim 14, wherein the memory control circuit unit is further configured to: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the number of open bits of each of the plurality of physical erase units.

16. The memory storage device according to claim 14, wherein the memory control circuit unit is further configured to: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units. 17 . The memory storage device as claimed in claim 10 , wherein the number of open bits is used to indicate a degree of wear of each of the plurality of physical erase units.

18. The memory storage device according to claim 10, wherein the memory control circuit unit is further configured to: In response to the number of the physical erase units whose open bit number is greater than the warning threshold being greater than the threshold value, a warning signal is output.

19. A memory control circuit unit for controlling a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module comprises a plurality of physical erasing units, and the memory control circuit unit comprises: A host interface for coupling to a host system; A memory interface, for coupling to the rewritable non-volatile memory module; Error checking and correction circuits; as well as a memory management circuit coupled to the host interface, the memory interface and the error checking and correction circuit, The memory management circuit is used to: Obtaining the number of open bits of each of the plurality of physical erasure units; Determine whether there is a first physical erasure unit having a number of open bits greater than a first threshold; and In response to the existence of the first physical erasing unit having the number of open bits greater than the first threshold, a first wear leveling operation is performed on the first physical erasing unit.

20. The memory control circuit unit according to claim 19, wherein the memory management circuit is further configured to: A status reading operation is performed on each of the plurality of physical erasing units to obtain the number of open bits.

21. The memory control circuit unit according to claim 20, wherein the memory management circuit is further configured to: A read voltage is applied to a plurality of memory cells in a write state in each of the plurality of physical erasing units to obtain the number of open bits.

22. The memory control circuit unit according to claim 20, wherein the ECC circuit does not perform an ECC operation during the process in which the memory management circuit performs the read operation.

23. The memory control circuit unit according to claim 19, wherein the memory management circuit is further configured to: Obtaining an average number of erasure times of the plurality of physical erasure units; Determining whether the average number of erasures is greater than a switching threshold; and In response to the average erase count being not greater than the switching threshold, a second wear leveling operation is performed based on the erase counts of each of the plurality of physical erase units.

24. The memory control circuit unit according to claim 23, wherein the memory management circuit is further configured to: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the number of open bits of each of the plurality of physical erase units.

25. The memory control circuit unit according to claim 23, wherein the memory management circuit is further configured to: In response to the average erase count being greater than the switching threshold, the first wear leveling operation is performed based on the erase count of each of the plurality of physical erase units and the number of open bits of each of the plurality of physical erase units. 26 . The memory control circuit unit according to claim 19 , wherein the number of open bits is used to indicate a degree of wear of each of the plurality of physical erase units.

27. The memory control circuit unit according to claim 19, wherein the memory management circuit is further configured to: In response to the number of the physical erase units whose open bit number is greater than the warning threshold being greater than the threshold value, a warning signal is output.