Memory controller, physical page management method and storage device
By adjusting the error correction capability of the error correction code, the spare area space of the physical page is used to replace the unstable storage space, which solves the problem of low utilization in traditional non-volatile memory management and improves the utilization efficiency and access efficiency of storage space.
Patent Information
- Application Number
- CN202311343836.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-10-17
AI Technical Summary
Traditional non-volatile memory management methods manage memory in units of physical blocks, resulting in low flash memory utilization and direct discarding of memory when some blocks are damaged, leading to a rapid decrease in available storage space.
By adjusting the error correction capability of the error correction code, the spare area space of the entity page is used to replace the unstable part of the storage space, thus maintaining the data storage capability of the entity page.
It improves the utilization efficiency of storage space and increases the access and working efficiency of storage devices.
Smart Images

Figure CN117270788B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a memory management technology, and more particularly to a physical page management method, and a storage device and memory controller using the method. Background Technology
[0002] Non-volatile memory refers to computer memory that retains its data even when the current is cut off. It has advantages such as non-volatile data, low power consumption, small size and no mechanical structure, and is widely used in various electronic devices.
[0003] NAND flash memory is a type of non-volatile memory that stores data in physical pages and erases data in physical blocks, offering fast write and erase speeds. However, due to its manufacturing process and storage principles, bad blocks are inevitable during production and use, necessitating appropriate methods for bad block management.
[0004] However, traditional management methods operate on a block-by-block basis. If a block contains bad pages or the number of bad pages exceeds a certain limit, the block is considered bad and discarded. This block-based management method suffers from low flash memory utilization. With the development of flash memory, the capacity of each block continues to increase, making the traditional practice of discarding entire blocks wasteful. Furthermore, when a portion of a page is found to be damaged, the traditional approach directly labels that page as bad and discards it. Over time, the rapidly increasing number of bad pages accelerates the process of classifying a block as bad, causing a rapid decline in the available storage space of non-volatile memory. Therefore, how to manage memory at the fundamental level (page-by-page) to improve the low space utilization problem traditionally faced by non-volatile memory is a goal pursued by those in the field. Summary of the Invention
[0005] This invention relates to a storage controller for controlling a storage device configured with a rewritable non-volatile memory module, and a physical page management method used by the storage controller. By adjusting the error correction capability of the error correction code, the space (column) of the spare area of the physical page saved can be used to replace the unstable part of the storage space (column) in the physical page, thereby improving the data storage capability of the physical page.
[0006] Embodiments of the present invention provide a storage controller for controlling a storage device configured with a rewritable non-volatile memory module. The storage controller includes: a memory interface control circuit, an error checking and correction circuit, and a processor. The connection interface circuit is coupled to a host system. The memory interface control circuit is coupled to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of memory dies, wherein each memory die has a plurality of physical blocks, each physical block has a plurality of physical pages, each physical page has a data area and a spare area, each data area has a first number of columns, and each spare area has a second number of columns, wherein the first number is greater than the second number. The processor is coupled to the memory interface control circuit and the error checking and correction circuit, wherein the processor is further coupled to the connection interface circuit of the storage device for coupling to the host system. The processor is configured to select a target entity page from the plurality of entity pages, wherein the processor is further configured to identify one or more target columns in the target data area of the target entity page, wherein the processor is further configured to mark the target column as bad column, and set one or more available columns in the target spare area of the target entity page, the same as the total number of bad columns, to the target data area to replace the unavailable bad columns, thereby maintaining the total number of available columns in the target data area of the target entity page not less than the first number.
[0007] In one embodiment of the present invention, before executing the operation of setting one or more available columns in the target spare area of the target entity page to the target data area with the same total number as the total number of bad columns, the processor further determines whether the total number of available columns in the target spare area is greater than a spare column threshold value. If the processor determines that the total number of available columns in the target spare area is greater than the spare column threshold value, the processor executes the operation of setting one or more available columns in the target spare area of the target entity page to the target data area with the same total number as the total number of bad columns. If the processor determines that the total number of available columns in the target spare area is not greater than the spare column threshold value, the processor further determines, based on the total number of target columns in the target data area of the target entity page, to adjust the error correction capability of the error checking and correction circuit corresponding to the target entity page from a preset first value to a second value or to mark the target entity page as a bad entity page.
[0008] In one embodiment of the present invention, in response to determining that the total number of available columns in the target spare area is not greater than the spare column threshold, the processor further determines whether the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold. In response to determining that the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold, the processor adjusts the error correction capability of the error checking and correction circuit corresponding to the target entity page from a preset first value to a second value.
[0009] In one embodiment of the present invention, in response to determining that the total number of available columns in the target spare area is not greater than the spare column threshold, the processor further determines whether the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold, wherein in response to determining that the total number of target columns in the data area of the target entity page is greater than the bad column number threshold, the processor further marks the target entity page as the bad entity page.
[0010] In one embodiment of the invention, during the operation of adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the bad column number threshold value, wherein a first error correction code generated by the error checking and correction circuit based on the error correction capability for the first value requires a first space for storage, wherein the processor sets the second value such that a second error correction code generated by the error checking and correction circuit based on the error correction capability for the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is equal to the bad column number threshold value.
[0011] In one embodiment of the invention, during the operation of adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the total number of bad columns, wherein a first error correction code generated by the error checking and correction circuit based on the error correction capability for the first value requires a first space for storage, wherein the processor sets the second value such that a second error correction code generated by the error checking and correction circuit based on the error correction capability for the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is greater than or equal to the total number of bad columns.
[0012] In one embodiment of the present invention, after adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit from a preset first value to a second value, the processor further instructs the error checking and correction circuit to verify the target entity page according to the adjusted error correction capability. When the target entity page passes the verification, the processor determines that the target entity page is a usable entity page and marks the target entity page as a weak error correction entity page, wherein the weak error correction entity page is used to store data that does not require a high error correction capability. When the target entity page fails the verification, the processor determines that the target entity page is an unusable entity page and marks the target entity page as a bad entity page.
[0013] Another embodiment of the present invention provides a physical page management method for a rewritable non-volatile memory module. The rewritable non-volatile memory module includes a plurality of memory dies, wherein each memory die has a plurality of physical blocks, each physical block has a plurality of physical pages, each physical page has a data area and a spare area, each data area has a first number of columns, and each spare area has a second number of columns, wherein the first number is greater than the second number. The method includes: selecting a target physical page from the plurality of physical pages; identifying one or more target columns in a target data area of the target physical page; and marking the target columns as bad columns, and assigning one or more available columns, equal in total number to the target spare area of the target physical page and the total number of bad columns, to the target data area to replace the unavailable bad columns, thereby maintaining the total number of available columns in the target data area of the target physical page not less than the first number.
[0014] Another embodiment of the present invention provides a storage device including a connection interface circuit, a rewritable non-volatile memory module, and a memory controller. The connection interface circuit is coupled to a host system. The rewritable non-volatile memory module includes a plurality of memory dies, each memory die having a plurality of physical blocks, each physical block having a plurality of physical pages, each physical page having a data area and a spare area, each data area having a first number of columns, and each spare area having a second number of columns, wherein the first number is greater than the second number. The memory controller is coupled to the connection interface circuit and the rewritable non-volatile memory module. Furthermore, the memory controller is configured to select a target physical page from the plurality of physical pages, wherein the memory controller is further configured to identify one or more target columns in the target data area of the target physical page, wherein the memory controller is further configured to mark the target columns as bad columns, and to assign one or more available columns, equal to the total number of bad columns in the target spare area of the target physical page, to the target data area to replace the unusable bad columns, thereby maintaining the total number of available columns in the target data area of the target physical page not less than the first number.
[0015] Based on the above, the storage device, storage controller, and entity page management method used by the storage controller provided in this embodiment of the invention can select target entity pages with weak storage capacity, identify unstable target columns in the target entity pages, reduce the error correction capability of error correction codes, thereby reducing the storage space (columns) of the target spare area required for the error correction codes generated by the target entity pages, and use the stable columns of the saved target spare area to replace the target columns, thereby improving the data storage capacity of the target entity pages, thereby improving the storage space utilization efficiency of the storage device and increasing the access and working efficiency of the storage device. Attached Figure Description
[0016] The accompanying drawings are included to further illustrate the invention, and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
[0017] Figure 1 This is a block diagram illustrating a host system and storage device according to an embodiment of the present invention;
[0018] Figure 2 A flowchart illustrating an entity page management method according to an embodiment of the present invention;
[0019] Figure 3 A flowchart illustrating an entity page management method according to another embodiment of the present invention;
[0020] Figure 4 This is a schematic diagram illustrating an entity page management method according to an embodiment of the present invention;
[0021] Figure 5 This is a schematic diagram illustrating the ability to adjust error correction according to an embodiment of the present invention.
[0022] Explanation of icon numbers
[0023] 10: Host System
[0024] 20: Storage device
[0025] 110, 211: Processor
[0026] 120: Host memory
[0027] 130: Data transmission interface circuit
[0028] 210: Storage Controller
[0029] 212: Data Management Circuit
[0030] 213: Memory Interface Control Circuit
[0031] 214: Error checking and correction circuit
[0032] 216: Buffer memory
[0033] 217: Power Management Circuit
[0034] 220: Rewritable Non-volatile Memory Module
[0035] 230: Connection interface circuit
[0036] S210, S220, S235, S235, S240, S250, S260, S270: Flow steps of entity page management method
[0037] PG(0), PG(1), PG(N), PG(T), PG'(T): entity page
[0038] DA(T), DA'(T): Data area of the entity page
[0039] SA(T), SA'(T), SA(0), SA'(0): Data area of entity page
[0040] D1~DP: Columns in the data area of the entity page
[0041] S1~SQ: Columns in the spare area of the entity page Detailed Implementation
[0042] Reference will now be made in detail to exemplary embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same component reference numerals are used in the drawings and description to denote the same or similar parts.
[0043] Figure 1 This is a block diagram illustrating a host system and storage device according to an embodiment of the present invention. Please refer to... Figure 1 The host system 10 is, for example, a personal computer, a laptop computer, or a server. The host system 10 includes a processor 110, host memory 120, and a data transfer interface circuit 130. In this embodiment, the processor 110 is coupled (also referred to as electrically connected) to the host memory 120 and the data transfer interface circuit 130. In another embodiment, the processor 110, host memory 120, and data transfer interface circuit 130 are coupled to each other via a system bus. In this embodiment, the processor 110, host memory 120, and data transfer interface circuit 130 may be located on the motherboard of the host system 10.
[0044] Storage device 20 includes a storage controller 210, a rewritable non-volatile memory module 220, and a connection interface circuit 230. The storage controller 210 includes a processor 211, a data management circuit 212, and a memory interface control circuit 213.
[0045] In this embodiment, the host system 10 is coupled to the storage device 20 via a data transmission interface circuit 130 and a connection interface circuit 230 to perform data access operations. For example, the host system 10 can store data in or read data from the storage device 20 via the data transmission interface circuit 130.
[0046] In this embodiment, the number of data transmission interface circuits 130 can be one or more. Through the data transmission interface circuits 130, the motherboard can be coupled to the storage device 20 via wired or wireless means. The storage device 20 can be, for example, a USB flash drive, memory card, solid-state drive (SSD), or wireless storage device. The wireless storage device can be, for example, a Near Field Communication (NFC) storage device, a WiFi storage device, a Bluetooth storage device, or a Bluetooth Low Energy storage device (e.g., iBeacon), or other storage devices based on various wireless communication technologies. Furthermore, the motherboard can also be coupled to various I / O devices such as a Global Positioning System (GPS) module, network interface card, wireless transmission device, keyboard, screen, and speaker via the system bus.
[0047] In this embodiment, the data transmission interface circuit 130 and the connection interface circuit 230 are interface circuits compatible with the Peripheral Component Interconnect Express (PCI Express) standard. Furthermore, data transmission between the data transmission interface circuit 130 and the connection interface circuit 230 utilizes the Non-Volatile Memory Express (NVMe) communication protocol.
[0048] However, it must be understood that the present invention is not limited thereto. The data transmission interface circuit 130 and the connection interface circuit 230 may also conform to the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronics Engineers (IEEE) 1394 standard, the Serial Advanced Technology Attachment (SATA) 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 Multi-Chip Package (MCP) interface standard, the Multi Media Card (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. In another embodiment, the connection interface circuit 230 may be packaged in a chip with the memory controller 210, or the connection interface circuit 230 may be disposed outside a chip containing the memory controller 210.
[0049] In this embodiment, the host memory 120 is used to temporarily store instructions or data executed by the processor 110. For example, in this embodiment, the host memory 120 may be Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), etc. However, it must be understood that the present invention is not limited thereto, and the host memory 120 may also be other suitable memories.
[0050] The storage controller 210 is used to execute multiple 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 220 according to the instructions of the host system 10.
[0051] More specifically, the processor 211 in the storage controller 210 is hardware with computing capabilities, used to control the overall operation of the storage controller 210. Specifically, the processor 211 is programmed with multiple control instructions / program codes, and these control instructions / program codes are executed during the operation of the storage device 20 to perform operations such as writing, reading, and erasing data. Furthermore, in this embodiment, the control instructions / program codes can also be executed to perform physical page management operations to implement the physical page management method provided by this invention. The control instructions / program codes corresponding to the physical page management method can also be implemented as hardware circuit units to implement the physical page management method provided by this invention.
[0052] It is worth mentioning that, in this embodiment, the processor 110 and the processor 211 are, for example, a central processing unit (CPU), a microprocessor, or other programmable processing units (microprocessor), digital signal processor (DSP), programmable controller, application specific integrated circuits (ASIC), programmable logic device (PLD), or other similar circuit components, and the present invention is not limited thereto.
[0053] In one embodiment, the storage controller 210 further includes a read-only memory (not shown) and a random access memory (not shown). Specifically, the read-only memory has a boot code, and when the storage controller 210 is enabled, the processor 211 first executes this boot code to load control instructions stored in the rewritable non-volatile memory module 220 into the random access memory of the storage controller 210. Subsequently, the processor 211 executes these control instructions to perform operations such as writing, reading, and erasing data. In another embodiment, the control instructions of the processor 211 may also be stored in program code form in a specific area of the rewritable non-volatile memory module 220, for example, in a physical storage unit within the rewritable non-volatile memory module 220 dedicated to storing system data.
[0054] In this embodiment, as described above, the storage controller 210 further includes a data management circuit 212 and a memory interface control circuit 213. It should be noted that the operations performed by each component of the storage controller 210 can also be considered as operations performed by the storage controller 210 itself.
[0055] The data management circuit 212 is coupled to the processor 211, the memory interface control circuit 213, and the connection interface circuit 230. The data management circuit 212 is used to receive instructions from the processor 211 to perform data transfer. For example, it reads data from the host system 10 (e.g., host memory 120) via the connection interface circuit 230 and writes the read data to the rewritable non-volatile memory module 220 via the memory interface control circuit 213 (e.g., performing a write operation according to a write instruction from the host system 10). Another example is reading data from one or more physical units of the rewritable non-volatile memory module 220 (data can be read from one or more memory cells in one or more physical units) via the memory interface control circuit 213 and writing the read data to the host system 10 (e.g., host memory 120) via the connection interface circuit 230 (e.g., performing a read operation according to a read instruction from the host system 10). In another embodiment, the data management circuit 212 may also be integrated into the processor 211.
[0056] The memory interface control circuit 213 is used to receive instructions from the processor 211 and, in conjunction with the data management circuit 212, to perform write (also known as programming) operations, read operations, or erase operations on the rewritable non-volatile memory module 220.
[0057] For example, processor 211 can execute a write instruction sequence to instruct memory interface control circuit 213 to write data into rewritable non-volatile memory module 220; processor 211 can execute a read instruction sequence to instruct memory interface control circuit 213 to read data from one or more physical units corresponding to the read instruction of rewritable non-volatile memory module 220; processor 211 can execute an erase instruction sequence to instruct memory interface control circuit 213 to perform an erase operation on rewritable non-volatile memory module 220. The write instruction sequence, read instruction sequence, and erase instruction sequence may each include one or more program codes or instruction codes and are used to instruct the rewritable non-volatile memory module 220 to perform corresponding write, read, and erase operations. In one embodiment, processor 211 may also issue other types of instruction sequences to memory interface control circuit 213 to perform corresponding operations on rewritable non-volatile memory module 220.
[0058] Furthermore, data to be written to the rewritable non-volatile memory module 220 is converted into a format acceptable to the rewritable non-volatile memory module 220 via the memory interface control circuit 213. Specifically, if the processor 211 needs to access the rewritable non-volatile memory module 220, the processor 211 transmits a corresponding instruction sequence to the memory interface control circuit 213 to instruct the memory interface control circuit 213 to perform the corresponding operation. For example, these instruction sequences may include write instruction sequences indicating the writing of data, read instruction sequences indicating the reading of data, erase instruction sequences indicating the erasure of data, and corresponding instruction sequences for indicating various memory operations. 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, a read instruction sequence may include information such as the read identification code and memory address.
[0059] Furthermore, the storage controller 210 establishes a logical-to-physical address mapping table and a physical-to-logical address mapping table to record the address mapping relationships between logical units (e.g., logical blocks, logical pages, or logical columns) and physical units (e.g., physical erase units / physical blocks, physical pages, physical columns) configured for the rewritable non-volatile memory module 220. In other words, the storage controller 210 can use the logical-to-physical address mapping table to find the physical unit mapped to a logical unit (e.g., find the physical page mapped to a logical page; find the physical address mapped to a logical address), and the storage controller 210 can use the physical-to-logical address mapping table to find the logical unit mapped to a physical unit (e.g., find the logical page mapped to a physical page; find the logical address mapped to a physical address). However, the above-described technical concepts regarding the mapping between logical units and physical units are conventional techniques used by those skilled in the art and are not the technical solutions intended to be described in this invention, and will not be elaborated upon here.
[0060] In this embodiment, the error checking and correction circuit 214 is coupled to the processor 211 and is used to execute error checking and correction procedures to ensure data integrity. Specifically, when the processor 211 receives a write instruction from the host system 10, the error checking and correction circuit 214 generates a corresponding error correcting code (ECC) and / or error detecting code (EDC) for the data corresponding to the write instruction, and the processor 211 writes the data corresponding to the write instruction along with the corresponding error correcting code and / or error detecting code into the rewritable non-volatile memory module 220. For example, the data corresponding to the write instruction is written to the data area of the physical page corresponding to the write instruction in the rewritable non-volatile memory module 220, and the corresponding error correcting code and / or error detecting code is written to the spare area of the physical page. Subsequently, when the processor 211 reads data from the rewritable non-volatile memory module 220, it simultaneously reads the corresponding error correction code and / or error check code. The error checking and correction circuit 214 then performs an error checking and correction procedure on the read data based on this error correction code and / or error check code. Furthermore, after the error checking and correction procedure, if the read data is successfully decoded, the error checking and correction circuit 214 can return the number of error bits to the processor 211.
[0061] In one embodiment, the storage controller 210 further includes a buffer memory 216 and a power management circuit 217. The buffer memory is coupled to the processor 211 and is used to temporarily store data and instructions from the host system 10, data from the rewritable non-volatile memory module 220, or other system data used to manage the storage device 20, so that the processor 211 can quickly access the data, instructions, or system data from the buffer memory 216. The power management circuit 217 is coupled to the processor 211 and is used to control the power supply to the storage device 20.
[0062] The rewritable non-volatile memory module 220 is coupled to the memory controller 210 (memory interface control circuit 213) and is used to store data written by the host system 10.
[0063] In this embodiment, the rewritable non-volatile memory module 220 has multiple word lines, each of which is coupled to multiple memory cells, also called columns (or entity columns). Multiple columns on the same word line form an entity programming unit (also called an entity page). Furthermore, multiple entity pages can form an entity block (also called an entity erase unit). Each memory die in the multiple memory dies of the rewritable non-volatile memory module has multiple entity blocks.
[0064] In this embodiment, the smallest unit of data size written to the rewritable non-volatile memory module 220 each time is a column. The file system executed by the host system 10 uses clusters as the smallest unit to access / manage data written to logical pages, and the file system can know / manage the logical address and size of each piece of data. The size of an entity page is also equal to the size of a logical page. Each entity page can be divided into multiple entity columns. An entity column is a sub-unit of an entity page, and it is a horizontal division of the entity page.
[0065] By dividing a physical page into multiple columns, data at specific locations within the page can be read and written without needing to read or modify the entire page. This improves read / write efficiency and reduces wear on the die of the rewritable non-volatile memory module. The size of each column varies depending on the type of rewritable non-volatile memory module.
[0066] For ease of explanation, in the following embodiments, each column is 1 byte (bit set). Furthermore, it is assumed that each physical page of the rewritable non-volatile memory module 220 is 36 bytes in size, with each physical page space further divided into two regions: a larger data area and a smaller spare area. For example, the data area has 30 physical columns, and the spare area has 6 physical columns. The physical columns of the data area are used to store write data from the host system, and the physical columns of the spare area (also called a redundancy area, spare area, or out-of-band area) are used to store system data used to manage the rewritable non-volatile memory module. This system data includes metadata, error correction codes and / or error checking codes, physical page correction capability markers, etc. It should be noted that the present invention is not limited to the size of each physical page, logical page, physical column, and logical column.
[0067] Figure 2 This is a flowchart illustrating an entity page management method according to an embodiment of the present invention. Please refer to... Figure 2 In step S210, the processor selects a target entity page from a plurality of entity pages. Several embodiments are described below.
[0068] In one embodiment, the processor 211 determines multiple entity pages of each bad block in the bad block list as target entity pages, and selects one bad page from one of the bad blocks as the target entity page, or selects the bad page with the smallest or largest number of error bits as the target entity page according to the size of the corresponding error bit count, so as to restore the data storage capability of the target entity page by performing the entity page management method provided in this embodiment.
[0069] In another embodiment, in order to make full use of the over-provisioning area, the processor 211 may also select a bad entity page of one of the bad blocks in the over-provisioning area of the rewritable non-volatile memory module 220 as a target entity page, and perform the entity page management method provided in this embodiment on the target entity page to restore the data storage capacity of the target entity page.
[0070] If, after implementing the entity page management method, the processor 211 determines that the target entity page is a usable entity page, the processor 211 further removes the bad page from the bad page list and marks the target entity page as a usable entity page. After repeated operations, all bad pages in a bad block may be restored to usable entity pages, making the bad block a usable entity block, thereby increasing the number of usable entity blocks in the over-provisioning area and improving the availability of the over-provisioning area.
[0071] In another embodiment, the processor 211 can identify unstable target entity blocks during routine operation. For example, the processor 211 identifies entity blocks with the following anomalous characteristics as unstable entity blocks and identifies unstable entity pages as target entity pages from them. The anomalous characteristics include one or more of the following: the number of rereads is higher than a corresponding threshold value, the decoding time is higher than a corresponding threshold value, the read time is higher than a corresponding threshold value, the number of error bits is higher than a corresponding threshold value, and the number of writes is higher than a corresponding threshold value.
[0072] In another embodiment, the processor 211 may record unstable target entity pages during routine operation. For example, the processor 211 may consider entity pages with the following anomalous characteristics as unstable entity pages or target entity pages, the anomalous characteristics including one or more of the following: the number of rereads is higher than a corresponding threshold value, the decoding time is higher than a corresponding threshold value, the read time is higher than a corresponding threshold value, the number of error bits is higher than a corresponding threshold value, the decoding time is higher than a corresponding threshold value, and the number of writes is higher than a corresponding threshold value.
[0073] During routine read / write / erase operations, the processor 211 can first mark entity pages / entity blocks with the aforementioned abnormal characteristics, and then use idle time to select target entity pages from the marked unstable entity pages / entity blocks to restore the data storage capability of the target entity pages using the entity page management method provided in this embodiment.
[0074] In another embodiment, processor 211 may filter target physical pages using the number of error bits. For example, processor 211 manages multiple physical pages in the rewritable non-volatile memory module 220 in a clustered manner. The multiple physical pages are clustered according to the maximum error correction capability of error checking and correction circuit 214 and the number of error bits of each physical page to obtain multiple groups corresponding to multiple error bit number ranges. For example, physical pages with 0 error bits are divided into a first group, physical pages with 1 to 20 error bits are divided into a second group, physical pages with 21 to 40 error bits are divided into a third group, physical pages with 41 to 60 error bits are divided into a fourth group, and physical pages with 61 or more error bits are divided into a fifth group. The fifth group is determined to be bad pages. The physical pages with the second highest number of misaligned bits (i.e., the fourth group) are considered target physical pages.
[0075] Please refer to again Figure 2 Next, in step S220, the processor 211 identifies one or more target columns in the target data area of the target entity page. The target column is an entity column identified as unstable or a column already determined to be bad. In one embodiment, statistical calculations can be used to record which columns are relatively unstable. In subsequent use, when a column reaches a certain limit on the number of uses, it is determined to be a bad column and added to the bad column list.
[0076] Next, in step S230, the processor 211 marks the target column as a bad column. The processor 211 may record the entity address of the target column marked as a bad column into a bad column list. Entity columns marked as bad columns will be identified by the processor 211 as entity columns that are unusable / unwritable.
[0077] Next, in step S260, the processor 211 assigns one or more available columns, equal to the total number of bad columns in the target spare area of the target entity page, to the target data area to replace the unusable bad columns, thereby maintaining the total number of available columns in the target data area of the target entity page at no less than a first number. That is, in order to replace a potentially unstable target column, the processor 211 utilizes the same number of available columns in the spare area (also called the target spare area) of the target entity page to which the target column belongs. By assigning the same number of available columns from the target spare area to the target data area of the target entity page, the available space size of the target data area is maintained, and the reliability of the target data area is maintained (because unstable target columns are set as bad columns and are no longer used). The available columns are blank, data-storable, and relatively stable entity columns.
[0078] In this way, when writing to the target entity page later, the processor 211 can skip the bad columns and avoid data errors, while also ensuring the data storage capacity of the target entity page.
[0079] Figure 3 This is a flowchart illustrating an entity page management method according to an embodiment of the present invention. Please refer to... Figure 3 , Figure 3 and Figure 2 The difference lies in that, before setting the available columns in the spare area to replace the corresponding target columns (marked as bad columns), the processor 211 further determines whether the total number of available columns in the target spare area of the target entity page is greater than the spare column threshold (e.g., step S235), and may also determine whether the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold (e.g., step S240). The corresponding descriptions of the same steps will be omitted below.
[0080] In this embodiment, after the target column is marked as a bad column, before executing the operation of setting one or more available columns in the target spare area of the target entity page to the target data area with the same total number of bad columns as the total number of bad columns, the processor 211 executes step S235.
[0081] In step S235, the processor 211 determines whether the total number of available columns in the target spare area is greater than a spare column threshold. In response to the determination that the total number of available columns in the target spare area is greater than the spare column threshold, the processor 211 performs the operation of setting one or more available columns in the target spare area of the target entity page to the target data area, where the total number of available columns is the same as the total number of bad columns (i.e., step S260). In this example, when the total number of available columns in the target spare area is greater than the spare column threshold, the processor 211 determines that, without reducing error correction capability, the target spare area still has enough columns that can be used to replace target columns whose number is less than or equal to the bad column number threshold.
[0082] Conversely, in response to the determination that the total number of available columns in the target spare area is greater than the spare column threshold, the processor 211 executes step S240 to determine, based on the total number of target columns in the target data area of the target entity page, whether to adjust the error correction capability of the corresponding target entity page from a preset first value to a second value or to mark the target entity page as a bad entity page.
[0083] More specifically, in step S240, the processor 211 determines whether the total number of target columns in the target data area of the target entity page is not greater than a bad column count threshold. Specifically, the processor 211 may set the same bad column count threshold for each target entity page, the bad column count threshold being determined based on the minimum error correction capability of the error checking and correction circuit 214. In another embodiment, the processor 211 may set an adaptive bad column count threshold for each target entity page, the bad column count threshold being determined based on the minimum error correction capability of the error checking and correction circuit 214 and the available space in the spare area of the target entity page.
[0084] If the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold (S240 → Yes), the processor 211 continues to execute step S250; if the total number of target columns in the target data area of the target entity page is greater than the bad column number threshold (S240 → No), the processor 211 continues to execute step S270.
[0085] In step S270, the processor 211 is further configured to mark the target entity page as a bad entity page. The processor 211 may record the entity address of the entity page marked as a bad entity page into a bad page list. The entity page marked as a bad entity page will be identified by the processor 211 as an entity page that is unusable / unwritable.
[0086] In step S250, the processor 211 adjusts the error correction capability corresponding to the target entity page from a preset first value to a second value. The first value is greater than the second value.
[0087] In one embodiment, the difference between the first value and the second value is related to the bad column number threshold. In this embodiment, the first error correction code generated by the error checking and correction circuit 21 based on the error correction capability for the first value requires a first space for storage. That is, the first space is the usage space for the preset first error checking code. Next, the processor 211 sets the second value so that the second error correction code generated by the error checking and correction circuit 214 based on the error correction capability for the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is equal to the bad column number threshold. In other words, in order to save a total space in the spare area equal to the space difference between the first space and the second space, the processor 211 correspondingly reduces the error correction capability of the corresponding target page, so that the usage space (i.e., the second space) of the corresponding generated second error correction code is reduced to a size where the space difference between it and the first space is equal to the size of the column corresponding to the bad column number threshold.
[0088] In another embodiment, the difference between the first value and the second value is related to the total number of bad columns in the target entity page. That is, the processor 211 sets the second value such that a second error correction code generated by the error checking and correction circuit 214 based on the error correction capability of the second value requires a second space for storage, such that the space difference between the first space and the second space equals the total space of one or more columns for a target number, wherein the target number is greater than or equal to the total number of bad columns. In other words, in this embodiment, when the total number of bad columns is less than the bad column number threshold, the processor 211 may set a second value that is larger than the second value in the previous embodiment (but still smaller than the first value) so that the number of columns in the target spare area corresponding to the saved space difference is sufficient to replace the bad columns (i.e., the saved space difference is equal to the size of the bad columns).
[0089] The following utilizes Figure 5 This illustrates the concept of adjusting error correction capabilities to save space.
[0090] Figure 5 This is a schematic diagram illustrating the adjustment of error correction capability according to an embodiment of the present invention. For example, taking the spare area SA(0) of an entity page as an example, it is assumed that the storage space required for the first error correction code generated by using the error correction capability with a preset first value is the size of 4 entity columns (e.g., ...). Figure 5The entity columns S1 to S4 in the upper spare area SA(0) are used to store the first error correction code. When the error correction capability is adjusted to a smaller second value, only the two entity columns required for storage are used to generate the second error correction code using the second value error correction capability (e.g., Figure 5 The entity columns S3 and S4 in the lower half of the spare area SA'(0) are used to store the second error correction code. In contrast, the space of two entity columns can be saved in the spare area S'A(0). The space saved by adjusting the error correction capability (e.g., entity columns S1 and S2) can be used to replace the same number of bad columns in the corresponding data area.
[0091] In one embodiment, after adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit 214 from a preset first value to a second value, the processor 211 further instructs the error checking and correction circuit 214 to verify the target entity page according to the adjusted error correction capability. When the target entity page passes the verification, the processor 211 determines that the target entity page is a usable entity page and marks the target entity page as a weak error correction entity page, wherein the weak error correction entity page is used to store data that does not require a high error correction capability. Since the error correction capability of the weak error correction entity page is weak, theoretically such an entity page is best used to store less important or easily regenerated data. This is because if data errors occur, weak error correction capability means a lower chance of error correction, resulting in the loss of stored data.
[0092] In other words, because the error correction capability of the corresponding target entity page has been reduced, the resulting second error correction code will be smaller, thus saving space. This saved space can be used to replace bad columns in the target data area. At this point, the target entity page will be checked again to ensure that it still has reliable data storage after the error correction capability has been adjusted.
[0093] In this way, the rewritable non-volatile memory module 220 will have two error checking and correction coding methods with error correction capabilities. The longer code is used to protect general entity pages that are not selected as target entity pages, and the shorter code is used to manage different types of selected target entity pages. For example, when parsing a write instruction, if the physical address corresponding to the logical address is the target entity page, then when writing the corresponding write data to the target entity page, the processor 211 generates a short code for error checking and correction to protect the write data stored in the target entity page.
[0094] Figure 4 This is a schematic diagram illustrating an entity page management method according to an embodiment of the present invention. For example, please refer to... Figure 4Assume that the rewritable non-volatile memory module 220 has multiple physical pages PG(0) to PG(N). The processor 211 selects a target physical page PG(T) from these pages (step S210). The target data area DA(T) of the target physical page PG(T) has P physical columns D1 to DP, and the target spare area SA(T) of the target physical page PG(T) has Q physical columns S1 to SQ, where P is greater than Q, and the corresponding bad column number threshold is 3. The processor 211 identifies two target columns D3 and D4 (step S220). Next, the processor 211 marks the target columns D3 and D4 as bad columns D'3 and D'4 (step S230). Next, the processor 211 determines that the total number of available columns in the target spare area is not greater than the spare column threshold (step S235). Next, the processor 211 determines that the number of the target columns is 2, which is less than the corresponding bad column number threshold (step S240). Next, the processor 211 adjusts the error correction capability of the target entity page PG(T) to a second value (step S250). Since adjusting the error correction capability of the target entity page PG(T) to the second value saves space in the target spare area for two entity columns (this number corresponds to the number of bad columns), the processor 211 selects two entity columns (e.g., columns S1 and S2) from the target spare area SA(T) and sets entity columns S1 and S2 to replace bad columns D'3 and D'4 (step S260) to make up for the space lost in the target data area DA(T) due to marking bad columns D'3 and D'4. That is, after executing step S260, the target data area DA'(T) of the adjusted target entity page PG'(T) further includes entity pages S1 and S2, and the target spare area SA'(T) of the adjusted target entity page PG'(T) does not include entity pages S1 and S2 (i.e., the remaining entity pages S3 to SQ).
[0095] Based on the above, the storage device, storage controller, and entity page management method used by the storage controller provided in this embodiment of the invention can select target entity pages with weak storage capacity, identify unstable target columns in the target entity pages, reduce the error correction capability of error correction codes, thereby reducing the storage space (columns) of the target spare area required for the error correction codes generated by the target entity pages, and use the stable columns of the saved target spare area to replace the target columns, thereby improving the data storage capacity of the target entity pages, thereby improving the storage space utilization efficiency of the storage device and increasing the access and working efficiency of the storage device.
[0096] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions 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 storage controller for controlling a storage device configured with a rewritable nonvolatile memory module, characterized by, The storage controller includes: A memory interface control circuit is used to couple to the rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of memory dies, wherein each memory die has a plurality of physical blocks, each physical block has a plurality of physical pages, each physical page has a data area and a spare area, each data area has a first number of columns, and each spare area has a second number of columns, wherein the first number is greater than the second number. Error checking and correction circuitry; and The processor is coupled to the memory interface control circuit and the error checking and correction circuit, wherein the processor is further coupled to the connection interface circuit of the storage device for coupling to the host system. The processor is used to select a target entity page from the plurality of entity pages. The processor is further configured to identify one or more target columns in the target data area of the target entity page. The processor is further used to mark the target column as a bad column. The processor is further configured to move one or more available columns, whose total number is equal to the total number of bad columns in the target spare area of the target entity page, from the target spare area to the target data area, so that the target spare area no longer contains the one or more available columns to replace the unavailable bad columns, thereby maintaining the total number of available columns in the target data area of the target entity page not less than the first number. Before executing the operation of setting one or more available columns in the target spare area of the target entity page to be the same as the total number of bad columns in the target spare area, the processor further determines whether the total number of available columns in the target spare area is greater than a spare column threshold value. If the total number of available columns in the target spare area is greater than the spare column threshold, the processor performs an operation to assign one or more available columns, whose total number in the target spare area of the target entity page is the same as the total number of bad columns, to the target data area. The processor further determines, based on the total number of available columns in the target spare area not exceeding the spare column threshold, whether to adjust the error correction capability of the error checking and correction circuit corresponding to the target entity page from a preset first value to a second value or to mark the target entity page as a bad entity page, according to the total number of target columns in the target data area of the target entity page. The processor further determines whether the total number of available columns in the target spare area is not greater than the spare column threshold, in accordance with the determination that the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold. If the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold, the processor adjusts the error correction capability of the error checking and correction circuit corresponding to the target entity page from a preset first value to a second value. If the total number of target columns in the target data area of the target entity page is greater than the bad column number threshold, the processor further marks the target entity page as the bad entity page.
2. The storage controller of claim 1, wherein, In the operation of adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the bad column number threshold. The first error correction code generated by the error checking and correction circuit based on the error correction capability of the first value requires storage in the first space. The processor sets the second value such that a second error correction code generated by the error correction capability of the error checking and correction circuit based on the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is equal to the bad column number threshold.
3. The storage controller of claim 1, wherein, In the operation of adjusting the error correction capability of the corresponding target entity page of the error checking and correction circuit from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the total number of bad columns. The first error correction code generated by the error checking and correction circuit based on the error correction capability of the first value requires storage in the first space. The processor sets the second value such that a second error correction code generated by the error correction capability of the error checking and correction circuit based on the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is greater than or equal to the total number of bad columns.
4. The storage controller of claim 1, wherein, After adjusting the error correction capability of the error checking and correction circuit corresponding to the target entity page from a preset first value to a second value, the processor further instructs the error checking and correction circuit to verify the target entity page according to the adjusted error correction capability. When the target entity page passes the verification, the processor determines that the target entity page is a usable entity page and marks it as a weak error-correcting entity page, wherein the weak error-correcting entity page is used to store data that does not require high error-correction capabilities. If the target entity page fails the verification, the processor determines that the target entity page is an unusable entity page and marks the target entity page as a bad entity page.
5. A physical page management method for a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of memory chips, wherein each memory chip has a plurality of physical blocks, each physical block has a plurality of physical pages, each physical page has a data area and a spare area, each data area has a first number of columns, and each spare area has a second number of columns, wherein the first number is greater than the second number, characterized in that... include: Select the target entity page from the plurality of entity pages; Identify one or more target columns in the target data area of the target entity page; Mark the target column as a bad column; One or more available columns in the target spare area of the target entity page, which have the same total number as the total number of bad columns, are moved from the target spare area to the target data area, so that the target spare area no longer contains the one or more available columns to replace the unavailable bad columns, thereby maintaining the total number of available columns in the target data area of the target entity page not less than the first number; Before executing the step of setting one or more available columns in the target spare area of the target entity page to the target data area with the same total number of available columns as the total number of bad columns, the method further includes: determining whether the total number of available columns in the target spare area is greater than a spare column threshold value; In response to the determination that the total number of available columns in the target spare area is greater than the spare column threshold, the step of setting one or more available columns in the target spare area of the target entity page, which are the same as the total number of bad columns, to the target data area is executed; In response to the determination that the total number of available columns in the target spare area is not greater than the spare column threshold, the error correction capability of the target entity page is adjusted from a preset first value to a second value or the target entity page is marked as a bad entity page based on the total number of target columns in the target data area of the target entity page. The method, which reflects the determination that the total number of available columns in the target spare area is not greater than the spare column threshold value, further includes: Determine whether the total number of the target columns in the target data area of the target entity page is not greater than the threshold value for the number of bad columns; In response to the determination that the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold, the error correction capability of the corresponding target entity page is adjusted from a preset first value to a second value; and The target entity page is marked as a bad entity page if the total number of target columns in the target data area of the target entity page is greater than the bad column number threshold.
6. The physical page management method of claim 5, wherein, In the step of adjusting the error correction capability of the target entity page from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the bad column number threshold value. The method further includes: The first error correction code generated based on the error correction capability for the first value requires a first space for storage; and The second value is set such that a second error correction code generated based on the error correction capability of the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is equal to the bad column number threshold.
7. The entity page management method according to claim 5, characterized in that, In the step of adjusting the error correction capability of the corresponding target entity page from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the total number of bad columns. The method further includes: The first error correction code generated based on the error correction capability for the first value requires a first space for storage; and The second value is set such that a second error correction code generated based on the error correction capability of the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is greater than or equal to the total number of bad columns.
8. The physical page management method of claim 5, wherein, The method further includes, after adjusting the error correction capability of the target entity page from a preset first value to a second value: The target entity page is validated based on the adjusted error correction capability; and When the target entity page passes the verification, it is determined that the target entity page is a usable entity page, and the target entity page is marked as a weak error correction entity page, wherein the weak error correction entity page is used to store data that does not require high error correction capability; If the target entity page fails the verification, the target entity page is determined to be an unusable entity page and is marked as a bad entity page.
9. A memory device, comprising: include: Connecting interface circuitry for coupling to the host system; A rewritable non-volatile memory module, wherein the rewritable non-volatile memory module includes a plurality of memory dies, wherein each memory die has a plurality of physical blocks, each physical block has a plurality of physical pages, each physical page has a data area and a spare area, each data area has a first number of columns, and each spare area has a second number of columns, wherein the first number is greater than the second number. as well as The memory controller is coupled to the connection interface circuit and the rewritable non-volatile memory module. The memory controller is used to select a target entity page from the plurality of entity pages. The memory controller is further configured to identify one or more target columns in the target data area of the target entity page. The memory controller is further used to mark the target column as a bad column. The memory controller is further configured to move one or more available columns, equal to the total number of bad columns in the target spare area of the target entity page, from the target spare area to the target data area, so that the target spare area no longer contains the one or more available columns to replace the unavailable bad columns, thereby maintaining the total number of available columns in the target data area of the target entity page not less than the first number. Before executing the operation of setting one or more available columns in the target spare area of the target entity page to be the same as the total number of bad columns in the target spare area, the memory controller further determines whether the total number of available columns in the target spare area is greater than a spare column threshold value. In response to the determination that the total number of available columns in the target spare area is greater than the spare column threshold, the memory controller performs the operation of setting one or more available columns in the target spare area of the target entity page, which are the same as the total number of bad columns, to the target data area. The memory controller further determines, based on the total number of available columns in the target spare area not exceeding the spare column threshold, whether to adjust the error correction capability of the target entity page from a preset first value to a second value or to mark the target entity page as a bad entity page, according to the total number of target columns in the target data area of the target entity page. The memory controller further determines whether the total number of available columns in the target spare area is not greater than the spare column threshold, in accordance with the determination that the total number of target columns in the target data area of the target entity page is not greater than the bad column number threshold. If the total number of target columns in the target data area of the target entity page is not greater than the bad column count threshold, the memory controller adjusts the error correction capability of the corresponding target entity page from a preset first value to a second value. The memory controller marks the target entity page as a bad entity page if the total number of target columns in the target data area of the target entity page is greater than the bad column number threshold.
10. The memory device of claim 9, wherein, In the operation of adjusting the error correction capability of the target entity page from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the bad column number threshold. The first error correction code generated by the memory controller based on the error correction capability of the first value requires storage in the first space. The memory controller sets the second value such that a second error correction code generated based on the error correction capability of the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is equal to the bad column number threshold.
11. The memory device of claim 9, wherein, In the operation of adjusting the error correction capability of the target entity page from a preset first value to a second value, the first value is greater than the second value, and the difference between the first value and the second value is related to the total number of bad columns. The first error correction code generated by the memory controller based on the error correction capability of the first value requires storage in the first space. The memory controller sets the second value such that a second error correction code generated by the error correction capability of the error checking and correction circuit based on the second value requires a second space for storage, such that the space difference between the first space and the second space is equal to the total space of one or more columns for a target number, wherein the target number is greater than or equal to the total number of bad columns.
12. The memory device of claim 9, wherein, After adjusting the error correction capability of the target entity page from a preset first value to a second value, the memory controller verifies the target entity page based on the adjusted error correction capability. When the target entity page passes the verification, the memory controller determines that the target entity page is a usable entity page and marks it as a weak error-correcting entity page. The weak error-correcting entity page is used to store data that does not require high error-correction capabilities. If the target entity page fails the verification, the memory controller determines that the target entity page is an unusable entity page and marks the target entity page as a bad entity page.
Citation Information
Patent Citations
Variable Strength ECC
US20080072120A1
Methods and apparatuses for managing bad memory cell
US20100269000A1
