CN106776376B - Buffer memory management method, memory control circuit unit and storage device - Google Patents
Buffer memory management method, memory control circuit unit and storage device Download PDFInfo
- Publication number
- CN106776376B CN106776376B CN201510820913.2A CN201510820913A CN106776376B CN 106776376 B CN106776376 B CN 106776376B CN 201510820913 A CN201510820913 A CN 201510820913A CN 106776376 B CN106776376 B CN 106776376B
- Authority
- CN
- China
- Prior art keywords
- area
- mapping table
- logical address
- cache unit
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0866—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
- G06F12/0873—Mapping of cache memory to specific storage devices or parts thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0866—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
- G06F12/0871—Allocation or management of cache space
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Read Only Memory (AREA)
Abstract
本发明提供一种缓冲存储器管理方法、存储器控制电路单元及存储装置。此方法包括:在缓冲存储器划分出第一区域与第二区域以暂存多个逻辑地址‑物理地址映射表,并且对第一区域执行回存操作。此方法也包括:接收一写入指令,其中此写入指令指示的逻辑地址所属的逻辑地址‑物理地址映射表已被暂存在第一区域。此方法还包括:将此逻辑地址‑物理地址映射表复制到第二区域,并更新第二区域中的此逻辑地址‑物理地址映射表。本发明能提升将逻辑地址‑物理地址映射表从缓冲存储器回存至可复写式非易失性存储器模块时的运作效率及系统稳定性。
The present invention provides a buffer memory management method, a memory control circuit unit and a storage device. The method includes: dividing a first area and a second area in the buffer memory to temporarily store a plurality of logical address-physical address mapping tables, and performing a restore operation on the first area. The method also includes: receiving a write instruction, wherein the logical address-physical address mapping table to which the logical address indicated by the write instruction belongs has been temporarily stored in the first area. The method also includes: copying the logical address-physical address mapping table to the second area, and updating the logical address-physical address mapping table in the second area. The present invention can improve the operating efficiency and system stability when restoring the logical address-physical address mapping table from the buffer memory to a rewritable non-volatile memory module.
Description
技术领域technical field
本发明是有关于一种缓冲存储器管理方法,且特别是有关于一种缓冲存储器管理方法、存储器控制电路单元及存储装置。The present invention relates to a buffer memory management method, and in particular to a buffer memory management method, a memory control circuit unit and a storage device.
背景技术Background technique
数码相机、移动电话与MP3播放器在这几年来的成长十分迅速,使得消费者对存储媒体的需求也急速增加。由于可复写式非易失性存储器模块(例如,快闪存储器)具有数据非易失性、省电、体积小,以及无机械结构等特性,所以非常适合内建于上述所举例的各种可携式多媒体装置中。Digital cameras, mobile phones, and MP3 players have grown rapidly in recent years, making consumers' demand for storage media also increase rapidly. Since the rewritable non-volatile memory module (for example, flash memory) has the characteristics of data non-volatility, power saving, small size, and no mechanical structure, it is very suitable for being built in the various memory modules listed above. in portable multimedia devices.
一般来说,在使用可复写式非易失性存储器模块作为存储媒体的存储器存储装置中,通常也会配置缓冲存储器,用以暂存程序码、数据或是用于存储器存储装置在执行背景(background)工作时数据的暂存区域。例如,存储器存储装置的控制器会将逻辑地址-物理地址映射表载入至缓冲存储器以利存取数据。而当接收到写入指令而执行写入操作时,存储器存储装置的控制器会更新暂存在缓冲存储器中的逻辑地址-物理地址映射表。并且当缓冲存储器中已暂存大量的已被更新的逻辑地址-物理地址映射表时,存储器存储装置的控制器会将缓冲存储器中已被更新的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。由于已被更新的逻辑地址-物理地址映射表有可能不是暂存在缓冲存储器中连续的缓存单元中,而可复写式非易失性存储器模块又是以物理编程单元为最小写入单位,因此,必须将已被更新的逻辑地址-物理地址映射表先复制到缓冲存储器中的暂存区域,以集中成相当于一个物理编程单元的大小才能回存至可复写式非易失性存储器模块。然而,大量的复制操作将导致系统负载过重,回存时间过长,使整体性能下降。Generally speaking, in a memory storage device that uses a rewritable non-volatile memory module as a storage medium, a buffer memory is also usually configured to temporarily store program codes and data or to be used in the execution background of the memory storage device ( The temporary storage area for data during background) work. For example, the controller of the memory storage device loads the logical address-physical address mapping table into the buffer memory to facilitate data access. When receiving a write command and performing a write operation, the controller of the memory storage device will update the logical address-physical address mapping table temporarily stored in the buffer memory. And when a large number of updated logical address-physical address mapping tables have been temporarily stored in the buffer memory, the controller of the memory storage device will return the updated logical address-physical address mapping table in the buffer memory to the rewritable type non-volatile memory module. Since the updated logical address-physical address mapping table may not be temporarily stored in continuous cache units in the buffer memory, and the rewritable non-volatile memory module uses the physical programming unit as the minimum write unit, therefore, The updated logical address-physical address mapping table must first be copied to the temporary storage area in the buffer memory so as to be concentrated into a size equivalent to one physical programming unit before being stored back into the rewritable non-volatile memory module. However, a large number of copy operations will cause the system to be overloaded, and the restore time will be too long, which will reduce the overall performance.
此外,在将缓冲存储器中已被更新的逻辑地址-物理地址映射表被回存至可复写式非易失性存储器模块的期间,倘若又接收到写入指令而需再次更新上述正被回存的逻辑地址-物理地址映射表,此时存储器存储装置的控制器会先暂停接收此写入指令的数据及写入操作的执行。如此一来,可能发生因等待时间过长而造成写入失败的情况。因此,如何提升将逻辑地址-物理地址映射表从缓冲存储器回存至可复写式非易失性存储器模块时的运作效率及系统稳定性,为此领域技术人员所关心的议题。In addition, during the period when the updated logical address-physical address mapping table in the buffer memory is stored back to the rewritable non-volatile memory module, if a write command is received again, the above-mentioned memory-backed mapping table needs to be updated again. The logical address-physical address mapping table, at this time, the controller of the memory storage device will first suspend receiving the data of the write command and executing the write operation. As a result, writing may fail due to a long waiting time. Therefore, how to improve the operating efficiency and system stability when restoring the logical address-physical address mapping table from the buffer memory to the rewritable non-volatile memory module is a topic concerned by those skilled in the art.
发明内容Contents of the invention
本发明提供一种缓冲存储器管理方法、存储器控制电路单元及存储装置,其能提升将逻辑地址-物理地址映射表从缓冲存储器回存至可复写式非易失性存储器模块时的运作效率及系统稳定性。The present invention provides a buffer memory management method, a memory control circuit unit and a storage device, which can improve the operating efficiency and system when restoring the logical address-physical address mapping table from the buffer memory to a rewritable non-volatile memory module stability.
本发明的一范例实施例提出一种缓冲存储器管理方法,用于存储器存储装置的缓冲存储器。此存储器存储装置具有可复写式非易失性存储器模块。本缓冲存储器管理方法包括在缓冲存储器中划分出第一区域与第二区域,其中第一区域与第二区域分别地具有连续的多个缓存单元,并且第一区域与第二区域中的缓存单元中的至少一部分缓存单元已暂存多个逻辑地址-物理地址映射表。本缓冲存储器管理方法也包括对第一区域的缓存单元执行回存操作以将存储在第一区域的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。本缓冲存储器管理方法还包括从主机系统接收第一写入指令,且第一写入指令指示将第一数据写入至第一逻辑地址,并且第一逻辑地址所属的第一逻辑地址-物理地址映射表已被暂存在第一区域的缓存单元之中的第一缓存单元中。本缓冲存储器管理方法还包括写入第一数据至可复写式非易失性存储器模块,并将第一区域中的第一逻辑地址-物理地址映射表复制到第二区域中的缓存单元之中的第二缓存单元中。本缓冲存储器管理方法还包括更新暂存在第二区域中的第二缓存单元中的第一逻辑地址-物理地址映射表。An exemplary embodiment of the present invention provides a cache memory management method for a cache memory of a memory storage device. The memory storage device has a rewritable non-volatile memory module. The buffer memory management method includes dividing a first area and a second area in the buffer memory, wherein the first area and the second area respectively have a plurality of consecutive cache units, and the cache units in the first area and the second area At least some of the cache units have temporarily stored multiple logical address-physical address mapping tables. The buffer memory management method also includes performing a store-back operation on the cache units in the first area to store back the logical address-physical address mapping table stored in the first area into the rewritable non-volatile memory module. The buffer memory management method further includes receiving a first write instruction from the host system, and the first write instruction indicates to write the first data to the first logical address, and the first logical address-physical address to which the first logical address belongs The mapping table has been temporarily stored in the first cache unit among the cache units in the first area. The buffer memory management method also includes writing the first data to the rewritable non-volatile memory module, and copying the first logical address-physical address mapping table in the first area to the cache unit in the second area in the second cache unit. The buffer memory management method further includes updating the first logical address-physical address mapping table temporarily stored in the second cache unit in the second area.
在本发明的一范例实施例中,上述更新暂存在第二区域中的第二缓存单元中的第一逻辑地址-物理地址映射表的步骤还包括将第二缓存单元标示为已更新状态,并将第二区域设定为更新区域,并且更新区域是用以暂存多个被更新的逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the step of updating the first logical address-physical address mapping table temporarily stored in the second cache unit in the second area further includes marking the second cache unit as an updated state, and The second area is set as an update area, and the update area is used to temporarily store a plurality of updated logical address-physical address mapping tables.
在本发明的一范例实施例中,上述的缓冲存储器管理方法还包括在第二区域的所有缓存单元都为已更新状态时,将第二区域的所有缓存单元中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。In an exemplary embodiment of the present invention, the above buffer memory management method further includes when all the cache units in the second area are in the updated state, converting the logical address-physical address mapping table in all the cache units in the second area to Store back to the rewritable non-volatile memory module.
在本发明的一范例实施例中,上述的缓冲存储器管理方法还包括根据第二区域中的缓存单元的顺序,选取第二区域中的第一个缓存单元作为第二缓存单元,并设定第一指标指向第二缓存单元。再者,在将第一逻辑地址-物理地址映射表复制到第二区域中的第二缓存单元之后,设定第一指标指向第二区域的缓存单元之中的另一个缓存单元,其中此另一个缓存单元为第二缓存单元的后一个不为已更新状态的缓存单元。In an exemplary embodiment of the present invention, the above buffer memory management method further includes selecting the first cache unit in the second area as the second cache unit according to the order of the cache units in the second area, and setting the first cache unit A pointer points to the second cache unit. Furthermore, after the first logical address-physical address mapping table is copied to the second cache unit in the second area, the first pointer is set to point to another cache unit among the cache units in the second area, wherein the other A cache unit is a cache unit that is not in an updated state after the second cache unit.
在本发明的一范例实施例中,上述的缓冲存储器管理方法还包括从主机系统接收第二写入指令,且第二写入指令指示将第二数据写入至第二逻辑地址,并且第二逻辑地址所属的第二逻辑地址-物理地址映射表已被暂存在第二区域的缓存单元之中的第三缓存单元中。再者,写入第二数据至可复写式非易失性存储器模块,并更新暂存在第二区域中的第三缓存单元中的第二逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the above buffer memory management method further includes receiving a second write command from the host system, and the second write command indicates to write the second data to the second logical address, and the second The second logical address-physical address mapping table to which the logical address belongs has been temporarily stored in the third cache unit among the cache units in the second area. Furthermore, the second data is written into the rewritable non-volatile memory module, and the second logical address-physical address mapping table temporarily stored in the third cache unit in the second area is updated.
在本发明的一范例实施例中,上述的缓冲存储器管理方法还包括从主机系统接收第三写入指令,其中第三写入指令指示将第三数据写入至第三逻辑地址,并且第三逻辑地址所属的第三逻辑地址-物理地址映射表尚未载入至映射表区。再者,从可复写式非易失性存储器模块中载入第三逻辑地址-物理地址映射表,并且第三逻辑地址-物理地址映射表被暂存在第二区域的缓存单元之中的第四缓存单元中。此外,写入第三数据至可复写式非易失性存储器模块,并更新暂存在第二区域中的第四缓存单元中的第三逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the above buffer memory management method further includes receiving a third write command from the host system, wherein the third write command indicates to write third data to a third logical address, and the third The third logical address-physical address mapping table to which the logical address belongs has not been loaded into the mapping table area. Furthermore, the third logical address-physical address mapping table is loaded from the rewritable non-volatile memory module, and the third logical address-physical address mapping table is temporarily stored in the fourth cache unit in the second area. in the cache unit. In addition, the third data is written into the rewritable non-volatile memory module, and the third logical address-physical address mapping table temporarily stored in the fourth cache unit in the second area is updated.
本发明的一范例实施例提出一种存储器控制电路单元,用于控制可复写式非易失性存储器模块。存储器控制电路单元包括主机接口、存储器接口、缓冲存储器及存储器管理电路。主机接口电性连接至主机系统,存储器接口电性连接至可复写式非易失性存储器模块,缓冲存储器电性连接至主机接口及存储器接口,存储器管理电路电性连接至主机接口、存储器接口与缓冲存储器。存储器管理电路会在缓冲存储器中划分出第一区域与第二区域,其中第一区域与第二区域分别地具有连续的多个缓存单元,并且第一区域与第二区域中的缓存单元中的至少一部分缓存单元已暂存多个逻辑地址-物理地址映射表。再者,存储器管理电路会对第一区域的缓存单元执行回存操作以将存储在第一区域的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。并且,存储器管理电路更从主机系统接收第一写入指令,此第一写入指令指示将第一数据写入至第一逻辑地址,并且第一逻辑地址所属的第一逻辑地址-物理地址映射表已被暂存在第一区域的缓存单元之中的第一缓存单元中。并且,存储器管理电路更写入第一数据至可复写式非易失性存储器模块,并将第一区域中的第一逻辑地址-物理地址映射表复制到第二区域中的缓存单元之中的第二缓存单元中。此外,存储器管理电路更新暂存在第二区域中的第二缓存单元中的第一逻辑地址-物理地址映射表。An exemplary embodiment of the present invention provides a memory control circuit unit for controlling a rewritable non-volatile memory module. The memory control circuit unit includes a host interface, a memory interface, a buffer memory and a memory management circuit. The host interface is electrically connected to the host system, the memory interface is electrically connected to the rewritable non-volatile memory module, the buffer memory is electrically connected to the host interface and the memory interface, and the memory management circuit is electrically connected to the host interface, the memory interface and the buffer memory. The memory management circuit divides the buffer memory into a first area and a second area, wherein the first area and the second area respectively have a plurality of continuous cache units, and the cache units in the first area and the second area have At least some of the cache units have temporarily stored multiple logical address-physical address mapping tables. Furthermore, the memory management circuit performs a store-back operation on the cache units in the first area to store back the logical address-physical address mapping table stored in the first area into the rewritable non-volatile memory module. Moreover, the memory management circuit further receives a first write command from the host system, the first write command indicates to write the first data to the first logical address, and the first logical address-physical address mapping to which the first logical address belongs The table has been temporarily stored in the first cache unit among the cache units in the first region. And, the memory management circuit further writes the first data to the rewritable non-volatile memory module, and copies the first logical address-physical address mapping table in the first area to the cache unit in the second area. in the second cache unit. In addition, the memory management circuit updates the first logical address-physical address mapping table temporarily stored in the second cache unit in the second area.
在本发明的一范例实施例中,上述的存储器管理电路还将第二缓存单元标示为已更新状态,并将第二区域设定为更新区域,并且更新区域用以暂存多个被更新的逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit also marks the second cache unit as an updated state, sets the second area as an update area, and the update area is used to temporarily store a plurality of updated Logical address-physical address mapping table.
在本发明的一范例实施例中,上述的存储器管理电路还在第二区域的所有缓存单元都为已更新状态时,将第二区域的所有缓存单元中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit also restores the logical address-physical address mapping tables in all the cache units in the second area when all the cache units in the second area are in the updated state to the rewritable non-volatile memory module.
在本发明的一范例实施例中,上述的存储器管理电路还根据第二区域中的缓存单元的顺序,选取第二区域中的第一个缓存单元作为第二缓存单元,并设定第一指标指向第二缓存单元。再者,在将第一区域中的第一逻辑地址-物理地址映射表复制到第二区域中的第二缓存单元中之后,上述的存储器管理电路更设定第一指标指向第二区域的缓存单元之中的另一个缓存单元,且此另一个缓存单元为第二缓存单元的后一个不为已更新状态的缓存单元。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit further selects the first cache unit in the second area as the second cache unit according to the order of the cache units in the second area, and sets the first index Points to the second cache location. Moreover, after copying the first logical address-physical address mapping table in the first area to the second cache unit in the second area, the above-mentioned memory management circuit further sets the first index to point to the cache in the second area Another cache unit among the units, and this other cache unit is a cache unit that is not in an updated state after the second cache unit.
在本发明的一范例实施例中,上述的存储器管理电路还从主机系统接收第二写入指令,此第二写入指令指示将第二数据写入至第二逻辑地址,并且第二逻辑地址所属的第二逻辑地址-物理地址映射表已被暂存在第二区域的缓存单元之中的第三缓存单元中。再者,上述的存储器管理电路还用以写入第二数据至可复写式非易失性存储器模块,并更新暂存在第二区域中的第三缓存单元中的第二逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit further receives a second write command from the host system, the second write command indicates to write the second data to the second logical address, and the second logical address The associated second logical address-physical address mapping table has been temporarily stored in the third cache unit among the cache units in the second area. Furthermore, the above-mentioned memory management circuit is also used to write the second data into the rewritable non-volatile memory module, and update the second logical address-physical address mapping temporarily stored in the third cache unit in the second area surface.
在本发明的一范例实施例中,上述的存储器管理电路还从主机系统接收第三写入指令,此第三写入指令指示将第三数据写入至第三逻辑地址,并且第三逻辑地址所属的第三逻辑地址-物理地址映射表尚未载入至映射表区。再者,上述的存储器管理电路更从可复写式非易失性存储器模块中载入第三逻辑地址-物理地址映射表,并且第三逻辑地址-物理地址映射表被暂存在第二区域的缓存单元之中的第四缓存单元中。此外,上述的存储器管理电路还写入第三数据至可复写式非易失性存储器模块,并更新暂存在第二区域中的第四缓存单元中的第三逻辑地址-物理地址映射表。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit further receives a third write command from the host system, the third write command indicates to write the third data to the third logical address, and the third logical address The associated third logical address-physical address mapping table has not been loaded into the mapping table area. Furthermore, the above-mentioned memory management circuit further loads a third logical address-physical address mapping table from the rewritable non-volatile memory module, and the third logical address-physical address mapping table is temporarily stored in the cache of the second area In the fourth cache unit among the units. In addition, the above-mentioned memory management circuit also writes the third data into the rewritable non-volatile memory module, and updates the third logical address-physical address mapping table temporarily stored in the fourth cache unit in the second area.
本发明的一范例实施例提出一种存储器存储装置,其包括连接接口单元、可复写式非易失性存储器模块及上述的存储器控制电路单元。连接接口单元电性连接至主机系统,存储器控制电路单元电性连接至连接接口单元与可复写式非易失性存储器模块,并且包括缓冲存储器。An exemplary embodiment of the present invention provides a memory storage device, which includes a connection interface unit, a rewritable non-volatile memory module, and the above-mentioned memory control circuit unit. The connection interface unit is electrically connected to the host system, and the memory control circuit unit is electrically connected to the connection interface unit and the rewritable non-volatile memory module, and includes a buffer memory.
基于上述,本发明范例实施例所提出的存储器控制电路单元、存储器存储装置及其使用的缓冲存储器管理方法能够有效节省将逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块的时间,并在回存期间持续接收来自主机系统的写入数据,可提升整体系统的运作效率及稳定性。Based on the above, the memory control circuit unit, the memory storage device and the buffer memory management method proposed by the exemplary embodiments of the present invention can effectively save the storage of the logical address-physical address mapping table to the rewritable non-volatile memory module time, and continue to receive write data from the host system during the restore period, which can improve the operating efficiency and stability of the overall system.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail with reference to the accompanying drawings.
附图说明Description of drawings
图1是根据一范例实施例所示出的主机系统与存储器存储装置的示意图;FIG. 1 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment;
图2是根据一范例实施例所示出的电脑、输入/输出装置与存储器存储装置的示意图;FIG. 2 is a schematic diagram of a computer, an input/output device and a memory storage device according to an exemplary embodiment;
图3是根据本发明范例实施例所示出的主机系统与存储器存储装置的示意图;3 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment of the present invention;
图4是根据一范例实施例所示出的存储器存储装置的概要方块图;FIG. 4 is a schematic block diagram of a memory storage device according to an exemplary embodiment;
图5是根据一范例实施例所示出的存储器控制电路单元的概要方块图;FIG. 5 is a schematic block diagram of a memory control circuit unit according to an exemplary embodiment;
图6与图7是根据一范例实施例所示出的管理物理擦除单元的范例示意图;FIG. 6 and FIG. 7 are exemplary schematic diagrams showing management of physical erase units according to an exemplary embodiment;
图8是根据一范例实施例所示出的缓冲存储器的示意图;Fig. 8 is a schematic diagram of a buffer memory according to an exemplary embodiment;
图9A~9F是根据一范例实施例所示出的缓冲存储器管理方法的示意图;9A-9F are schematic diagrams of a buffer memory management method according to an exemplary embodiment;
图10A~10D是根据另一范例实施例所示出的缓冲存储器管理方法的示意图;10A-10D are schematic diagrams of a buffer memory management method according to another exemplary embodiment;
图11A及11B是根据一范例实施例所示出的缓冲存储器管理方法的流程图。11A and 11B are flowcharts of a cache memory management method according to an exemplary embodiment.
附图标记说明:Explanation of reference signs:
10:存储器存储装置;10: memory storage device;
11:主机系统;11: host system;
12:电脑;12: computer;
13:输入/输出装置;13: input/output device;
122:微处理器;122: microprocessor;
124:随机存取存储器(RAM);124: random access memory (RAM);
126:系统总线;126: system bus;
128:数据传输接口;128: data transmission interface;
21:鼠标;21: mouse;
22:键盘;22: keyboard;
23:显示器;23: Display;
24:打印机;24: printer;
25:随身碟;25: Pen drive;
26:记忆卡;26: memory card;
27:固态硬盘;27: SSD;
31:数码相机;31: digital camera;
32:SD卡;32: SD card;
33:MMC卡;33: MMC card;
34:记忆棒;34: memory stick;
35:CF卡;35: CF card;
36:嵌入式存储装置;36: embedded storage device;
402:连接接口单元;402: connect the interface unit;
404:存储器控制电路单元;404: memory control circuit unit;
406:可复写式非易失性存储器模块;406: a rewritable non-volatile memory module;
410(0)~410(N):物理擦除单元;410(0)~410(N): physical erasing unit;
502:存储器管理电路;502: memory management circuit;
504:主机接口;504: host interface;
506:存储器接口;506: memory interface;
508:缓冲存储器;508: buffer memory;
510:电源管理电路;510: power management circuit;
512:错误检查与校正电路;512: error checking and correction circuit;
602:数据区;602: data area;
604:闲置区;604: idle area;
606:系统区;606: system area;
608:取代区;608: replace area;
LBA(0)~LBA(H):逻辑单元;LBA(0)~LBA(H): logic unit;
LZ(0)~LZ(M):逻辑区域;LZ(0)~LZ(M): logical area;
810(1-0)~810(1-n)、810(2-0)~810(2-n):缓存单元;810(1-0)~810(1-n), 810(2-0)~810(2-n): cache unit;
MTZ:映射表区;MTZ: mapping table zone;
Z1:第一区域;Z1: the first zone;
Z2:第二区域;Z2: second zone;
P1:第一指标;P1: the first index;
P2:第二指标;P2: the second index;
MT(0)~MT(2n)、MT(k)、MT(k)’、MT(s)、MT(x):逻辑地址-物理地址映射表;MT(0)~MT(2n), MT(k), MT(k)', MT(s), MT(x): logical address-physical address mapping table;
S1101、S1103、S1105、S1107、S1109、S1111、S1113、S1115、S1117、S1119、S1121、S1123、S1125、S1127、S1129:缓冲存储器管理方法的步骤。S1101, S1103, S1105, S1107, S1109, S1111, S1113, S1115, S1117, S1119, S1121, S1123, S1125, S1127, S1129: steps in the buffer memory management method.
具体实施方式Detailed ways
一般而言,存储器存储装置(也称,存储器存储系统)包括可复写式非易失性存储器模块与控制器(也称,控制电路单元)。通常存储器存储装置是与主机系统一起使用,以使主机系统可将数据写入至存储器存储装置或从存储器存储装置中读取数据。Generally speaking, a memory storage device (also called a memory storage system) includes a rewritable non-volatile memory module and a controller (also called a control circuit unit). Typically memory storage devices are used with a host system such that the host system can write data to or read data from the memory storage device.
图1是根据一范例实施例所示出的主机系统与存储器存储装置的示意图,且图2是根据一范例实施例所示出的电脑、输入/输出装置与存储器存储装置的示意图。FIG. 1 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment, and FIG. 2 is a schematic diagram of a computer, an input/output device and a memory storage device according to an exemplary embodiment.
请参照图1,主机系统11一般包括电脑12与输入/输出(input/output,简称:I/O)装置13。电脑12包括微处理器122、随机存取存储器(random access memory,简称:RAM)124、系统总线126与数据传输接口128。输入/输出装置13包括如图2的鼠标21、键盘22、显示器23与打印机24。必须了解的是,图2所示的装置非限制输入/输出装置13,输入/输出装置13可还包括其他装置。Referring to FIG. 1 , the host system 11 generally includes a computer 12 and an input/output (input/output, I/O for short) device 13 . The computer 12 includes a microprocessor 122 , a random access memory (random access memory, RAM for short) 124 , a system bus 126 and a data transmission interface 128 . The input/output device 13 includes a mouse 21 , a keyboard 22 , a monitor 23 and a printer 24 as shown in FIG. 2 . It must be understood that the device shown in FIG. 2 is not limited to the input/output device 13, and the input/output device 13 may also include other devices.
在本范例实施例中,存储器存储装置10是通过数据传输接口128与主机系统11的其他元件电性连接。通过微处理器122、随机存取存储器124与输入/输出装置13的运作可将数据写入至存储器存储装置10或从存储器存储装置10中读取数据。例如,存储器存储装置10可以是如图2所示的随身碟25、记忆卡26或固态硬盘(Solid State Drive,简称:SSD)27等的可复写式非易失性存储器存储装置。In this exemplary embodiment, the memory storage device 10 is electrically connected to other components of the host system 11 through the data transmission interface 128 . Data can be written into the memory storage device 10 or read from the memory storage device 10 through the operation of the microprocessor 122 , the random access memory 124 and the input/output device 13 . For example, the memory storage device 10 may be a rewritable non-volatile memory storage device such as a flash drive 25 , a memory card 26 or a solid state drive (Solid State Drive, SSD for short) 27 as shown in FIG. 2 .
图3是根据本发明范例实施例所示出的主机系统与存储器存储装置的示意图。FIG. 3 is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment of the present invention.
一般而言,主机系统11为可实质地与存储器存储装置10配合以存储数据的任意系统。虽然在本范例实施例中,主机系统11是以电脑系统来做说明,然而,在另一范例实施例中主机系统11可以是数码相机、摄影机、通信装置、音频播放器或视频播放器等系统。例如,在主机系统为图3中的数码相机(摄影机)31时,可复写式非易失性存储器存储装置则为其所使用的SD卡32、MMC卡33、记忆棒(memory stick)34、CF卡35或嵌入式存储装置36(如图3所示)。嵌入式存储装置36包括嵌入式多媒体卡(Embedded MMC,简称:eMMC)、通用快闪存储器(Universal Flash Storage,简称:UFS)。值得一提的是,嵌入式多媒体卡或通用快闪存储器是直接电性连接于主机系统的基板上。In general, host system 11 is any system that can cooperate substantially with memory storage device 10 to store data. Although in this exemplary embodiment, the host system 11 is described as a computer system, however, in another exemplary embodiment, the host system 11 may be a system such as a digital camera, a video camera, a communication device, an audio player, or a video player. . For example, when the host computer system is a digital camera (video camera) 31 in FIG. CF card 35 or embedded storage device 36 (as shown in FIG. 3 ). The embedded storage device 36 includes an embedded multimedia card (Embedded MMC, eMMC for short) and a universal flash memory (Universal Flash Storage, UFS for short). It is worth mentioning that the embedded multimedia card or the universal flash memory is directly electrically connected to the substrate of the host system.
图4是根据一范例实施例所示出的存储器存储装置的概要方块图。FIG. 4 is a schematic block diagram of a memory storage device according to an exemplary embodiment.
请参照图4,存储器存储装置10包括连接接口单元402、存储器控制电路单元404与可复写式非易失性存储器模块406。Referring to FIG. 4 , the memory storage device 10 includes a connection interface unit 402 , a memory control circuit unit 404 and a rewritable non-volatile memory module 406 .
在本范例实施例中,连接接口单元402是兼容于串行高级技术附件(SerialAdvanced Technology Attachment,简称:SATA)标准。然而,必须了解的是,本发明不限于此,连接接口单元402也可以是符合并行高级技术附件(Parallel Advanced TechnologyAttachment,简称:PATA)标准、电气和电子工程师协会(Institute of Electrical andElectronic Engineers,简称:IEEE)1394标准、高速周边零件连接接口(PeripheralComponent Interconnect Express,简称:PCI Express)标准、通用序列总线(UniversalSerial Bus,简称:USB)标准、超高速一代(Ultra High Speed-I,简称:UHS-I)接口标准、超高速二代(Ultra High Speed-II,简称:UHS-II)接口标准、安全数字(Secure Digital,简称:SD)接口标准、记忆棒(Memory Stick,简称:MS)接口标准、多媒体存储卡(Multi MediaCard,简称:MMC)接口标准、小型快闪(Compact Flash,简称:CF)接口标准、集成式驱动电子接口(Integrated Device Electronics,简称:IDE)标准或其他适合的标准。在本范例实施例中,连接接口单元可与存储器控制电路单元封装在一个芯片中,或布设于一包含存储器控制电路单元的芯片外。In this exemplary embodiment, the connection interface unit 402 is compatible with the Serial Advanced Technology Attachment (SATA) standard. However, it must be understood that the present invention is not limited thereto, and the connection interface unit 402 may also conform to the Parallel Advanced Technology Attachment (Parallel Advanced Technology Attachment, referred to as: PATA) standard, the Institute of Electrical and Electronic Engineers (Institute of Electrical and Electronic Engineers, referred to as: IEEE) 1394 standard, Peripheral Component Interconnect Express (PCI Express for short) standard, Universal Serial Bus (Universal Serial Bus, USB for short) standard, Ultra High Speed-I (UHS-I for short) ) interface standard, Ultra High Speed-II (UHS-II for short) interface standard, Secure Digital (Secure Digital, SD for short) interface standard, Memory Stick (MS for short) interface standard, Multi Media Card (MMC for short) interface standard, Compact Flash (CF for short) interface standard, Integrated Device Electronics (IDE for short) standard or other suitable standards. In this exemplary embodiment, the connection interface unit and the memory control circuit unit can be packaged in a chip, or arranged outside a chip including the memory control circuit unit.
存储器控制电路单元404用以执行以硬件型式或软件型式实作的多个逻辑闸或控制指令,并且根据主机系统11的指令在可复写式非易失性存储器模块406中进行数据的写入、读取与抹除等运作。The memory control circuit unit 404 is used to execute a plurality of logic gates or control instructions implemented in hardware or software, and write data in the rewritable non-volatile memory module 406 according to the instructions of the host system 11, Operations such as reading and erasing.
可复写式非易失性存储器模块406是电性连接至存储器控制电路单元404,并且用以存储主机系统11所写入的数据。可复写式非易失性存储器模块406具有物理擦除单元410(0)~410(N)。例如,物理擦除单元410(0)~410(N)可属于同一个存储器晶粒(die)或者属于不同的存储器晶粒。每一物理擦除单元分别具有多个物理编程单元,其中属于同一个物理擦除单元的物理编程单元可被独立地写入且被同时地抹除。然而,必须了解的是,本发明不限于此,每一物理擦除单元是可由64个物理编程单元、256个物理编程单元或其他任意个物理编程单元所组成。The rewritable non-volatile memory module 406 is electrically connected to the memory control circuit unit 404 and used for storing data written by the host system 11 . The rewritable non-volatile memory module 406 has physical erasing units 410(0)˜410(N). For example, the physical erase units 410(0)˜410(N) may belong to the same memory die or belong to different memory dies. Each physical erasing unit has a plurality of physical programming units, wherein the physical programming units belonging to the same physical erasing unit can be written independently and erased simultaneously. However, it must be understood that the present invention is not limited thereto, and each physical erasing unit may be composed of 64 physical programming units, 256 physical programming units, or any other number of physical programming units.
更详细来说,物理擦除单元为抹除的最小单位。也即,每一物理擦除单元含有最小数目之一并被抹除的存储单元。物理编程单元为编程的最小单元。即,物理编程单元为写入数据的最小单元。每一物理编程单元通常包括数据比特区与冗余比特区。数据比特区包含多个物理存取地址用以存储使用者的数据,而冗余比特区用以存储系统的数据(例如,控制信息与错误更正码)。在本范例实施例中,每一个物理编程单元的数据比特区中会包含8个物理存取地址,且一个物理存取地址的大小为512字节(byte)。然而,在其他范例实施例中,数据比特区中也可包含数目更多或更少的物理存取地址,本发明并不限制物理存取地址的大小以及个数。例如,在一范例实施例中,物理擦除单元为物理区块,并且物理编程单元为物理页面或物理扇区,但本发明不以此为限。In more detail, the physical erasing unit is the smallest unit of erasing. That is, each physical erase unit contains a minimum number of memory cells that are erased. The physical programming unit is the smallest unit of programming. That is, the physical programming unit is the minimum unit for writing data. Each physical programming unit generally includes a data bit area and a redundant bit area. The data bit area contains multiple physical access addresses for storing user data, and the redundant bit area is used for storing system data (eg, control information and error correction code). In this exemplary embodiment, the data bit area of each physical programming unit includes 8 physical access addresses, and the size of one physical access address is 512 bytes. However, in other exemplary embodiments, the data bit area may also include more or less physical access addresses, and the present invention does not limit the size and number of physical access addresses. For example, in an exemplary embodiment, the physical erasing unit is a physical block, and the physical programming unit is a physical page or a physical sector, but the invention is not limited thereto.
在本范例实施例中,可复写式非易失性存储器模块406为多阶存储单元(MultiLevel Cell,简称:MLC)NAND型快闪存储器模块(即,一个存储单元中可存储2个数据比特的快闪存储器模块)。然而,本发明不限于此,可复写式非易失性存储器模块406也可是单阶存储单元(Single Level Cell,简称:SLC)NAND型快闪存储器模块(即,一个存储单元中可存储1个数据比特的快闪存储器模块)、多阶存储单元(Trinary Level Cell,简称:TLC)NAND型快闪存储器模块(即,一个存储单元中可存储3个数据比特的快闪存储器模块)、其他快闪存储器模块或其他具有相同特性的存储器模块。In this exemplary embodiment, the rewritable non-volatile memory module 406 is a multilevel memory cell (MultiLevel Cell, referred to as: MLC) NAND flash memory module (that is, a memory cell that can store 2 data bits flash memory module). However, the present invention is not limited thereto, and the rewritable non-volatile memory module 406 may also be a single-level memory cell (Single Level Cell, referred to as: SLC) NAND flash memory module (that is, one memory cell can store one data bit flash memory module), multi-level memory cell (Trinary Level Cell, referred to as: TLC) NAND flash memory module (that is, a flash memory module that can store 3 data bits in a storage unit), other fast flash memory module or other memory modules with the same characteristics.
图5是根据一范例实施例所示出的存储器控制电路单元的概要方块图。FIG. 5 is a schematic block diagram of a memory control circuit unit according to an exemplary embodiment.
请参照图5,存储器控制电路单元404包括存储器管理电路502、主机接口504与存储器接口506、缓冲存储器508、电源管理电路510与错误检查与校正电路512。Referring to FIG. 5 , the memory control circuit unit 404 includes a memory management circuit 502 , a host interface 504 and a memory interface 506 , a buffer memory 508 , a power management circuit 510 and an error checking and correction circuit 512 .
存储器管理电路502用以控制存储器控制电路单元404的整体运作。具体来说,存储器管理电路502具有多个控制指令,并且在存储器存储装置10运作时,此些控制指令会被执行以进行数据的写入、读取与抹除等运作。The memory management circuit 502 is used to control the overall operation of the memory control circuit unit 404 . Specifically, the memory management circuit 502 has a plurality of control instructions, and when the memory storage device 10 is operating, these control instructions are executed to perform operations such as writing, reading, and erasing data.
在本范例实施例中,存储器管理电路502的控制指令是以软件型式来实作。例如,存储器管理电路502具有微处理器单元(未示出)与只读存储器(未示出),并且此些控制指令是被烧录至此只读存储器中。当存储器存储装置10运作时,此些控制指令会由微处理器单元来执行以进行数据的写入、读取与抹除等运作。In this exemplary embodiment, the control commands of the memory management circuit 502 are implemented in software. For example, the memory management circuit 502 has a microprocessor unit (not shown) and a read-only memory (not shown), and these control instructions are burned into the read-only memory. When the memory storage device 10 is in operation, these control instructions are executed by the microprocessor unit to perform operations such as writing, reading, and erasing data.
图6与图7是根据一范例实施例所示出的管理物理擦除单元的范例示意图。FIG. 6 and FIG. 7 are schematic diagrams showing examples of managing physical erase units according to an example embodiment.
必须了解的是,在此描述可复写式非易失性存储器模块406的物理擦除单元的运作时,以“提取”、“分组”、“划分”、“关联”等词来操作物理擦除单元是逻辑上的概念。也就是说,可复写式非易失性存储器模块的物理擦除单元的实际位置并未更动,而是逻辑上对可复写式非易失性存储器模块的物理擦除单元进行操作。It must be understood that when describing the operation of the physical erasing unit of the rewritable non-volatile memory module 406, words such as "extract", "group", "divide", and "associate" are used to operate physical erasure. A unit is a logical concept. That is to say, the actual position of the physical erasing unit of the rewritable nonvolatile memory module is not changed, but the physical erasing unit of the rewritable nonvolatile memory module is logically operated.
请参照图6,存储器控制电路单元404(或存储器管理电路502)会将物理擦除单元410(0)~410(N)逻辑地分组为数据区602、闲置区604、系统区606与取代区608。Please refer to FIG. 6, the memory control circuit unit 404 (or the memory management circuit 502) will logically group the physical erasing units 410(0)-410(N) into a data area 602, an idle area 604, a system area 606, and a replacement area. 608.
逻辑上属于数据区602与闲置区604的物理擦除单元是用以存储来自于主机系统11的数据。具体来说,数据区602的物理擦除单元是被视为已存储数据的物理擦除单元,而闲置区604的物理擦除单元是用以替换数据区602的物理擦除单元。也就是说,当从主机系统11接收到写入指令与欲写入的数据时,存储器管理电路502会从闲置区604中提取物理擦除单元,并且将数据写入至所提取的物理擦除单元中,以替换数据区602的物理擦除单元。The physical erase units logically belonging to the data area 602 and the spare area 604 are used to store data from the host system 11 . Specifically, the physical erasing unit of the data area 602 is regarded as a physical erasing unit of stored data, and the physical erasing unit of the spare area 604 is a physical erasing unit used to replace the data area 602 . That is to say, when receiving the write instruction and the data to be written from the host system 11, the memory management circuit 502 will extract the physical erase unit from the spare area 604, and write the data into the extracted physical erase unit. unit to replace the physical erase unit of the data area 602.
逻辑上属于系统区606的物理擦除单元是用以记录系统数据。例如,系统数据包括关于可复写式非易失性存储器模块的制造商与型号、可复写式非易失性存储器模块的物理擦除单元数、每一物理擦除单元的物理编程单元数等。The physical erase units logically belonging to the system area 606 are used to record system data. For example, the system data includes the manufacturer and model of the rewritable nonvolatile memory module, the number of physically erased units of the rewritable nonvolatile memory module, the number of physically programmed units per physically erased unit, and the like.
逻辑上属于取代区608中的物理擦除单元是用于坏物理擦除单元取代程序,以取代损坏的物理擦除单元。具体来说,倘若取代区608中仍存有正常的物理擦除单元并且数据区602的物理擦除单元损坏时,存储器管理电路502会从取代区608中提取正常的物理擦除单元来更换损坏的物理擦除单元。Physically erased units that logically belong to the replacement area 608 are used in the bad physically erased unit replacement process to replace damaged physically erased units. Specifically, if there are still normal physical erasing units in the replacement area 608 and the physical erasing units in the data area 602 are damaged, the memory management circuit 502 will extract normal physical erasing units from the replacement area 608 to replace the damaged ones. physical erase unit.
特别是,数据区602、闲置区604、系统区606与取代区608的物理擦除单元的数量会根据不同的存储器规格而有所不同。此外,必须了解的是,在存储器存储装置10的运作中,物理擦除单元关联至数据区602、闲置区604、系统区606与取代区608的分组关系会动态地变动。例如,当闲置区604中的物理擦除单元损坏而被取代区608的物理擦除单元取代时,则原本取代区608的物理擦除单元会被关联至闲置区604。In particular, the number of physical erase units in the data area 602 , the spare area 604 , the system area 606 and the replacement area 608 varies according to different memory specifications. In addition, it must be understood that during the operation of the memory storage device 10 , the grouping relationship of the physical erase unit associated with the data area 602 , the spare area 604 , the system area 606 and the replacement area 608 will change dynamically. For example, when a physically erased unit in the spare area 604 is damaged and replaced by a physically erased unit in the replacement area 608 , the original physically erased unit in the replacement area 608 will be associated with the spare area 604 .
请参照图7,存储器控制电路单元404(或存储器管理电路502)会配置逻辑单元LBA(0)~LBA(H)以映射数据区602的物理擦除单元,其中每一逻辑单元具有多个逻辑子单元以映射对应的物理擦除单元的物理编程单元。并且,当主机系统11欲写入数据至逻辑单元或更新存储于逻辑单元中的数据时,存储器控制电路单元404(或存储器管理电路502)会从闲置区604中提取一个物理擦除单元来写入数据,以轮替数据区602的物理擦除单元。在本范例实施例中,逻辑子单元可以是逻辑页面或逻辑扇区。Please refer to FIG. 7, the memory control circuit unit 404 (or the memory management circuit 502) will configure the logical units LBA(0)-LBA(H) to map the physical erasing units of the data area 602, wherein each logical unit has multiple logic The subunits are mapped to the physical programming units of the corresponding physical erasing units. And, when the host system 11 intends to write data to the logic unit or update the data stored in the logic unit, the memory control circuit unit 404 (or the memory management circuit 502) will extract a physical erase unit from the idle area 604 to write input data to rotate the physical erasing units of the data area 602. In this exemplary embodiment, a logical subunit may be a logical page or a logical sector.
为了识别每个逻辑单元的数据被存储在哪个物理擦除单元,在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会记录逻辑单元与物理擦除单元之间的映射。并且,当主机系统11欲在逻辑子单元中存取数据时,存储器控制电路单元404(或存储器管理电路502)会确认此逻辑子单元所属的逻辑单元,并且在此逻辑单元所映射的物理擦除单元中来存取数据。例如,在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会在可复写式非易失性存储器模块406中存储逻辑地址-物理地址映射表来记录每一逻辑单元所映射的物理擦除单元,并且当欲存取数据时存储器控制电路单元404(或存储器管理电路502)会将逻辑地址-物理地址映射表载入至缓冲存储器508来维护。In order to identify which physical erasing unit the data of each logical unit is stored in, in this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) records the mapping between the logical unit and the physical erasing unit. Moreover, when the host system 11 intends to access data in the logical subunit, the memory control circuit unit 404 (or the memory management circuit 502) will confirm the logical unit to which the logical subunit belongs, and the physical erase mapped to the logical unit In addition to the unit to access data. For example, in this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502) stores a logical address-physical address mapping table in the rewritable non-volatile memory module 406 to record the mapping of each logical unit The physical erase unit, and when data is to be accessed, the memory control circuit unit 404 (or the memory management circuit 502 ) will load the logical address-physical address mapping table into the buffer memory 508 for maintenance.
值得一提的是,由于缓冲存储器508的容量有限无法存储记录所有逻辑单元的映射关系的映射表,因此,在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会将逻辑单元LBA(0)~LBA(H)分组为多个逻辑区域LZ(0)~LZ(M),并且为每一逻辑区域配置一个逻辑地址-物理地址映射表。特别是,当存储器控制电路单元404(或存储器管理电路502)欲更新某个逻辑单元的映射时,对应此逻辑单元所属的逻辑区域的逻辑地址-物理地址映射表会被载入至缓冲存储器508来被更新。It is worth mentioning that, due to the limited capacity of the buffer memory 508, it is impossible to store a mapping table that records the mapping relationship of all logic units. Therefore, in this exemplary embodiment, the memory control circuit unit 404 (or memory management circuit 502) will Units LBA(0)-LBA(H) are grouped into a plurality of logical zones LZ(0)-LZ(M), and a logical address-physical address mapping table is configured for each logical zone. In particular, when the memory control circuit unit 404 (or the memory management circuit 502) intends to update the mapping of a certain logical unit, the logical address-physical address mapping table corresponding to the logical area to which the logical unit belongs will be loaded into the buffer memory 508 to be updated.
在本发明另一范例实施例中,存储器管理电路502的控制指令也可以程序码型式存储于可复写式非易失性存储器模块406的特定区域(例如,存储器模块中专用于存放系统数据的系统区)中。此外,存储器管理电路502具有微处理器单元(未示出)、只读存储器(未示出)及随机存取存储器(未示出)。特别是,此只读存储器具有驱动码,并且当存储器控制电路单元404被致能时,微处理器单元会先执行此驱动码段来将存储于可复写式非易失性存储器模块406中的控制指令载入至存储器管理电路502的随机存取存储器中。之后,微处理器单元会运转此些控制指令以进行数据的写入、读取与抹除等运作。In another exemplary embodiment of the present invention, the control instructions of the memory management circuit 502 can also be stored in a specific area of the rewritable non-volatile memory module 406 in the form of program codes (for example, a system dedicated to storing system data in the memory module) area). In addition, the memory management circuit 502 has a microprocessor unit (not shown), a read only memory (not shown), and a random access memory (not shown). In particular, the ROM has a driver code, and when the memory control circuit unit 404 is enabled, the microprocessor unit will first execute the driver code segment to store the data stored in the rewritable non-volatile memory module 406 The control instructions are loaded into the random access memory of the memory management circuit 502 . Afterwards, the microprocessor unit will execute these control instructions to perform operations such as writing, reading and erasing data.
此外,在本发明另一范例实施例中,存储器管理电路502的控制指令也可以一硬件型式来实作。例如,存储器管理电路502包括微控制器、存储单元管理电路、存储器写入电路、存储器读取电路、存储器抹除电路与数据处理电路。存储单元管理电路、存储器写入电路、存储器读取电路、存储器抹除电路与数据处理电路是电性连接至微控制器。其中,存储单元管理电路用以管理可复写式非易失性存储器模块406的物理擦除单元;存储器写入电路用以对可复写式非易失性存储器模块406下达写入指令以将数据写入至可复写式非易失性存储器模块406中;存储器读取电路用以对可复写式非易失性存储器模块406下达读取指令以从可复写式非易失性存储器模块406中读取数据;存储器抹除电路用以对可复写式非易失性存储器模块406下达抹除指令以将数据从可复写式非易失性存储器模块406中抹除;而数据处理电路用以处理欲写入至可复写式非易失性存储器模块406的数据以及从可复写式非易失性存储器模块406中读取的数据。In addition, in another exemplary embodiment of the present invention, the control instructions of the memory management circuit 502 can also be implemented in a hardware form. For example, the memory management circuit 502 includes a microcontroller, a memory unit management circuit, a memory writing circuit, a memory reading circuit, a memory erasing circuit and a data processing circuit. The storage unit management circuit, the memory writing circuit, the memory reading circuit, the memory erasing circuit and the data processing circuit are electrically connected to the microcontroller. Wherein, the storage unit management circuit is used to manage the physical erasing unit of the rewritable non-volatile memory module 406; the memory writing circuit is used to issue a write instruction to the rewritable non-volatile memory module 406 to write data into the rewritable nonvolatile memory module 406; the memory read circuit is used to issue a read instruction to the rewritable nonvolatile memory module 406 to read from the rewritable nonvolatile memory module 406 Data; the memory erasing circuit is used to issue an erase command to the rewritable non-volatile memory module 406 to erase data from the rewritable non-volatile memory module 406; and the data processing circuit is used to process the data to be written Data input to the rewritable non-volatile memory module 406 and data read from the rewritable non-volatile memory module 406.
请再参照图5,主机接口504是电性连接至存储器管理电路502并且用以电性连接至连接接口单元402,以接收与识别主机系统11所传送的指令与数据。也就是说,主机系统11所传送的指令与数据会通过主机接口504来传送至存储器管理电路502。在本范例实施例中,主机接口504是兼容于SATA标准。然而,必须了解的是本发明不限于此,主机接口504也可以是兼容于PATA标准、IEEE 1394标准、PCI Express标准、USB标准、UHS-I接口标准、UHS-II接口标准、SD标准、MS标准、MMC标准、CF标准、IDE标准或其他适合的数据传输标准。Referring to FIG. 5 again, the host interface 504 is electrically connected to the memory management circuit 502 and used to electrically connect to the connection interface unit 402 to receive and identify commands and data transmitted by the host system 11 . That is to say, the commands and data sent by the host system 11 are sent to the memory management circuit 502 through the host interface 504 . In this exemplary embodiment, the host interface 504 is compatible with the SATA standard. However, it must be understood that the present invention is not limited thereto, and the host interface 504 may also be compatible with PATA standard, IEEE 1394 standard, PCI Express standard, USB standard, UHS-I interface standard, UHS-II interface standard, SD standard, MS standard, MMC standard, CF standard, IDE standard or other suitable data transmission standards.
存储器接口506是电性连接至存储器管理电路502并且用以存取可复写式非易失性存储器模块406。也就是说,欲写入至可复写式非易失性存储器模块406的数据会通过存储器接口506转换为可复写式非易失性存储器模块406所能接受的格式。The memory interface 506 is electrically connected to the memory management circuit 502 and used for accessing the rewritable non-volatile memory module 406 . That is to say, the data to be written into the rewritable non-volatile memory module 406 will be converted into a format acceptable to the rewritable non-volatile memory module 406 through the memory interface 506 .
缓冲存储器508是电性连接至存储器管理电路502并且用以暂存来自于主机系统11的数据与指令或来自于可复写式非易失性存储器模块406的数据。The buffer memory 508 is electrically connected to the memory management circuit 502 and used for temporarily storing data and instructions from the host system 11 or data from the rewritable non-volatile memory module 406 .
电源管理电路510是电性连接至存储器管理电路502并且用以控制存储器存储装置10的电源。The power management circuit 510 is electrically connected to the memory management circuit 502 and used to control the power of the memory storage device 10 .
错误检查与校正电路512是电性连接至存储器管理电路502并且用以执行错误检查与校正程序以确保数据的正确性。具体来说,当存储器管理电路502从主机系统11中接收到写入指令时,错误检查与校正电路512会为对应此写入指令的数据产生对应的错误检查与校正码(Error Checking and Correcting Code,简称:ECC Code),并且存储器管理电路502会将对应此写入指令的数据与对应的错误检查与校正码写入至可复写式非易失性存储器模块406中。之后,当存储器管理电路502从可复写式非易失性存储器模块406中读取数据时会同时读取此数据对应的错误检查与校正码,并且错误检查与校正电路512会根据此错误检查与校正码对所读取的数据执行错误检查与校正程序。The error checking and correcting circuit 512 is electrically connected to the memory management circuit 502 and used for executing error checking and correcting procedures to ensure the correctness of data. Specifically, when the memory management circuit 502 receives a write command from the host system 11, the error checking and correcting circuit 512 will generate a corresponding error checking and correcting code (Error Checking and Correcting Code) for the data corresponding to the write command. , referred to as: ECC Code), and the memory management circuit 502 will write the data corresponding to the write command and the corresponding error checking and correction code into the rewritable non-volatile memory module 406 . Afterwards, when the memory management circuit 502 reads data from the rewritable non-volatile memory module 406, it will simultaneously read the error checking and correction code corresponding to the data, and the error checking and correction circuit 512 will read the error checking and correction code according to the error checking and correction code. The correction code performs error checking and correction procedures on the read data.
图8是根据一范例实施例所示出的缓冲存储器的示意图。FIG. 8 is a schematic diagram of a buffer memory according to an exemplary embodiment.
请参照图8,在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)在缓冲存储器508中划分出映射表区MTZ,用以暂存从可复写式非易失性存储器模块406所载入的逻辑地址-物理地址映射表。特别是,存储器控制电路单元404(或存储器管理电路502)会将映射表区MTZ更划分为第一区域Z1与第二区域Z2,且第一区域Z1与第二区域Z2分别具有连续的多个缓存单元。每一缓存单元用以暂存一个逻辑地址-物理地址映射表,且每一缓存单元可被标示为不同状态,例如已更新(dirty)状态、未更新(clean)状态、无效(invalid)状态、存储(saving)状态或载入(loading)状态等,用以表示缓存单元中的数据的状态。在本范例实施例中,一个逻辑地址-物理地址映射表的大小为512B,因此,每一缓存单元的大小为512B。而第一区域Z1与第二区域Z2的大小可为一特定值,例如64MB或128MB。然而,必须暸解的是,在其他范例实施例中,缓存单元的大小可依实际的逻辑地址-物理地址映射表而定,且第一区域Z1与第二区域Z2的大小也可视实际使用需求而设定,本发明并不加以限制。Please refer to FIG. 8 , in this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) divides the mapping table zone MTZ in the buffer memory 508 for temporarily storing data from the rewritable non-volatile memory module. 406 the loaded logical address-physical address mapping table. In particular, the memory control circuit unit 404 (or the memory management circuit 502) further divides the mapping table zone MTZ into a first zone Z1 and a second zone Z2, and the first zone Z1 and the second zone Z2 respectively have a plurality of continuous cache unit. Each cache unit is used to temporarily store a logical address-physical address mapping table, and each cache unit can be marked as a different state, such as updated (dirty) state, not updated (clean) state, invalid (invalid) state, A saving state or a loading state, etc., are used to represent the state of the data in the cache unit. In this exemplary embodiment, the size of a logical address-physical address mapping table is 512B, therefore, the size of each cache unit is 512B. The size of the first zone Z1 and the second zone Z2 can be a specific value, such as 64MB or 128MB. However, it must be understood that, in other exemplary embodiments, the size of the cache unit may be determined according to the actual logical address-physical address mapping table, and the sizes of the first zone Z1 and the second zone Z2 may also be determined according to actual usage requirements Rather, the present invention is not limited.
如图8所示,第一区域Z1具有缓存单元810(1-0)~810(1-n),第二区域Z2具有缓存单元810(2-0)~810(2-n)。在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)可预先从可复写式非易失性存储器模块406中将多个逻辑地址-物理地址映射表载入至缓冲存储器508中的映射表区MTZ,并将此些逻辑地址-物理地址映射表各别暂存至第一区域Z1与第二区域Z2的缓存单元中。As shown in FIG. 8 , the first zone Z1 has cache units 810(1-0)˜810(1-n), and the second zone Z2 has cache units 810(2-0)˜810(2-n). In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) can preload multiple logical address-physical address mapping tables from the rewritable non-volatile memory module 406 into the buffer memory 508 The mapping table zone MTZ, and temporarily store these logical address-physical address mapping tables in the cache units of the first zone Z1 and the second zone Z2 respectively.
图9A~9F是根据一范例实施例所示出的缓冲存储器管理方法的示意图。9A-9F are schematic diagrams of a buffer memory management method according to an exemplary embodiment.
请参照图9A,第一区域Z1中的缓存单元810(1-0)~810(1-n)分别暂存逻辑地址-物理地址映射表MT(0)~MT(n),第二区域Z2中的缓存单元810(2-0)~810(2-n)分别暂存逻辑地址-物理地址映射表MT(n+1)~MT(2n)。为方便说明,本范例实施例是以第一区域Z1与第二区域Z2的缓存单元都不为已更新状态开始说明。当从主机系统11接收到写入指令,此写入指令指示将写入数据写入至逻辑地址,存储器控制电路单元404(或存储器管理电路502)会将此逻辑地址所属的逻辑地址-物理地址映射表暂存至映射表区MTZ的第一区域Z1以进行维护。更详细地说,存储器控制电路单元404(或存储器管理电路502)会先判断欲写入的逻辑地址所属的逻辑地址-物理地址映射表是否已暂存在第一区域Z1或第二区域Z2的缓存单元中。Please refer to FIG. 9A, cache units 810(1-0)-810(1-n) in the first zone Z1 temporarily store logical address-physical address mapping tables MT(0)-MT(n), respectively, and the second zone Z2 The cache units 810 ( 2 - 0 )˜ 810 ( 2 - n ) temporarily store logical address-physical address mapping tables MT(n+1)˜MT(2n) respectively. For the convenience of description, the present exemplary embodiment begins with the fact that neither the cache units in the first zone Z1 nor the second zone Z2 are updated. When a write instruction is received from the host system 11, the write instruction indicates that the write data is written to a logical address, and the memory control circuit unit 404 (or memory management circuit 502) will convert the logical address-physical address to which the logical address belongs The mapping table is temporarily stored in the first zone Z1 of the mapping table zone MTZ for maintenance. More specifically, the memory control circuit unit 404 (or the memory management circuit 502) will first determine whether the logical address-physical address mapping table to which the logical address to be written belongs has been temporarily stored in the cache of the first zone Z1 or the second zone Z2 in the unit.
在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会设定更新区域,用以暂存被更新的逻辑地址-物理地址映射表。在本范例实施例中,当存储器存储装置10刚上电时,存储器控制电路单元404(或存储器管理电路502)是将更新区域设定为第一区域Z1。而在另一范例实施例中,存储器控制电路单元404(或存储器管理电路502)也可初始地将更新区域设定为第二区域Z2。In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) sets an update area for temporarily storing the updated logical address-physical address mapping table. In this exemplary embodiment, when the memory storage device 10 is first powered on, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the update zone as the first zone Z1. In another exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) may also initially set the update zone as the second zone Z2.
当从主机系统接收到指示将数据写入至属于逻辑地址-物理地址映射表MT(n+2)的逻辑地址的写入指令时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(n+2)已载入至缓冲存储器508中的映射表区MTZ,且被暂存在第二区域Z2的缓存单元810(2-1)。因此,存储器控制电路单元404(或存储器管理电路502)会将数据写入至可复写式非易失性存储器模块406中所述逻辑地址所映射的物理编程单元,并更新暂存在缓存单元810(2-1)的逻辑地址-物理地址映射表MT(n+2)。接着,存储器控制电路单元404(或存储器管理电路502)会将已更新的逻辑地址-物理地址映射表MT(n+2)从第二区域Z2的缓存单元810(2-1)搬移至目前被设定为更新区域的第一区域Z1中。When receiving a write instruction indicating to write data to a logical address belonging to the logical address-physical address mapping table MT(n+2) from the host system, the memory control circuit unit 404 (or the memory management circuit 502) will determine the logical The address-physical address mapping table MT(n+2) has been loaded into the mapping table zone MTZ in the buffer memory 508, and is temporarily stored in the cache unit 810(2-1) of the second zone Z2. Therefore, the memory control circuit unit 404 (or memory management circuit 502) will write data to the physical programming unit mapped to the logical address in the rewritable non-volatile memory module 406, and update the temporary cache unit 810 ( 2-1) logical address-physical address mapping table MT(n+2). Next, the memory control circuit unit 404 (or the memory management circuit 502) will move the updated logical address-physical address mapping table MT(n+2) from the cache unit 810(2-1) of the second zone Z2 to the current In the first zone Z1 which is set as the update zone.
在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)还会设定第一指标P1指向第一区域Z1中的其中一个缓存单元,且此被指向的缓存单元不为已更新状态。具体来说,存储器控制电路单元404(或存储器管理电路502)会根据第一区域Z1中的多个缓存单元的前后顺序,由前往后依序判断是否不为已更新状态。如图9A所示,由于此时第一区域Z1中的所有缓存单元都不为已更新状态。因此,存储器控制电路单元404(或存储器管理电路502)设定第一指标P1指向第一区域Z1中的第一个缓存单元810(1-0)。之后,存储器控制电路单元404(或存储器管理电路502)会根据第一指标P1来存储已更新的逻辑地址-物理地址映射表。例如,存储器控制电路单元404(或存储器管理电路502)会根据第一指标P1将已更新的逻辑地址-物理地址映射表MT(n+2)从第二区域Z2的缓存单元810(2-1)搬移至第一区域Z1的缓存单元810(1-0)中。In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502) also sets the first pointer P1 to point to one of the cache units in the first zone Z1, and the pointed cache unit is not updated state. Specifically, the memory control circuit unit 404 (or the memory management circuit 502 ) judges from front to back according to the order of the multiple cache units in the first zone Z1 whether they are not in the updated state. As shown in FIG. 9A , at this time, all cache units in the first zone Z1 are not in the updated state. Therefore, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the first index P1 to point to the first cache unit 810 (1-0) in the first zone Z1. Afterwards, the memory control circuit unit 404 (or the memory management circuit 502 ) stores the updated logical address-physical address mapping table according to the first index P1. For example, the memory control circuit unit 404 (or the memory management circuit 502) will transfer the updated logical address-physical address mapping table MT(n+2) from the cache unit 810(2-1 ) is moved to the cache unit 810(1-0) of the first zone Z1.
请参照图9B,已更新的逻辑地址-物理地址映射表MT(n+2)被搬移至第一区域Z1的缓存单元810(1-0)中之后,存储器控制电路单元404(或存储器管理电路502)会将缓存单元810(1-0)标示为已更新状态。此外,存储器控制电路单元404(或存储器管理电路502)会设定第一指标P1指向第一区域Z1中的缓存单元810(1-0)的后一个不为已更新状态的缓存单元。在本范例实施例中,缓存单元810(1-0)的后一个缓存单元810(1-1)即不为已更新状态。因此,存储器控制电路单元404(或存储器管理电路502)会设定第一指标P1指向缓存单元810(1-1)。在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)更可将原本暂存在第一区域Z1的缓存单元810(1-0)中的逻辑地址-物理地址映射表MT(0)搬移至第二区域Z2的缓存单元810(2-1)中。而在另一范例实施例中,也可不搬移而直接覆盖掉逻辑地址-物理地址映射表MT(0)。Please refer to FIG. 9B, after the updated logical address-physical address mapping table MT(n+2) is moved to the cache unit 810(1-0) of the first zone Z1, the memory control circuit unit 404 (or memory management circuit 502) will mark the cache unit 810(1-0) as updated. In addition, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the first pointer P1 to point to the last cache unit of the cache units 810 ( 1 - 0 ) in the first zone Z1 that is not in the updated state. In this exemplary embodiment, the subsequent cache unit 810(1-1) of the cache unit 810(1-0) is not in the updated state. Therefore, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the first index P1 to point to the cache unit 810(1-1). In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502) can further temporarily store the logical address-physical address mapping table MT(0) in the cache unit 810(1-0) of the first zone Z1 ) is moved to the cache unit 810(2-1) in the second zone Z2. In another exemplary embodiment, the logical address-physical address mapping table MT(0) may also be directly overwritten without being moved.
此时,倘若从主机系统接收到指示将数据写入至属于逻辑地址-物理地址映射表MT(n)的逻辑地址的另一写入指令时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(n)已载入至缓冲存储器508中的映射表区MTZ,且被暂存在第一区域Z1的缓存单元810(1-n)中。如图9C所示,存储器控制电路单元404(或存储器管理电路502)会将数据写入至可复写式非易失性存储器模块406中所述逻辑地址所映射的物理编程单元,更新暂存在缓存单元810(1-n)中的逻辑地址-物理地址映射表MT(n),并将缓存单元810(1-n)标示为已更新状态。At this time, if another write instruction indicating to write data to a logical address belonging to the logical address-physical address mapping table MT(n) is received from the host system, the memory control circuit unit 404 (or the memory management circuit 502) It will be determined that the logical address-physical address mapping table MT(n) has been loaded into the mapping table zone MTZ in the buffer memory 508, and is temporarily stored in the cache units 810(1-n) in the first zone Z1. As shown in FIG. 9C, the memory control circuit unit 404 (or the memory management circuit 502) will write data to the physical programming unit mapped to the logical address in the rewritable non-volatile memory module 406, and update the temporary cache The logical address-physical address mapping table MT(n) in the unit 810(1-n) marks the cache unit 810(1-n) as an updated state.
此时,倘若从主机系统接收到指示将数据写入至属于逻辑地址-物理地址映射表MT(k)的逻辑地址的又一写入指令时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(k)尚未被载入至缓冲存储器508中的映射表区MTZ。因此,存储器控制电路单元404(或存储器管理电路502)会从可复写式非易失性存储器模块406中将逻辑地址-物理地址映射表MT(k)载入至映射表区MTZ,并以第一指标P1所指向的第一区域Z1中的缓存单元810(1-1)来暂存逻辑地址-物理地址映射表MT(k)。如图9D所示,逻辑地址-物理地址映射表MT(k)被暂存在第一区域Z1中的缓存单元810(1-1)中,且存储器控制电路单元404(或存储器管理电路502)将数据写入至可复写式非易失性存储器模块406中。此外,存储器控制电路单元404(或存储器管理电路502)并会更新逻辑地址-物理地址映射表MT(k),且将缓存单元810(1-1)标示为已更新状态。更进一步地,存储器控制电路单元404(或存储器管理电路502)会选取第一区域Z1中缓存单元810(1-1)的后一个不为已更新状态的缓存单元810(1-2)用以暂存下一个已更新的逻辑地址-物理地址映射表,并设定第一指标P1指向缓存单元810(1-2)。At this time, if another write command indicating to write data to a logical address belonging to the logical address-physical address mapping table MT(k) is received from the host system, the memory control circuit unit 404 (or the memory management circuit 502) It is determined that the logical address-physical address mapping table MT(k) has not been loaded into the mapping table zone MTZ in the buffer memory 508 . Therefore, the memory control circuit unit 404 (or the memory management circuit 502) will load the logical address-physical address mapping table MT(k) from the rewritable non-volatile memory module 406 into the mapping table zone MTZ, and use the first The cache unit 810(1-1) in the first zone Z1 pointed to by a pointer P1 temporarily stores the logical address-physical address mapping table MT(k). As shown in FIG. 9D, the logical address-physical address mapping table MT(k) is temporarily stored in the cache unit 810(1-1) in the first zone Z1, and the memory control circuit unit 404 (or the memory management circuit 502) will Data is written into the rewritable non-volatile memory module 406 . In addition, the memory control circuit unit 404 (or the memory management circuit 502 ) updates the logical address-physical address mapping table MT(k), and marks the cache unit 810(1-1) as an updated state. Furthermore, the memory control circuit unit 404 (or the memory management circuit 502) will select the next cache unit 810(1-2) of the cache unit 810(1-1) in the first zone Z1 that is not in the updated state for The next updated logical address-physical address mapping table is temporarily stored, and the first pointer P1 is set to point to the cache unit 810 (1-2).
在本范例实施例中,倘若第一区域Z1中的所有缓存单元810(1-0)~810(1-n)都被标示为已更新状态,存储器控制电路单元404(或存储器管理电路502)会启动回存操作,以将暂存在第一区域Z1的所有缓存单元810(1-0)~810(1-n)中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块406中。然而,需了解的是,存储器控制电路单元404(或存储器管理电路502)也会在其他时间点启动回存操作。举例而言,在执行数据合并或垃圾收集(Garbage collection)等背景操作、或存储器存储装置被断电前、或经过一段时间未收到来自于主机系统11的写入指令等情况下,存储器控制电路单元404(或存储器管理电路502)也会启动回存操作,将更新的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块406。In this exemplary embodiment, if all cache units 810(1-0)˜810(1-n) in the first zone Z1 are marked as updated, the memory control circuit unit 404 (or the memory management circuit 502) A store-back operation will be started to store back the logical address-physical address mapping tables temporarily stored in all cache units 810(1-0)-810(1-n) in the first zone Z1 to the rewritable non-volatile memory module 406. However, it should be understood that the memory control circuit unit 404 (or the memory management circuit 502 ) will also start the store back operation at other time points. For example, when performing background operations such as data consolidation or garbage collection (Garbage collection), or before the memory storage device is powered off, or does not receive a write command from the host system 11 after a period of time, the memory control The circuit unit 404 (or the memory management circuit 502 ) will also start a store-back operation, and store the updated logical address-physical address mapping table back into the rewritable non-volatile memory module 406 .
在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)还会设定第二指标P2指向第二区域Z2中的其中一个缓存单元。具体来说,存储器控制电路单元404(或存储器管理电路502)会根据第二区域Z2中的多个缓存单元的前后顺序,由后往前来决定第二指标P2要指向的缓存单元。如图9E所示,可从第二区域Z2中的最后一个缓存单元810(2-n)开始,设定第二指标P2指向缓存单元810(2-n)。In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) further sets the second index P2 to point to one of the cache units in the second zone Z2. Specifically, the memory control circuit unit 404 (or the memory management circuit 502 ) determines the cache unit to be pointed to by the second pointer P2 from the back to the front according to the order of the multiple cache units in the second zone Z2. As shown in FIG. 9E , the second pointer P2 can be set to point to the cache unit 810 ( 2 - n ) starting from the last cache unit 810 ( 2 - n ) in the second zone Z2 .
此时,倘若从主机系统接收到指示读取属于逻辑地址-物理地址映射表MT(s)的逻辑地址的数据的读取指令时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(s)尚未被载入至缓冲存储器508中的映射表区MTZ。因此,存储器控制电路单元404(或存储器管理电路502)会从可复写式非易失性存储器模块406中将逻辑地址-物理地址映射表MT(s)载入至映射表区MTZ,并以第二指标P2所指向的缓存单元810(2-n)来暂存逻辑地址-物理地址映射表MT(s)。如图9F所示,在逻辑地址-物理地址映射表MT(s)被暂存在第二区域Z2中的缓存单元810(2-n)中之后,存储器控制电路单元404(或存储器管理电路502)便可根据逻辑地址-物理地址映射表MT(s)读取存储在可复写式非易失性存储器模块中的数据。此外,存储器控制电路单元404(或存储器管理电路502)并会设定第二指标P2指向第二区域Z2中缓存单元810(2-n)的前一个缓存单元,即缓存单元810(2-(n-1))。在本范例实施例中,倘若第二指标P2已指向第二区域Z2的第一个缓存单元810(2-0)时,存储器控制电路单元404(或存储器管理电路502)会选取第二区域Z2的最后一个缓存单元810(2-n)作为下一个第二指标P2要指向的缓存单元。At this time, if a read instruction indicating to read data belonging to a logical address of the logical address-physical address mapping table MT(s) is received from the host system, the memory control circuit unit 404 (or the memory management circuit 502) will judge the logical The address-physical address mapping table MT(s) has not been loaded into the mapping table zone MTZ in the buffer memory 508 . Therefore, the memory control circuit unit 404 (or the memory management circuit 502) will load the logical address-physical address mapping table MT(s) from the rewritable non-volatile memory module 406 into the mapping table zone MTZ, and use the first The cache unit 810(2-n) pointed to by the two pointers P2 temporarily stores the logical address-physical address mapping table MT(s). As shown in FIG. 9F, after the logical address-physical address mapping table MT(s) is temporarily stored in the cache unit 810(2-n) in the second zone Z2, the memory control circuit unit 404 (or the memory management circuit 502) Then the data stored in the rewritable non-volatile memory module can be read according to the logical address-physical address mapping table MT(s). In addition, the memory control circuit unit 404 (or the memory management circuit 502) will also set the second index P2 to point to the previous cache unit of the cache unit 810(2-n) in the second zone Z2, that is, the cache unit 810(2-( n-1)). In this exemplary embodiment, if the second pointer P2 points to the first cache unit 810 (2-0) in the second zone Z2, the memory control circuit unit 404 (or the memory management circuit 502) will select the second zone Z2 The last cache unit 810(2-n) of is used as the next cache unit to be pointed to by the second index P2.
此时,倘若从主机系统接收到指示读取属于逻辑地址-物理地址映射表MT(n+1)的逻辑地址的数据的另一读取指令时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(n+1)已被载入至缓冲存储器508中的映射表区MTZ,且被暂存在第二区域Z2的缓存单元810(2-0)中。如图9F所示,存储器控制电路单元404(或存储器管理电路502)直接根据暂存在第二区域Z2的缓存单元810(2-0)中的逻辑地址-物理地址映射表MT(n+1)读取可复写式非易失性存储器模块406中的数据。At this time, if another read command indicating to read data belonging to a logical address of the logical address-physical address mapping table MT(n+1) is received from the host system, the memory control circuit unit 404 (or the memory management circuit 502 ) will determine that the logical address-physical address mapping table MT(n+1) has been loaded into the mapping table zone MTZ in the buffer memory 508, and is temporarily stored in the cache unit 810(2-0) of the second zone Z2. As shown in FIG. 9F, the memory control circuit unit 404 (or the memory management circuit 502) directly stores the logical address-physical address mapping table MT(n+1) in the cache unit 810(2-0) of the second zone Z2 directly. Read the data in the rewritable non-volatile memory module 406 .
图10A~10D是根据另一范例实施例所示出的缓冲存储器管理方法的示意图。图10A~10D是有关于在对第一区域Z1执行回存操作的期间接收到写入指令时的缓冲存储器管理方法。10A-10D are schematic diagrams of a buffer memory management method according to another exemplary embodiment. 10A to 10D are related to the buffer memory management method when a write command is received during the restore operation of the first zone Z1.
请参照图10A,在本范例实施例中,倘若被设定为更新区域的第一区域Z1中所有缓存单元810(1-0)~810(1-n)都被标示为已更新状态时,存储器控制电路单元404(或存储器管理电路502)会启动回存操作,以将暂存在第一区域Z1中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。然而,存储器控制电路单元404(或存储器管理电路502)也会在其他时间点启动回存操作,并已于前述内容中举例说明,在此不再赘述。此外,在启动回存操作以将暂存在第一区域Z1中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块时,存储器控制电路单元404(或存储器管理电路502)会重新设定更新区域为第二区域Z2。因此,当从主机系统11接收到写入指令,存储器控制电路单元404(或存储器管理电路502)会根据所接收的写入指令将需更新的逻辑地址-物理地址映射表暂存至映射表区MTZ的第二区域Z2(即更新区域)以进行维护。在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会将第一指标P1指向第二区域Z2中的其中一个缓存单元,且此被指向的缓存单元不为已更新状态。如图10A所示,由于此时第二区域Z2中的所有缓存单元都不为已更新状态,因此,存储器控制电路单元404(或存储器管理电路502)会设定第一指标P1指向第二区域Z2中的第一个缓存单元810(2-0)。Please refer to FIG. 10A. In this exemplary embodiment, if all cache units 810(1-0)-810(1-n) in the first zone Z1 set as the update zone are marked as updated, The memory control circuit unit 404 (or the memory management circuit 502 ) initiates a store-back operation to store back the logical address-physical address mapping table temporarily stored in the first zone Z1 into the rewritable non-volatile memory module. However, the memory control circuit unit 404 (or the memory management circuit 502 ) will also start the store back operation at other time points, which have been illustrated in the foregoing content, and will not be repeated here. In addition, when starting the store back operation to store back the logical address-physical address mapping table temporarily stored in the first zone Z1 to the rewritable non-volatile memory module, the memory control circuit unit 404 (or the memory management circuit 502) The update area will be reset to the second area Z2. Therefore, when a write command is received from the host system 11, the memory control circuit unit 404 (or memory management circuit 502) temporarily stores the logical address-physical address mapping table to be updated in the mapping table area according to the received write command The second zone Z2 of the MTZ, ie the update zone, is for maintenance. In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) points the first pointer P1 to one of the cache units in the second zone Z2, and the pointed cache unit is not in an updated state. As shown in FIG. 10A, since all cache units in the second zone Z2 are not in the updated state at this time, the memory control circuit unit 404 (or the memory management circuit 502) will set the first index P1 to point to the second zone The first cache unit 810(2-0) in Z2.
在回存操作期间,倘若从主机系统11接收到指示将数据(以下也参考为第一数据)写入至属于逻辑地址-物理地址映射表MT(k)(以下也参考为第一逻辑地址-物理地址映射表)的逻辑地址的写入指令(以下也参考为第一写入指令)时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(k)已载入至缓冲存储器508中的映射表区MTZ,且被暂存在第一区域Z1的缓存单元810(1-1)(以下也参考为第一缓存单元)中。此时,存储器控制电路单元404(或存储器管理电路502)会将数据写入至可复写式非易失性存储器模块406中所述逻辑地址所映射的物理编程单元,并将逻辑地址-物理地址映射表MT(k)复制到第二区域Z2,且暂存在第一指标P1所指向的缓存单元810(2-0)(以下也参考为第二缓存单元)中。存储器控制电路单元404(或存储器管理电路502)将逻辑地址-物理地址映射表MT(k)复制为逻辑地址-物理地址映射表MT(k)’,并如图10B所示,将逻辑地址-物理地址映射表MT(k)’暂存在第二区域Z2的缓存单元810(2-0)中。并且,存储器控制电路单元404(或存储器管理电路502)会更新暂存在第二区域Z2中的缓存单元810(2-0)中的逻辑地址-物理地址映射表MT(k)’,且将缓存单元810(2-0)标示为已更新状态。此外,存储器控制电路单元404(或存储器管理电路502)会设定第一指标P1指向第二区域Z2中的缓存单元810(2-0)的后一个不为已更新状态的缓存单元。在本范例实施例中,缓存单元810(2-0)的后一个缓存单元810(2-1)即不为已更新状态。因此,存储器控制电路单元404(或存储器管理电路502)会设定第一指标P1指向缓存单元810(2-1)。During the memory back operation, if an instruction is received from the host system 11 to write data (hereinafter also referred to as the first data) into the logical address-physical address mapping table MT(k) (hereinafter also referred to as the first logical address- physical address mapping table) logical address write instruction (hereinafter also referred to as the first write instruction), the memory control circuit unit 404 (or memory management circuit 502) will determine the logical address-physical address mapping table MT (k) It has been loaded into the mapping table zone MTZ in the buffer memory 508 and temporarily stored in the cache unit 810 ( 1 - 1 ) of the first zone Z1 (hereinafter also referred to as the first cache unit). At this point, the memory control circuit unit 404 (or the memory management circuit 502) will write data to the physical programming unit mapped to the logical address in the rewritable non-volatile memory module 406, and convert the logical address-physical address The mapping table MT(k) is copied to the second zone Z2 and temporarily stored in the cache unit 810 ( 2 - 0 ) pointed to by the first pointer P1 (hereinafter also referred to as the second cache unit). The memory control circuit unit 404 (or the memory management circuit 502) copies the logical address-physical address mapping table MT(k) into a logical address-physical address mapping table MT(k)', and as shown in FIG. 10B, converts the logical address- The physical address mapping table MT(k)' is temporarily stored in the cache unit 810(2-0) of the second zone Z2. Moreover, the memory control circuit unit 404 (or the memory management circuit 502) will update the logical address-physical address mapping table MT(k)' temporarily stored in the cache unit 810(2-0) in the second zone Z2, and cache Cell 810(2-0) is marked as updated. In addition, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the first pointer P1 to point to the next cache unit of the cache unit 810 ( 2 - 0 ) in the second zone Z2 that is not in the updated state. In this exemplary embodiment, the subsequent cache unit 810(2-1) of the cache unit 810(2-0) is not in the updated state. Therefore, the memory control circuit unit 404 (or the memory management circuit 502 ) sets the first index P1 to point to the cache unit 810 ( 2 - 1 ).
此时,倘若从主机系统接收到指示将数据(以下也参考为第二数据)写入至属于逻辑地址-物理地址映射表MT(n+3)(以下也参考为第二逻辑地址-物理地址映射表)的逻辑地址的另一写入指令(以下也参考为第二写入指令)时,存储器控制电路单元404(或存储器管理电路502)会判断逻辑地址-物理地址映射表MT(n+3)已载入至缓冲存储器508中的映射表区MTZ,且被暂存在第二区域Z2的缓存单元810(2-2)(以下也参考为第三缓存单元)中。如图10C所示,存储器控制电路单元404(或存储器管理电路502)会将数据写入至可复写式非易失性存储器模块406中所述逻辑地址所映射的物理编程单元,并更新逻辑地址-物理地址映射表MT(n+3),且将缓存单元810(2-2)标示为已更新状态。At this point, if an instruction is received from the host system to write data (hereinafter also referred to as the second data) into the logical address-physical address mapping table MT(n+3) (hereinafter also referred to as the second logical address-physical address mapping table) for another write command (hereinafter also referred to as the second write command), the memory control circuit unit 404 (or memory management circuit 502) will determine the logical address-physical address mapping table MT (n+ 3) It has been loaded into the mapping table zone MTZ in the buffer memory 508 and temporarily stored in the cache unit 810(2-2) of the second zone Z2 (hereinafter also referred to as the third cache unit). As shown in Figure 10C, the memory control circuit unit 404 (or the memory management circuit 502) will write data to the physical programming unit mapped to the logical address in the rewritable non-volatile memory module 406, and update the logical address - The physical address mapping table MT(n+3), and marks the cache unit 810(2-2) as updated.
此时,倘若从主机系统接收到指示将数据(以下也参考为第三数据)写入至属于逻辑地址-物理地址映射表MT(x)(以下也参考为第三逻辑地址-物理地址映射表)的逻辑地址的又一写入指令(以下也参考为第三写入指令)时,存储器控制电路单元404(或存储器管理电路502)判断逻辑地址-物理地址映射表MT(x)尚未被载入至缓冲存储器508中的映射表区MTZ。因此,存储器控制电路单元404(或存储器管理电路502)会从可复写式非易失性存储器模块406中将逻辑地址-物理地址映射表MT(x)载入至映射表区MTZ,并以第一指标P1所指向的第二区域Z2中的缓存单元810(2-1)来暂存逻辑地址-物理地址映射表MT(x)。如图10D所示,逻辑地址-物理地址映射表MT(x)被暂存在第二区域Z2中的缓存单元810(2-1)(以下也参考为第四缓存单元)中,且存储器控制电路单元404(或存储器管理电路502)会将数据写入至可复写式非易失性存储器模块406。存储器控制电路单元404(或存储器管理电路502)并会更新逻辑地址-物理地址映射表MT(x),且将缓存单元810(2-1)标示为已更新状态。At this point, if an instruction is received from the host system to write data (hereinafter also referred to as the third data) into the logical address-physical address mapping table MT (x) (hereinafter also referred to as the third logical address-physical address mapping table ) of another write command (hereinafter also referred to as the third write command), the memory control circuit unit 404 (or memory management circuit 502) judges that the logical address-physical address mapping table MT(x) has not been loaded into the mapping table zone MTZ in the buffer memory 508. Therefore, the memory control circuit unit 404 (or the memory management circuit 502) will load the logical address-physical address mapping table MT(x) from the rewritable non-volatile memory module 406 into the mapping table zone MTZ, and use the first The cache unit 810(2-1) in the second zone Z2 pointed to by a pointer P1 temporarily stores the logical address-physical address mapping table MT(x). As shown in FIG. 10D, the logical address-physical address mapping table MT(x) is temporarily stored in the cache unit 810(2-1) (hereinafter also referred to as the fourth cache unit) in the second zone Z2, and the memory control circuit The unit 404 (or the memory management circuit 502 ) writes data into the rewritable non-volatile memory module 406 . The memory control circuit unit 404 (or the memory management circuit 502 ) will also update the logical address-physical address mapping table MT(x), and mark the cache unit 810(2-1) as an updated state.
更进一步地,存储器控制电路单元404(或存储器管理电路502)会选取第二区域Z2中缓存单元810(2-1)的后一个不为已更新状态的缓存单元以设定第一指标P1。在本范例实施例中,存储器控制电路单元404(或存储器管理电路502)会依序判断缓存单元810(2-1)的后一个缓存单元810(2-2)已被标示为已更新状态。因此,存储器控制电路单元404(或存储器管理电路502)会依序往后寻找不为已更新状态的缓存单元。接着,存储器控制电路单元404(或存储器管理电路502)会判断缓存单元810(2-2)的后一个缓存单元810(2-3)不为已更新状态,并设定第一指标P1指向缓存单元810(2-3)。Furthermore, the memory control circuit unit 404 (or the memory management circuit 502 ) selects the last cache unit of the cache unit 810 ( 2 - 1 ) in the second zone Z2 that is not in the updated state to set the first index P1 . In this exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) sequentially determines that the next cache unit 810 ( 2 - 2 ) of the cache unit 810 ( 2 - 1 ) has been marked as updated. Therefore, the memory control circuit unit 404 (or the memory management circuit 502 ) will sequentially search for cache units that are not in the updated state. Next, the memory control circuit unit 404 (or the memory management circuit 502) will determine that the next cache unit 810(2-3) of the cache unit 810(2-2) is not in the updated state, and set the first pointer P1 to point to the cache Unit 810(2-3).
在本范例实施例中,当关于第一区域Z1的回存操作完成之后,即存储器控制电路单元404(或存储器管理电路502)已将第一区域Z1的所有缓存单元810(1-0)~810(1-n)中的逻辑地址-物理地址映射表写入至该可复写式非易失性存储器模块中,存储器控制电路单元404(或存储器管理电路502)会将第一区域Z1的所有缓存单元810(1-0)~810(1-n)标示为未更新状态。如此一来,当第二区域Z2的所有缓存单元810(2-0)~810(2-n)都被标示为已更新状态时,存储器控制电路单元404(或存储器管理电路502)会启动回存操作,以将暂存在第二区域Z2的所有缓存单元810(2-0)~810(2-n)中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块406中,同时重新设定更新区域为第一区域Z1,以持续接收来自主机系统的写入指令的数据来执行写入操作。除此之外,在另一范例实施例中,存储器控制电路单元404(或存储器管理电路502)也可在缓冲存储器508中再划分出具有连续的多个缓存单元的另一区域来暂存逻辑地址-物理地址映射表,本发明并不加以限制。In this exemplary embodiment, after the restore operation on the first zone Z1 is completed, that is, the memory control circuit unit 404 (or the memory management circuit 502 ) has saved all cache units 810(1-0)˜ Write the logical address-physical address mapping table in 810(1-n) into the rewritable non-volatile memory module, and the memory control circuit unit 404 (or memory management circuit 502) will write all The cache units 810(1-0)-810(1-n) are marked as not updated. In this way, when all the cache units 810(2-0)˜810(2-n) in the second zone Z2 are marked as updated, the memory control circuit unit 404 (or the memory management circuit 502) will start back to Store operation, so as to store back the logical address-physical address mapping tables temporarily stored in all cache units 810(2-0)-810(2-n) of the second zone Z2 to the rewritable non-volatile memory module 406 At the same time, the update area is reset to the first area Z1, so as to continuously receive the data of the write command from the host system to perform the write operation. In addition, in another exemplary embodiment, the memory control circuit unit 404 (or the memory management circuit 502 ) may further divide the buffer memory 508 into another area with multiple consecutive cache units to temporarily store logic The address-physical address mapping table is not limited in the present invention.
图11A及11B是根据一范例实施例所示出的缓冲存储器管理方法的流程图。11A and 11B are flowcharts of a cache memory management method according to an exemplary embodiment.
请参照图11A,在步骤S1101中,存储器控制电路单元404(或存储器管理电路502)会在缓冲存储器508中划分出映射表区。Referring to FIG. 11A , in step S1101 , the memory control circuit unit 404 (or the memory management circuit 502 ) divides a mapping table area in the buffer memory 508 .
在步骤S1103中,存储器控制电路单元404(或存储器管理电路502)会将映射表区划分为分别具有连续的多个缓存单元的第一区域与第二区域。In step S1103 , the memory control circuit unit 404 (or the memory management circuit 502 ) divides the mapping table area into a first area and a second area respectively having a plurality of consecutive cache units.
在步骤S1105中,存储器控制电路单元404(或存储器管理电路502)从可复写式非易失性存储器模块中载入多个逻辑地址-物理地址映射表至第一区域与第二区域。如上所述,每一个被载入的逻辑地址-物理地址映射表是被暂存在第一区域中的其中一个缓存单元或第二区域中的其中一个缓存单元。In step S1105, the memory control circuit unit 404 (or the memory management circuit 502) loads a plurality of logical address-physical address mapping tables from the rewritable non-volatile memory module into the first area and the second area. As mentioned above, each loaded logical address-physical address mapping table is temporarily stored in one of the cache units in the first area or in one of the cache units in the second area.
在步骤S1107中,存储器控制电路单元404(或存储器管理电路502)将更新区域设定为第一区域。In step S1107, the memory control circuit unit 404 (or the memory management circuit 502) sets the update area to the first area.
在步骤S1109中,存储器控制电路单元404(或存储器管理电路502)更新所述多个逻辑地址-物理地址映射表的其中一个逻辑地址-物理地址映射表,将此其中一个逻辑地址-物理地址映射表暂存至第一区域的缓存单元之中的其中一个缓存单元,并且将第一区域中的此其中一个缓存单元标示为已更新状态。具体而言,存储器控制电路单元404(或存储器管理电路502)会根据从主机系统11所接收的写入指令来更新逻辑地址-物理地址映射表,相关操作方式已于前述的范例实施例中说明,在此不再赘述。In step S1109, the memory control circuit unit 404 (or the memory management circuit 502) updates one of the logical address-physical address mapping tables of the plurality of logical address-physical address mapping tables, and maps one of the logical address-physical address The table is temporarily stored in one of the cache units in the first area, and the one of the cache units in the first area is marked as updated. Specifically, the memory control circuit unit 404 (or the memory management circuit 502) will update the logical address-physical address mapping table according to the write command received from the host system 11, and the relevant operation methods have been described in the aforementioned exemplary embodiments , which will not be repeated here.
在步骤S1111中,倘若第一区域的所有缓存单元都被标示为已更新状态时,存储器控制电路单元404(或存储器管理电路502)将暂存在第一区域的所有缓存单元中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。然而,存储器控制电路单元404(或存储器管理电路502)也会在其他时间点启动回存操作,并已于前述内容中举例说明,在此不再赘述。In step S1111, if all cache units in the first area are marked as updated, the memory control circuit unit 404 (or memory management circuit 502) temporarily stores the logical address-physical address in all cache units in the first area The address mapping table is stored back into the rewritable non-volatile memory module. However, the memory control circuit unit 404 (or the memory management circuit 502 ) will also start the store back operation at other time points, which have been illustrated in the foregoing content, and will not be repeated here.
倘若在将暂存在第一区域的所有缓存单元中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中期间,从主机系统11接收到写入指令,将另外执行图11B的流程。If a write command is received from the host system 11 during the process of restoring the logical address-physical address mapping tables temporarily stored in all the cache units in the first area to the rewritable non-volatile memory module, it will additionally execute the 11B process.
请参照图11B,在步骤S1113中,存储器控制电路单元404(或存储器管理电路502)从主机系统接收到指示将数据写入至属于一逻辑地址-物理地址映射表的一逻辑地址的写入指令。Please refer to FIG. 11B, in step S1113, the memory control circuit unit 404 (or the memory management circuit 502) receives from the host system a write command indicating to write data to a logical address belonging to a logical address-physical address mapping table .
在步骤S1115中,存储器控制电路单元404(或存储器管理电路502)将更新区域更改为第二区域。In step S1115, the memory control circuit unit 404 (or the memory management circuit 502) changes the update area to the second area.
在步骤S1117中,存储器控制电路单元404(或存储器管理电路502)判断此逻辑地址所属的逻辑地址-物理地址映射表是否已被暂存在第一区域或第二区域中。In step S1117, the memory control circuit unit 404 (or the memory management circuit 502) determines whether the logical address-physical address mapping table to which the logical address belongs has been temporarily stored in the first area or the second area.
在步骤S1119中,倘若此逻辑地址所属的逻辑地址-物理地址映射表已被暂存在第一区域的缓存单元(以下也参考为第一缓存单元)中,存储器控制电路单元404(或存储器管理电路502)将数据写入至可复写式非易失性存储器模块,且将第一区域中的第一缓存单元中的逻辑地址-物理地址映射表复制到第二区域中的缓存单元(以下也参考为第二缓存单元)中。In step S1119, if the logical address-physical address mapping table to which the logical address belongs has been temporarily stored in the cache unit of the first area (hereinafter also referred to as the first cache unit), the memory control circuit unit 404 (or memory management circuit 502) Write data to the rewritable non-volatile memory module, and copy the logical address-physical address mapping table in the first cache unit in the first area to the cache unit in the second area (also refer to below for the second cache unit).
在步骤S1121中,存储器控制电路单元404(或存储器管理电路502)更新暂存在第二区域中的第二缓存单元中的逻辑地址-物理地址映射表,并将第二缓存单元标示为已更新状态。In step S1121, the memory control circuit unit 404 (or the memory management circuit 502) updates the logical address-physical address mapping table temporarily stored in the second cache unit in the second area, and marks the second cache unit as an updated state .
在步骤S1123中,倘若此逻辑地址所属的逻辑地址-物理地址映射表已被暂存在第二区域的缓存单元(以下也参考为第三缓存单元)中,存储器控制电路单元404(或存储器管理电路502)将数据写入至可复写式非易失性存储器模块,更新暂存在第二区域中的第三缓存单元中的逻辑地址-物理地址映射表,并将第三缓存单元标示为已更新状态。In step S1123, if the logical address-physical address mapping table to which the logical address belongs has been temporarily stored in the cache unit of the second area (hereinafter also referred to as the third cache unit), the memory control circuit unit 404 (or memory management circuit 502) Write data into the rewritable non-volatile memory module, update the logical address-physical address mapping table temporarily stored in the third cache unit in the second area, and mark the third cache unit as an updated state .
在步骤S1125中,倘若此逻辑地址所属的逻辑地址-物理地址映射表尚未被暂存在第一区域或第二区域,存储器控制电路单元404(或存储器管理电路502)从可复写式非易失性存储器模块载入此逻辑地址所属的逻辑地址-物理地址映射表并暂存在第二区域的缓存单元(以下也参考为第四缓存单元)中。In step S1125, if the logical address-physical address mapping table to which the logical address belongs has not been temporarily stored in the first area or the second area, the memory control circuit unit 404 (or the memory management circuit 502 ) starts from the rewritable non-volatile The memory module loads the logical address-physical address mapping table to which the logical address belongs and temporarily stores it in the cache unit in the second area (hereinafter also referred to as the fourth cache unit).
在步骤S1127中,存储器控制电路单元404(或存储器管理电路502)将数据写入至可复写式非易失性存储器模块,更新暂存在第二区域中的第四缓存单元中的逻辑地址-物理地址映射表,并将第四缓存单元标示为已更新状态。In step S1127, the memory control circuit unit 404 (or the memory management circuit 502) writes data into the rewritable non-volatile memory module, and updates the logical address-physical address temporarily stored in the fourth cache unit in the second area. address mapping table, and mark the fourth cache unit as updated.
在步骤S1129中,倘若第二区域的所有缓存单元都被标示为已更新状态时,存储器控制电路单元404(或存储器管理电路502)将暂存在第二区域的所有缓存单元中的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块中。然而,存储器控制电路单元404(或存储器管理电路502)也会在其他时间点启动回存操作,并已于前述内容中举例说明,在此不再赘述。In step S1129, if all cache units in the second area are marked as updated, the memory control circuit unit 404 (or memory management circuit 502) temporarily stores the logical address-physical address in all cache units in the second area The address mapping table is stored back into the rewritable non-volatile memory module. However, the memory control circuit unit 404 (or the memory management circuit 502 ) will also start the store back operation at other time points, which have been illustrated in the foregoing content, and will not be repeated here.
综上所述,本发明所提供的缓冲存储器管理方法、存储器控制电路单元与存储器存储装置,是在缓冲存储器中划分出具有连续缓存单元的特定区域,并将更新区域设定为特定区域,以将被更新的逻辑地址-物理地址映射表集中暂存在更新区域中。如此一来,当要将缓冲存储器中的已更新的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块时,便可根据物理编程单元的大小,直接将更新区域中的已更新的逻辑地址-物理地址映射表写入至物理编程单元,而无须另外执行复制与收集的操作。且通过将此特定区域设定为特定大小,可在进行回存操作时,避免因需处理的数据量过大而造成系统负载过重的问题,进而有效提升回存操作的处理速度。此外,通过更改更新区域的方式,使得在将缓冲存储器中的已更新的逻辑地址-物理地址映射表回存至可复写式非易失性存储器模块的期间,可持续从主机系统接收写入指令的数据,并执行写入操作,避免因等待时间过长而导致写入失败的情况,提升系统的稳定性。To sum up, the buffer memory management method, memory control circuit unit and memory storage device provided by the present invention are to divide a specific area with continuous buffer units in the buffer memory, and set the update area as a specific area, so as to The logical address-physical address mapping table to be updated is temporarily stored in the update area. In this way, when the updated logical address-physical address mapping table in the buffer memory is to be stored back to the rewritable non-volatile memory module, the data in the update area can be directly stored according to the size of the physical programming unit. The updated logical address-physical address mapping table is written into the physical programming unit without additional copying and collecting operations. And by setting the specific area to a specific size, the problem of overloading the system due to the large amount of data to be processed can be avoided during the restore operation, thereby effectively improving the processing speed of the restore operation. In addition, by changing the way of updating the area, during the period when the updated logical address-physical address mapping table in the buffer memory is stored back to the rewritable non-volatile memory module, the write command can be continuously received from the host system data and perform write operations to avoid write failures due to long waiting times and improve system stability.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510820913.2A CN106776376B (en) | 2015-11-24 | 2015-11-24 | Buffer memory management method, memory control circuit unit and storage device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510820913.2A CN106776376B (en) | 2015-11-24 | 2015-11-24 | Buffer memory management method, memory control circuit unit and storage device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN106776376A CN106776376A (en) | 2017-05-31 |
| CN106776376B true CN106776376B (en) | 2019-08-06 |
Family
ID=58963295
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510820913.2A Active CN106776376B (en) | 2015-11-24 | 2015-11-24 | Buffer memory management method, memory control circuit unit and storage device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106776376B (en) |
Families Citing this family (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US10289544B2 (en) * | 2016-07-19 | 2019-05-14 | Western Digital Technologies, Inc. | Mapping tables for storage devices |
| US10628326B2 (en) * | 2017-08-21 | 2020-04-21 | Micron Technology, Inc. | Logical to physical mapping |
| CN107844431B (en) * | 2017-11-03 | 2022-01-25 | 合肥兆芯电子有限公司 | Mapping table updating method, memory control circuit unit and memory storage device |
| US10445088B2 (en) * | 2018-01-11 | 2019-10-15 | Macronix International Co., Ltd. | System boot code clone |
| CN109684238A (en) * | 2018-12-19 | 2019-04-26 | 湖南国科微电子股份有限公司 | A kind of storage method, read method and the solid state hard disk of solid state hard disk mapping relations |
| TWI697778B (en) * | 2019-06-17 | 2020-07-01 | 慧榮科技股份有限公司 | A data storage device and a data processing method |
| CN110674056B (en) * | 2019-09-02 | 2021-11-23 | 新华三大数据技术有限公司 | Garbage recovery method and device |
| CN111597129B (en) * | 2020-05-21 | 2022-06-07 | 北京泽石科技有限公司 | Cache management method and device, storage medium and solid-state nonvolatile storage device |
| CN111737165B (en) * | 2020-07-02 | 2023-09-12 | 群联电子股份有限公司 | Memory control method, memory storage device and memory control circuit unit |
| CN112433957B (en) * | 2020-11-16 | 2023-04-14 | 合肥康芯威存储技术有限公司 | Data access method, data access system and readable storage device |
| CN115878051B (en) * | 2023-03-03 | 2023-06-09 | 浪潮电子信息产业股份有限公司 | Data synchronization method, data synchronization system, storage medium and electronic equipment |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1617113A (en) * | 2003-11-13 | 2005-05-18 | 国际商业机器公司 | Method of assigning virtual memory to physical memory, storage controller and computer system |
| CN102436421A (en) * | 2010-09-29 | 2012-05-02 | 腾讯科技(深圳)有限公司 | Method for caching data |
| CN102841853A (en) * | 2011-06-24 | 2012-12-26 | 群联电子股份有限公司 | Memory management table processing method, memory controller and memory storage device |
| CN103026346A (en) * | 2010-07-27 | 2013-04-03 | 国际商业机器公司 | Logical to physical address mapping in storage systems comprising solid state memory devices |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPWO2006067923A1 (en) * | 2004-12-22 | 2008-06-12 | 松下電器産業株式会社 | MEMORY CONTROLLER, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY SYSTEM, AND MEMORY CONTROL METHOD |
| US8321597B2 (en) * | 2007-02-22 | 2012-11-27 | Super Talent Electronics, Inc. | Flash-memory device with RAID-type controller |
| US8417893B2 (en) * | 2008-02-04 | 2013-04-09 | Apple Inc. | Memory mapping techniques |
| JP5295286B2 (en) * | 2011-02-23 | 2013-09-18 | 株式会社日立製作所 | Storage device and computer equipped with the same |
| US9081660B2 (en) * | 2011-08-09 | 2015-07-14 | Sandisk Technologies Inc. | Method and system for efficiently swapping pieces into and out of DRAM |
-
2015
- 2015-11-24 CN CN201510820913.2A patent/CN106776376B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1617113A (en) * | 2003-11-13 | 2005-05-18 | 国际商业机器公司 | Method of assigning virtual memory to physical memory, storage controller and computer system |
| CN103026346A (en) * | 2010-07-27 | 2013-04-03 | 国际商业机器公司 | Logical to physical address mapping in storage systems comprising solid state memory devices |
| CN102436421A (en) * | 2010-09-29 | 2012-05-02 | 腾讯科技(深圳)有限公司 | Method for caching data |
| CN102841853A (en) * | 2011-06-24 | 2012-12-26 | 群联电子股份有限公司 | Memory management table processing method, memory controller and memory storage device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106776376A (en) | 2017-05-31 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106776376B (en) | Buffer memory management method, memory control circuit unit and storage device | |
| TWI584122B (en) | Buffer memory management method, memory control circuit unit and memory storage device | |
| TWI537728B (en) | Buffer memory management method, memory control circuit unit and memory storage device | |
| CN106557432B (en) | Buffer memory management method, memory control circuit unit and storage device | |
| TWI454911B (en) | Data writing method, memory controller and memory storage apparatus | |
| US8516184B2 (en) | Data updating using mark count threshold in non-volatile memory | |
| TW201437807A (en) | Method of recording mapping information method, and memory controller and memory storage apparatus using the same | |
| TWI498899B (en) | Data writing method, memory controller and memory storage apparatus | |
| TWI571882B (en) | Wear leveling method, memory control circuit unit and memory storage device | |
| TW201945927A (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| CN106775436B (en) | Data access method, memory control circuit unit and memory | |
| CN106469122A (en) | Effective data merging method, memory controller and memory storage device | |
| TW201348960A (en) | Memory management method, and memory controller and memory storage device using the same | |
| TW201401050A (en) | Data writing method, memory controller and memory storage device | |
| CN102915273B (en) | Data writing method, memory controller and memory storage device | |
| CN103136111B (en) | Data writing method, memory controller and memory storage device | |
| TWI540428B (en) | Data writing method, memory controller and memory storage apparatus | |
| CN103914391B (en) | Data reading method, memory controller and memory storage device | |
| CN104536906B (en) | Data writing method, memory controller and memory storage device | |
| CN102567221B (en) | Data management method, memory controller and memory storage device | |
| CN108733577A (en) | Memory management method, memory control circuit unit and memory storage device | |
| TWI501244B (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| TWI629590B (en) | Memory management method, memory control circuit unit and memory storage device | |
| TWI533309B (en) | Data writing method, memory storage device and memory control circuit unit | |
| CN103365790B (en) | Memory controller, storage device and data writing method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |