Data processing method and corresponding data storage device

CN113835617BActive Publication Date: 2024-09-06SILICON MOTION INC
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202110056670.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-11-11
Filing Date
2021-01-15
Publication Date
2024-09-06
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

The time required for existing data storage devices to look up or search in the mapping table increases significantly as the capacity of the memory device increases, resulting in a decrease in access performance.

Method used

A sub-region bit table is used to record and update data in the memory block. By determining the sub-region to which the logical address belongs and updating the value of the corresponding bit, the search time for the global or regional mapping table is reduced.

Benefits of technology

The reading speed of the memory device is improved, the time of searching the mapping table is saved, and the access performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113835617B_ABST
    Figure CN113835617B_ABST
Patent Text Reader

Abstract

The present invention relates to a data processing method and a corresponding data storage device, which includes a memory device and a memory controller. The memory controller configures a predetermined memory block as an active memory block for receiving data from a host device, and updates the content of a sub-region bit table in response to a write operation of the active memory block. The sub-region bit table includes one or more bits, each bit is associated with one or more sub-regions, and a value of each bit is initially set to a preset value. When data of a first logical address received from the host device is written to the active memory block, the memory controller determines which sub-region the first logical address belongs to, and sets the value of the bit associated with the sub-region to which the first logical address belongs to a predetermined value different from the preset value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a data processing method and a corresponding data storage device which can effectively improve the access performance of a memory device. Background Art

[0002] As the technology of data storage devices has grown rapidly in recent years, many data storage devices, such as memory cards, solid state drives, embedded Multi Media Cards (eMMC) and Universal Flash Storage (UFS) that comply with Secure Digital (SD) / Multi Media Card (MMC) specifications, Compact Flash (CF) specifications, Memory Stick (MS) specifications and Extreme Digital (XD) specifications, have been widely used in a variety of applications. Therefore, efficient access control has become an important issue for these data storage devices.

[0003] In order to assist the access operation of the data storage device, the data storage device can establish and maintain one or more mapping tables to record the mapping relationship between the physical address and the logical address. The logical address is the address used by a host device connected to the data storage device, and the host device can use the logical address to identify different memory spaces. The physical address is the address used by the data storage device, and the data storage device can use the physical address to identify different memory spaces. The memory controller manages these mapping tables according to the access operation of the memory device.

[0004] In response to a read instruction with a logical address to be read, the memory controller must look up the mapping table to obtain the physical address of the data storing the logical address to be read. However, table lookup or search is usually a time-consuming operation. In addition, the size of the table usually increases as the capacity of the memory device increases. Therefore, the time required to look up or search in the mapping table will increase significantly as the size of the mapping table increases.

[0005] In order to solve this problem and improve the reading speed of the memory device, a data processing method is needed that can effectively process the data stored in the memory device and improve the access performance of the memory device. Summary of the invention

[0006] An object of the present invention is to solve the problem of wasting time due to looking up or searching in a mapping table.

[0007] According to one embodiment of the present invention, a data storage device includes a memory device and a memory controller. The memory device includes a plurality of memory blocks. The memory controller is coupled to the memory device for accessing the memory device. The memory controller configures a given memory block as an active memory block for receiving data from a host device, and updates the contents of a sub-region bit table in response to a write operation of the active memory block. The sub-region bit table includes one or more bits, each bit is associated with one or more sub-regions, and a value of each bit is initially set to a preset value. When data of a first logical address received from the host device is written to the active memory block, the memory controller determines which sub-region the first logical address belongs to, and sets the value of the bit associated with the sub-region to which the first logical address belongs to a given value different from the preset value.

[0008] According to another embodiment of the present invention, a data processing method is applied to a data storage device, wherein the data storage device includes a memory device and a memory controller, the memory device includes a plurality of memory blocks, the memory blocks include at least one active memory block for receiving data to be written to the memory device from a host device, the memory controller is coupled to the memory device for accessing the memory device, the data processing method is executed by the memory controller and includes: writing data of a first logical address to the active memory block; and updating the content of a sub-region bit table in response to the write operation of the active memory block, wherein the sub-region bit table includes one or more bits, each bit is associated with one or more sub-regions, and a value of each bit is initially set to a preset value. The step of updating the content of the sub-region bit table in response to the write operation of the active memory block also includes: determining to which sub-region the first logical address belongs; and setting the value of the bit associated with the sub-region to which the first logical address belongs to a predetermined value different from the preset value. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Figure 1 FIG. 4 is a block diagram showing an example of a data storage device according to an embodiment of the present invention.

[0010] Figure 2 It is an example of showing logical units and their corresponding logical block addresses.

[0011] Figure 3 It shows the operations available in the host control mode.

[0012] Figure 4 It shows the operations available in the device control mode.

[0013] Figure 5 is a sample format for displaying HPB projects.

[0014] Figure 6 It shows the corresponding operation of the HPB read instruction.

[0015] Figure 7 is a flow chart showing a data processing method for improving the read speed of a memory device according to an embodiment of the present invention.

[0016] Figure 8 is a flow chart showing a data processing method for improving the read speed of a memory device according to another embodiment of the present invention.

[0017]

Explanation of symbols

[0018] 100: Data storage device

[0019] 110: memory controller

[0020] 112: Microprocessor

[0021] 112C: Program code

[0022] 112M: Read-only memory

[0023] 114: Memory interface

[0024] 116: Buffer memory

[0025] 118:Host Interface

[0026] 120: memory device

[0027] 130: Host device

[0028] 132: Encoder

[0029] 134:Decoder

[0030] 200:Logical unit

[0031] A-1, A-2, A-3, A-4, B-1, B-2, B-3, C-1, C-2, C-3, C-4, C-5, C-6, D-1, D-2, D-3, D-4, D-5, D-6, D-7: Operation

[0032] DATA IN UPIU: Universal Flash Memory Storage Protocol Information Unit for data entry

[0033] HPB_Rgn_0, HPB_Rgn_(N-1): HPB area

[0034] HPB_Sub_Rgn_0, HPB_Sub_Rgn_(L-1): HPB sub-region

[0035] LBA: Logical Block Address DETAILED DESCRIPTION

[0036] In the following, many specific details are described to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will still understand how to implement the present invention in the absence of one or more specific details or relying on other methods, elements or materials. In other cases, well-known structures, materials or operations are not shown or described in detail to avoid obscuring the main concepts of the present invention.

[0037] References throughout this specification to "an embodiment" or "an example" mean that a particular feature, structure, or characteristic described in conjunction with the embodiment or example is included in at least one of the multiple embodiments of the present invention. Thus, the phrases "in an embodiment of the present invention," "in an embodiment of the present invention," "in an example," or "in an example of the present invention" appearing in various places throughout this specification do not necessarily all refer to the same embodiment or example. Furthermore, the particular features, structures, or characteristics may be combined in any suitable combinations and / or subcombinations in one or more embodiments or examples.

[0038] In addition, in order to make the purpose, features and advantages of the present invention more clearly understood, the following specific embodiments of the present invention are specifically cited and described in detail with the accompanying drawings. The purpose is to illustrate the spirit of the present invention rather than to limit the scope of protection of the present invention. It should be understood that the following embodiments can be implemented through software, hardware, firmware, or any combination of the above.

[0039] Figure 1 1 is a block diagram example of a data storage device according to an embodiment of the present invention. The data storage device 100 may include a memory device 120 and a memory controller 110. The memory controller 110 is used to access the memory device 120 and control the operation of the memory device 120. The memory device 120 may be a non-volatile (NV) memory device (e.g., a flash memory), and may include one or more memory elements (e.g., one or more flash memory dies, one or more flash memory chips, or other similar elements).

[0040] The data storage device 100 may be coupled to a host device 130. The host device 130 may include at least a processor, a power circuit, and at least one random access memory (RAM), such as at least one dynamic random access memory (DRAM), at least one static random access memory (SRAM), etc. (not shown in the figure). Figure 1). The processor and the random access memory may be connected to each other via a bus and may be coupled to the power circuit to obtain power. The processor may control the operation of the host device 130. The power circuit may supply power to the processor, the random access memory, and the data storage device 100, for example, outputting one or more driving voltages to the data storage device 100. The data storage device 100 may obtain the driving voltage from the host device 130 as the power supply of the data storage device 100 and provide storage space for the host device 130.

[0041] According to one embodiment of the present invention, the memory controller 110 may include a microprocessor 112, a read-only memory (ROM) 112M, a memory interface 114, a buffer memory 116, and a host interface 118. The ROM 112M is used to store program code 112C. The microprocessor 112 is used to execute the program code 112C to control access to the memory device 120. The program code 112C may include one or more program modules, such as a bootloader program code. When the data storage device 100 obtains power from the host device 130, the microprocessor 112 may execute an initialization program of the data storage device 100 by executing the program code 112C. In the initialization program, the microprocessor 112 may load a set of In-System Programming (ISP) program codes (not shown) from the memory device 120. Figure 1 ). The microprocessor 112 can execute the set of in-system programming codes so that the data storage device 100 can have various functions. According to an embodiment of the present invention, the set of in-system programming codes may include, but are not limited to: one or more program modules related to memory access (e.g., reading, writing, and erasing), such as a read operation module, a table lookup module, a wear leveling module, a read refresh module, a read reclaim module, a garbage collection module, an unexpected power off recovery (SPOR) module, and an uncorrectable error correction code (UECC) module, which are respectively provided to perform corresponding operations such as reading, table lookup, wear leveling, read refresh, read reclaim, garbage collection, unexpected power off recovery, and error handling of detected UECC errors.

[0042] The memory interface 114 includes an encoder 132 and a decoder 134 , wherein the encoder 132 is used to encode data to be written into the memory device 120 , such as performing ECC encoding, and the decoder 134 is used to decode data read from the memory device 120 .

[0043] In a typical case, the memory device 120 includes a plurality of memory elements, such as a plurality of flash memory dies or a plurality of flash memory chips, and each memory element may include a plurality of memory blocks. The memory controller 110 performs an erase operation on the memory device 120 in units of blocks. In addition, a memory block may record (include) a specific number of data pages, such as physical data pages, wherein the memory controller 110 performs a write operation on the memory device 120 in units of data pages.

[0044] In practice, the memory controller 110 may utilize its own internal components to perform a variety of control operations, such as utilizing the memory interface 114 to control the access operations of the memory device 120 (especially the access operations to at least one memory block or at least one data page), utilizing the buffer memory 116 to perform the required buffer processing, and utilizing the host interface 118 to communicate with the host device 130.

[0045] In one embodiment, the memory controller 110 communicates with the host device 130 via the host interface 118 using a standard communication protocol. For example, the standard communication protocol includes (but is not limited to): Universal Serial Bus (USB) standard, SD interface standard, Ultra High Speed-I (UHS-I) interface standard, Ultra High Speed-II (UHS-II) interface standard, CF interface standard, MMC interface standard, eMMC interface standard, UFS interface standard, Advanced Technology Attachment (ATA) standard, Serial ATA (SATA) standard, Peripheral Component Interconnect Express (PCI-E) standard, Parallel Advanced Technology Attachment (PATA) standard, etc.

[0046] In one embodiment, the buffer memory 116 is implemented as a random access memory. For example, the buffer memory 116 may be a static random access memory, but the present invention is not limited thereto. In other embodiments, the buffer memory 116 may be a dynamic random access memory.

[0047] In one embodiment, the data storage device 100 may be a portable memory device (e.g., a memory card that complies with SD / MMC, CF, MS, or XD standards), and the host device 130 is an electronic device that can be connected to the data storage device, such as a mobile phone, a notebook computer, a desktop computer, etc. In another embodiment, the data storage device 100 may be a solid state drive or an embedded storage device that complies with UFS or eMMC specifications, and may be disposed in an electronic device, such as a mobile phone, a notebook computer, or a desktop computer, and in this case, the host device 130 may be a processor of the electronic device.

[0048] The host device 130 may issue instructions to the data storage device 100 , such as a read instruction or a write instruction, to access data stored in the memory device 120 , or the host device 130 may issue instructions to the data storage device 100 to further control and manage the data storage device 100 .

[0049] The memory device 120 may store a global logical to physical (abbreviated as L2P) (or host to flash (abbreviated as H2F)) mapping table for use by the memory controller 110 when accessing data of the memory device 120. The global L2P mapping table may be located in a predetermined area of ​​the memory device 120, such as a system area, but the present invention is not limited thereto. The global L2P mapping table may be divided into a plurality of regional L2P mapping tables, and the regional L2P mapping tables may be stored in the same or different memory elements. For example, a memory element may store a regional L2P mapping table. When necessary, the memory controller 110 may load at least a portion (e.g., a portion or all) of the global L2P mapping table into the buffer memory 116 or other memory. For example, the memory controller 110 may load a regional L2P mapping table as a temporary L2P mapping table for accessing data of the memory device 120 according to the regional L2P mapping table, but the present invention is not limited thereto.

[0050] In order to improve the read performance, the Host Performance Booster (HPB) series of standards have been recently released. HPB uses a memory device on the host device side (e.g., DRAM of the host device 130) to temporarily store mapping information maintained by the UFS device side (e.g., data storage device 100 implemented in accordance with the UFS specification). The mapping information can be obtained from the global or local L2P mapping table mentioned above. With the help of this mapping information, the host device 130 can issue a specific read instruction (hereinafter referred to as an HPB READ instruction) with information related to the physical address (e.g., physical block addresses (abbreviated as PBAs)) corresponding to the logical address (e.g., logical block addresses (abbreviated as LBAs)) that the host device 130 wants to read to read data, wherein the information related to the physical address can be carried in one or more HPB entries. In this way, the memory controller 110 can save the time spent on reading and loading the global or local L2P mapping table from the memory device 120, and save the time spent on searching the loaded L2P mapping table for the physical address corresponding to the logical address that the host device 130 wants to read. In this way, the read performance can be improved.

[0051] Generally speaking, the memory device 120 may be divided into a plurality of partitions, each partition may be regarded as a logical unit, and each logical unit may correspond to a plurality of logical block addresses. Figure 2 is an example of a logical unit 200 and its corresponding logical block address. As defined in the HPB specification, the logical block address corresponding to each logical unit (e.g., logical block address LBA 0 to LBA Z, where Z is a positive integer) can be divided into a plurality of HPB regions (e.g., HPB regions HPB_Rgn_0 to HPB_Rgn_(N-1), where N is a positive integer greater than 1), and each HPB region can be further divided into a plurality of HPB sub-regions (e.g., HPB sub-regions HPB_Sub_Rgn_0 to HPB_Sub_Rgn_(L-1), where L is a positive integer). The size of an HPB sub-region can be less than or equal to the size of an HPB region. To simplify the description, the HPB sub-regions are referred to as sub-regions, and the HPB regions are referred to as regions.

[0052] In the embodiment of the present invention, there are two modes for obtaining HPB items, including a host control mode and a device control mode.

[0053] Figure 3is a schematic diagram for showing possible operations in the host control mode. In the host control mode, the host system (e.g., the host device 130) can identify a new sub-region to be activated (operation A-1) and issue a HPB READ BUFFER command (operation A-2) to request the HPB entry corresponding to the sub-region to be activated. In response to receiving the HPB READ BUFFER command, the UFS device (e.g., the memory controller 110) can read at least a portion of the L2P mapping table (e.g., read the global L2P mapping table or the regional L2P mapping table) from the memory device 120, which corresponds to the sub-region selected to be activated, and provide the HPB entry according to the mapping information recorded in the L2P mapping table (operation A-3). The UFS device can then transmit the HPB entry to the host system via a DATA IN UFS Protocol Information Unit (UPIU) packet (operation A-4). The host system may configure a HPB area (also referred to as an HPB cache area) in the system memory to store the HPB items (operation A-5).

[0054] The host system may also identify a region to be deactivated (operation B-1) and issue a HPB WRITE BUFFER command to request deactivation of a region (operation B-2). The UFS device may deactivate the corresponding region in response to receiving the HPB WRITE BUFFER command (operation B-3).

[0055] In addition, when the UFS device determines that the HPB entry corresponding to any sub-region needs to be updated, for example, when the UFS device modifies the L2P mapping information corresponding to an activated sub-region (operation C-1), the UFS device may transmit a response UPIU packet to the host system to suggest the host system to update the HPB entry corresponding to the sub-region (operation C-2). In response to receiving the response UPIU packet, the host system may issue an HPB read buffer instruction (operation C-3) and transmit it to the UFS device to request the updated HPB entry corresponding to the activated sub-region (operation C-4). In response to receiving the HPB read buffer instruction, the UFS device may read the portion of the L2P mapping table corresponding to the activated sub-region and provide the HPB entry according to the mapping information recorded in the L2P mapping table (operation C-5). Similarly, the UFS device may then transmit the HPB entry to the host system via a DATA IN UPIU packet (operation C-6). The host system may update the HPB entries stored in the HPB cache area according to the received information (operation C-7).

[0056] Figure 4 is a schematic diagram for showing possible operations in the device control mode. In the device control mode, the UFS device may identify a new sub-region to be activated and / or a region to be deactivated (operation D-1), and transmit a response UPIU packet to the host system to suggest the host system to activate the selected new sub-region or deactivate the selected region (operation D-2). For deactivating the selected region, the host system may discard the HPB entry corresponding to the region that is no longer activated (operation D-3). For the activated new sub-region, the host system may issue an HPB read buffer instruction and transmit it to the UFS device to request the HPB entry corresponding to the sub-region to be activated (operation D-4). Similarly, in response to receiving the HPB read buffer instruction, the UFS device may read at least a portion of the L2P mapping table (e.g., read the global L2P mapping table or the regional L2P mapping table) from the memory device 120, which portion corresponds to the sub-region selected to be activated, and provide the HPB entry according to the mapping information recorded in the L2P mapping table (operation D-5). The UFS device may then transmit the HPB item to the host system via a DATA IN UPIU packet (operation D-6). The host system may configure an HPB area (also referred to as an HPB cache area) in the system memory to store the HPB item (operation D-7).

[0057] Figure 5is an example format for displaying HPB items. In one embodiment of the present invention, the size of an HPB item is 8 bytes. In this example format, 4 bytes are used to record the physical address obtained from the L2P mapping table (e.g., the global or local L2P mapping table, or the temporary L2P mapping table loaded into the buffer memory 116 by the memory controller 110), and the remaining 4 bytes are used to record another physical address, which is the address actually used to store the aforementioned global or local L2P mapping table in the flash memory. More specifically, in Figure 5 In the example format shown, the first 4-byte PBA and the second 4-byte PBA are combined to form an HPB entry, wherein the first PBA is a physical block address stored in Table 1 (also referred to as T1 table), which is a physical block address mapped to a logical block address, and the second PBA is a physical block address stored in Table 2 (also referred to as T2 table), which is a physical block address of the T1 table. Here, the T1 table may be a global or local L2P mapping table stored in the memory device 120, and the T2 table may be a system table for recording the physical addresses of each management table (e.g., global or local L2P mapping table) actually stored in the memory device 120.

[0058] Since when the content (e.g., mapping information) of a management table (e.g., global or regional L2P mapping table) needs to be updated, the memory controller 110 can configure another memory space to store the updated content of the management table, therefore, when the physical block address mapped by a logical block address changes, not only the content of the T1 table needs to be modified, but the updated content of the T1 table will also be stored in another new storage space of the memory device 120. Therefore, the physical address corresponding to the T1 table recorded in the system table will also change accordingly. In this way, the content of the T2 table recorded in the HPB project can be used to verify whether the data stored in the physical block address mapped by a logical block address corresponding to the HPB project is still valid data. When the content of the T2 table recorded in the HPB project matches the physical address of the latest T1 table maintained by the memory controller 110, it means that the data stored in the physical block address (T1 table content) recorded in this HPB project is still valid data. On the contrary, it means that the data stored in the physical block address recorded in this HPB project is invalid data. It should be noted that the verification of whether the data stored in the aforementioned physical block address is still valid data may be performed by the memory controller 110 of the data storage device.

[0059] With the information provided by the HPB project, the host device 130 can issue the aforementioned HPB read command, which can carry relevant information such as the starting logical address that the host device 130 attempts to read, the transfer length (TRANSFER LENGTH), and the content recorded in the HPB project, so as to read data. Figure 6 is a schematic diagram for showing the corresponding operation of the HPB read instruction. The host system can obtain the required HPB item information from the HPB cache area and send an HPB read instruction to the UFS device (operation E-1). The HPB read instruction carries a logical block address LBA (e.g., the starting LBA), the HPB item content corresponding to the LBA, and the transfer length, and is transmitted through the HPB read instruction UPIU packet (operation E-2). In a specific embodiment, the transfer length can be limited to 1, but the present invention is not limited to this. In other embodiments of the present invention, the transfer length can be set to any positive integer. Upon receiving the HPB read instruction, the UFS device can decode the HPB item corresponding to a selected LBA that the host device 130 attempts to read to obtain the physical address or PBA corresponding to the selected LBA, and access the memory device according to the physical address or PBA related information to obtain the data that the host device 130 attempts to read (operation E-3). The UFS device can determine whether the received HPB item is still valid in operation E-3. For example, by determining whether the T2 table content recorded in the HPB item matches the physical address of the latest T1 table maintained by the memory controller 110, it is determined whether the HPB item is still valid. If the content of the HPB item is valid, the UFS device can obtain the data that the host device 130 attempts to read (i.e., the "logical block data" shown in the figure), and transmit one or more universal flash memory storage communication protocol information unit (DATA IN UPIU) packets for inputting data to the host system to transmit the data (operation E-4) to the host system, and transmit a response UPIU packet (operation E-5) to the host system after the data transmission is completed, wherein the "logical block data" refers to the data corresponding to the logical address LBA selected by the host device 130 to be read. On the other hand, if the received HPB item is determined to be invalid, the UFS device can skip operation E-4 and directly execute operation E-5, by transmitting a response UPIU packet to the host system to suggest that the host system update the corresponding HPB item.

[0060] It should be noted that in some embodiments of the present invention, the UFS device end may actively suggest the host system to update the HPB project. For example, in the aforementioned operation C-2 or operation D-2, the UFS device end actively suggests the host system to update the HPB project or suggests the host system to activate a new sub-area by sending a response UPIU packet. In other embodiments of the present invention, the UFS device end may not actively suggest the host system to update the HPB project. In these embodiments, the UFS device end may instead suggest the host system to update the corresponding HPB project by sending a response UPIU packet to the host system after determining that the HPB project is invalid. For example, after receiving the HPB read instruction, if the UFS device determines that the HPB project is invalid in the aforementioned operation E-3, it suggests the host system to update the corresponding HPB project through a response UPIU packet.

[0061] According to an embodiment of the present invention, the memory controller 110 may configure a given memory block as an active memory block (also referred to as a buffer) for receiving data from the host device 130, and correspondingly record a plurality of logical addresses in a mapping table. The mapping table may be a physical to logical (P2L) (or Flash to Host (F2H)) mapping table. Different from the aforementioned global or regional L2P mapping table stored in the memory device 120, the P2L mapping table corresponding to the active memory block is usually stored in the buffer memory 116 as a temporary mapping table.

[0062] In one embodiment of the present invention, the P2L mapping table may include a plurality of fields, one field of the P2L mapping table corresponds to a physical address of the current memory block, and is used to record mapping information of the physical address, wherein four physical addresses may correspond to a physical data page. For example, a physical address may be used to store 4 kilobytes (KB) of data, and the size of a physical data page may be 16KB. The mapping information of a physical address recorded in the P2L mapping table of the current memory block is physical-to-logical mapping information of which logical address the data of the physical address stored in the current memory block points to.

[0063] In addition, the global or regional L2P mapping table (hereinafter collectively referred to as the L2P mapping table) stored in the memory device 120 may include a plurality of fields, and a field of the L2P mapping table is used to record mapping information of a logical address. A logical address may correspond to a logical data page. The mapping information of a logical address or a logical data page recorded in the L2P mapping table is the logical-to-physical mapping information of which physical address of the memory device stores the data of the logical address or the logical data page.

[0064] Generally speaking, the content of the P2L mapping table corresponding to the current memory block is updated to the L2P mapping table stored in the memory device 120 only when the current memory block is filled and is to be updated as a data block of the data area in the memory device 120. That is, in the conventional design, when the current memory block is still used as an active buffer and is still used to receive data from the host device 130, the content of the P2L mapping table corresponding to the current memory block will not be updated to the L2P mapping table. Therefore, when receiving a read instruction with a specified logical address of the data to be read by the host device 130, the memory controller 110 must first search the P2L mapping table corresponding to the current memory block according to the specified logical address to determine whether the current memory block stores the data of the specified logical address. If so, since the data stored in the current memory block is the latest data, the memory controller 110 provides the data corresponding to the specified logical address stored in the current memory block to the host device 130. If not, the memory controller 110 must further load the L2P mapping table (for example, when the HPB related technology is not applied), and search the L2P mapping table to obtain the physical address storing the data corresponding to the designated logical address to be read.

[0065] However, as described above, table lookup or search is a time-consuming operation. In order to solve this problem and further improve the read speed of the memory device, especially when HPB related technology is applied, in an embodiment of the present invention, the memory controller 110 can establish a sub-region bit table to record or indicate which sub-region data is stored in the current memory block, and the memory controller 110 can update the content of the sub-region bit table in response to the write operation of the current memory block.

[0066] More specifically, according to an embodiment of the present invention, the sub-region bit table may include one or more bits, each bit is associated with one or more sub-regions, and a value of each bit may be initially set to a preset value. It should be noted that although the above is described using a sub-region bit table for recording or indicating which sub-region's data is stored in the currently used memory block, the present invention is not limited to this. In other embodiments of the present invention, the aforementioned bit table may also be a region bit table for recording or indicating which region's data is stored in the currently used memory block. In addition, in an embodiment of the present invention, the aforementioned region may be such as Figure 2 The HPB region shown, and the aforementioned sub-regions may be as follows Figure 2As described above, the memory device 120 may be divided into a plurality of partitions, each of which may be considered as a logical unit corresponding to a plurality of logical block addresses. Each logical unit may be divided into a plurality of HPB regions, and each HPB region may be further divided into a plurality of HPB sub-regions. In the following paragraphs, for simplicity of description, the sub-region bit table and the region bit table will be collectively referred to as the region / sub-region bit table.

[0067] In one embodiment of the present invention, the region / sub-region bit table may include a plurality of bits, each of which is associated with a HPB region / HPB sub-region. Therefore, the value of each bit is used to indicate whether the current memory block has data of the HPB region / HPB sub-region associated with the bit. In another embodiment of the present invention, the region / sub-region bit table may include a plurality of bits, each of which is associated with more than one HPB region / HPB sub-region. That is, the information of whether the data of the associated multiple HPB regions / HPB sub-regions is stored in the current memory block is compressed into one bit. Therefore, the value of each bit is used to indicate whether the current memory block has data of any one of the multiple HPB regions / HPB sub-regions associated with the bit. In another embodiment of the present invention, the region / sub-region bit table may include only one bit, which is associated with one or more HPB regions / HPB sub-regions. Therefore, the value of the bit is used to indicate whether the current memory block has data of any one of the one or more HPB regions / HPB sub-regions associated with the bit.

[0068] In some embodiments of the present invention, one or more HPB regions / HPB sub-regions associated with one or more bits of the region / sub-region bit table may be one or more HPB regions / HPB sub-regions requested to be activated by the host device 130 (or, one or more HPB regions / HPB sub-regions that have been activated). In other embodiments, one or more HPB regions / HPB sub-regions associated with one or more bits of the region / sub-region bit table may also be not limited to one or more HPB regions / HPB sub-regions requested to be activated by the host device 130 (or, one or more HPB regions / HPB sub-regions that have been activated).

[0069] As described above, the host system (e.g., the host device 130) may confirm the new sub-region to be activated, and issue a HPB read buffer instruction to request the HPB item corresponding to the sub-region to be activated. Therefore, upon receiving the HPB read buffer instruction, the memory controller 110 may know which HPB sub-region is to be activated. When the region / sub-region bit table may include more than one bit, and each bit is associated with more than one activated HPB region / HPB sub-region, the memory controller 110 may add one or more bits associated with the aforementioned new sub-region to be activated in the region / sub-region bit table. That is, according to an embodiment of the present invention, in an application where the region / sub-region bit table includes more than one bit, and the HPB region / HPB sub-region associated with these bits is an activated HPB region / HPB sub-region, the region / sub-region bit table is expandable. When any new HPB sub-region is requested to be activated by the host device 130, the memory controller 110 may add one or more bits associated with one or more HPB sub-regions to be activated in the region / sub-region bit table. On the other hand, when the host device 130 requests to deactivate a region, the memory controller 110 may delete one or more bits associated with one or more HPB sub-regions included in the HPB region to be deactivated in the region / sub-region bit table. It should be noted that in this application, the memory controller 110 may further record the relevant information of which bit is associated with which activated HPB region / HPB sub-region.

[0070] According to another embodiment of the present invention, in an application where the region / sub-region bit table includes only one bit, the bit may be associated with an activated HPB region / HPB sub-region and / or an HPB region / HPB sub-region to be activated. In addition, the bit may be used as a flag to indicate whether the currently used memory block stores any data belonging to the logical address of the activated HPB region / HPB sub-region and / or the HPB region / HPB sub-region to be activated. If the currently used memory block stores any data belonging to the logical address of the activated HPB region / HPB sub-region and / or the HPB region / HPB sub-region to be activated, the memory controller 110 may set the value of the flag to a predetermined value different from the preset value. Otherwise, the value of the flag will be maintained as the preset value.

[0071] According to an embodiment of the present invention, the region / sub-region bit table may be stored in the buffer memory 116, and may be maintained by the memory controller 110 according to the data stored in the current memory block. In the embodiment of the present invention, using the information recorded in the region / sub-region bit table, when receiving a read instruction or an HPB read instruction, the memory controller 110 may determine whether the operation of searching the P2L mapping table corresponding to the current memory block can be directly skipped. For example, when the aforementioned flag or a bit in the region / sub-region bit table indicates that the data of a logical address to be read is not stored in the current memory block, the memory controller 110 may determine to directly skip the operation of searching the P2L mapping table corresponding to the current memory block. In this way, the time for performing useless searches in the P2L mapping table corresponding to the current memory block can be saved (because the data of the logical address to be read is not stored in the current memory block), thereby improving the reading speed of the memory device. In particular, when the read instruction received by the memory controller 110 is a HPB read instruction, and the memory controller 110 has determined that the operation of searching the P2L mapping table corresponding to the currently used memory block can be directly skipped, the memory controller 110 can decode the received HPB item corresponding to the LBA specified to be read to obtain the corresponding physical address or PBA, and can directly use the physical address or PBA to access the memory device 120. In this way, the acceleration effect of using the HPB item can be truly brought into play.

[0072] Figure 7 FIG. 1 is a flow chart showing a data processing method for improving the read speed of a memory device according to an embodiment of the present invention. Figure 7 In the following, the operation of updating the content of the region / sub-region bit table will be introduced. The data processing method can be executed by the memory controller 110 and may include the following steps:

[0073] Step S702: In response to a write command received from the host device 130, data of a first logical address is written into the current memory block, so as to write the data of the first logical address into the memory device 120.

[0074] Step S704: Determine which region / sub-region the first logical address belongs to. An example of the relationship between a logical address (eg, logical block address LBAs) and an HPB region / HPB sub-region is shown in Figure 2 A person familiar with the technical field can easily deduce the method of converting the logical address into the HPB region / HPB sub-region index value, so it will not be described in detail here.

[0075] Step S706: Set the value of the bit associated with the region / sub-region to which the first logical address belongs to a predetermined value different from the preset value. It is worth noting that in some embodiments of the present invention, when the HPB region / HPB sub-region associated with one or more bits in the region / sub-region bit table is an activated HPB region / HPB sub-region, then when the region / sub-region determined in step S704 is not an activated HPB region / HPB sub-region, step S706 can be omitted.

[0076] Figure 8 FIG. 2 is a flow chart showing a data processing method for improving the read speed of a memory device according to another embodiment of the present invention. Figure 8 In the following, the operation of using the region / sub-region bit table content will be introduced. The data processing method can be executed by the memory controller 110 and may include the following steps:

[0077] Step S802: Receive a read command with a second logical address from the host device 130. In one embodiment of the present invention, the read command may be an HPB read command with the second logical address (e.g., the starting LBA), the HPB item corresponding to the second logical address, and the transfer length.

[0078] Step S804: Determine to which region / sub-region the second logical address belongs.

[0079] Step S806: Determine whether the value of the bit associated with the region / sub-region to which the second logical address belongs is set to a predetermined value. If yes, execute step S808. If no, execute step S810.

[0080] Step S808: Search the P2L mapping table corresponding to the current memory block to determine whether the current memory block has a physical address storing the data of the second logical address. The memory controller 110 may search the P2L mapping table corresponding to the current memory block according to the second logical address to determine whether the current memory block stores the data of the second logical address, and obtain the data that the host system attempts to read according to the determination result. If so, since the data stored in the current memory block is the latest data, the memory controller 110 provides the data corresponding to the second logical address stored in the current memory block to the host device 130. If not, the memory controller 110 may access the memory device 120 using the physical address or PBA obtained by decoding the received HPB item corresponding to the second logical address, obtain the data that the host system attempts to read, and provide the data of the second logical address to the host device 130.

[0081] Step S810: Skip the operation of searching the P2L mapping table corresponding to the current memory block (i.e., do not search the P2L mapping table corresponding to the current memory block), and directly use the physical address or PBA obtained by decoding the HPB item corresponding to the second logical address received to access the memory device 120, obtain the data that the host system attempts to read, and provide the data of the second logical address to the host device 130.

[0082] According to an embodiment of the present invention, the memory controller 110 may establish a region / sub-region bit table after transmitting one or more HPB items to the host device 130 and update the content of the region / sub-region bit table in response to the write operation of the current memory block. Since the physical address of the data stored at a given logical address may still change due to the memory controller 110 performing some background operations (e.g., garbage collection) or due to the host device 130 updating the data content of the given logical address after the memory controller 110 transmits one or more HPB items to the host device 130 in response to the HPB read buffer instruction issued by the host device 130, the physical address encoded in the HPB item may become wrong or outdated. Therefore, in an embodiment of the present invention, the memory controller 110 may start to use the region / sub-region bit table to record or indicate which sub-region data is stored in the current memory block after transmitting one or more HPB items to the host device 130, and the memory controller 110 may update the content of the region / sub-region bit table in response to the write operation of the current memory block.

[0083] According to another embodiment of the present invention, in response to a determination that it is necessary to suggest activating one or more sub-regions of a memory device (e.g., when the HPB is applied in a device control mode) or that it is necessary to transmit one or more HPB items (e.g., when the HPB is applied in a host control mode), the memory controller 110 directly updates the content of the L2P mapping table according to the P2L mapping table storing the latest mapping information corresponding to the current memory block before transmitting the one or more HPB items to the host device 130. After the content of the L2P mapping table is updated according to the P2L mapping table corresponding to the current memory block, the memory controller 110 may establish a region / sub-region bit table, and update the content of the region / sub-region bit table in response to a write operation of the current memory block. That is, after the content of the L2P mapping table is updated according to the P2L mapping table corresponding to the current memory block, the memory controller 110 may start to use the region / sub-region bit table to record or indicate which sub-region's data is stored in the current memory block, and may update the content of the region / sub-region bit table in response to a write operation of the current memory block. In addition, after the content of the L2P mapping table is updated according to the P2L mapping table corresponding to the currently used memory block, the memory controller 110 can generate an HPB entry according to the content of the L2P mapping table recording the latest mapping information, and transmit a packet including the HPB entry (e.g., the aforementioned DATA IN UPIU packet) to the host device 130. In this way, the aforementioned problem of encoding an erroneous or obsolete physical address in the HPB entry or the physical address encoded in the HPB entry becoming an erroneous or obsolete physical address due to a subsequent memory access operation can be effectively solved.

[0084] According to yet another embodiment of the present invention, the memory controller 110 may create a region / sub-region bit table after the active memory block is allocated, and update the content of the region / sub-region bit table in response to a write operation of the active memory block.

[0085] In the embodiment of the present invention, by using the region / sub-region bit table to record or indicate which sub-region data is stored in the current memory block, the memory controller 110 can omit the operation of searching the P2L mapping table corresponding to the current memory block according to the designated logical address that the host device 130 wants to read, which is required in the conventional art. When it is determined that the operation of searching the P2L mapping table corresponding to the current memory block can be omitted according to the content recorded in the region / sub-region bit table, the memory controller 110 does not search the P2L mapping table corresponding to the current memory block, but directly uses the physical address or PBA obtained by decoding the HPB item corresponding to the designated logical address received to access the memory device 120, and obtain the data that the host system attempts to read. In this way, the acceleration effect of using the HPB item can be truly brought into play.

[0086] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should fall within the scope of the present invention.

Claims

1. A data storage device, comprising: A memory device comprising a plurality of memory blocks; as well as a memory controller coupled to the memory device for accessing the memory device, wherein the memory controller configures a given memory block as an active memory block for receiving data from a host device, stores a first mapping table corresponding to the active memory block, and updates the content of a sub-region bit table in response to a write operation of the active memory block, wherein the sub-region bit table includes one or more bits, each bit is associated with one or more sub-regions, and a value of each bit is initially set to a preset value, and the first mapping table includes a plurality of fields, a field of the first mapping table is used to record mapping information of a physical address of the active memory block, and the mapping information of the physical address is a physical-to-logical mapping information of which logical address the data of the physical address stored in the active memory block points to, and wherein when data of a first logical address received from the host device is written into the currently used memory block, the memory controller determines to which sub-region the first logical address belongs, and sets the value of the bit associated with the sub-region to which the first logical address belongs to a predetermined value different from the preset value; and The memory device further stores a second mapping table, the second mapping table includes a plurality of fields, a field of the second mapping table is used to record mapping information of a logical address, and the mapping information of the logical address is a logical-to-physical mapping information of which physical address of the memory device stores the data of the logical address, and after the content of the second mapping table has been updated according to the first mapping table, the memory controller establishes the sub-region bit table and updates the content of the sub-region bit table in response to the write operation of the active memory block.

2. The data storage device according to claim 1, wherein: In response to receiving a read instruction with a second logical address, the memory controller determines to which sub-region the second logical address belongs, and determines whether the value of the bit associated with the sub-region to which the second logical address belongs in the sub-region bit table is set to the predetermined value, and when the value of the bit associated with the sub-region to which the second logical address belongs is not set to the predetermined value, the memory controller omits the operation of searching the first mapping table according to the second logical address.

3. The data storage device according to claim 2, wherein: When the value of the bit associated with the sub-region to which the second logical address belongs is set to the predetermined value, the memory controller searches the first mapping table according to the second logical address to determine whether a physical address in the current memory block stores data of the second logical address.

4. The data storage device according to claim 2, wherein: The read instruction is a Host Performance Booster (HPB) read instruction with the second logical address and relevant information of a HPB item corresponding to the second logical address, and the HPB item includes relevant information of a physical address storing data of the second logical address.

5. The data storage device according to claim 1, wherein: The memory controller creates the sub-region bit table after transmitting one or more HPB entries to the host device and updates the content of the sub-region bit table in response to the write operation of the active memory block.

6. The data storage device according to claim 1, wherein: After the content of the second mapping table has been updated according to the first mapping table, the memory controller further generates one or more HPB entries according to the second mapping table, and transmits a packet including the one or more HPB entries to the host device.

7. The data storage device according to claim 1, wherein: The one or more sub-regions associated with each bit of the sub-region bit table are one or more sub-regions requested by the host device to be activated.

8. A data processing method, applicable to a data storage device, wherein the data storage device comprises a memory device and a memory controller, the memory device comprises a plurality of memory blocks, the memory blocks comprising at least one active memory block for receiving data to be written to the memory device from a host device, the memory controller coupled to the memory device for accessing the memory device and storing a first mapping table corresponding to the active memory block, the data processing method being executed by the memory controller and comprising: Writing data of a first logical address into the currently used memory block; as well as updating the content of a sub-region bit table in response to the write operation of the active memory block, wherein the sub-region bit table includes one or more bits, each bit is associated with one or more sub-regions, and a value of each bit is initially set to a preset value, The step of updating the content of the sub-region bit table in response to the write operation of the active memory block further comprises: Determine to which sub-region the first logical address belongs; as well as The value of the bit associated with the sub-region to which the first logical address belongs is set to a predetermined value different from the preset value, The sub-region bit table is established after the content of a second mapping table is updated according to the first mapping table, The first mapping table includes a plurality of fields, a field of the first mapping table is used to record mapping information of a physical address of the current memory block, and the mapping information of the physical address is physical-to-logical mapping information of which logical address the data of the physical address stored in the current memory block points to, and The second mapping table includes a plurality of fields, a field of the second mapping table is used to record mapping information of a logical address, and the mapping information of the logical address is a logical-to-physical mapping information of which physical address of the memory device stores the data of the logical address.

9. The data processing method according to claim 8, characterized in that: Also includes: In response to receiving a read instruction with a second logical address, determining to which sub-region the second logical address belongs; as well as determining whether the value of the bit associated with the sub-region to which the second logical address belongs in the sub-region bit table is set to the predetermined value, and correspondingly determining whether to omit searching the first mapping table according to the second logical address, When the value of the bit associated with the sub-region to which the second logical address belongs is not set to the predetermined value, it is determined to omit searching the first mapping table according to the second logical address.

10. The data processing method according to claim 9, characterized in that: Also includes: When the value of the bit associated with the sub-region to which the second logical address belongs is set to the predetermined value, the first mapping table is searched according to the second logical address to determine whether there is a physical address in the current memory block storing the data of the second logical address.

11. The data processing method according to claim 9, characterized in that: The read instruction is a Host Performance Booster (HPB) read instruction with the second logical address and relevant information of a HPB item corresponding to the second logical address, and the HPB item includes relevant information of a physical address storing data of the second logical address.

12. The data processing method according to claim 8, characterized in that: The sub-region bit table is created after one or more HPB entries are transmitted to the host device.

13. The data processing method according to claim 8, characterized in that: Also includes: generating one or more HPB items according to the second mapping table after the content of the second mapping table is updated according to the first mapping table; as well as A packet including the one or more HPB items is sent to the host device.

14. The data processing method according to claim 8, characterized in that: The one or more sub-regions associated with each bit of the sub-region bit table are one or more sub-regions requested by the host device to be activated.

Citation Information

Patent Citations

  • Storage controlling apparatus, storage apparatus, information processing system and processing method

    CN103377140A

  • Methods for caching and reading data to be written into storage unit and apparatuses using same

    CN105893275A

  • Memory system and operating method of the memory system

    CN110244907A

  • Data storage device and operating method thereof

    CN110837342A

  • Data processing system and method for operating the same

    CN110858180A