Mapping table management method of memory device, memory controller of memory device, memory device, and electronic device
By using table analysis and group-by-group updating of the address mapping table in the memory controller, the problem of increased controller burden in flash memory management is solved, efficient memory management is achieved, and side effects are avoided.
Patent Information
- Application Number
- CN202410008085.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-02
- Filing Date
- 2024-01-02
- Publication Date
- 2024-09-03
AI Technical Summary
When dealing with flash memory access management, the existing technology increases the workload of the controller integrated circuit and may introduce side effects. There is a need to solve the problem of updating the internal management information of the memory device without introducing side effects.
By using table analysis in the memory controller, the temporary logical to physical address mapping table is updated group by group, and the updated information is written into the non-volatile memory to cancel the page mapping of multiple blocks to free up storage space. .
Effectively updates internal management information in non-volatile memory, improves overall performance, avoids side effects caused by item-by-item processing, and ensures stable operation of the memory device under different circumstances.
Smart Images

Figure CN118585124A
Abstract
Description
Technical Field
[0001] The present invention relates to memory control, and more particularly to a method and a related device for performing mapping table management of a memory device in a predetermined communication architecture by means of table analysis. Background Art
[0002] The memory device may include a flash memory for storing data, and the access management for the flash memory is quite complicated. For example, the memory device may be a memory card, a solid state drive (SSD), or an embedded storage device (e.g., an embedded storage device that complies with the universal flash storage (UFS) specification). The memory device can be used to store different files (e.g., system files and user files) in the file system of the host. As time goes by, some data stored in the memory device may become invalid data. When some invalid data and some valid data are mixed in the same storage block in the memory device, a garbage collection (GC) operation is generally required to release more storage space for further use. According to the prior art, the host can transmit information related to unused storage space to the memory device to allow the memory device to release more storage space for further use. Therefore, the memory device may need to change the internal management information of the memory device accordingly, which leads to a sudden increase in the workload of the controller integrated circuit (IC) in the memory device. Prior art attempts to solve this problem, however, may introduce more problems (such as certain side effects), and therefore, an innovative method and related architecture are needed to solve these problems without introducing side effects or in a manner that is less likely to introduce side effects. Summary of the invention
[0003] Therefore, an object of the present invention is to provide a method and related device for managing a mapping table of a memory device in a predetermined communication architecture (eg, a universal flash storage communication architecture) by means of table analysis, so as to solve the above-mentioned problem.
[0004] At least one embodiment of the present invention provides a method for managing a mapping table of a memory device in a predetermined communication architecture by means of table analysis, wherein the method can be applied to a memory controller of the memory device, the memory device can include a memory controller and a non-volatile memory, the non-volatile memory can include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), and the at least one non-volatile memory element can include multiple blocks. The method may include: using a memory controller to receive a first command from a host device through a transmission interface circuit of the memory controller, wherein the first command indicates that a first portion of storage space corresponding to a first logical address range will not be used by the host device; and in response to the first command, loading a local logical-to-physical address mapping table from a non-volatile memory into a volatile memory in the memory controller as a temporary logical-to-physical address mapping table, changing a plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table in a group-by-group manner rather than an item-by-item manner to form a plurality of updated logical-to-physical table entries, and updating the local logical-to-physical address mapping table in the non-volatile memory according to the plurality of updated logical-to-physical table entries of the temporary logical-to-physical address mapping table to unmap at least a portion of all pages of at least one block of the plurality of blocks, wherein the first portion of storage space includes at least a portion of the pages.
[0005] In addition to the above method, the present invention also provides a memory controller of a memory device, wherein the memory device includes a memory controller and a non-volatile memory, the non-volatile memory may include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), and the at least one non-volatile memory element may include a plurality of blocks. In addition, the memory controller includes a processing circuit, wherein the processing circuit is used to control the memory controller according to a plurality of host commands from a host device, so as to allow the host device to access the non-volatile memory through the memory controller, and to perform mapping table management of the memory device in a predetermined communication architecture by means of table analysis. The memory controller also includes a transmission interface circuit, wherein the transmission interface circuit is used to communicate with the host device. For example, a memory controller receives a first command from a host device through a transmission interface circuit of the memory controller, wherein the first command indicates that a first portion of storage space corresponding to a first logical address range will not be used by the host device; and in response to the first command, the memory controller loads a local logical-to-physical address mapping table from a non-volatile memory to a volatile memory in the memory controller as a temporary logical-to-physical address mapping table, changes a plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table in a group-by-group manner rather than an item-by-item manner to serve as a plurality of updated logical-to-physical table entries, and updates the local logical-to-physical address mapping table in the non-volatile memory according to the plurality of updated logical-to-physical table entries of the temporary logical-to-physical address mapping table to unmap at least a portion of all pages of at least one block of the plurality of blocks, wherein the first portion of storage space includes at least a portion of the pages.
[0006] In addition to the above method, the present invention also provides a memory device including the above memory controller, wherein the memory device includes: a non-volatile memory for storing information; and a memory controller coupled to the non-volatile memory and used to control the operation of the memory device.
[0007] In addition to the above method, the present invention also provides an electronic device including the above memory device, wherein the electronic device further includes a host device coupled to the memory device. The host device may include: at least one processor for controlling the operation of the host device; and a power supply circuit coupled to the at least one processor and used to provide power to the at least one processor and the memory device. In addition, the memory device provides storage space for the host device.
[0008] According to some embodiments, the device may include at least a portion (e.g., a portion or all) of an electronic device. For example, the device may include a memory controller in a memory device. For another example, the device may include a memory device. For another example, the device may include an electronic device.
[0009] According to some embodiments, a memory device may store data for a host device, wherein some of the stored data may need to be updated. In addition, the host device may transmit a first command carrying first information (e.g., a first starting logical address and a first length) to a memory controller to notify the memory controller of a first logical address range to allow the memory device to release more storage space for further use. In addition, it is suggested that the memory device may be operated according to at least one control scheme (e.g., one or more control schemes) of the method to perform related operations, in particular, loading internal management information (e.g., at least one address mapping table, such as one or more address mapping tables) from a non-volatile memory to a volatile memory in the memory controller as a temporary version of the internal management information, using a dedicated hardware circuit in the memory controller to change the temporary version of the internal management information as an updated version of the internal management information without processing the temporary version of the internal management information in an item-by-item manner, and updating the internal management information in the non-volatile memory according to the updated version of the internal management information.
[0010] The method and related apparatus of the present invention can ensure that the memory device can operate properly in different situations. For example, the memory device can effectively update the internal management information in the non-volatile memory without processing the temporary version of the internal management information in an item-by-item manner, thereby increasing the overall performance. In addition, the method and related apparatus of the present invention can solve the problems encountered by the prior art without introducing side effects or in a manner that is unlikely to introduce side effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 is a schematic diagram of an electronic device according to an embodiment of the present invention.
[0012] Figure 2 It is a schematic diagram of an address mapping control scheme involving physical blocks according to an embodiment of the present invention.
[0013] Figure 3 FIG. 4 is a schematic diagram of a block expansion control scheme according to an embodiment of the present invention.
[0014] Figure 4 FIG. 4 is a schematic diagram of an address mapping control scheme involving a super block according to an embodiment of the present invention.
[0015] Figure 5FIG. 4 is a schematic diagram of an address mapping control scheme involving a super block according to another embodiment of the present invention.
[0016] Fig. 6A FIG. 4 is a schematic diagram of a first processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0017] Figure 6B FIG. 4 is a schematic diagram of a second processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0018] Figure 6C FIG. 4 is a schematic diagram of a third processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0019] Fig.6D FIG. 4 is a schematic diagram of a fourth processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0020] Fig. 6E FIG. 4 is a schematic diagram of a fifth processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0021] Fig. 6F FIG. 4 is a schematic diagram of a sixth processing operation of a loop-based unmapping control scheme according to an embodiment of the present invention.
[0022] Figure 7 FIG. 2 is a schematic diagram of a hybrid processing control scheme of a method for performing mapping table management of a memory device in a predetermined communication architecture by using table analysis according to an embodiment of the present invention.
[0023] Fig. 8A FIG. 4 is a schematic diagram of a first item group processing operation of the search-based unmapping control scheme of the method according to an embodiment of the present invention.
[0024] Figure 8B Based on Fig. 8A A schematic diagram of the second item group processing operation of the search-based unmapping control scheme of the method of the illustrated embodiment.
[0025] Fig. 9 FIG. 4 is a schematic diagram of a workflow of the method according to an embodiment of the present invention.
[0026]
Explanation of symbols
[0027] 10: Electronic devices
[0028] 50: Host device
[0029] 52: Processor
[0030] 54: Power supply circuit
[0031] 58,118: Transmission interface circuit
[0032] 100: memory device
[0033] 110:Memory Controller
[0034] 112: Microprocessor
[0035] 112C: Program code
[0036] 112M: Read-only memory
[0037] 114: Control logic circuit
[0038] 114U: Table update circuit
[0039] 116: Random Access Memory
[0040] 116T: Temporary logical to physical address mapping table
[0041] 116VP: Temporary valid page count table
[0042] 120: Non-volatile memory
[0043] 120T: Global logical to physical address mapping table
[0044] 120VP: Valid Page Count Table
[0045] 122-1~122-N: Non-volatile memory element
[0046] BLK#0: Block
[0047] XB#0,XB#1:Super Block
[0048] S10~S14, S20~S25: Steps DETAILED DESCRIPTION
[0049] Figure 11 is a schematic diagram of an electronic device 10 according to an embodiment of the present invention, wherein the electronic device 10 may include a host device 50 and a memory device 100. The host device 50 may include at least one processor (e.g., one or more processors; which may be collectively referred to as a processor 52), a power supply circuit 54, and a transmission interface circuit 58, wherein the processor 52 and the transmission interface circuit 58 may be coupled to each other through a bus, and may be coupled to the power supply circuit 54 to obtain power. The processor 52 may be used to control the operation of the host device 50, and the power supply circuit 54 may be used to provide power to the processor 52, the transmission interface circuit 58, and the memory device 100, and output one or more driving voltages to the memory device 100. The memory device 100 may be used to provide storage space for the host device 50, and may obtain one or more driving voltages from the host device 50 as a power supply for the memory device 100. Examples of the host device 50 may include, but are not limited to: a multi-function mobile phone, a tablet computer, a wearable device, and a personal computer, such as a desktop computer and a notebook computer. Examples of the memory device 100 may include, but are not limited to, portable memory devices (e.g., memory cards conforming to SD / MMC, CF, MS or XD specifications, solid state drives (SSDs), and different types of embedded memory devices (e.g., embedded memory devices conforming to universal flash storage (UFS) specifications or embedded multi media card (eMMC) specifications). According to the present embodiment, the memory device 100 may include a controller, such as a memory controller 110, and may further include a non-volatile memory 120 (for simplicity, the non-volatile memory 120 is not shown in FIG. 1 ). Figure 1 1, wherein the memory controller 110 is used to access the non-volatile memory 120, and the non-volatile memory 120 is used to store information. The non-volatile memory 120 may include at least one non-volatile memory element (e.g., one or more non-volatile memory elements), such as a plurality of non-volatile memory elements 122-1, 122-2, ..., and 122-N (for simplicity, the non-volatile memory elements 122-1, 122-2, ..., and 122-N are referred to as "NV memory" in FIG. 1 ). Figure 1 , respectively, as “NV memory elements” in the figure), where “N” may represent a positive integer greater than 1. For example, the non-volatile memory 120 may be a flash memory, and the plurality of non-volatile memory elements 122-1, 122-2, . . . , and 122-N may be a plurality of flash memory chips or a plurality of flash memory dies, but the present invention is not limited thereto.
[0050] like Figure 1As shown, the memory controller 110 may include a processing circuit (e.g., a microprocessor 112), a storage unit (e.g., a read-only memory (ROM) 112M; for the sake of simplicity, it is marked as "ROM"), a control logic circuit 114, a random access memory 116 (random access memory, RAM; for the sake of simplicity, it is marked as "RAM", for example, it can be implemented by a static random access memory (SRAM), but the present invention is not limited thereto) and a transmission interface circuit 118, wherein at least a portion (e.g., a portion or all) of the above components can be coupled to each other through a bus. The random access memory 116 can be used to provide an internal storage space for the memory controller 110 (e.g., it can temporarily store information). In addition, the read-only memory 112M of this embodiment is used to store a program code 112C, and the microprocessor 112 is used to execute the program code 112C to control the access of the non-volatile memory 120. It should be noted that the program code 112C can also be stored in the random access memory 116 or any type of memory. In addition, the control logic circuit 114 can be used to control the non-volatile memory 120, and can include a table update circuit 114U for updating internal management information (e.g., at least one table, such as one or more tables) under the control of the processing circuit (e.g., the microprocessor 122), and can further include an error correction code (ECC) circuit (not shown). Figure 1), which can perform error correction code encoding and error correction code decoding to protect data and / or perform error correction. The transmission interface circuit 118 may include a plurality of sub-circuits, and the plurality of sub-circuits may interact with each other to communicate. The transmission interface circuit 118 may comply with one or more communication specifications among different communication specifications (e.g., Serial Advanced Technology Attachment (SATA) specification, Universal Serial Bus (USB) specification, Peripheral Component Interconnect Express (PCIe) specification, embedded multimedia card specification or universal flash storage specification), and may be used for the memory device 100 to communicate with the host device 50 (e.g., the transmission interface circuit 58) according to the one or more communication specifications. Similarly, the transmission interface circuit 58 may comply with the one or more communication specifications, and may be used for the host device 50 to communicate with the memory device 100 (e.g., the transmission interface circuit 118) according to the one or more communication specifications. For example, the multiple sub-circuits of the transmission interface circuit 118 may include a universal flash storage controller 118C (labeled as a "UFS controller" for simplicity), a standardized communication protocol (Unified Protocol, commonly referred to as UniPro) circuit 118U (labeled as a "UniPro circuit" for simplicity), and a physical layer (physical layer, PHY) circuit (for example, an M physical layer (M-PHY) circuit 118M that complies with the relevant specifications of the MIPI Alliance), and the transmission interface circuit 58 can be implemented as having a circuit architecture similar to or the same as the circuit architecture of the transmission interface circuit 118 (for example, multiple corresponding sub-circuits), but the present invention is not limited to this.
[0051] In the present embodiment, the host device 50 can indirectly access the non-volatile memory 120 in the memory device 100 by transmitting a plurality of host commands and corresponding logical addresses to the memory controller 110. The memory controller 110 receives the plurality of host commands and corresponding logical addresses, and converts the plurality of host commands into a plurality of memory operation commands (which may be referred to as operation commands), and then uses the plurality of operation commands to control the non-volatile memory 120 to read or write / program the memory cells or data pages of the corresponding physical addresses in the non-volatile memory 120, etc., wherein the physical addresses may be related to the logical addresses. For example, the memory controller 110 may generate or update at least one logical-to-physical (L2P) address mapping table to manage the relationship between the physical addresses and the logical addresses. The non-volatile memory 120 may store a global logical-to-physical address mapping table 120T for the memory controller 110 to control the memory device 100 to access the data in the non-volatile memory 120, but the present invention is not limited thereto. In addition, the memory controller 110 may generate or update a first physical-to-logical (P2L) address mapping table (not shown) in the non-volatile memory 120. Figure 1 ), and generates or updates the valid page count table 120VP in the non-volatile memory 120. For example, the memory controller 110 may refer to the first physical-to-logical address mapping table and the valid page count table 120VP to perform a garbage collection (GC) operation.
[0052] For better understanding, the global logical-to-physical address mapping table 120T may be located in a predetermined region (e.g., a system region) within the non-volatile memory 122-1 element, wherein the valid page count table 120VP may be located in the predetermined region (e.g., the system region) within the non-volatile memory 122-1 element, but the present invention is not limited thereto. For example, the global logical-to-physical address mapping table 120T may be divided into a plurality of local logical-to-physical address mapping tables, and the plurality of local logical-to-physical address mapping tables may be stored in one or more non-volatile memory elements of the non-volatile memory elements 122-1, 122-2, and 122-N, and in particular, may be stored in the non-volatile memory elements 122-1, 122-2, and 122-N, respectively. When necessary, the memory controller 110 may load at least a portion (e.g., a portion or all) of the global logical-to-physical address mapping table 120T into the random access memory 116 or other memory. For example, the memory controller 110 may load a local logical-to-physical address mapping table (e.g., a first local logical-to-physical address mapping table) among the plurality of local logical-to-physical address mapping tables into the random access memory 116 as a temporary logical-to-physical address mapping table 116T, so as to access data in the non-volatile memory 120 according to the local logical-to-physical address mapping table stored as the temporary logical-to-physical address mapping table 116T, but the present invention is not limited thereto. For example, when necessary, the memory controller 110 may load the valid page count table 120VP into the random access memory 116 as a temporary valid page count table 116VP.
[0053] In addition, the at least one non-volatile memory element (e.g., one or more non-volatile memory elements, such as {122-1, 122-2, ..., 122-N}) may include a plurality of blocks, wherein the minimum unit for the memory controller 110 to perform a data erase operation on the non-volatile memory 120 is a block, and the minimum unit for the memory controller 110 to perform a data write operation on the non-volatile memory 120 is a page, but the present invention is not limited thereto. For example, any non-volatile memory element 122-n (the symbol "n" may represent any integer in the interval [1, N]) among the non-volatile memory elements 122-1, 122-2, ..., and 122-N may include a plurality of blocks, and a block within the plurality of blocks may include and record a specific number of pages, wherein the memory controller 110 may access a certain page of a certain block within the plurality of blocks according to a block address and a page address.
[0054] According to some embodiments, the memory controller 110 may monitor the valid page counts of the plurality of blocks respectively for use in subsequent processing (e.g., garbage collection operation), wherein the valid page count table 120VP may be used to store the valid page counts of the plurality of blocks respectively. For data reception, the memory controller 110 may configure at least one block (e.g., one or more blocks) among the plurality of blocks of at least one non-volatile memory element (e.g., one or more non-volatile memory elements, such as {122-1, 122-2, ..., 122-N}) in the non-volatile memory 120 as at least one active block (e.g., one or more active blocks), and use the at least one active block to receive and store data (e.g., host-write data) from the host device 50. For example, the data (e.g., host-write data, such as data to be written into the non-volatile memory 120) may include a plurality of sets of partial data, and the at least one active block may include a first active block. In addition, the memory controller 110 may maintain (eg, generate or update) a temporary physical-to-logical address mapping table in the random access memory 116 to perform related internal management.
[0055] During the reception and storage of data from the host device 50 (e.g., host write data, such as data to be written into the non-volatile memory 120), the memory controller 110 may utilize the first active block to receive and store one or more sets of partial data among the plurality of sets of partial data, and record a physical-to-logical table entry in the temporary physical-to-logical address mapping table for indicating the physical-to-logical address mapping relationship for the first active block. The physical-to-logical address mapping relationship indicated by the physical-to-logical table entry may represent a physical-to-logical address mapping relationship between a logical address and a physical address, wherein the host device 50 writes the one or more sets of partial data into the logical address, and the physical address indicates the location in the first active block where the one or more sets of partial data are stored. When a first predetermined criterion is met (e.g., the first active block is completely programmed), the memory controller 110 may perform a set of table-related processing operations, and the set of table processing operations may include:
[0056] (1) a first table-related processing operation: updating the global logical-to-physical address mapping table 120T (e.g., some logical-to-physical table entries therein) according to the temporary physical-to-logical address mapping table (e.g., physical-to-logical table entries therein) to indicate a logical-to-physical address mapping relationship for the first active block;
[0057] (2) a second table related processing operation: updating the first physical-to-logical address mapping table in the non-volatile memory 120 according to the temporary physical-to-logical address mapping table, for example, by writing all physical-to-logical table entries recorded in the temporary physical-to-logical address mapping table into the first physical-to-logical address mapping table to perform the above-mentioned subsequent processing; and
[0058] (3) a third table related processing operation: after updating the global logical-to-physical address mapping table 120T and the first physical-to-logical address mapping table according to the temporary physical-to-logical address mapping table, clearing the temporary physical-to-logical address mapping table (e.g., the physical-to-logical table entries therein) to reuse the corresponding storage space in the temporary physical-to-logical address mapping table and / or the random access memory 116;
[0059] The first table-related processing operation may include loading a local logical-to-physical address mapping table (e.g., the first local logical-to-physical address mapping table) in the global logical-to-physical address mapping table 120T into the random access memory 116 as a temporary logical-to-physical address mapping table 116T, updating one or more logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T to indicate one or more logical-to-physical address mapping relationships among a plurality of logical-to-physical address mapping relationships for the first active block, and updating the global logical-to-physical address mapping table 120T (e.g., the local logical-to-physical address mapping table therein) according to the temporary logical-to-physical address mapping table 116T, but the present invention is not limited thereto. The first predetermined standard may be replaced by any one of a plurality of predetermined standards to allow the memory controller to perform the set of table-related processing operations when any of the above standards is met. For example, the plurality of predetermined standards may include:
[0060] (1) First predetermined standard: the first active block is fully programmed; and
[0061] (2) a second predetermined criterion: the number of physical-to-logical table entries recorded in the temporary physical-to-logical address mapping table reaches a predetermined entry count;
[0062] The predetermined entry count may represent a predetermined table size of the temporary physical-to-logical address mapping table. For example, when the first active block is completely programmed or the number of physical-to-logical table entries recorded in the temporary physical-to-logical address mapping table reaches the predetermined entry count, the memory controller 110 may perform the set of table-related processing operations.
[0063] In addition, the memory controller 110 may record at least one valid page count (e.g., one or more valid page counts) of the at least one active block (e.g., the first active block) in the temporary valid page count table 116VP to indicate the number of valid pages in the at least one active block, and update the valid page count table 120VP according to the temporary valid page count table 116VP, but the present invention is not limited thereto. According to some embodiments, the memory controller 110 may directly record at least one valid page count of the at least one active block in the non-volatile memory 120 to update the valid page count table 120VP to indicate the number of valid pages in the at least one active block.
[0064] After any one of the at least one active block (e.g., the first active block) is completely programmed, the memory device 100 (e.g., the memory controller 110) may close any of the active blocks to make the active block an inactive block, and select a blank block (e.g., an erased block) as a replacement for the active block for subsequent processing corresponding to the active block. In addition, the subsequent processing may include performing a garbage collection process to write valid data from all data in the inactive block to another blank block (e.g., another erased block).
[0065] According to certain embodiments, since the physical-to-logical address mapping relationship indicated by the physical-to-logical table item in the first physical-to-logical address mapping table and the logical-to-physical address mapping relationship indicated by the related logical-to-physical table item in the global logical-to-physical address mapping table 120T should be inverse address mapping relationships to each other, the memory controller 110 can determine the latest mapping information (e.g., physical address) carried by the related logical-to-physical table item in the global logical-to-physical address mapping table 120T based on the latest mapping information (e.g., logical address) carried by the physical-to-logical table item in the first physical-to-logical address mapping table.
[0066] Figure 2The present invention is a schematic diagram of an address mapping control scheme involving physical blocks according to an embodiment of the present invention. For example, in response to at least one write command (e.g., one or more write commands) from the host device 50, the memory controller 110 may write data from the host device 50 to a page of block BLK#0, and in particular, may perform the table-related processing operations for the first active block (e.g., block BLK#0). When necessary, the memory controller 110 may load a local logical-to-physical address mapping table (e.g., the first logical-to-physical address mapping table) from a plurality of local logical-to-physical address mapping tables into the random access memory 116 as a temporary logical-to-physical address mapping table 116T, so as to access the data stored in block BLK#0 according to the temporary logical-to-physical address mapping table 116T. Therefore, the temporary logical-to-physical address mapping table 116T may include Figure 2 The multiple logical-to-physical table entries shown may carry multiple physical addresses of the page of block BLK#0 to indicate the address mapping relationship between the physical address of the page of block BLK#0 and the logical address of the data (for example, for the order of the multiple logical-to-physical table entries corresponding to the logical addresses in the temporary logical-to-physical address mapping table 116T, with arrows pointing to the address mapping relationship of the page of block BLK#0), wherein any one of the multiple physical addresses may include a physical block address (physical block address, PBA) and a physical page address (physical page address, PPA), and the physical block address and the physical page address may be respectively located in multiple higher bits (for example, a group of consecutive bits including the most significant bit (MSB)) and multiple lower bits (for example, a group of consecutive bits including the least significant bit (LSB)) of the physical address, but the present invention is not limited to this.
[0067] Before performing the table-related processing operation for the first active block (e.g., block BLK#0), during the period of writing data to block BLK#0, the memory controller 110 may also write the number of valid pages (e.g., pages storing valid data) among all pages of block BLK#0 into the temporary valid page count table 116VP as the valid page count of block BLK#0, and in particular, when the valid page count changes, the valid page count (e.g., the number of valid pages) of block BLK#0 is updated in real time. When the data written to BLK#0 is sequential data, the valid page count of block BLK#0 may increase, but the present invention is not limited thereto. When the data written to BLK#0 is non-sequential data, the valid page count of block BLK#0 may increase or decrease (e.g., depending on whether the host device 50 requires to rewrite or update part of the data at the same logical address). In addition, the memory controller 110 may update the valid page count table 120VP according to the temporary valid page count table 116VP.
[0068] Figure 3 FIG. 1 is a schematic diagram of a block expansion control scheme according to an embodiment of the present invention. The non-volatile memory elements 122-1, 122-2, ..., and 122-N may include at least two memory elements 122-1 and 122-2 (e.g., chip #0 and chip #1 or die #0 and die #1; for simplicity, labeled as "chip / die #0" and "chip / die #1", respectively), and any non-volatile memory element 122-n in the non-volatile memory elements 122-1, 122-2, ..., and 122-N, such as chip Any chip among chip #0 and chip #1 or any bare die among bare die #0 and bare die #1 may include multiple planes, such as plane #0 and plane #1, wherein any plane among plane #0 and plane #1 of any of the above-mentioned non-volatile memory elements 122-n (for example, any chip among chip #0 and chip #1 or any bare die among bare die #0 and bare die #1) may include its own blocks BLK#0, BLK#1, etc.
[0069] Under the control of the memory controller 110, the memory device 100 may combine a group of first corresponding blocks BLK#0 in all planes (e.g., plane #0 and plane #1) of all non-volatile memory elements (e.g., chip #0 and chip #1 or die #0 and die #1) into a first superblock XB#0, but the present invention is not limited thereto. For example, the memory device 100 may combine multiple groups of corresponding blocks BLK#0, BLK#1, etc. in all planes (e.g., plane #0 and plane #1) of all non-volatile memory elements (e.g., chip #0 and chip #1 or die #0 and die #1) into multiple superblocks XB#0, XB#1, etc. In addition, the memory controller 110 can access (e.g., read or write) the multiple groups of corresponding blocks BLK#0, BLK#1, etc. in the multiple super blocks XB#0, XB#1, etc. according to the multiple physical block addresses, and in particular, can access (e.g., read or write) the corresponding pages in the multiple super blocks XB#0, XB#1, etc. according to the multiple physical block addresses and the related physical page addresses. For better understanding, Figure 3 The blocks in the same row shown may represent a group of corresponding blocks accessed by the same physical block address, and Figure 3 Pages shown in the same row may represent a group of corresponding pages accessed by the same physical page address.
[0070] For example, the memory controller 110 may access (e.g., read or write) the group of corresponding blocks BLK#0 in the super block XB#0 according to a first physical block address, and in particular, may access (e.g., read or write) a group of first corresponding pages in the group of corresponding blocks BLK#0 respectively located in the super block XB#0 according to a first physical block address and a first physical page address, and may access (e.g., read or write) a group of second corresponding pages in the group of corresponding blocks BLK#0 respectively located in the super block XB#0 according to a first physical block address and a second physical page address, and the rest may be deduced by analogy. For another example, the memory controller 110 may access (e.g., read or write) the group of corresponding blocks BLK#1 in the super block XB#1 according to a second physical block address, and in particular, may access (e.g., read or write) a group of first corresponding pages in the group of corresponding blocks BLK#1 respectively located in the super block XB#1 according to the second physical block address and a first physical page address, and may access (e.g., read or write) a group of second corresponding pages in the group of corresponding blocks BLK#1 respectively located in the super block XB#1 according to the second physical block address and a second physical page address, and the rest may be deduced by analogy.
[0071] Figure 4FIG. 1 is a schematic diagram of an address mapping control scheme involving a super block according to an embodiment of the present invention. For better understanding, Figure 3 The super block XB#0 and its pages shown can be used as Figure 4 The example of super block XB#0 and its pages is shown, but the present invention is not limited to this. For example, in response to at least one write command (e.g., one or more write commands) from the host device 50, the memory controller 110 may store data from the host device 50 to the pages of the super block XB#0, and in particular, perform the table-related processing operations for the above-mentioned at least one active block (e.g., the first active block, such as the group of corresponding blocks BLK#0 in the super block XB#0). When necessary, the memory controller 110 may load a local logical-to-physical address mapping table (e.g., the first local logical-to-physical address mapping table) from the multiple local logical-to-physical address mapping tables into the random access memory 116 as a temporary logical-to-physical address mapping table 116T, so as to access the data stored in the super block XB#0 according to the temporary logical-to-physical address mapping table 116T. Therefore, the temporary logical-to-physical address mapping table 116T may include Figure 4 The multiple logical-to-physical table entries shown may carry multiple physical addresses of the pages of super block XB#0 to indicate the address mapping relationship between the physical addresses of the pages of super block XB#0 and the logical addresses of the data (for example, for the order of the multiple logical-to-physical table entries corresponding to the logical addresses in the temporary logical-to-physical address mapping table 116T, with arrows pointing to the address mapping relationship of the pages of super block XB#0), wherein any one of the multiple physical addresses may include a physical block address and a physical page address, and the physical block address and the physical page address may be located in multiple higher bits (for example, a group of consecutive bits including the most significant bits) and multiple lower bits (for example, a group of consecutive bits including the least significant bits) of the physical address, respectively, but the present invention is not limited to this.
[0072] Before performing the table-related processing operation for the at least one active block (e.g., the first active block, such as the corresponding block BLK#0 in super block XB#0), during the writing of data to super block XB#0, the memory controller 110 may further write the number of valid pages (e.g., pages storing valid data) among all pages of super block XB#0 into the temporary valid page count table 116VP as a valid page count of super block XB#0, and in particular, when the valid page count changes, the valid page count (e.g., the number of valid pages) of super block XB#0 is updated in real time. When the data written to super block XB#0 is continuous data, the valid page count of super block XB#0 may be increased, but the present invention is not limited thereto. When the data written to super block XB#0 is non-continuous data, the valid page count of super block XB#0 may be increased or decreased (e.g., depending on whether the host device 50 requires to rewrite or update part of the data at the same logical address). In addition, the memory controller 110 may update the valid page count table 120VP according to the temporary valid page count table 116VP.
[0073] Figure 5 is a schematic diagram of an address mapping control scheme involving a super block according to another embodiment of the present invention, and Figure 4 Compared to the embodiment shown, the memory controller 110 may perform similar operations when writing data to the pages of super blocks XB#0, XB#1, etc. For example, in response to at least one write command (e.g., one or more write commands) from the host device 50, the memory controller 110 may store data from the host device 50 to the pages of super blocks XB#0, XB#1, etc., and in particular, perform the table-related processing operations for the at least one active block (e.g., the first active block, such as the corresponding block BLK in the super blocks XB#0, XB#1, etc.). When necessary, the memory controller 110 may load a local logical-to-physical address mapping table (e.g., the first local logical-to-physical address mapping table) from the plurality of local logical-to-physical address mapping tables into the random access memory 116 as a temporary logical-to-physical address mapping table 116T, so as to access the data stored in the super blocks XB#0, XB#1, etc. according to the temporary logical-to-physical address mapping table 116T. Therefore, the temporary logical-to-physical address mapping table 116T may include Figure 5The multiple logical-to-physical table entries shown in the figure may carry multiple physical addresses of pages of super blocks XB#0, XB#1, etc., to indicate the address mapping relationship between the physical addresses of the pages of super blocks XB#0, XB#1, etc. and the logical addresses of the data (for example, for the order of the multiple logical-to-physical table entries corresponding to the logical addresses in the temporary logical-to-physical address mapping table 116T, with arrows pointing to the address mapping relationship of the pages of super blocks XB#0, XB#1, etc.), wherein any one of the multiple physical addresses may have a physical address corresponding to the logical address of the super blocks XB#0, XB#1, etc. Figure 4 Similar or identical format of the physical address in the illustrated embodiment.
[0074] Before performing the table-related processing operation for at least one active block (e.g., the first active block, such as any super block among super blocks XB#0, XB#1, etc.), during writing data to any super block, the memory controller 110 may write the number of valid pages (e.g., pages storing valid data) among all pages of any super block into the temporary valid page count table 116VP as a valid page count of any super block, and in particular, when the valid page count changes, the valid page count (e.g., the number of valid pages) of any super block is updated in real time. In addition, the operation performed by the memory controller 110 on super block XB#0 can be used as an example of the operation performed by the memory controller 110 on any super block. For the sake of brevity, similar contents of this embodiment will not be described in detail again.
[0075] According to some embodiments, the memory controller 110 may receive a first command (e.g., an unmap command, a trim command, or an erase command) from the host device 50 through the transmission interface circuit 118 of the memory controller 110, wherein the first command may indicate that a first portion of storage space corresponding to a first logical address range will not be used by the host device 50. For example, the first command may carry first information related to the first logical address range, and the first information may include at least one first logical address (e.g., one or more first logical addresses), such as a first starting logical address (e.g., a logical block address (LBA)), and in particular, may further include a first length for indicating the first logical address range, wherein the first portion of storage space may correspond to the first logical address range, but the present invention is not limited thereto. According to some embodiments, the command format of the first command and / or the first information carried by the first command may vary.
[0076] 6A to 6F Schematic diagrams of a first entry processing operation, a second entry processing operation, a third entry processing operation, a fourth entry processing operation, a fifth entry processing operation, and a sixth entry processing operation according to a loop-based de-mapping control scheme according to an embodiment of the present invention. For example, the memory controller 110 may operate according to the loop-based de-mapping control scheme to process all logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T in an entry-by-entry manner, but the present invention is not limited thereto. In addition, the memory controller 110 (e.g., the microprocessor 112) may execute a loop to process the logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T. In each iteration of the loop, the memory controller 110 may process one of the logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T and change (e.g., reduce) the valid page count of a certain super block among the super blocks XB#0, XB#1, etc. in the temporary valid page count table 116VP.
[0077] For example, in Fig. 6A In the first entry processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., the top logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the first row in the super block XB#0 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the first row of the page in the super block XB#0 invalid, wherein the data originally pointing to Figure 5 The first arrow of the first row of pages in superblock XB#0 is shown to have been deleted to indicate the operation of unmapping the first row of pages in superblock XB#0; Figure 6B In the second entry processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., the next logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the second column in the super block XB#0 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the second column of the page in the super block XB#0 invalid, wherein the data originally pointed to Figure 5 The second arrow of the second column of the page in the super block XB#0 is deleted to indicate the operation of unmapping the second column of the page in the super block XB#0; the rest can be deduced by analogy. Figure 6CIn the third entry processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., a subsequent last logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the last column of the page in the super block XB#0 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the last column of the page in the super block XB#0 invalid, wherein the data originally pointing to Figure 5 Another arrow showing the last row of pages in superblock XB#0 has been deleted to indicate the operation of unmapping the last row of pages in superblock XB#0.
[0078] In addition, Fig.6D In the fourth processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., another subsequent logical-to-physical table entry, such as the logical-to-physical table entry after the last subsequent logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the first column of the page in the super block XB#1 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the first column of the page in the super block XB#1 invalid, wherein the data originally pointing to Figure 5 The first arrow of the first row of pages in superblock XB#1 is shown to have been deleted to indicate the operation of unmapping the first row of pages in superblock XB#1; Fig. 6E In the fifth processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., another subsequent logical-to-physical table entry, such as a logical-to-physical table entry after the aforementioned another subsequent logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the second column of the page in the super block XB#1 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the second column of the page in the super block XB#1 invalid, wherein the data originally pointing to Figure 5 The second arrow of the second column of pages in superblock XB#1 is shown to have been deleted to indicate the operation of unmapping the second column of pages in superblock XB#1; the rest can be deduced by analogy. Fig. 6F In the sixth processing operation shown, the memory device 100 (e.g., the memory controller 110) may fill a logical-to-physical table entry (e.g., another subsequent logical-to-physical table entry) with a first predetermined value (e.g., 0) to unmap the last column of the page in the super block XB#1 (e.g., cancel or clear its related address mapping relationship), and in particular, make all data in the last column of the page in the super block XB#1 invalid, wherein the data originally pointing to Figure 5Another arrow showing the last row of pages in superblock XB#1 has been deleted to indicate the operation of unmapping the last row of pages in superblock XB#1.
[0079] like 6A to 6F As shown, the memory controller 110 may operate according to the loop-based unmapping control scheme to process all logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T in an entry-by-entry manner to unmap pages in super blocks XB#0, XB#1, etc. in a row-by-row manner, and in particular, process a logical-to-physical table entry in the temporary logical-to-physical address mapping table 116T and change the valid page count in the temporary valid page count table 116VP in each iteration of the loop, but the present invention is not limited thereto. According to some embodiments, the memory controller 110 may process the logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T more efficiently.
[0080] Figure 7 A schematic diagram of a hybrid processing control scheme for a method of managing a mapping table of a memory device in a predetermined communication architecture (such as a universal flash storage communication architecture) by using table analysis according to an embodiment of the present invention. The method can be applied to Figure 1 The architecture shown, such as the electronic device 10, the host device 50, the memory device 100 and the memory controller 110, in particular, the elements within the memory controller 110. In addition, the memory device 100 (e.g., the memory controller 110) operated according to the method may execute a loop including steps S10 to S14 one or more times to perform entry-group processing (e.g., the operations of steps S11, S12, and S13) to divide all logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T into multiple entry groups, and process these logical-to-physical table entries in a group-by-group manner. For example, the loop index i may have a predetermined initial value (e.g., 0; for simplicity, in Figure 7 ) and incremented by a predetermined increment (e.g., 1) (for simplicity, in Figure 7 ), wherein steps S10 to S13 may correspond to a preparation phase, a search phase, a filling phase, and a completion phase, respectively, and certain steps (such as steps S11, S12, and S13) may be executed using a dedicated hardware circuit (such as a table update circuit 114U), but the present invention is not limited thereto.
[0081] In step S10, the memory device 100 (e.g., the memory controller 110) may prepare to process the i-th entry group GRP(i) corresponding to the index i in the temporary logical-to-physical address mapping table 116T, such as at least one logical-to-physical table entry L2PTE(i) corresponding to the index i (e.g., one or more logical-to-physical table entries {L2PTE(i)}), in particular, obtain a physical block address PBA(i) of a super block XB(i) including a valid page {VP(i)} from a first logical-to-physical table entry L2PTE(i) in the temporary logical-to-physical address mapping table 116T (for simplicity, in Figure 7 For better understanding, Figure 5 The super blocks XB#0, XB#1, etc. and their pages shown in the figure can be used as examples of super blocks XB(i) and valid pages {VP(i)}, respectively, but the present invention is not limited thereto. In addition, the first logical-to-physical table entry L2PTE(i) can carry a physical address {PBA(i), PPA(i)}, and the physical address {PBA(i), PPA(i)} can include a physical block address PBA(i) and a physical page address PPA(i), wherein the physical block address PBA(i) and the physical page address PPA(i) can be located in a plurality of higher bits (e.g., a group of consecutive bits including the most significant bits) and a plurality of lower bits (e.g., a group of consecutive bits including the least significant bits) of the physical address {PBA(i), PPA(i)}, respectively, but the present invention is not limited thereto.
[0082] In step S11, the memory device 100 (e.g., the memory controller 110) may start searching the temporary logical-to-physical address mapping table 116T for any logical-to-physical table entry (for simplicity, in the following example) that carries a different physical block address (e.g., any physical block address different from the physical block address PBA(i) of the super block XB(i)) from the next logical-to-physical table entry (if it exists) of the first logical-to-physical table entry L2PTE(i). Figure 7, marked as “searching logical-to-physical table entries without VPXB”). For example, the at least one logical-to-physical table entry L2PTE(i) may include X consecutive logical-to-physical table entries {L2PTE(i)} carrying the same physical block address PBA(i), and any of the logical-to-physical table entries carrying different physical block addresses (e.g., any physical block address different from the physical block address PBA(i)) may represent an immediately searched logical-to-physical table entry without the physical block address PBA(i), such as the next logical-to-physical table entry after the X consecutive logical-to-physical table entries {L2PTE(i)}, but the present invention is not limited thereto. For another example, the at least one logical-to-physical table entry L2PTE(i) may include a single logical-to-physical table entry L2PTE(i), and any of the logical-to-physical table entries carrying a different physical block address (for example, any physical block address that is different from the physical block address PBA(i)) may represent an immediately searched logical-to-physical table entry that does not carry the physical block address PBA(i), such as the next logical-to-physical table entry after the single logical-to-physical table entry L2PTE(i).
[0083] In step S12, the memory device 100 (e.g., the memory controller 110) may change the at least one logical-to-physical table entry L2PTE(i) corresponding to the index i (e.g., one or more logical-to-physical table entries L2PTE(i)), in particular, calculate the difference between the first position of the first logical-to-physical table entry L2PTE(i) in the temporary logical-to-physical address mapping table 116 and the second position of any one of the logical-to-physical table entries carrying different physical block addresses, so as to determine the range of the i-th item group GRP(i) (e.g., the at least one logical-to-physical table entry L2PTE(i)) in the temporary logical-to-physical address mapping table 116, and fill the range of the i-th item group GRP(i) (e.g., the at least one logical-to-physical table entry L2PTE(i)) with a first predetermined value (e.g., 0), so that all data in the valid page {VP(i)} of the super block XB(i) corresponding to the range becomes invalid (for simplicity, in Figure 7 , labeled “Fill range to invalidate data” in the example above), where the difference between the first and second positions may indicate the size of the range.
[0084] For example, when the difference between the first position and the second position is equal to X, the memory controller 110 may replace the table content of the X entry range of X consecutive logical-to-physical table entries {L2PTE(i)} with bit 0, so that all bits in the X entry range become bit 0. For another example, when the difference between the first position and the second position is equal to 1, the memory controller 110 may replace the table content of a single entry range of a single logical-to-physical table entry L2PTE(i) with bit 0, so that all bits in the single entry range become bit 0.
[0085] In step S13, the memory device 100 (e.g., the memory controller 110) may set any of the logical-to-physical table entries mentioned in the above step S11, such as the above-mentioned logical-to-physical table entry carrying any physical block address different from the physical block address PBA(i), as a new first logical-to-physical table entry L2PTE(i+1) (for simplicity, in Figure 7 marked as "Set the logic without VPXB to the physical table item as the new first item").
[0086] In step S14, the memory device 100 (e.g., the memory controller 110) may determine the next operation to be performed according to whether there is a next item group GRP(i+1) to be processed (e.g., whether any of the logical-to-physical table items mentioned in the above step S11 is searched). If yes (e.g., any of the logical-to-physical table items mentioned in the above step S11 is searched), the process proceeds to step S10; if no (e.g., any of the logical-to-physical table items mentioned in the above step S11 is not searched), the process proceeds to step S11. Figure 7 The workflow shown ends.
[0087] For example, in step S11, the memory device 100 (e.g., a dedicated hardware circuit, such as a table update circuit 114U) may search for any logic-to-physical table item in the temporary logic-to-physical address mapping table 116T without exceeding the overall range of the temporary logic-to-physical address mapping table 116T, and may utilize a register circuit (e.g., a register therein) within the memory controller 110 to indicate whether any of the logic-to-physical table items is found. In particular, before starting to search for any of the logic-to-physical table items, a register value stored in the register circuit is set to a preset register value (e.g., 0). If any of the logic-to-physical table items is found, the register value is set to a first register value (e.g., 1), but the present invention is not limited thereto. After performing the operation of step S11, if the register value is equal to the preset register value (e.g., 0) (which indicates that a remaining portion of the entire range of the temporary logical-to-physical address mapping table 116T has been completely searched in step S11), the memory controller 110 may determine the range mentioned in step S12 to be equal to the remaining portion (e.g., the i-th entry group GRP(i), such as the above-mentioned at least one logical-to-physical table entry L2PTE(i) may occupy the remaining portion), so as to perform the operation of step S12 (e.g., fill the range with a first predetermined value (e.g., 0)), and skip step S13 to jump to step S14. In response to the register value being equal to the preset register value (e.g., 0), the memory controller 110 may obtain a judgment result of "No" in step S14.
[0088] based on Figure 7In the hybrid processing control scheme shown, when the valid page {VP(0)} of super block XB(0), the valid page {VP(1)} of super block XB(1), etc. are used to store consecutive data respectively, the memory device 100 (e.g., the memory controller 110) can collect multiple sets of consecutive logical to physical table entries {{L2PTE(0)}, {L2PTE(1)}, ...} carrying physical block addresses {PBA(0), PBA(1), ...} into entry groups {GRP(0), GRP(1), ...} respectively.}, and process the item groups {GRP(0), GRP(1), ...} (e.g., multiple groups of consecutive logical-to-physical table items) in a group-by-group manner to increase overall performance, without having to process all logical-to-physical table items in the temporary logical-to-physical address mapping table 116T in an item-by-item manner, wherein any group of consecutive logical-to-physical table items {L2PTE(i)} among the multiple groups of consecutive logical-to-physical table items {{L2PTE(0)}, {L2PTE(1)}, ...} should carry the same physical block address PBA(i). Therefore, the memory device 100 (e.g., the memory controller 110) can immediately complete the update of the temporary logical-to-physical address mapping table 116T without being affected by 6A to 6F The global logical-to-physical address mapping table 120T in the non-volatile memory 120 can be updated in real time according to the temporary logical-to-physical address mapping table 116T to clear the related logical-to-physical address mapping relationship originally indicated by the updated old logical-to-physical table entry. For example, in response to the first command from the host device 50, the memory device 100 (e.g., the memory controller 110) can execute Figure 7 The workflow shown in FIG. 1 can operate the memory device 100 (e.g., the memory controller 110) according to the next command from the host device 50 without any delay. In some examples, at least a portion of the pages (e.g., a portion of the pages or all of the pages) of the valid page {VP(0)} of the super block XB(0), the valid page {VP(1)} of the super block XB(1), etc. can be used to store non-contiguous data, and the memory device 100 (e.g., the memory controller 110) can also execute the first command in response to the first command. Figure 7 The illustrated workflow can be used to operate the memory device 100 (eg, the memory controller 110) according to the next command from the host device 50 without any significant delay. Therefore, the method can ensure that the memory device (eg, the memory controller 110) is properly operated in different situations.
[0089] For a better understanding, this method can be Figure 7 The process is illustrated in the flowchart, but the present invention is not limited thereto. According to some embodiments, one or more steps may be performed in Figure 7 Add, delete or modify the workflow shown.
[0090] According to some embodiments, the memory controller 110 may be used to extract a group of consecutive bits (e.g., a plurality of higher bits, such as a group of consecutive bits including the most significant bit) from all bits of the physical address {PBA(i), PPA(i)} as the physical block address PBA(i) in step S10. For the sake of brevity, similar contents of these embodiments are not repeatedly described in detail.
[0091] Fig. 8A and Figure 8B Schematic diagrams of the first and second item group processing operations of the search-based de-mapping control scheme of the method according to an embodiment of the present invention. Figure 7 During the workflow shown, the memory controller 110 may process the i-th item group GRP(i) among the multiple item groups {GRP(i)} in the temporary logical address physical address mapping table 116T, and correspondingly change (e.g., reduce) the valid page count of a certain super block among the super blocks XB#0, XB#1, etc. in the temporary valid page count table 116VP.
[0092] For example, in a first item group processing operation, the memory device 100 (e.g., the memory controller 110) may fill an item group (e.g., the item group GRP(0)) with a first predetermined value (e.g., 0) to unmap multiple columns of pages in the super block XB#0 (e.g., the first column of the page, the second column of the page, ..., and the last column of the page), such as canceling or clearing the related address mapping relationship, in particular, making all data in the multiple columns of the pages in the super block XB#0 invalid, wherein the data originally pointing to the address column GRP(0) is invalidated. Figure 5 The arrows of the multiple columns of pages in the super block XB#0 are deleted to indicate the operation of unmapping the multiple columns of pages in the super block XB#0. In the second item group processing operation, the memory device 100 (e.g., the memory controller 110) can fill an item group (e.g., the item group GRP(1)) with a first predetermined value (e.g., 0) to unmap the multiple columns of pages in the super block XB#1 (e.g., the first column of the page, the second column of the page, ... and the last column of the page), such as canceling or clearing the related address mapping relationship, in particular, making all the data in the multiple columns of the pages in the super block XB#1 invalid, wherein the data originally pointing to the Figure 5 The arrows of the columns of pages in superblock XB#1 are shown to have been deleted to indicate the operation of unmapping the columns of pages in superblock XB#1; the rest can be analogized similarly.
[0093] like Fig. 8A and Figure 8B As shown, the memory controller 110 may be operated according to a search-based unmapping control scheme to process all logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T in a group-by-group manner to unmap pages of super blocks XB#0, XB#1, etc. in a block-by-block manner, in particular, to perform Figure 7 The illustrated entry group processing processes an entry group in the temporary logical to physical address mapping table 116T and effectively utilizes the size of the corresponding entry group to change (e.g., reduce) the valid page count in the temporary valid page count table 116VP. For the sake of brevity, similar contents of this embodiment are not repeatedly described in detail here.
[0094] Fig. 9 1 is a schematic diagram of the workflow of the method according to an embodiment of the present invention. The memory controller 110 can use multiple local logical-to-physical address mapping tables to manage the relationship between physical addresses and logical addresses (e.g., the physical address indicating the location where the host write data is stored in the non-volatile memory 120 and the logical address where the host device 50 writes the host write data). For example, the multiple local logical-to-physical address mapping tables can be implemented as a series of local logical-to-physical address mapping tables {L2PT(1), L2PT(2), ..., ADDR(X)} corresponding to a series of logical address ranges {ADDR(1), ADDR(2), ..., ADDR(X)}. 2PT(2), …, L2PT(X)}, and the series of logical address ranges {ADDR(1), ADDR(2), …, ADDR(X)} can be implemented as a series of continuous ranges of a series of continuous logical addresses {ADD(0), ADD(1), …, ADD((X*Y)-1)}, such as a range of X intervals [ADD(0), ADD(Y-1)], [ADD(Y), ADD((2*Y)-1)], … and [ADD((X-1)*Y), ADD((X*Y)-1)].
[0095] In step S20, the memory device 100 (e.g., the memory controller 110) may receive a first command (e.g., an unmap command, a trim command, or an erase command) from the host device 50 through the transmission interface circuit 118 of the memory controller 110, wherein the first command may indicate that a first portion of storage space corresponding to a first logical address range will not be used by the host device 50. For example, in response to the first command, the memory device 100 (e.g., the memory controller 110) may perform steps S21 to S25.
[0096] In step S21, the memory device 100 (e.g., the memory controller 110) may select a local logical-to-physical address mapping table L2PT(x) corresponding to a logical address range ADDR(x) from a plurality of local logical-to-physical address mapping tables (e.g., the series of local logical-to-physical address mapping tables {L2PT(1), L2PT(2), ..., L2PT(X)}) according to the first command for processing in a loop including steps S21 to S25, where "x" may represent a positive integer in the interval [1, X]. Since the first command may carry first information related to the first logical address range, the memory controller 110 may determine the logical address range ADDR(x) according to the first logical address range indicated by the first information (e.g., the first starting logical address and the first length).
[0097] The logical address range ADDR(x) may include at least a portion (e.g., a portion or all) of the first logical address range, and at least a portion of the first logical address range may fall within the logical address range ADDR(x). For example, the logical address range ADDR(x) may include the entire first logical address range, and the first logical address range may fall within the logical address range ADDR(x), wherein the loop including steps S21 to S25 may be executed once, but the present invention is not limited thereto. For another example, the logical address range ADDR(x) may include a portion of the first logical address range, and the portion of the first logical address range may fall within the logical address range ADDR(x), wherein the loop including steps S21 to S25 may be executed more than once to switch between different local logical-to-physical address mapping tables {L2PT(x)} corresponding to different logical address ranges {ADDR(x)} (e.g., multiple logical address ranges {ADDR(x)} covering multiple portions of the first logical address range, respectively).
[0098] In step S22, the memory device 100 (e.g., the memory controller 110) may load the local logical-to-physical address mapping table L2PT(x) corresponding to the logical address range ADDR(x) from the non-volatile memory 120 to a volatile memory (e.g., the random access memory 116) within the memory controller 110 as a temporary logical-to-physical address mapping table 116T, wherein the local logical-to-physical address mapping table L2PT(x) is one of a plurality of local logical-to-physical address mapping tables (e.g., the series of local logical-to-physical address mapping tables {L2PT(1), L2PT(2), …, L2PT(X)}) within the global logical-to-physical address mapping table 120T.
[0099] In step S23, the memory device 100 (e.g., the memory controller 110) may change the plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T in a group-by-group manner rather than an item-by-item manner to form a plurality of updated logical-to-physical table entries. For better understanding, the plurality of logical-to-physical table entries and the plurality of updated logical-to-physical table entries may represent Figure 5 The logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T are shown and Figure 8B The temporary logical-to-physical address mapping table 116T is shown as a logical-to-physical table entry, but the present invention is not limited thereto. In addition, the memory device 100 (e.g., the memory controller 110) can utilize a dedicated hardware circuit (e.g., the table update circuit 114U) to change the plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table 116T in a group-by-group manner to serve as the plurality of updated logical-to-physical table entries.
[0100] For example, the operation of step S23 may include: Figure 7The workflow shown, such as the operations of step S10 to step S14, wherein step S23 may include a plurality of sub-steps (e.g., step S10 to step S14), but the present invention is not limited thereto. In particular, the memory controller 110 may obtain a first physical block address (e.g., physical block address PBA(i)) from the first logical-to-physical table entry L2PTE(i) in the temporary logical-to-physical address mapping table 116T to prepare for processing a first entry group (e.g., the i-th entry group GRP(i)) in the temporary logical-to-physical address mapping table 116T, wherein the first entry group (e.g., the i-th entry group GRP(i)) may include the at least one logical-to-physical table entry L2PTE(i), and the at least one logical-to-physical table entry L2PTE(i) may include the first logical-to-physical table entry L2PTE(i). For example, the first logical-to-physical table entry L2PTE(i) may be the starting logical-to-physical table entry among the at least one logical-to-physical table entry L2PTE(i). In addition, the memory controller 110 may search for any logical-to-physical table entry in the temporary logical-to-physical address mapping table 116T that carries a different physical block address, wherein the different physical block address may represent any physical block address different from the first physical block address, such as any physical block address different from the physical block address PBA(i). In addition, the memory controller 110 may determine a first range of a first group of entries (e.g., the i-th group of entries GRP(i)) in the temporary logical-to-physical address mapping table 116T, such as the range mentioned in step S12, and fill the first range of the first group of entries with a first predetermined value (e.g., 0), but the present invention is not limited thereto. According to some embodiments, the first predetermined value may vary, for example, the first predetermined value may be equal to any other value different from 0.
[0101] In step S24, the memory device 100 (e.g., the memory controller 110) may update the local logical-to-physical address mapping table L2PT(x) in the non-volatile memory 120 according to the multiple updated logical-to-physical table entries of the temporary logical-to-physical address mapping table 116T, so as to unmap at least a portion of all pages of at least one block of the multiple blocks, wherein the first portion of storage space may include the at least a portion of the pages. For example, the at least one block may include at least one super block among super blocks XB#0, XB#1, etc., and in particular, may include a block BLK within the at least one super block, but the present invention is not limited thereto. According to some embodiments, the at least one block may include at least one physical block, such as at least one of the blocks BLK#0, BLK#1, etc. in any one of the multiple planes (e.g., plane #0 and plane #1) of any one of the non-volatile memory elements 122-n (e.g., any one of the chips among the chip #0 and chip #1 or any one of the die among the die #0 and die #1).
[0102] In step S25, the memory device 100 (e.g., the memory controller 110) may determine whether to perform the next operation. For example, the memory device 100 may determine whether to perform the next operation according to whether there is another local logical-to-physical address mapping table (e.g., the next local logical-to-physical address mapping table) that needs to be processed in the series of local logical-to-physical address mapping tables {L2PT(1), L2PT(2), ..., L2PT(X)} (for simplicity, the local logical-to-physical address mapping table is not shown in FIG. 1 ). Fig. 9 If yes (for example, there are other local logical to physical address mapping tables that need to be processed), proceed to step S21; if no (for example, there are no other local logical to physical address mapping tables that need to be processed), then Fig. 9 The workflow shown ends.
[0103] For a better understanding, this method can be Fig. 9 The process is illustrated in the flowchart, but the present invention is not limited thereto. According to some embodiments, one or more steps may be performed in Fig. 9 Add, delete or modify the workflow shown.
[0104] According to some embodiments, taking the i-th item group GRP(i) as an example of the first item group, each logical-to-physical table entry L2PTE(i) in at least one logical-to-physical table entry L2PTE(i) of the i-th item group GRP(i) may be used to carry a physical address (e.g., physical address {PBA(i), PPA(i)}), and the physical address may include a physical block address and a physical page address. The memory controller 110 may fill each logical-to-physical table entry L2PTE(i) with a first predetermined value, such as each logical-to-physical table entry L2PTE(i) carrying a physical block address and a physical page address. For example, the memory controller 110 may fill each logical-to-physical table entry L2PTE(i) with a first predetermined bit (e.g., bit 0), respectively. For the sake of brevity, similar contents of these embodiments are not repeated in detail.
[0105] According to some embodiments, the memory controller 110 may be configured to perform the following steps according to the method (eg, at least one control scheme thereof, such as Figure 7 The hybrid processing control scheme shown and Fig. 8A and Figure 8B The memory controller 110 may unmap a portion of the pages in a block without unmapping certain valid pages, and may update the latest valid page count of the block in the temporary valid page count table 116VP and the valid page count table 120VP, wherein the latest valid page count of the block may be a non-zero value (e.g., a positive value). In addition, the memory controller 110 may perform garbage collection operations, in particular, read all valid data from the valid pages of the block, write the valid data of the block to a blank block (e.g., an erase block), and erase the block to release more storage space for further use. For the sake of brevity, similar contents of these embodiments are not repeated in detail herein.
[0106] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.
Claims
1. A method for managing a mapping table of a memory device in a predetermined communication architecture by means of table analysis, the method being applied to a memory controller of the memory device, the memory device comprising the memory controller and a non-volatile memory, the non-volatile memory comprising at least one non-volatile memory element, the at least one non-volatile memory element comprising a plurality of blocks, the method comprising: Using the memory controller to receive a first command from a host device through a transmission interface circuit of the memory controller, wherein the first command indicates that a first portion of storage space corresponding to a first logical address range will not be used by the host device; and In response to the first command, a local logical-to-physical address mapping table is loaded from the non-volatile memory into a volatile memory in the memory controller as a temporary logical-to-physical address mapping table, a plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table are changed in a group-by-group manner rather than an item-by-item manner to serve as a plurality of updated logical-to-physical table entries, and the local logical-to-physical address mapping table in the non-volatile memory is updated according to the plurality of updated logical-to-physical table entries of the temporary logical-to-physical address mapping table to unmap at least a portion of all pages of at least one block of the plurality of blocks, wherein the first portion of the storage space includes the at least a portion of the pages.
2. The method according to claim 1, characterized in that The non-volatile memory is used to store a global logical-to-physical address mapping table, and the global logical-to-physical address mapping table includes a plurality of local logical-to-physical address mapping tables, wherein the local logical-to-physical address mapping table is one of the plurality of local logical-to-physical address mapping tables.
3. The method according to claim 1, characterized in that The step of changing the plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table in a group-by-group manner rather than an item-by-item manner to serve as the plurality of updated logical-to-physical table entries further comprises: The plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table are changed group by group by a dedicated hardware circuit in the memory controller to form the plurality of updated logical-to-physical table entries.
4. The method according to claim 1, characterized in that The step of changing the plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table in a group-by-group manner rather than an item-by-item manner to serve as the plurality of updated logical-to-physical table entries further comprises: Obtaining a first physical block address from a first logical-to-physical table entry in the temporary logical-to-physical address mapping table in preparation for processing a first group of entries in the temporary logical-to-physical address mapping table, wherein the first group of entries includes at least one logical-to-physical table entry, and the at least one logical-to-physical table entry includes the first logical-to-physical table entry; searching the temporary logical-to-physical address mapping table for any logical-to-physical table entry carrying a different physical block address, wherein the different physical block address represents any physical block address different from the first physical block address; and A first range of the first item group in the temporary logical-to-physical address mapping table is determined, and the first range of the first item group is filled with a first predetermined value.
5. The method according to claim 4, characterized in that Each of the at least one logical-to-physical table entry of the first item group is used to carry a physical address, and the physical address includes a physical block address and a physical page address; and the step of filling the first range of the first item group with the first predetermined value further includes: Each logical-to-physical table entry is filled with the first predetermined value, wherein each logical-to-physical table entry carries the physical block address and the physical page address.
6. The method according to claim 5, characterized in that The physical block address and the physical page address are respectively located in a first continuous bit group and a second continuous bit group of all bits of the physical address; and the step of using the first predetermined value to fill the first range of the first item group further includes: A plurality of bits in each logical-to-physical table entry are filled with a predetermined bit.
7. The method according to claim 4, characterized in that The first logical-to-physical table entry is used to carry a first physical address, and the first physical address includes the first physical block address and a first physical page address, wherein the first physical block address and the first physical page address are respectively located in a group of first consecutive bits and a group of second consecutive bits among all bits of the first physical address; and the memory controller is used to extract the group of first consecutive bits from all bits of the first physical address as the first physical block address.
8. The method according to claim 1, characterized in that The first command carries first information related to the first logical address range, and the first information includes at least one first logical address for indicating the first logical address range.
9. The method according to claim 8, characterized in that The at least one first logical address includes a first starting logical address; and in addition to the first starting logical address, the first information further includes a first length for indicating the first logical address range.
10. A memory controller of a memory device, the memory device comprising the memory controller and a non-volatile memory, the non-volatile memory comprising at least one non-volatile memory element, the at least one non-volatile memory element comprising a plurality of blocks, the memory controller comprising: a processing circuit for controlling the memory controller according to a plurality of host commands from a host device to allow the host device to access the non-volatile memory through the memory controller, wherein the processing circuit is used to perform mapping table management of the memory device in a predetermined communication architecture by table analysis; as well as a transmission interface circuit for communicating with the host device; in: The memory controller receives a first command from the host device through the transmission interface circuit of the memory controller, wherein the first command indicates that a first portion of storage space corresponding to a first logical address range will not be used by the host device; as well as In response to the first command, the memory controller loads a local logical-to-physical address mapping table from the non-volatile memory into a volatile memory within the memory controller as a temporary logical-to-physical address mapping table, changes a plurality of logical-to-physical table entries in the temporary logical-to-physical address mapping table in a group-by-group manner rather than an item-by-item manner to serve as a plurality of updated logical-to-physical table entries, and updates the local logical-to-physical address mapping table in the non-volatile memory according to the plurality of updated logical-to-physical table entries of the temporary logical-to-physical address mapping table to unmap at least a portion of all pages of at least one block of the plurality of blocks, wherein the first portion of the storage space includes the at least a portion of the pages.
11. A memory device comprising the memory controller according to claim 10, wherein the memory device comprises: The non-volatile memory is used to store information; and The memory controller is coupled to the non-volatile memory and is used to control the operation of the memory device.
12. An electronic device comprising the memory device of claim 11, and further comprising: The host device is coupled to the memory device, wherein the host device includes: at least one processor for controlling the operation of the host device; as well as a power supply circuit coupled to the at least one processor and configured to provide power to the at least one processor and the memory device; The memory device provides storage space for the host device.
