+

CN104238956A - Data writing method, memory controller and memory storage device - Google Patents

Data writing method, memory controller and memory storage device Download PDF

Info

Publication number
CN104238956A
CN104238956A CN201310253210.7A CN201310253210A CN104238956A CN 104238956 A CN104238956 A CN 104238956A CN 201310253210 A CN201310253210 A CN 201310253210A CN 104238956 A CN104238956 A CN 104238956A
Authority
CN
China
Prior art keywords
data
district
chaotic
universe
logical
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.)
Pending
Application number
CN201310253210.7A
Other languages
Chinese (zh)
Inventor
叶志刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Phison Electronics Corp
Original Assignee
Phison Electronics Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to CN201310253210.7A priority Critical patent/CN104238956A/en
Publication of CN104238956A publication Critical patent/CN104238956A/en
Pending legal-status Critical Current

Links

Landscapes

  • Read Only Memory (AREA)

Abstract

本发明涉及一种数据写入方法、存储器控制器与存储器存储装置。本方法用于可复写式非易失性存储器模块。本方法包括提取物理抹除单元作为全域混乱区且建立全域混乱区搜寻表以记录在全域混乱区中对应暂存于全域混乱区中的更新数据所属的已更新逻辑页面的多个更新信息。本方法也包括接收欲存储至一逻辑页面的更新数据;判断对应此全域混乱区的数据零散程度是否小于数据零散程度阈值。本方法还包括,以及倘若对应此全域混乱区的数据零散程度小于数据零散程度阈值时,将此更新数据写入至此全域混乱区中并且在全域混乱区搜寻表中记录对应此逻辑页面的更新信息。

The present invention relates to a data writing method, a memory controller and a memory storage device. The method is used for a rewritable non-volatile memory module. The method includes extracting a physical erase unit as a global chaos area and establishing a global chaos area search table to record multiple update information of updated logical pages corresponding to the updated data temporarily stored in the global chaos area in the global chaos area. The method also includes receiving updated data to be stored in a logical page; determining whether the data fragmentation degree corresponding to this global chaos area is less than the data fragmentation degree threshold. The method also includes, and if the data fragmentation degree corresponding to this global chaos area is less than the data fragmentation degree threshold, writing this updated data into this global chaos area and recording the update information corresponding to this logical page in the global chaos area search table.

Description

数据写入方法、存储器控制器与存储器存储装置Data writing method, memory controller and memory storage device

技术领域technical field

本发明涉及一种用于可复写式非易失性存储器的数据写入方法及使用此方法的存储器控制器与存储器存储装置。The invention relates to a data writing method for a rewritable non-volatile memory, a memory controller and a memory storage device using the method.

背景技术Background technique

数字相机、手机与MP3在这几年来的成长十分迅速,使得消费者对存储介质的需求也急速增加。由于可复写式非易失性存储器(rewritable non-volatilememory)具有数据非挥发性、省电、体积小、无机械结构、读写速度快等特性,最适于可携式电子产品,例如笔记型计算机。固态硬盘就是一种以快闪存储器作为存储介质的存储器存储装置。因此,近年快闪存储器产业成为电子产业中相当热门的一环。The rapid growth of digital cameras, mobile phones, and MP3 players has led to a rapid increase in consumer demand for storage media. Because rewritable non-volatile memory (rewritable non-volatile memory) has the characteristics of non-volatile data, power saving, small size, no mechanical structure, and fast read and write speed, it is most suitable for portable electronic products, such as notebooks. computer. A solid state drive is a memory storage device that uses flash memory as a storage medium. Therefore, the flash memory industry has become a very popular part of the electronics industry in recent years.

快闪存储器模块具有多个物理抹除单元(physical erasing unit)且每一物理抹除单元具有多个物理编程单元(physical page),其中在物理抹除单元中写入数据时必须依据物理编程单元的顺序写入数据。此外,已被写入数据的物理编程单元并需先被抹除后才能再次用于写入数据。特别是,物理抹除单元为抹除的最小单位,并且物理编程单元为编程(亦称写入)的最小单元。因此,在快闪存储器模块的管理中,物理抹除单元会被区分为数据区与闲置区。The flash memory module has a plurality of physical erasing units (physical erasing unit) and each physical erasing unit has a plurality of physical programming units (physical pages), wherein when writing data in the physical erasing unit, it must be based on the physical programming unit Write data in order. In addition, the physical programming unit that has been written with data needs to be erased before it can be used to write data again. In particular, the physical erasing unit is the smallest unit of erasing, and the physical programming unit is the smallest unit of programming (also known as writing). Therefore, in the management of the flash memory module, the physical erasing unit is divided into a data area and an idle area.

数据区的物理抹除单元是用以存储主机系统所存储的数据。具体来说,存储器存储装置中的存储器管理电路会将主机系统所存取的逻辑存取地址转换为逻辑区块的逻辑页面并且将逻辑区块的逻辑页面映射至数据区的物理抹除单元的物理编程单元。也就是说,快闪存储器模块的管理上数据区的物理抹除单元是被视为已被使用的物理抹除单元(例如,已存储主机系统所写入的数据)。例如,存储器管理电路会使用逻辑转物理地址映射表来记载逻辑区块与数据区的物理抹除单元的映射关系,其中逻辑区块中的逻辑页面是对应所映射的物理抹除单元的物理编程单元。The physical erasing unit of the data area is used to store data stored in the host system. Specifically, the memory management circuit in the memory storage device will convert the logical access address accessed by the host system into the logical page of the logical block and map the logical page of the logical block to the physical erase unit of the data area. Physical programming unit. That is to say, the physical erasing unit of the management data area of the flash memory module is regarded as the physical erasing unit that has been used (for example, the data written by the host system has been stored). For example, the memory management circuit will use the logical-to-physical address mapping table to record the mapping relationship between the logical block and the physical erasing unit of the data area, wherein the logical page in the logical block is the physical programming corresponding to the mapped physical erasing unit unit.

闲置区的物理抹除单元是用以轮替数据区中的物理抹除单元。具体来说,如上所述,已写入数据的物理抹除单元必须被抹除后才可再次用于写入数据,因此,闲置区的物理抹除单元是被设计用于写入更新数据以替换映射逻辑区块的物理抹除单元。基此,在闲置区中的物理抹除单元为空或可使用的物理抹除单元,即无记录数据或标记为已没用的无效数据。The physical erasing unit in the spare area is used to replace the physical erasing unit in the data area. Specifically, as mentioned above, the physical erasing unit that has written data must be erased before it can be used to write data again. Therefore, the physical erasing unit in the spare area is designed to write update data to Replaces physical erase units that map logical blocks. Based on this, the physical erasing unit in the spare area is an empty or usable physical erasing unit, that is, no recorded data or invalid data marked as useless.

也就是说,数据区与闲置区的物理抹除单元的物理编程单元是以轮替方式来映射逻辑区块的逻辑页面,以存储主机系统所写入的数据。例如,存储器存储装置的存储器管理电路会从闲置区中提取一个或多个物理抹除单元作为全域混乱物理抹除单元,并且当主机系统欲写入更新数据的逻辑存取地址是对应存储器存储装置的某一逻辑区块的某一逻辑页面时,存储器存储装置的存储器管理电路会将此更新数据写入至全域混乱物理抹除单元的物理编程单元中。That is to say, the physical programming unit of the physical erasing unit and the physical programming unit of the data area and the idle area map the logical pages of the logical block in an alternate manner to store the data written by the host system. For example, the memory management circuit of the memory storage device will extract one or more physical erasing units from the spare area as the global chaos physical erasing unit, and when the logical access address of the host system to write update data is the corresponding memory storage device For a certain logical page of a certain logical block, the memory management circuit of the memory storage device will write the update data into the physical programming unit of the global chaos physical erasing unit.

特别是,在存储器存储装置运作期间,当全域混乱物理抹除单元快被耗尽时,存储器存储装置的存储器管理电路会将存储在全域混乱物理抹除单元中的数据整理至对应的物理抹除单元中(以下称为“有效数据合并运作”),以腾出全域混乱物理抹除单元的存储空间,已执行后续的写入指令。在将存储在全域混乱物理抹除单元中的数据整理至对应的物理抹除单元中后,存储器存储装置的存储器管理电路需更新逻辑转物理地址映射表,以使后续的存取运作能够正常被执行。由于存储器存储装置的容量越来越大,因此,一般会使用多个逻辑转物理地址映射表来记录所有逻辑区块与物理抹除单元之间的映射。因此,当需先进行“有效数据合并运作”方能完成来自于主机系统的写入指令时,可能会因为需要多次的进行载入与回存不同的逻辑转物理地址映射表以将全域混乱区搜寻表中的信息记录至逻辑转物理地址映射表,而导致延迟完成此写入指令的时间,造成存储器存储装置的效能低落。In particular, during the operation of the memory storage device, when the global chaos physical erasing unit is almost exhausted, the memory management circuit of the memory storage device will organize the data stored in the global chaos physical erasing unit into the corresponding physical erasure In the unit (hereinafter referred to as "valid data merge operation"), in order to free up the storage space of the global chaos physical erasure unit, the subsequent write command has been executed. After sorting the data stored in the global chaotic physical erasing unit into the corresponding physical erasing unit, the memory management circuit of the memory storage device needs to update the logical-to-physical address mapping table so that subsequent access operations can be normally performed implement. Since the capacity of the memory storage device is getting larger and larger, generally multiple logical-to-physical address mapping tables are used to record the mapping between all logical blocks and physical erasing units. Therefore, when the "effective data merge operation" is required to complete the write command from the host system, it may be necessary to load and restore different logical-to-physical address mapping tables multiple times to confuse the entire domain. The information in the area search table is recorded into the logical-to-physical address mapping table, which delays the completion of the write command, resulting in low performance of the memory storage device.

发明内容Contents of the invention

本发明提供一种数据写入方法、存储器控制器、存储器控制器与存储器存储装置,其能够有效地降低在执行写入指令时因进行全域混乱物理抹除单元有效数据合并运作而造成的延迟。The invention provides a data writing method, a memory controller, a memory controller and a memory storage device, which can effectively reduce the delay caused by combining valid data of global chaos physical erasing units when executing a write command.

本发明一范例实施例提出一种用于写入数据至可复写式非易失性存储器模块的数据写入方法,其中此可复写式非易失性存储器模块具有多个物理抹除单元,每一物理抹除单元具有多个物理编程单元,此些物理抹除单元至少分组为数据区与闲置区,此闲置区的物理抹除单元用以替换数据区的物理抹除单元以写入数据,多个逻辑单元被配置以映射此数据区的物理抹除单元,并且每一逻辑单元具有多个逻辑页面。本数据写入方法包括:从闲置区的物理抹除单元中提取至少一个物理抹除单元作为全域混乱区,其中此全域混乱区用以暂存属于多个已更新逻辑页面的数据,并且此些已更新逻辑页面属在此些逻辑单元之中的多个已更新逻辑单元。本数据写入方法还包括建立全域混乱区搜寻表以记录在全域混乱区中对应此些已更新逻辑页面的多个更新信息。本数据写入方法也包括接收写入指令与对应此写入指令的更新数据,其中此更新数据是属于第一逻辑页面并且第一逻辑页面属在此些逻辑单元之中的第一逻辑单元。本数据写入方法还包括记录对应此全域混乱区的数据零散程度;判断对应此全域混乱区的数据零散程度是否小于数据零散程度阈值;以及倘若对应此全域混乱区的数据零散程度小于数据零散程度阈值时,将此更新数据写入至此全域混乱区中并且在全域混乱区搜寻表中记录对应第一逻辑页面的更新信息。An exemplary embodiment of the present invention provides a data writing method for writing data into a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical erasing units, each A physical erasing unit has a plurality of physical programming units, and these physical erasing units are at least grouped into a data area and an idle area, and the physical erasing unit in the idle area is used to replace the physical erasing unit in the data area to write data, Multiple logical units are configured to map the physical erase units of the data area, and each logical unit has multiple logical pages. The data writing method includes: extracting at least one physical erasing unit from the physical erasing unit in the spare area as a global chaotic area, wherein the global chaotic area is used to temporarily store data belonging to a plurality of updated logical pages, and these The updated logical page belongs to a plurality of updated logical units among the logical units. The data writing method further includes establishing a global chaotic area search table to record a plurality of update information corresponding to the updated logical pages in the global chaotic area. The data writing method also includes receiving a write command and update data corresponding to the write command, wherein the update data belongs to the first logical page and the first logical page belongs to the first logical unit among the logical units. This data writing method also includes recording the fragmentation degree of data corresponding to the global chaos area; judging whether the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold; and if the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree When the threshold is reached, the update data is written into the global chaotic area and the update information corresponding to the first logical page is recorded in the global chaotic area search table.

在本发明的一范例实施例中,上述的数据写入方法还包括:倘若对应此全域混乱区的该数据零散程度非小于数据零散程度阈值时,从闲置区中提取第一物理抹除单元作为对应第一逻辑单元的子物理抹除单元,将更新数据写入至此子物理抹除单元中,并且更新对应第一逻辑单元的逻辑转物理地址映射表,其中此子物理抹除单元只用以存储属于第一逻辑单元的数据。In an exemplary embodiment of the present invention, the above-mentioned data writing method further includes: if the data fragmentation degree corresponding to the global chaos area is not less than the data fragmentation degree threshold, extracting the first physical erasing unit from the spare area as Write update data into the sub-physical erasing unit corresponding to the first logical unit, and update the logic-to-physical address mapping table corresponding to the first logical unit, wherein the sub-physical erasing unit is only used for Data belonging to the first logical unit is stored.

在本发明的一范例实施例中,上述的数据写入方法还包括:将此些逻辑单元分组成多个逻辑区域;以及配置多个逻辑转物理地址映射表以分别地指派给此些逻辑区域,其中此些逻辑转物理地址映射表用以记录此些逻辑区域的逻辑单元与上述数据区的物理抹除单元之间的多个映射关系并且每一逻辑转物理地址映射表被独立地配置给此些逻辑区域的其中之一。In an exemplary embodiment of the present invention, the above-mentioned data writing method further includes: grouping these logical units into multiple logical areas; and configuring multiple logical-to-physical address mapping tables to be assigned to these logical areas respectively , wherein these logical-to-physical address mapping tables are used to record multiple mapping relationships between the logical units of these logical areas and the physical erasing units of the above-mentioned data area, and each logical-to-physical address mapping table is independently configured for One of these logical regions.

在本发明的一范例实施例中,此些已更新逻辑单元属在此些逻辑区域之中的多个已更新逻辑区域。并且,记录对应此全域混乱区的数据零散程度的步骤包括:计算此些已更新逻辑区域的数目;以及记录此些已更新逻辑区域的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, the updated logical units belong to a plurality of updated logical areas in the logical areas. Moreover, the step of recording the fragmentation degree of data corresponding to the global chaotic area includes: calculating the number of the updated logical areas; and recording the number of the updated logical areas as the data fragmentation degree corresponding to the global chaotic area.

在本发明的一范例实施例中,上述记录对应此全域混乱区的数据零散程度的步骤包括:计算上述已更新逻辑单元的数目;以及记录此些已更新逻辑单元的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, the step of recording the data fragmentation degree corresponding to the global chaos area includes: calculating the number of the above-mentioned updated logical units; and recording the number of these updated logical units as the corresponding global chaos area Fragmentation of data.

在本发明的一范例实施例中,上述记录对应此全域混乱区的数据零散程度的步骤包括:计算多个待更新逻辑转物理地址映射表的数目以及记录此些待更新逻辑转物理地址映射表的数目作为对应全域混乱区的数据零散程度,其中此些待更新逻辑转物理地址映射表用以记录上述已更新逻辑单元与上述数据区的物理抹除单元之间的映射。In an exemplary embodiment of the present invention, the step of recording the degree of fragmentation of data corresponding to the global chaotic area includes: calculating the number of multiple logical-to-physical address mapping tables to be updated and recording these logical-to-physical address mapping tables to be updated The number is used as the fragmentation degree of data corresponding to the global chaotic area, wherein the logical-to-physical address mapping tables to be updated are used to record the mapping between the updated logical unit and the physical erasing unit of the data area.

在本发明的一范例实施例中,上述数据写入方法,还包括:判断全域混乱区中是否存有属于上述第一逻辑单元的有效数据;以及若全域混乱区中存有属于上述第一逻辑单元的有效数据时,将上述更新数据写入至全域混乱区中,其中上述判断对应全域混乱区的数据零散程度是否小于数据零散程度阈值的步骤是在全域混乱区中未存有属于上述第一逻辑单元的有效数据时被执行。In an exemplary embodiment of the present invention, the above-mentioned data writing method further includes: judging whether there is valid data belonging to the first logic unit in the global chaos area; and if there is valid data belonging to the first logic unit in the global chaos area When there is valid data in the unit, write the above-mentioned update data into the global chaos area, wherein the step of judging whether the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold is that there is no data belonging to the above-mentioned first Executed when there is valid data for the logical unit.

本发明一范例实施例提出一种用于控制可复写式非易失性存储器模块的存储器控制器,其中可复写式非易失性存储器模块具有多个物理抹除单元,每一物理抹除单元具有多个物理编程单元,此些物理抹除单元至少分组为数据区与闲置区,闲置区的物理抹除单元用以替换数据区的物理抹除单元以写入数据。存储器控制器包括主机接口、存储器接口与存储器管理电路。主机接口用以电性连接至主机系统。存储器接口用以电性连接至可复写式非易失性存储器模块。存储器管理电路电性连接至主机接口与存储器接口,并且用以配置多个逻辑单元以映射数据区的这些物理抹除单元,其中每一逻辑单元具有多个逻辑页面。此外,存储器管理电路还用以从闲置区的物理抹除单元中提取至少一个物理抹除单元作为全域混乱区,其中此全域混乱区用以暂存属于多个已更新逻辑页面的数据,并且此些已更新逻辑页面属于上述逻辑单元之中的多个已更新逻辑单元。另外,存储器管理电路还用以建立全域混乱区搜寻表以记录在此全域混乱区中对应此些已更新逻辑页面的多个更新信息。在此,存储器管理电路还用以接收写入指令与对应此写入指令的更新数据,此更新数据是属于第一逻辑页面并且第一逻辑页面属于第一逻辑单元。再者,存储器管理电路还用以记录对应全域混乱区的数据零散程度并且判断对应全域混乱区的数据零散程度是否小于数据零散程度阈值。倘若对应全域混乱区的数据零散程度小于数据零散程度阈值时,存储器管理电路将更新数据写入至全域混乱区中并且在全域混乱区搜寻表中记录对应第一逻辑页面的更新信息。An exemplary embodiment of the present invention provides a memory controller for controlling a rewritable non-volatile memory module, wherein the rewritable non-volatile memory module has a plurality of physical erasing units, and each physical erasing unit There are a plurality of physical programming units, and these physical erasing units are at least grouped into a data area and an idle area, and the physical erasing units in the idle area are used to replace the physical erasing units in the data area to write data. The memory controller includes a host interface, a memory interface and a memory management circuit. The host interface is used to electrically connect to the host system. The memory interface is used for electrically connecting to the rewritable non-volatile memory module. The memory management circuit is electrically connected to the host interface and the memory interface, and is used to configure a plurality of logical units to map the physical erasing units of the data area, wherein each logical unit has a plurality of logical pages. In addition, the memory management circuit is also used to extract at least one physical erasing unit from the physical erasing unit in the spare area as a global chaos area, wherein the global chaos area is used to temporarily store data belonging to a plurality of updated logical pages, and this These updated logical pages belong to a plurality of updated logical units among the above logical units. In addition, the memory management circuit is also used to establish a global chaotic area lookup table to record a plurality of update information corresponding to the updated logical pages in the global chaotic area. Here, the memory management circuit is further configured to receive a write command and update data corresponding to the write command, the update data belongs to the first logical page and the first logical page belongs to the first logical unit. Furthermore, the memory management circuit is also used for recording the data fragmentation degree corresponding to the global chaos area and judging whether the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold. If the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold, the memory management circuit writes update data into the global chaos area and records update information corresponding to the first logical page in the global chaos area search table.

在本发明的一范例实施例中,倘若对应此全域混乱区的该数据零散程度非小于数据零散程度阈值时,上述存储器管理电路从闲置区中提取第一物理抹除单元作为对应第一逻辑单元的子物理抹除单元,将更新数据写入至此子物理抹除单元中,并且更新对应第一逻辑单元的逻辑转物理地址映射表,其中此子物理抹除单元只用以存储属于第一逻辑单元的数据。In an exemplary embodiment of the present invention, if the data fragmentation degree corresponding to the global chaos area is not less than the data fragmentation degree threshold, the memory management circuit extracts the first physical erasing unit from the idle area as the corresponding first logical unit Sub-physical erasing unit, write update data into this sub-physical erasing unit, and update the logical-to-physical address mapping table corresponding to the first logical unit, wherein this sub-physical erasing unit is only used to store data belonging to the first logical unit unit's data.

在本发明的一范例实施例中,上述存储器管理电路还用以将此些逻辑单元分组成多个逻辑区域以及配置多个逻辑转物理地址映射表以分别地指派给此些逻辑区域,其中此些逻辑转物理地址映射表用以记录此些逻辑区域的逻辑单元与上述数据区的物理抹除单元之间的多个映射并且每一逻辑转物理地址映射表被独立地配置给此些逻辑区域的其中之一。In an exemplary embodiment of the present invention, the above-mentioned memory management circuit is further used to group these logical units into multiple logical areas and configure multiple logical-to-physical address mapping tables to be respectively assigned to these logical areas, wherein the These logical-to-physical address mapping tables are used to record multiple mappings between the logical units of these logical areas and the physical erasing units of the above-mentioned data area, and each logical-to-physical address mapping table is independently configured for these logical areas one of the .

在本发明的一范例实施例中,此些已更新逻辑单元属在此些逻辑区域之中的多个已更新逻辑区域。并且,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器管理电路计算此些已更新逻辑区域的数目并且记录此些已更新逻辑区域的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, the updated logical units belong to a plurality of updated logical areas in the logical areas. And, in the operation of recording the data fragmentation degree corresponding to the global chaos area, the memory management circuit calculates the number of these updated logical areas and records the number of these updated logical areas as the data fragmentation degree corresponding to the global chaos area .

在本发明的一范例实施例中,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器管理电路计算上述已更新逻辑单元的数目并且记录此些已更新逻辑单元的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, during the operation of recording the fragmentation degree of data corresponding to the global chaotic area, the memory management circuit calculates the number of updated logical units and records the number of updated logical units as a corresponding The degree of fragmentation of data in the global chaotic area.

在本发明的一范例实施例中,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器管理电路计算多个待更新逻辑转物理地址映射表的数目并且记录此些待更新逻辑转物理地址映射表的数目作为对应全域混乱区的数据零散程度,其中此些待更新逻辑转物理地址映射表用以记录上述已更新逻辑单元与上述数据区的物理抹除单元之间的映射。In an exemplary embodiment of the present invention, during the operation of recording the fragmentation degree of data corresponding to the global chaotic area, the memory management circuit calculates the number of multiple logic-to-physical address mapping tables to be updated and records the logic to be updated The number of the physical address mapping table is used as the fragmentation degree of the data corresponding to the global chaotic area, wherein the logical to physical address mapping tables to be updated are used to record the mapping between the updated logical unit and the physical erasing unit of the data area.

在本发明的一范例实施例中,存储器管理电路还用以判断全域混乱区中是否存有属于上述第一逻辑单元的有效数据,其中若全域混乱区中存有属于上述第一逻辑单元的有效数据时,存储器管理电路将上述更新数据写入至全域混乱区中,其中存储器管理电路是在全域混乱区中未存有属于第一逻辑单元的有效数据时执行上述判断对应全域混乱区的数据零散程度是否小于数据零散程度阈值的运作。In an exemplary embodiment of the present invention, the memory management circuit is further used to determine whether there is valid data belonging to the first logic unit in the global chaos area, wherein if there is valid data belonging to the first logic unit in the global chaos area data, the memory management circuit writes the update data into the global chaos area, wherein the memory management circuit performs the above judgment when there is no valid data belonging to the first logic unit in the global chaos area. Whether the degree is less than the threshold of data fragmentation degree.

本发明一范例实施例提出一种存储器存储装置,其包括连接器、可复写式非易失性存储器模块与存储器控制器。连接器用以电性连接至主机系统。可复写式非易失性存储器模块具有多个物理抹除单元,每一物理抹除单元具有多个物理编程单元,此些物理抹除单元至少分组为数据区与闲置区,且闲置区的物理抹除单元用以替换数据区的物理抹除单元以写入数据。存储器控制器电性连接至连接器与可复写式非易失性存储器模块,并且用以配置多个逻辑单元以映射数据区的这些物理抹除单元,其中每一逻辑单元具有多个逻辑页面。此外,存储器控制器还用以从闲置区的物理抹除单元中提取至少一个物理抹除单元作为全域混乱区,其中此全域混乱区用以暂存属于多个已更新逻辑页面的数据,并且此些已更新逻辑页面属于上述逻辑单元之中的多个已更新逻辑单元。另外,存储器控制器还用以建立全域混乱区搜寻表以记录在此全域混乱区中对应此些已更新逻辑页面的多个更新信息。在此,存储器控制器还用以接收写入指令与对应此写入指令的更新数据,此更新数据是属于第一逻辑页面并且第一逻辑页面属于第一逻辑单元。再者,存储器控制器还用以记录对应全域混乱区的数据零散程度并且判断对应全域混乱区的数据零散程度是否小于数据零散程度阈值。倘若对应全域混乱区的数据零散程度小于数据零散程度阈值时,存储器控制器将更新数据写入至全域混乱区中并且在全域混乱区搜寻表中记录对应第一逻辑页面的更新信息。An exemplary embodiment of the present invention provides a memory storage device, which includes a connector, a rewritable non-volatile memory module, and a memory controller. The connector is used to electrically connect to the host system. The rewritable non-volatile memory module has a plurality of physical erasing units, and each physical erasing unit has a plurality of physical programming units. These physical erasing units are at least grouped into a data area and an idle area, and the physical area of the idle area is The erasing unit is used to replace the physical erasing unit of the data area to write data. The memory controller is electrically connected to the connector and the rewritable non-volatile memory module, and is used to configure a plurality of logical units to map the physical erasing units of the data area, wherein each logical unit has a plurality of logical pages. In addition, the memory controller is also used to extract at least one physical erasing unit from the physical erasing unit in the spare area as a global chaotic area, wherein the global chaotic area is used to temporarily store data belonging to a plurality of updated logical pages, and this These updated logical pages belong to a plurality of updated logical units among the above logical units. In addition, the memory controller is also used to establish a global chaotic area lookup table to record a plurality of update information corresponding to the updated logical pages in the global chaotic area. Here, the memory controller is further configured to receive a write command and update data corresponding to the write command, the update data belongs to the first logical page and the first logical page belongs to the first logical unit. Furthermore, the memory controller is also used to record the data fragmentation degree corresponding to the global chaos area and determine whether the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold. If the data fragmentation degree corresponding to the global chaos area is less than the data fragmentation degree threshold, the memory controller writes update data into the global chaos area and records update information corresponding to the first logical page in the global chaos area search table.

在本发明之一范例实施例中,倘若对应此全域混乱区的该数据零散程度非小于数据零散程度阈值时,上述存储器控制器从闲置区中提取第一物理抹除单元作为对应第一逻辑单元的子物理抹除单元,将更新数据写入至对应第一逻辑单元的子物理抹除单元中,并且更新对应第一逻辑单元的逻辑转物理地址映射表,其中此子物理抹除单元只用以存储属于第一逻辑单元的数据。In an exemplary embodiment of the present invention, if the data fragmentation degree corresponding to the global chaos area is not less than the data fragmentation degree threshold, the memory controller extracts the first physical erasing unit from the spare area as the corresponding first logical unit sub-physical erasing unit, write update data into the sub-physical erasing unit corresponding to the first logical unit, and update the logic-to-physical address mapping table corresponding to the first logical unit, wherein the sub-physical erasing unit only uses to store data belonging to the first logical unit.

在本发明的一范例实施例中,上述存储器控制器还用以将此些逻辑单元分组成多个逻辑区域以及配置多个逻辑转物理地址映射表以分别地指派给此些逻辑区域,其中此些逻辑转物理地址映射表用以记录此些逻辑区域的逻辑单元与上述数据区的物理抹除单元之间的多个映射关系并且每一逻辑转物理地址映射表被独立地配置给此些逻辑区域的其中之一。In an exemplary embodiment of the present invention, the above-mentioned memory controller is further configured to group these logical units into multiple logical areas and configure multiple logical-to-physical address mapping tables to be respectively assigned to these logical areas, wherein the These logical-to-physical address mapping tables are used to record multiple mapping relationships between the logical units of these logical areas and the physical erasing units of the above-mentioned data area, and each logical-to-physical address mapping table is independently configured for these logical one of the regions.

在本发明的一范例实施例中,此些已更新逻辑单元属在此些逻辑区域之中的多个已更新逻辑区域。并且,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器控制器计算此些已更新逻辑区域的数目并且记录此些已更新逻辑区域的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, the updated logical units belong to a plurality of updated logical areas in the logical areas. And, in the operation of recording the data fragmentation degree corresponding to the global chaos area, the above-mentioned memory controller calculates the number of these updated logical areas and records the number of these updated logical areas as the data fragmentation degree corresponding to the global chaos area .

在本发明的一范例实施例中,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器控制器计算上述已更新逻辑单元的数目并且记录此些已更新逻辑单元的数目作为对应全域混乱区的数据零散程度。In an exemplary embodiment of the present invention, during the operation of recording the fragmentation degree of data corresponding to the global chaotic area, the memory controller calculates the number of updated logical units and records the number of updated logical units as a corresponding The degree of fragmentation of data in the global chaotic area.

在本发明的一范例实施例中,在上述记录对应此全域混乱区的数据零散程度的运作中,上述存储器控制器计算多个待更新逻辑转物理地址映射表的数目并且记录此些待更新逻辑转物理地址映射表的数目作为对应全域混乱区的数据零散程度,其中此些待更新逻辑转物理地址映射表用以记录上述已更新逻辑单元与上述数据区的物理抹除单元之间的映射。In an exemplary embodiment of the present invention, during the operation of recording the degree of fragmentation of data corresponding to the global chaotic area, the memory controller calculates the number of a plurality of logic-to-physical address mapping tables to be updated and records the logic to be updated The number of the physical address mapping table is used as the fragmentation degree of the data corresponding to the global chaotic area, wherein the logical to physical address mapping tables to be updated are used to record the mapping between the updated logical unit and the physical erasing unit of the data area.

在本发明的一范例实施例中,存储器控制器还用以判断全域混乱区中是否存有属于上述第一逻辑单元的有效数据,其中若全域混乱区中存有属于上述第一逻辑单元的有效数据时,存储器控制器将上述更新数据写入至全域混乱区中,其中存储器控制器是在全域混乱区中未存有属于第一逻辑单元的有效数据时执行上述判断对应全域混乱区的数据零散程度是否小于数据零散程度阈值的运作。In an exemplary embodiment of the present invention, the memory controller is also used to determine whether there is valid data belonging to the first logic unit in the global chaos area, wherein if there is valid data belonging to the first logic unit in the global chaos area data, the memory controller writes the update data into the global chaos area, wherein the memory controller executes the above judgment when there is no valid data belonging to the first logical unit in the global chaos area. Whether the degree is less than the threshold of data fragmentation degree.

基于上述,本发明范例实施例的数据写入方法、存储器控制器与存储器存储装置能够避免在执行全域混乱物理抹除单元有效数据合并运作时耗费过多时间于更新逻辑转物理地址映射表,由此提升执行写入指令的速度。Based on the above, the data writing method, the memory controller, and the memory storage device of the exemplary embodiments of the present invention can avoid spending too much time on updating the logical-to-physical address mapping table when performing the global chaos physical erasing unit effective data combination operation, by This increases the speed at which write instructions are executed.

为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。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 shows 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 of the present invention.

图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.

图4是绘示图1所示的存储器存储装置的概要方块图。FIG. 4 is a schematic block diagram illustrating the memory storage device shown in FIG. 1 .

图5是根据一范例实施例所绘示的存储器控制器的概要方块图。FIG. 5 is a schematic block diagram of a memory controller according to an exemplary embodiment.

图6与图7是根据第一范例实施例所绘示的管理物理区块的范例示意图。FIG. 6 and FIG. 7 are exemplary schematic diagrams of managing physical blocks according to the first exemplary embodiment.

图8~14是绘示使用全域混乱区写入数据的简化范例。8-14 illustrate simplified examples of writing data using the global chaos area.

图15是根据图14所绘示的全域混乱区搜寻表的简化范例。FIG. 15 is a simplified example of the global chaos area search table shown in FIG. 14 .

图16~21是绘示执行全域混乱区有效数据合并程序以完成后续写入指令的简化范例。FIGS. 16-21 illustrate simplified examples of executing the global chaotic area valid data merging process to complete subsequent write commands.

图22~图24是绘示的使用子物理单元来写入更新数据的范例。FIGS. 22 to 24 illustrate examples of using sub-physical units to write update data.

图25是根据一范例实施例所绘示的数据写入方法的流程图。FIG. 25 is a flowchart of a data writing method according to an exemplary embodiment.

【符号说明】【Symbol Description】

1000:主机系统1000: host system

1100:计算机1100: computer

1102:微处理器1102: Microprocessor

1104:随机存取存储器1104: random access memory

1106:输入/输出装置1106: Input/Output Device

1108:系统总线1108: System bus

1110:数据传输接口1110: data transmission interface

1202:鼠标1202: mouse

1204:键盘1204: keyboard

1206:显示器1206: display

1208:打印机1208: Printer

1212:随身碟1212: Pen drive

1214:存储卡1214: memory card

1216:固态硬盘1216: SSD

1310:数字相机1310: Digital camera

1312:SD卡1312: SD card

1314:MMC卡1314: MMC card

1316:记忆棒1316: memory stick

1318:CF卡1318: CF card

1320:嵌入式存储装置1320: Embedded storage device

100:存储器存储装置100: memory storage device

102:连接器102: Connector

104:存储器控制器104: memory controller

106:可复写式非易失性存储器模块106: Rewritable non-volatile memory module

202:存储器管理电路202: memory management circuit

204:主机接口204: host interface

206:存储器接口206: memory interface

208:缓冲存储器208: buffer memory

210:电源管理电路210: power management circuit

212:错误检查与校正电路212: Error checking and correction circuit

410(0)~410(N):物理抹除单元410(0)~410(N): physical erasing unit

502:系统区502: System area

504:数据区504: data area

506:闲置区506: idle area

508:取代区508: Replacement area

550:全域混乱区550: Global Chaos Zone

LBA(0)~LBA(H):逻辑单元LBA(0)~LBA(H): logic unit

LZ(0)~LZ(M):逻辑区域LZ(0)~LZ(M): logical area

800:全域混乱区搜寻表800: Global Chaos Area Search Table

810(0)~810(4):根单元810(0)~810(4): root unit

902:第一栏位902: First field

904:第二栏位904: Second field

906:第三栏位906: The third field

S2501、S2503、S2505、S2507、S2509、S2511:数据写入方法的步骤S2501, S2503, S2505, S2507, S2509, S2511: steps of data writing 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). 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是根据一范例实施例所绘示的主机系统与存储器存储装置。FIG. 1 shows a host system and a memory storage device according to an exemplary embodiment.

请参照图1,主机系统1000一般包括计算机1100与输入/输出(input/output,I/O)装置1106。计算机1100包括微处理器1102、随机存取存储器(random access memory,RAM)1104、系统总线1108与数据传输接口1110。输入/输出装置1106包括如图2的鼠标1202、键盘1204、显示器1206与打印机1208。必须了解的是,图2所示的装置非限制输入/输出装置1106,输入/输出装置1106可还包括其他装置。Referring to FIG. 1 , the host system 1000 generally includes a computer 1100 and an input/output (I/O) device 1106 . The computer 1100 includes a microprocessor 1102 , a random access memory (random access memory, RAM) 1104 , a system bus 1108 and a data transmission interface 1110 . The input/output device 1106 includes a mouse 1202 , a keyboard 1204 , a monitor 1206 and a printer 1208 as shown in FIG. 2 . It must be understood that the device shown in FIG. 2 is not limited to the input/output device 1106, and the input/output device 1106 may also include other devices.

在本发明实施例中,存储器存储装置100是通过数据传输接口1110与主机系统1000的其他元件电性连接。通过微处理器1102、随机存取存储器1104与输入/输出装置1106的运作可将数据写入至存储器存储装置100或从存储器存储装置100中读取数据。例如,存储器存储装置100可以是如图2所示的随身碟1212、存储卡1214或固态硬盘(Solid State Drive,SSD)1216等的可复写式非易失性存储器存储装置。In the embodiment of the present invention, the memory storage device 100 is electrically connected with other components of the host system 1000 through the data transmission interface 1110 . Data can be written into or read from the memory storage device 100 through the operation of the microprocessor 1102 , the random access memory 1104 and the input/output device 1106 . For example, the memory storage device 100 may be a rewritable non-volatile memory storage device such as a flash drive 1212, a memory card 1214, or a solid state drive (Solid State Drive, SSD) 1216 as shown in FIG. 2 .

一般而言,主机系统1000为可实质地与存储器存储装置100配合以存储数据的任意系统。虽然在本范例实施例中,主机系统1000是以计算机系统来作说明,然而,在本发明另一范例实施例中主机系统1000可以是数字相机、摄像机、通信装置、音频播放器或视频播放器等系统。例如,在主机系统为数字相机(摄像机)1310时,可复写式非易失性存储器存储装置则为其所使用的SD卡1312、MMC卡1314、记忆棒(memory stick)1316、CF卡1318或嵌入式存储装置1320(如图3所示)。嵌入式存储装置1320包括嵌入式多媒体卡(Embedded MMC,eMMC)。值得一提的是,嵌入式多媒体卡是直接电性连接于主机系统的基板上。In general, host system 1000 is any system that can cooperate substantially with memory storage device 100 to store data. Although in this exemplary embodiment, the host system 1000 is illustrated as a computer system, however, in another exemplary embodiment of the present invention, the host system 1000 may be a digital camera, video camera, communication device, audio player or video player and other systems. For example, when the host system is a digital camera (video camera) 1310, the rewritable non-volatile memory storage device is an SD card 1312, an MMC card 1314, a memory stick (memory stick) 1316, a CF card 1318 or An embedded storage device 1320 (as shown in FIG. 3 ). The embedded storage device 1320 includes an embedded multimedia card (Embedded MMC, eMMC). It is worth mentioning that the embedded multimedia card is directly electrically connected to the substrate of the host system.

图4是绘示图1所示的存储器存储装置的概要方块图。FIG. 4 is a schematic block diagram illustrating the memory storage device shown in FIG. 1 .

请参照图4,存储器存储装置100包括连接器102、存储器控制器104与可复写式非易失性存储器模块106。Referring to FIG. 4 , the memory storage device 100 includes a connector 102 , a memory controller 104 and a rewritable non-volatile memory module 106 .

在本范例实施例中,连接器102是相容于串行先进附件(Serial AdvancedTechnology Attachment,SATA)标准。然而,必须了解的是,本发明不限于此,连接器102也可以是符合并行先进附件(Parellel 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)接口标准、多媒体存储卡(MultiMedia Card,MMC)接口标准、小型快闪(Compact Flash,CF)接口标准、整合式驱动电子接口(Integrated Device Electronics,IDE)标准或其他适合的标准。In this exemplary embodiment, the connector 102 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 connector 102 may also be a high-speed, high-speed Peripheral Component Interconnect Express (PCI Express) standard, Universal Serial Bus (Universal Serial Bus, USB) standard, Ultra High Speed-I (UHS-I) interface standard, Ultra High Speed II (Ultra High Speed-II, UHS-II) interface standard, Secure Digital (Secure Digital, SD) interface standard, Memory Stick (Memory Stick, MS) interface standard, multimedia memory card (MultiMedia Card, MMC) interface standard, small flash (Compact Flash, CF) interface standard, Integrated Device Electronics (IDE) standard, or other suitable standards.

存储器控制器104用以执行以硬件形式或固件形式实作的多个逻辑门或控制指令,并且根据主机系统1000的指令在可复写式非易失性存储器模块106中进行数据的写入、读取与抹除等运作。The memory controller 104 is used to execute a plurality of logic gates or control instructions implemented in the form of hardware or firmware, and write and read data in the rewritable non-volatile memory module 106 according to the instructions of the host system 1000 Fetch and erase operations.

可复写式非易失性存储器模块106是电性连接至存储器控制器104,并且用以存储主机系统1000所写入的数据。可复写式非易失性存储器模块106具有物理抹除单元410(0)~410(N)。例如,物理抹除单元410(0)~410(N)可属于同一个存储器晶粒(die)或者属于不同的存储器晶粒。每一物理抹除单元分别具有多个物理编程单元,其中属于同一个物理抹除单元的物理编程单元可被独立地写入且被同时地抹除。然而,必须了解的是,本发明不限于此,每一物理抹除单元是可由64个物理编程单元、256个物理编程单元或其他任意个物理编程单元所组成。The rewritable non-volatile memory module 106 is electrically connected to the memory controller 104 and used for storing data written by the host system 1000 . The rewritable non-volatile memory module 106 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.

更详细来说,物理抹除单元为抹除的最小单位。亦即,每一物理抹除单元含有最小数目之一并被抹除的记忆胞。物理编程单元为编程的最小单元。即,物理编程单元为写入数据的最小单元。每一物理编程单元通常包括数据位区与冗余位区。数据位区包含多个物理存取地址用以存储使用者的数据,而冗余位区用以存储系统的数据(例如,控制信息与错误更正码)。在本范例实施例中,每一个物理编程单元的数据位区中会包含4个物理存取地址,且一个物理存取地址的大小为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 field and a redundant bit field. The data bit area contains multiple physical access addresses to store user data, and the redundant bit area is used to store system data (eg, control information and error correction code). In this exemplary embodiment, the data bit area of each physical programming unit includes 4 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.

在本范例实施例中,可复写式非易失性存储器模块106为多阶记忆胞(Multi Level Cell,MLC)NAND型快闪存储器模块(即,一个记忆胞中可存储2个位数据的快闪存储器模块)。然而,本发明不限于此,可复写式非易失性存储器模块106也可是单阶记忆胞(Single Level Cell,SLC)NAND型快闪存储器模块(即,一个记忆胞中可存储1个位数据的快闪存储器模块)、多阶记忆胞(Trinary Level Cell,TLC)NAND型快闪存储器模块(即,一个记忆胞中可存储3个位数据的快闪存储器模块)、其他快闪存储器模块或其他具有相同特性的存储器模块。In this exemplary embodiment, the rewritable non-volatile memory module 106 is a multi-level memory cell (Multi Level Cell, MLC) NAND flash memory module (that is, a memory cell can store 2 bits of data flash flash memory module). However, the present invention is not limited thereto, and the rewritable non-volatile memory module 106 may also be a single-level memory cell (Single Level Cell, SLC) NAND flash memory module (that is, one memory cell can store 1 bit of data flash memory module), multi-level memory cell (Trinary Level Cell, TLC) NAND flash memory module (that is, a flash memory module that can store 3 bits of data in a memory cell), other flash memory modules or Other memory modules with the same characteristics.

图5是根据一范例实施例所绘示的存储器控制器的概要方块图。FIG. 5 is a schematic block diagram of a memory controller according to an exemplary embodiment.

请参照图5,存储器控制器104包括存储器管理电路202、主机接口204与存储器接口206。Referring to FIG. 5 , the memory controller 104 includes a memory management circuit 202 , a host interface 204 and a memory interface 206 .

存储器管理电路202用以控制存储器控制器104的整体运作。具体来说,存储器管理电路202具有多个控制指令,并且在存储器存储装置100运作时,此些控制指令会被执行以进行数据的写入、读取与抹除等运作。The memory management circuit 202 is used to control the overall operation of the memory controller 104 . Specifically, the memory management circuit 202 has a plurality of control instructions, and when the memory storage device 100 is operating, these control instructions are executed to perform operations such as writing, reading, and erasing data.

在本范例实施例中,存储器管理电路202的控制指令是以固件形式来实作。例如,存储器管理电路202具有微处理器单元(未绘示)与只读存储器(未绘示),并且此些控制指令是被烧录至此只读存储器中。当存储器存储装置100运作时,此些控制指令会由微处理器单元来执行以进行数据的写入、读取与抹除等运作。In this exemplary embodiment, the control commands of the memory management circuit 202 are implemented in the form of firmware. For example, the memory management circuit 202 has a microprocessor unit (not shown) and a ROM (not shown), and these control instructions are burned into the ROM. When the memory storage device 100 is in operation, these control instructions will be executed by the microprocessor unit to perform operations such as writing, reading and erasing data.

在本发明另一范例实施例中,存储器管理电路202的控制指令也可以程序代码形式存储于可复写式非易失性存储器模块106的特定区域(例如,存储器模块中专用于存放系统数据的系统区)中。此外,存储器管理电路202具有微处理器单元(未绘示)、只读存储器(未绘示)及随机存取存储器(未绘示)。特别是,此只读存储器具有驱动码,并且当存储器控制器104被致能时,微处理器单元会先执行此驱动码段来将存储于可复写式非易失性存储器模块106中的控制指令载入至存储器管理电路202的随机存取存储器中。之后,微处理器单元会运转此些控制指令以进行数据的写入、读取与抹除等运作。In another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 may also be stored in a specific area of the rewritable non-volatile memory module 106 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 202 has a microprocessor unit (not shown), a read only memory (not shown) and a random access memory (not shown). In particular, the ROM has driver code, and when the memory controller 104 is enabled, the microprocessor unit will first execute the driver code segment to store the control code stored in the rewritable non-volatile memory module 106. The instructions are loaded into random access memory of the memory management circuit 202 . Afterwards, the microprocessor unit runs these control instructions to perform operations such as writing, reading and erasing data.

此外,在本发明另一范例实施例中,存储器管理电路202的控制指令也可以一硬件形式来实作。例如,存储器管理电路202包括微控制器、记忆胞管理电路、存储器写入电路、存储器读取电路、存储器抹除电路与数据处理电路。记忆胞管理电路、存储器写入电路、存储器读取电路、存储器抹除电路与数据处理电路是电性连接至微控制器。其中,记忆胞管理电路用以管理可复写式非易失性存储器模块106的物理抹除单元;存储器写入电路用以对可复写式非易失性存储器模块106下达写入指令以将数据写入至可复写式非易失性存储器模块106中;存储器读取电路用以对可复写式非易失性存储器模块106下达读取指令以从可复写式非易失性存储器模块106中读取数据;存储器抹除电路用以对可复写式非易失性存储器模块106下达抹除指令以将数据从可复写式非易失性存储器模块106中抹除;而数据处理电路用以处理欲写入至可复写式非易失性存储器模块106的数据以及从可复写式非易失性存储器模块106中读取的数据。In addition, in another exemplary embodiment of the present invention, the control instructions of the memory management circuit 202 may also be implemented in a hardware form. For example, the memory management circuit 202 includes a microcontroller, a memory cell management circuit, a memory writing circuit, a memory reading circuit, a memory erasing circuit and a data processing circuit. The memory cell 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 memory cell management circuit is used to manage the physical erasing unit of the rewritable non-volatile memory module 106; the memory write circuit is used to issue a write command to the rewritable non-volatile memory module 106 to write data into the rewritable nonvolatile memory module 106; the memory read circuit is used to issue a read instruction to the rewritable nonvolatile memory module 106 to read from the rewritable nonvolatile memory module 106 Data; the memory erasing circuit is used to issue an erase command to the rewritable non-volatile memory module 106 to erase data from the rewritable non-volatile memory module 106; and the data processing circuit is used to process the data to be written Data input to the rewritable non-volatile memory module 106 and data read from the rewritable non-volatile memory module 106.

主机接口204是电性连接至存储器管理电路202并且用以接收与识别主机系统1000所传送的指令与数据。也就是说,主机系统1000所传送的指令与数据会通过主机接口204来传送至存储器管理电路202。在本范例实施例中,主机接口204是相容于SATA标准。然而,必须了解的是本发明不限于此,主机接口204也可以是相容于PATA标准、IEEE1394标准、PCI Express标准、USB标准、UHS-I接口标准、UHS-II接口标准、SD标准、MS标准、MMC标准、CF标准、IDE标准或其他适合的数据传输标准。The host interface 204 is electrically connected to the memory management circuit 202 and used for receiving and identifying commands and data transmitted by the host system 1000 . That is to say, the commands and data transmitted by the host system 1000 are transmitted to the memory management circuit 202 through the host interface 204 . In this exemplary embodiment, the host interface 204 is compatible with the SATA standard. However, it must be understood that the present invention is not limited thereto, and the host interface 204 can also be compatible with PATA standard, IEEE1394 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.

存储器接口206是电性连接至存储器管理电路202并且用以存取可复写式非易失性存储器模块106。也就是说,欲写入至可复写式非易失性存储器模块106的数据会经由存储器接口206转换为可复写式非易失性存储器模块106所能接受的格式。The memory interface 206 is electrically connected to the memory management circuit 202 and used for accessing the rewritable non-volatile memory module 106 . That is to say, the data to be written into the rewritable nonvolatile memory module 106 will be converted into a format acceptable to the rewritable nonvolatile memory module 106 via the memory interface 206 .

在本发明一范例实施例中,存储器控制器104还包括缓冲存储器208、电源管理电路210与错误检查与校正电路212。In an exemplary embodiment of the present invention, the memory controller 104 further includes a buffer memory 208 , a power management circuit 210 and an error checking and correction circuit 212 .

缓冲存储器208是电性连接至存储器管理电路202并且用以暂存来自于主机系统1000的数据与指令或来自于可复写式非易失性存储器模块106的数据。The buffer memory 208 is electrically connected to the memory management circuit 202 and used for temporarily storing data and instructions from the host system 1000 or data from the rewritable non-volatile memory module 106 .

电源管理电路210是电性连接至存储器管理电路202并且用以控制存储器存储装置100的电源。The power management circuit 210 is electrically connected to the memory management circuit 202 and used to control the power of the memory storage device 100 .

错误检查与校正电路212是电性连接至存储器管理电路202并且用以执行错误检查与校正程序以确保数据的正确性。具体来说,当存储器管理电路202从主机系统1000中接收到写入指令时,错误检查与校正电路212会为对应此写入指令的数据产生对应的错误检查与校正码(Error Checking andCorrecting Code,ECC Code),并且存储器管理电路202会将对应此写入指令的数据与对应的错误检查与校正码写入至可复写式非易失性存储器模块106中。之后,当存储器管理电路202从可复写式非易失性存储器模块106中读取数据时会同时读取此数据对应的错误检查与校正码,并且错误检查与校正电路212会依据此错误检查与校正码对所读取的数据执行错误检查与校正程序。The error checking and correcting circuit 212 is electrically connected to the memory management circuit 202 and used for executing error checking and correcting procedures to ensure the correctness of data. Specifically, when the memory management circuit 202 receives a write command from the host system 1000, the error checking and correction circuit 212 will generate a corresponding error checking and correcting code (Error Checking and Correcting Code, ECC Code), and the memory management circuit 202 will write the data corresponding to the write command and the corresponding error checking and correction code into the rewritable non-volatile memory module 106. Afterwards, when the memory management circuit 202 reads data from the rewritable non-volatile memory module 106, it will simultaneously read the error checking and correction code corresponding to the data, and the error checking and correction circuit 212 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.

图6与图7是根据第一范例实施例所绘示的管理物理抹除单元的范例示意图。FIG. 6 and FIG. 7 are schematic diagrams illustrating examples of managing physical erasing units according to the first exemplary embodiment.

请参照图6,存储器控制器104(或存储器管理电路202)会将物理抹除单元410(0)~410-(N)逻辑地分组为数据区502、闲置区504、系统区506与取代区508。Referring to FIG. 6, the memory controller 104 (or the memory management circuit 202) will logically group the physical erasing units 410(0)-410-(N) into a data area 502, an idle area 504, a system area 506, and a replacement area. 508.

逻辑上属于数据区502与闲置区504的物理抹除单元是用以存储来自于主机系统1000的数据。具体来说,数据区502的物理抹除单元是被视为已存储数据的物理抹除单元,而闲置区504的物理抹除单元是用以替换数据区502的物理抹除单元。也就是说,当从主机系统1000接收到写入指令与欲写入的数据时,存储器管理电路202会从闲置区504中提取物理抹除单元,并且将数据写入至所提取的物理抹除单元中,以替换数据区502的物理抹除单元。The physical erase units logically belonging to the data area 502 and the free area 504 are used to store data from the host system 1000 . Specifically, the physical erasing unit of the data area 502 is regarded as a physical erasing unit of stored data, and the physical erasing unit of the spare area 504 is a physical erasing unit used to replace the data area 502 . That is to say, when receiving the write command and the data to be written from the host system 1000, the memory management circuit 202 will extract the physical erase unit from the spare area 504, and write the data into the extracted physical erase unit. unit to replace the physical erasing unit of the data area 502.

逻辑上属于系统区506的物理抹除单元是用以记录系统数据。例如,系统数据包括关于可复写式非易失性存储器模块的制造商与型号、可复写式非易失性存储器模块的物理抹除单元数、每一物理抹除单元的物理编程单元数等。The physical erase units logically belonging to the system area 506 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 physical erasing units of the rewritable nonvolatile memory module, the number of physical programming units per physical erasing unit, and the like.

逻辑上属于取代区508中的物理抹除单元是用于坏物理抹除单元取代程序,以取代损坏的物理抹除单元。具体来说,倘若取代区508中仍存有正常的物理抹除单元并且数据区502的物理抹除单元损坏时,存储器管理电路202会从取代区508中提取正常的物理抹除单元来更换损坏的物理抹除单元。The physical erasing units logically belonging to the replacement area 508 are used in the bad physical erasing unit replacement process to replace the damaged physical erasing units. Specifically, if there are still normal physical erasing units in the replacement area 508 and the physical erasing units in the data area 502 are damaged, the memory management circuit 202 will extract normal physical erasing units from the replacement area 508 to replace the damaged ones. physical erasing unit.

特别是,数据区502、闲置区504、系统区506与取代区508的物理抹除单元的数量会依据不同的存储器规格而有所不同。此外,必须了解的是,在存储器存储装置100的运作中,物理抹除单元关联至数据区502、闲置区504、系统区506与取代区508的分组关系会动态地变动。例如,当闲置区504中的物理抹除单元损坏而被取代区508的物理抹除单元取代时,则原本取代区508的物理抹除单元会被关联至闲置区504。In particular, the numbers of physical erasing units in the data area 502 , spare area 504 , system area 506 and replacement area 508 are different according to different memory specifications. In addition, it must be understood that during the operation of the memory storage device 100 , the grouping relationship of the physical erase unit associated with the data area 502 , the spare area 504 , the system area 506 and the replacement area 508 will change dynamically. For example, when the physical erasing unit in the spare area 504 is damaged and replaced by the physical erasing unit in the replacement area 508 , the original physical erasing unit in the replacement area 508 will be associated with the spare area 504 .

请参照图7,存储器控制器104(或存储器管理电路202)会配置逻辑单元LBA(0)~LBA(H)以映射数据区502的物理抹除单元,其中每一逻辑单元具有多个逻辑页面以映射对应的物理抹除单元的物理编程单元。并且,当主机系统100欲写入数据至逻辑单元或更新存储于逻辑单元中的数据时,存储器控制器104(或存储器管理电路202)会从闲置区504中提取一个物理抹除单元来写入数据,以轮替数据区502的物理抹除单元。Referring to FIG. 7, the memory controller 104 (or the memory management circuit 202) configures the logical units LBA(0)-LBA(H) to map the physical erasing units of the data area 502, wherein each logical unit has multiple logical pages to map the physical programming units of the corresponding physical erasing units. And, when the host system 100 intends to write data to the logical unit or update the data stored in the logical unit, the memory controller 104 (or the memory management circuit 202) will extract a physical erase unit from the spare area 504 to write data to rotate the physical erase units of the data area 502 .

为了识别数据每个逻辑单元的数据被存储在那个物理抹除单元,在本范例实施例中,存储器控制器104(或存储器管理电路202)会记录逻辑单元与物理抹除单元之间的映射。并且,当主机系统1000欲在逻辑页面中存取数据时,存储器控制器104(或存储器管理电路202)会确认此逻辑页面所属的逻辑单元,并且在此逻辑单元所映射的物理抹除单元中来存取数据。例如,在本范例实施例中,存储器控制器104(或存储器管理电路202)会在可复写式非易失性存储器模块106中存储逻辑转物理地址映射表来记录每一逻辑单元所映射的物理抹除单元,并且当欲存取数据时存储器控制器104(或存储器管理电路202)会将逻辑转物理地址映射表载入至缓冲存储器208来维护。In order to identify the physical erasing unit in which the data of each logical unit of data is stored, in this exemplary embodiment, the memory controller 104 (or the memory management circuit 202 ) records the mapping between the logical unit and the physical erasing unit. Moreover, when the host system 1000 intends to access data in the logical page, the memory controller 104 (or the memory management circuit 202) will confirm the logical unit to which the logical page belongs, and in the physical erase unit mapped to the logical unit to access data. For example, in this exemplary embodiment, the memory controller 104 (or the memory management circuit 202) stores a logical-to-physical address mapping table in the rewritable non-volatile memory module 106 to record the physical address mapped to each logical unit. The unit is erased, and the memory controller 104 (or the memory management circuit 202 ) loads the logical-to-physical address mapping table into the buffer memory 208 for maintenance when data is to be accessed.

值得一提的是,由于缓冲存储器208的容量有限无法存储记录所有逻辑单元的映射关系的映射表,因此,在本范例实施例中,存储器控制器104(或存储器管理电路202)会将逻辑单元LBA(0)~LBA(H)分组为多个逻辑区域LZ(0)~LZ(M),并且为每一逻辑区域配置一个逻辑转物理地址映射表。特别是,当存储器控制器104(或存储器管理电路202)欲更新某个逻辑单元的映射时,对应此逻辑单元所属的逻辑区域的逻辑转物理地址映射表会被载入至缓冲存储器208来被更新。It is worth mentioning that due to the limited capacity of the buffer memory 208, it is impossible to store a mapping table that records the mapping relationship of all logical units. Therefore, in this exemplary embodiment, the memory controller 104 (or memory management circuit 202) will store the logical units LBA(0)-LBA(H) are grouped into multiple logical zones LZ(0)-LZ(M), and a logical-to-physical address mapping table is configured for each logical zone. In particular, when the memory controller 104 (or the memory management circuit 202) intends to update the mapping of a certain logical unit, the logical-to-physical address mapping table corresponding to the logical area to which the logical unit belongs will be loaded into the buffer memory 208 for being renew.

在本范例实施例中,存储器控制器104(或存储器管理电路202)会从闲置区504中提取物理抹除单元作为全域混乱区,并且将包含于来自主机系统1000的写入指令中的数据(亦称为更新数据)写入至全域混乱区的物理抹除单元(亦称为全域混乱物理抹除单元)中。在本范例实施例中,全域混乱物理抹除单元是设计来存储分别对应于不同逻辑单元的数据。In this exemplary embodiment, the memory controller 104 (or the memory management circuit 202) extracts the physical erase unit from the spare area 504 as a global chaotic area, and writes the data included in the write command from the host system 1000 ( Also called update data) is written into the physical erasing unit of the global chaos area (also called the global chaos physical erasing unit). In this exemplary embodiment, the global chaos physical erasure unit is designed to store data respectively corresponding to different logical units.

具体来说,当存储器存储装置100从主机系统1000接收到写入指令时,来自于主机系统1000的写入指令中的数据可被写入至全域混乱区的物理抹除单元中。并且,当此全域混乱物理抹除单元已被写满时,存储器控制器104(或存储器管理电路202)会再从闲置区504中提取空的物理抹除单元作为另一个全域混乱物理抹除单元,以继续写入对应来自于主机系统1000的写入指令的更新数据。直到作为全域混乱区的物理抹除单元的数目已到达一上限值时,存储器控制器104(或存储器管理电路202)会执行数据合并程序,以使存储于全域混乱物理抹除单元中的数据成为无效数据,并且之后将所存储的数据皆为无效数据的全域混乱物理抹除单元关联回闲置区504。Specifically, when the memory storage device 100 receives a write command from the host system 1000, the data in the write command from the host system 1000 can be written into the physical erase unit of the global chaos area. And, when this global chaos physical erasing unit is full, the memory controller 104 (or memory management circuit 202) will extract an empty physical erasing unit from the spare area 504 as another global chaos physical erasing unit , to continue writing update data corresponding to the write command from the host system 1000 . When the number of physical erasing units as the global chaos area has reached an upper limit, the memory controller 104 (or the memory management circuit 202) will execute the data merging program, so that the data stored in the global chaos physical erasing unit become invalid data, and then associate the global chaos physical erasure unit whose stored data is all invalid data back to the spare area 504 .

图8~14是绘示使用全域混乱区写入数据的简化范例。8-14 illustrate simplified examples of writing data using the global chaos area.

为方便说明,在此假设数据区502具有5个物理抹除单元,闲置区504具有4个物理抹除单元,每一物理抹除单元具有3个物理编程单元,欲写入至每一物理抹除单元的数据必须依照物理编程单元的顺序来被写入,并且作为全域混乱物理抹除单元的物理抹除单元数的上限值为2。For the convenience of description, it is assumed that the data area 502 has 5 physical erasing units, the idle area 504 has 4 physical erasing units, and each physical erasing unit has 3 physical programming units. The data of the erasing units must be written in the order of the physical programming units, and the upper limit of the number of physical erasing units serving as global chaos physical erasing units is 2.

请参照图8,在存储器存储装置100的初始状态中,逻辑单元LBA(0)~LBA(4)的逻辑页面映射数据区502的物理抹除单元410(0)~410(4)的物理编程单元,并且闲置区504具有物理抹除单元410(5)~410(8)。也就是说,存储器控制器104(或存储器管理电路202)会在逻辑转物理地址映射表中记录逻辑单元LBA(0)~LBA(4)与物理抹除单元410(0)~410(4)之间的映射关系,并且将物理抹除单元410(0)~410(4)的物理编程单元视为已存储属于逻辑单元LBA(0)~LBA(4)的逻辑页面的数据(即,初始数据ID1~ID15)。必须了解的是,在存储器存储装置100刚出厂时,初始数据ID1~ID15可能为空数据。此外,存储器控制器104(或存储器管理电路202)会记录闲置区504中可用的物理抹除单元410(5)~410(8)。Please refer to FIG. 8, in the initial state of the memory storage device 100, the physical programming of the physical erasing units 410(0)-410(4) of the logical page mapping data area 502 of the logical units LBA(0)-LBA(4) units, and the spare area 504 has physical erase units 410(5)˜410(8). That is to say, the memory controller 104 (or the memory management circuit 202) records the logical units LBA(0)-LBA(4) and the physical erasing units 410(0)-410(4) in the logical-to-physical address mapping table and the physical programming units of the physical erasing units 410(0)-410(4) are regarded as having stored the data belonging to the logical pages of the logical units LBA(0)-LBA(4) (that is, the initial Data ID1~ID15). It must be understood that when the memory storage device 100 is just shipped from the factory, the initial data ID1-ID15 may be empty data. In addition, the memory controller 104 (or the memory management circuit 202 ) records the available physical erase units 410 ( 5 )˜ 410 ( 8 ) in the spare area 504 .

请参照图9,假设欲编程更新数据UD1并且更新数据UD1是属于逻辑单元LBA(0)的第1个逻辑页面时,存储器控制器104(或存储器管理电路202)会从闲置区504中提取物理抹除单元410(5)作为全域混乱区550的物理抹除单元并且下达编程指令以将此更新数据UD1写入至物理抹除单元410(5)的第0个物理编程单元。Please refer to FIG. 9 , assuming that the update data UD1 is to be programmed and the update data UD1 belongs to the first logical page of the logical unit LBA (0), the memory controller 104 (or the memory management circuit 202) will extract the physical page from the spare area 504 The erasing unit 410(5) serves as the physical erasing unit of the global chaos area 550 and issues a programming command to write the update data UD1 into the 0th physical programming unit of the physical erasing unit 410(5).

请参照图10,接续图9,假设欲再编程更新数据UD2并且更新数据UD2是属于逻辑单元LBA(1)的第0个逻辑页面时,存储器控制器104(或存储器管理电路202)会下达编程指令以将此更新数据UD2写入至物理抹除单元410(5)的第1个物理编程单元。Please refer to FIG. 10 , continuing FIG. 9 , assuming that the update data UD2 is to be reprogrammed and the update data UD2 belongs to the 0th logical page of the logical unit LBA (1), the memory controller 104 (or the memory management circuit 202) will issue a programming command to write the update data UD2 into the first physical programming unit of the physical erasing unit 410(5).

请参照图11,接续图10,假设欲再编程更新数据UD3并且更新数据UD3是属于逻辑单元LBA(2)的第1个逻辑页面时,存储器控制器104(或存储器管理电路202)会下达编程指令以将此更新数据UD3写入至物理抹除单元410(5)的第2个物理编程单元。Please refer to FIG. 11 and continue with FIG. 10. Assuming that the update data UD3 is to be reprogrammed and the update data UD3 belongs to the first logical page of the logic unit LBA (2), the memory controller 104 (or the memory management circuit 202) will issue a program command to write the update data UD3 into the second physical programming unit of the physical erasing unit 410(5).

请参照图12,接续图11,假设欲再编程更新数据UD4并且更新数据UD4是属于逻辑单元LBA(3)的第0个逻辑页面时,由于全域混乱物理抹除单元410(5)已无存储空间,因此,存储器控制器104(或存储器管理电路202)会从闲置区504中提取物理抹除单元410(6)作为全域混乱区550的物理抹除单元并且下达编程指令以将此更新数据UD4写入至物理抹除单元410(6)的第0个物理编程单元。Please refer to FIG. 12 and continue with FIG. 11. Assuming that the update data UD4 is to be reprogrammed and the update data UD4 belongs to the 0th logical page of the logical unit LBA (3), the physical erasing unit 410 (5) has no memory due to global confusion. Therefore, the memory controller 104 (or the memory management circuit 202) will extract the physical erase unit 410(6) from the spare area 504 as the physical erase unit of the global chaos area 550 and issue a program command to update the data UD4 Write to the 0th physical programming unit of the physical erasing unit 410(6).

请参照图13,接续图12,假设欲再编程更新数据UD5并且更新数据UD5是属于逻辑单元LBA(3)的第1个逻辑页面时,存储器控制器104(或存储器管理电路202)会下达编程指令以将此更新数据UD5写入至物理抹除单元410(6)的第1个物理编程单元。Please refer to FIG. 13 and continue with FIG. 12. Assuming that the update data UD5 is to be reprogrammed and the update data UD5 belongs to the first logical page of the logic unit LBA (3), the memory controller 104 (or the memory management circuit 202) will issue a programming command to write the update data UD5 into the first physical programming unit of the physical erasing unit 410(6).

请参照图14,接续图13,假设欲再编程更新数据UD6并且更新数据UD6是属于逻辑单元LBA(0)的第2个逻辑页面时,存储器控制器104(或存储器管理电路202)会下达编程指令以将此更新数据UD6写入至物理抹除单元410(6)的第2个物理编程单元。Please refer to FIG. 14 and continue with FIG. 13. Assuming that the update data UD6 is to be reprogrammed and the update data UD6 belongs to the second logical page of the logical unit LBA (0), the memory controller 104 (or the memory management circuit 202) will issue a program command to write the update data UD6 into the second physical programming unit of the physical erasing unit 410(6).

为了能够识别存储于全域混乱区的物理抹除单元中的数据是属于那个逻辑单元(亦称为已更新逻辑单元)的那个逻辑页面(亦称为已更新逻辑页面),在本范例实施例中,存储器管理电路202会建立全域混乱区搜寻表,以利有效数据的搜寻。在此,暂存于全域混乱区中的更新数据所属的逻辑页面称为已更新逻辑页面并且已更新逻辑页面所属的逻辑单元区块称为已更新逻辑单元。在全域混乱区搜寻表中,存储器控制器104(或存储器管理电路202)会建立多个根单元并且为每一根单元配置一登录链结。特别是,存储器控制器104(或存储器管理电路202)会将逻辑单元的逻辑页面分组来分别地对应至其中一个根单元,并且将已更新逻辑页面的更新信息记录在对应的根单元的登录链结上。基此,当欲在全域混乱物理抹除单元中搜寻特定逻辑单元的更新数据时,仅需搜寻对应的根单元的登录链结。In order to be able to identify that the data stored in the physical erasing unit of the global chaotic area belongs to that logical page (also called an updated logical page) of that logical unit (also called an updated logical unit), in this exemplary embodiment , the memory management circuit 202 will establish a global chaos area search table to facilitate the search of valid data. Here, the logical page to which the update data temporarily stored in the global chaotic area belongs is called an updated logical page and the logical unit block to which the updated logical page belongs is called an updated logical unit. In the global chaotic area search table, the memory controller 104 (or the memory management circuit 202 ) will create multiple root units and configure a login link for each root unit. In particular, the memory controller 104 (or the memory management circuit 202) will group the logical pages of the logical units to correspond to one of the root units respectively, and record the update information of the updated logical pages in the login chain of the corresponding root unit knot. Based on this, when it is desired to search for update data of a specific logical unit in the global chaos physical erasing unit, only the login link of the corresponding root unit needs to be searched.

例如,在本范例实施例中,存储器控制器104(或存储器管理电路202)会将每一逻辑单元的逻辑页面分别地对应至同一个根单元。也就是,同一个逻辑单元的逻辑页面是对应同一个根单元。必须了解的是,本发明不限于此,例如,在本发明另一范例实施中,也可将一个逻辑单元的一部分逻辑页面分组至一个根单元并且将此逻辑单元的另一部分逻辑页面分组至另一根单元。For example, in this exemplary embodiment, the memory controller 104 (or the memory management circuit 202 ) maps the logical pages of each logical unit to the same root unit. That is, the logical pages of the same logical unit correspond to the same root unit. It must be understood that the present invention is not limited thereto. For example, in another exemplary implementation of the present invention, a part of logical pages of a logical unit may also be grouped into a root unit and another part of logical pages of this logical unit may be grouped into another root unit. a unit.

此外,当为每一根单元分别地配置一个登录链结并且每当执行写入指令时,存储器控制器104(或存储器管理电路202)会在对应的登录链结上建立登录以记录关于此写入指令的更新信息。例如,每一登录包括第一栏位(例如,图15的栏位902)、第二栏位(例如,图15的栏位904)与第三栏位(例如,图6的栏位906),其中第一栏位记录已更新逻辑页面的地址,第二栏位用以记录存储此已更新逻辑页面的更新数据的物理地址,并且第三栏位用以标记此登录是否有效。在此,如果此登录为有效,则第三栏位例如会被标记为‘1’;并且若此登录为无效,则第三栏位例如会被标记为‘0’。必须了解的是,在此标记有效登录与无效登录的方式,不限于此。例如,也可以‘1’代表无效登录并且以‘0’代表有效登录。In addition, when a log link is configured for each root unit and whenever a write command is executed, the memory controller 104 (or memory management circuit 202) will create a log on the corresponding log link to record the write Update information for incoming instructions. For example, each entry includes a first field (e.g., field 902 of FIG. 15), a second field (e.g., field 904 of FIG. 15) and a third field (e.g., field 906 of FIG. 6) , wherein the first column records the address of the updated logical page, the second column records the physical address for storing the update data of the updated logical page, and the third column marks whether the login is valid. Here, if the registration is valid, the third field will be marked as '1', for example; and if the registration is invalid, the third field will be marked as '0', for example. It must be understood that the method of marking valid logins and invalid logins is not limited to this. For example, it is also possible to have a '1' for an invalid login and a '0' for a valid login.

图15是根据图14所绘示的全域混乱区搜寻表的简化范例。FIG. 15 is a simplified example of the global chaos area search table shown in FIG. 14 .

请参照图15,全域混乱区搜寻表800包括根单元810(0)~810(4),其中逻辑单元LBA(0)的逻辑页面是对应根单元810(0),逻辑单元LBA(1)的逻辑页面是对应根单元810(1),逻辑单元LBA(2)的逻辑页面是对应根单元810(2),逻辑单元LBA(3)的逻辑页面是对应根单元810(3),并且逻辑单元LBA(4)的逻辑页面是对应根单元810(4)。Please refer to FIG. 15, the global chaos area search table 800 includes root units 810(0)-810(4), wherein the logical pages of the logical unit LBA(0) correspond to the root unit 810(0), and the logical pages of the logical unit LBA(1) The logical page is the corresponding root unit 810(1), the logical page of the logical unit LBA(2) is the corresponding root unit 810(2), the logical page of the logical unit LBA(3) is the corresponding root unit 810(3), and the logical unit The logical page of LBA(4) is the corresponding root unit 810(4).

在根单元810(0)的登录链结中包含2个有效登录,以记录逻辑单元LBA(0)的第1个逻辑页面(即,信息"LBA(0)-1")与第2个逻辑页面(即,信息"LBA(0)-2")已被更新,其中逻辑单元LBA(0)的第1个逻辑页面的更新数据被写入至物理抹除单元410(5)的第0个物理编程单元(即,信息"410(5)-0")中并且逻辑单元LBA(0)的第2个逻辑页面的更新数据被写入至物理抹除单元410(6)的第2个物理编程单元(即,信息"410(6)-2")中。Include 2 valid entries in the entry link of the root unit 810(0) to record the 1st logical page (i.e., information "LBA(0)-1") and the 2nd logical page of the logical unit LBA(0) The page (i.e., the information "LBA(0)-2") has been updated, wherein the update data of the 1st logical page of the logical unit LBA(0) is written to the 0th page of the physical erase unit 410(5) In the physical program unit (i.e., information "410(5)-0") and the update data of the 2nd logical page of the logical unit LBA(0) is written to the 2nd physical page of the physical erase unit 410(6) in the programming unit (ie, information "410(6)-2").

在根单元810(1)的登录链结中包含1个有效登录,以记录逻辑单元LBA(1)的第0个逻辑页面(即,信息"LBA(1)-0")已被更新,其中逻辑单元LBA(1)的第0个逻辑页面的更新数据被写入至物理抹除单元410(5)的第1个物理编程单元(即,信息"410(5)-1")中。Include 1 valid entry in the entry link of root unit 810(1) to record that logical page 0 of logical unit LBA(1) (i.e., information "LBA(1)-0") has been updated, where The update data of the 0th logical page of the logical unit LBA(1) is written into the 1st physical programming unit (ie, information “410(5)-1”) of the physical erasing unit 410(5).

在根单元810(2)的登录链结中包含1个有效登录,以记录逻辑单元LBA(2)的第1个逻辑页面(即,信息"LBA(2)-1")已被更新,其中逻辑单元LBA(2)的第1个逻辑页面的更新数据被写入至物理抹除单元410(5)的第2个物理编程单元(即,信息"410(5)-2")中。Include 1 valid login in the login link of root unit 810(2) to record that logical page 1 of logical unit LBA(2) (i.e., information "LBA(2)-1") has been updated, where The update data of the first logical page of the logical unit LBA(2) is written into the second physical programming unit of the physical erasing unit 410(5) (ie, information “410(5)-2”).

在根单元810(3)的登录链结中包含2个有效登录,以记录逻辑单元LBA(3)的第0个逻辑页面(即,信息"LBA(3)-0")与第1个逻辑页面(即,信息"LBA(3)-1")已被更新,其中逻辑单元LBA(3)的第0个逻辑页面的更新数据被写入至物理抹除单元410(6)的第0个物理编程单元(即,信息"410(6)-0")中并且逻辑单元LBA(3)的第1个逻辑页面的更新数据被写入至物理抹除单元410(6)的第1个物理编程单元(即,信息"410(6)-1")中。Include 2 valid entries in the entry link of the root unit 810(3) to record the 0th logical page of the logical unit LBA(3) (i.e., the information "LBA(3)-0") and the 1st logical page The page (i.e., the information "LBA(3)-1") has been updated, wherein the update data of the 0th logical page of the logical unit LBA(3) is written to the 0th logical page of the physical erase unit 410(6) In the physical program unit (i.e., information "410(6)-0") and the update data of the 1st logical page of the logical unit LBA(3) is written to the 1st physical page of the physical erase unit 410(6) in the programming unit (ie, information "410(6)-1").

此外,在根单元810(0)~810(4)的登录链结中分别地会包含1个空的登录,以表示登录链结的结束。例如,倘若欲在全域混乱物理抹除单元中搜寻属于逻辑单元LBA(4)的数据时,存储器控制器104(或存储器管理电路202)可根据根单元810(4)的登录链结仅有空的登录,而识别出全域混乱物理抹除单元中未存储属于逻辑单元LBA(4)的数据,由此可直接依据逻辑转物理地址映射表的信息从对应的物理抹除单元的物理编程单元中读取数据。In addition, one empty entry is included in the entry links of the root units 810 ( 0 ) to 810 ( 4 ), indicating the end of the entry links. For example, if it is desired to search for data belonging to the logical unit LBA (4) in the global chaos physical erasing unit, the memory controller 104 (or the memory management circuit 202) can only have the free space according to the login link of the root unit 810 (4). However, it is recognized that no data belonging to the logical unit LBA (4) is stored in the global chaotic physical erasing unit, so that the data can be directly obtained from the physical programming unit of the corresponding physical erasing unit according to the information in the logical-to-physical address mapping table. read data.

以此类推,存储器控制器104(或存储器管理电路202)会依序地将主机系统1000欲存储的数据写入至作为全域混乱区的物理抹除单元中。特别是,当全域混乱区的物理抹除单元的数目达到3时,存储器控制器104(或存储器管理电路202)会在执行写入指令时一并执行数据合并程序,以防止闲置区的物理抹除单元被用尽。By analogy, the memory controller 104 (or the memory management circuit 202 ) will sequentially write the data to be stored by the host system 1000 into the physical erasing unit serving as the global chaotic area. In particular, when the number of physical erasing units in the global chaotic area reaches 3, the memory controller 104 (or the memory management circuit 202) will execute the data consolidation program when executing the write command, so as to prevent the physical erasing of the idle area. The division unit is exhausted.

图16~21是绘示执行全域混乱区有效数据合并程序以完成后续写入指令的简化范例。FIGS. 16-21 illustrate simplified examples of executing the global chaotic area valid data merging process to complete subsequent write commands.

请参照图16,接续图14,假设欲再编程更新数据UD7并且更新数据UD7是属于逻辑单元LBA(2)的第0个逻辑页面时,由于全域混乱物理抹除单元410(6)已无存储空间,并且作为全域混乱区550的物理抹除单元的数目已达到2,因此,存储器管理电路202在执行写入运作之前会执行数据合并程序。也就是说,在此例子中,在执行此次写入指令期间,存储器管理电路202会一并执行数据合并程序。Please refer to FIG. 16 and continue with FIG. 14. Assuming that the update data UD7 is to be reprogrammed and the update data UD7 belongs to the 0th logical page of the logical unit LBA (2), the physical erasing unit 410 (6) has no memory due to global confusion. space, and the number of physical erase units serving as the global chaos area 550 has reached 2, therefore, the memory management circuit 202 will perform a data consolidation procedure before performing a write operation. That is to say, in this example, during the execution of the write command, the memory management circuit 202 will also execute the data merging procedure.

例如,首先,存储器控制器104(或存储器管理电路202)会选择逻辑单元LBA(0)来进行数据合并。此时,存储器管理电路202会识别逻辑单元LBA(0)是映射物理抹除单元410(0),从闲置区504提取物理抹除单元410(7),并且将物理抹除单元410(0)以及全域混乱区550中属于逻辑单元LBA(0)的有效数据复制到物理抹除单元410(7)中。具体来说,存储器控制器104(或存储器管理电路202)会依序地将物理抹除单元410(0)中的数据ID1、物理抹除单元410(5)中的UD1与物理抹除单元410(6)中的数据UD6写入至物理抹除单元410(7)的第0~2个物理编程单元中,并且将物理抹除单元410(5)的第0个物理编程单元与物理抹除单元410(6)的第2个物理编程单元标示为无效(如斜线所示)。之后,存储器控制器104(或存储器管理电路202)会对物理抹除单元410(0)执行抹除运作,在逻辑转物理地址映射表中将逻辑单元LBA(0)重新映射至物理抹除单元410(7),并且将物理抹除单元410(0)关联至闲置区504。For example, first, the memory controller 104 (or the memory management circuit 202 ) will select the logical unit LBA(0) to perform data merging. At this point, the memory management circuit 202 will recognize that the logical unit LBA(0) is a mapped physical erase unit 410(0), extract the physical erase unit 410(7) from the spare area 504, and map the physical erase unit 410(0) And the valid data belonging to the logical unit LBA(0) in the global chaos area 550 is copied to the physical erasing unit 410(7). Specifically, the memory controller 104 (or the memory management circuit 202) sequentially transfers the data ID1 in the physical erasing unit 410(0), the UD1 in the physical erasing unit 410(5) and the data ID1 in the physical erasing unit 410 The data UD6 in (6) is written into the 0th to 2nd physical programming units of the physical erasing unit 410 (7), and the 0th physical programming unit of the physical erasing unit 410 (5) and the physical erasing The second physical programming unit of unit 410(6) is marked invalid (as shown by the slash). Afterwards, the memory controller 104 (or the memory management circuit 202) performs an erase operation on the physical erase unit 410(0), and remaps the logical unit LBA(0) to the physical erase unit in the logical-to-physical address mapping table 410(7), and associate the physical erase unit 410(0) to the spare area 504.

请参照图17,接着,存储器控制器104(或存储器管理电路202)会选择逻辑单元LBA(1)来进行数据合并。此时,存储器管理电路202会识别逻辑单元LBA(1)是映射物理抹除单元410(1),从闲置区504提取物理抹除单元410(8),并且将物理抹除单元410(1)以及全域混乱区550中属于逻辑单元LBA(1)的有效数据复制到物理抹除单元410(8)中。之后,存储器控制器104(或存储器管理电路202)会对物理抹除单元410(1)执行抹除运作,在逻辑转物理地址映射表中将逻辑单元LBA(1)重新映射至物理抹除单元410(8),并且将物理抹除单元410(1)关联至闲置区504。Referring to FIG. 17 , next, the memory controller 104 (or the memory management circuit 202 ) will select the logic unit LBA( 1 ) to perform data merging. At this point, the memory management circuit 202 will recognize that the logical unit LBA(1) is a mapped physical erase unit 410(1), extract the physical erase unit 410(8) from the spare area 504, and map the physical erase unit 410(1) to And the valid data belonging to the logical unit LBA(1) in the global chaotic area 550 is copied to the physical erasing unit 410(8). Afterwards, the memory controller 104 (or the memory management circuit 202) performs an erase operation on the physical erase unit 410(1), and remaps the logical unit LBA(1) to the physical erase unit in the logical-to-physical address mapping table 410(8), and associate physical erase unit 410(1) to spare area 504.

请参照图18,接着,存储器控制器104(或存储器管理电路202)会选择逻辑单元LBA(2)来进行数据合并。此时,存储器管理电路202会识别逻辑单元LBA(2)是映射物理抹除单元410(2),从闲置区504提取物理抹除单元410(0),并且将物理抹除单元410(2)以及全域混乱区550中属于逻辑单元LBA(2)的有效数据复制到物理抹除单元410(0)中。之后,存储器控制器104(或存储器管理电路202)会对物理抹除单元410(2)执行抹除运作,在逻辑转物理地址映射表中将逻辑单元LBA(2)重新映射至物理抹除单元410(0),并且将物理抹除单元410(2)关联至闲置区504。Referring to FIG. 18 , next, the memory controller 104 (or the memory management circuit 202 ) will select the logic unit LBA( 2 ) to perform data merging. At this point, the memory management circuit 202 will recognize that the logical unit LBA(2) is a mapped physical erase unit 410(2), extract the physical erase unit 410(0) from the spare area 504, and map the physical erase unit 410(2) And the valid data belonging to the logical unit LBA(2) in the global chaotic area 550 is copied to the physical erasing unit 410(0). Afterwards, the memory controller 104 (or the memory management circuit 202) performs an erase operation on the physical erase unit 410(2), and remaps the logical unit LBA(2) to the physical erase unit in the logical-to-physical address mapping table 410(0), and associate physical erase unit 410(2) to spare area 504.

请参照图19,接着,存储器控制器104(或存储器管理电路202)会选择逻辑单元LBA(3)来进行数据合并时,存储器管理电路202会识别逻辑单元LBA(3)是映射物理抹除单元410(3),从闲置区504提取物理抹除单元410(1),并且将物理抹除单元410(3)以及全域混乱区550中属于逻辑单元LBA(3)的有效数据复制到物理抹除单元410(1)中。之后,存储器控制器104(或存储器管理电路202)会对物理抹除单元410(3)执行抹除运作,在逻辑转物理地址映射表中将逻辑单元LBA(3)重新映射至物理抹除单元410(1),并且将物理抹除单元410(3)关联至闲置区504。Please refer to FIG. 19, and then, when the memory controller 104 (or memory management circuit 202) selects the logic unit LBA (3) for data merging, the memory management circuit 202 will recognize that the logic unit LBA (3) is a mapping physical erasing unit 410(3), extract the physical erasing unit 410(1) from the spare area 504, and copy the valid data belonging to the logical unit LBA(3) in the physical erasing unit 410(3) and the global chaotic area 550 to the physical erasing unit 410(3) In unit 410(1). Afterwards, the memory controller 104 (or the memory management circuit 202) performs an erase operation on the physical erase unit 410(3), and remaps the logical unit LBA(3) to the physical erase unit in the logical-to-physical address mapping table 410(1), and associate physical erase unit 410(3) to spare area 504.

特别是,此时,全域混乱区550的物理抹除单元所存储的数据皆为无效数据,因此,存储器控制器104(或存储器管理电路202)会对物理抹除单元410(5)与410(6)执行抹除运作,并且将抹除后的物理抹除单元410(5)与410(6)关联至闲置区504(如图20所示),由此完成全域混乱区550的有效数据合并运作。In particular, at this time, the data stored in the physical erasing units of the global chaos area 550 are all invalid data, therefore, the memory controller 104 (or the memory management circuit 202) will perform physical erasing on the physical erasing units 410(5) and 410( 6) Execute the erasing operation, and associate the erased physical erasing units 410(5) and 410(6) to the idle area 504 (as shown in FIG. 20 ), thereby completing the effective data merging of the global chaotic area 550 operate.

请参照图21,在完成全域混乱区550的有效数据合并运作之后,存储器控制器104(或存储器管理电路202)会从闲置区504中提取物理单元410(2)作为全域混乱区550的物理抹除单元并且下达编程指令以将此更新数据UD7写入至物理单元410(2)的第0个物理页面。Please refer to FIG. 21 , after the valid data merging operation of the global chaos area 550 is completed, the memory controller 104 (or memory management circuit 202 ) will extract the physical unit 410 ( 2 ) from the spare area 504 as a physical wipe of the global chaos area 550 Delete cells and issue a program command to write this update data UD7 to the 0th physical page of physical unit 410(2).

基此,根据上述运作,存储器控制器104(或存储器管理电路202)会将全域混乱区550的物理抹除单元的上的有效数据回存至逻辑单元所映射的物理抹除单元中,将存储无效数据的全域混乱物理抹除单元关联回闲置区504,并且从闲置区504中提取空的物理抹除单元作为全域混乱物理抹除单元,以维持全域混乱区550的物理抹除单元的数目小于上限值。Therefore, according to the above-mentioned operation, the memory controller 104 (or the memory management circuit 202) will store back the valid data on the physical erasing unit in the global chaos area 550 to the physical erasing unit mapped to the logical unit, and store The global chaos physical erasure unit of invalid data is associated back to the spare area 504, and the empty physical erasure unit is extracted from the spare area 504 as the global chaos physical erasure unit, so that the number of physical erasure units in the global chaos area 550 is kept less than Upper limit.

值得一提的是,如上所述,当执行全域混乱区550的数据合并运作时,存储器控制器104(或存储器管理电路202)需合并属于不同逻辑单元的有效数据,并且更新逻辑转物理地址映射表。特别是,如上所述,由于缓冲存储器208的容量有限,只能载入有限的逻辑转物理地址映射表,因此,倘若此些逻辑单元属于不同的逻辑区域时,存储器控制器104(或存储器管理电路202)需多次载入与回存不同的逻辑转物理地址映射表,方能完成全域混乱区550的数据合并运作,造成延迟写入指令的执行。基此,在本范例实施例中,存储器控制器104(或存储器管理电路202)会记录目前全域混乱区550的数据零散程度,并且判断目前全域混乱区550的数据零散程度是否小于数据零散程度阈值。特别是,只有在对应目前全域混乱区550的数据零散程度小于此数据零散程度阈值时,存储器控制器104(或存储器管理电路202)才会使用全域混乱区550来存储来自于主机系统1000的数据。It is worth mentioning that, as mentioned above, when performing the data merge operation of the global chaos area 550, the memory controller 104 (or the memory management circuit 202) needs to merge valid data belonging to different logical units, and update the logical-to-physical address mapping surface. In particular, as mentioned above, due to the limited capacity of the buffer memory 208, only a limited logic-to-physical address mapping table can be loaded, therefore, if these logical units belong to different logical regions, the memory controller 104 (or memory management The circuit 202) needs to load and restore different logic-to-physical address mapping tables multiple times in order to complete the data merging operation of the global chaos area 550, resulting in a delay in the execution of the write command. Based on this, in this exemplary embodiment, the memory controller 104 (or the memory management circuit 202) will record the current data fragmentation degree of the global chaos area 550, and determine whether the current data fragmentation degree of the global chaos area 550 is less than the data fragmentation degree threshold . In particular, the memory controller 104 (or the memory management circuit 202) will use the global chaos area 550 to store data from the host system 1000 only when the data fragmentation degree corresponding to the current global chaos area 550 is less than the data fragmentation degree threshold .

例如,在本发明一范例实施例中,存储器控制器104(或存储器管理电路202)会纪录有多少个逻辑区域的数据被存储在全域混乱区550中。具体来说,当将一个逻辑页面的更新数据存储至全域混乱区550时,存储器控制器104(或存储器管理电路202)可知道此逻辑页面是属那个逻辑单元(即,已更新逻辑单元)以及此逻辑单元是属于那个逻辑区域(即,已更新逻辑区域),因此,存储器控制器104(或存储器管理电路202)可记录目前已更新逻辑区域的数目(即,有多少个逻辑区域的数据被存储在全域混乱区550中)。特别是,倘若目前已更新逻辑区域的数目大于预设值时,存储器控制器104(或存储器管理电路202)会识别目前全域混乱区550的数据零散程度非小于数据零散程度阈值。For example, in an exemplary embodiment of the present invention, the memory controller 104 (or the memory management circuit 202 ) records how many logical areas of data are stored in the global chaos area 550 . Specifically, when the update data of a logical page is stored in the global chaos area 550, the memory controller 104 (or the memory management circuit 202) can know which logical unit this logical page belongs to (that is, the updated logical unit) and This logical unit belongs to that logical area (that is, the logical area that has been updated), therefore, the memory controller 104 (or the memory management circuit 202) can record the number of the logical area that has been updated (that is, how many data in the logical area have been updated) stored in the global chaos area 550). In particular, if the current number of updated logical regions is greater than the preset value, the memory controller 104 (or the memory management circuit 202 ) will identify that the current data fragmentation degree of the global chaos area 550 is not less than the data fragmentation degree threshold.

值得一提的是,以已更新逻辑区域的数目来判断全域混乱区550的数据零散程度仅为一范例,本发明不限于此。例如,在另一范例实施例中,存储器控制器104(或存储器管理电路202)也可以更新逻辑单元的数目来识别全域混乱区550的数据零散程度。例如,倘若目前已更新逻辑单元的数目大于预设值时,存储器控制器104(或存储器管理电路202)会识别目前全域混乱区550的数据零散程度非小于数据零散程度阈值。It should be noted that judging the fragmentation of data in the global chaos area 550 by the number of updated logical areas is just an example, and the present invention is not limited thereto. For example, in another exemplary embodiment, the memory controller 104 (or the memory management circuit 202 ) may also update the number of logical units to identify the data fragmentation degree of the global chaos area 550 . For example, if the current number of updated logical units is greater than the preset value, the memory controller 104 (or the memory management circuit 202 ) will identify that the current data fragmentation degree of the global chaos area 550 is not less than the data fragmentation degree threshold.

再者,由于在执行全域混乱区550的数据合并运作时,需更新对应已更新逻辑单元的逻辑转物理地址映射表(以下称为待更新逻辑转物理地址映射表)。因此,在另一范例实施例中,存储器控制器104(或存储器管理电路202)也可以待更新逻辑转物理地址映射表的数目来识别全域混乱区550的数据零散程度。例如,倘若待更新逻辑转物理地址映射表的数目大于预设值时,存储器控制器104(或存储器管理电路202)会识别目前全域混乱区550的数据零散程度非小于数据零散程度阈值。Furthermore, since the data merging operation of the global chaotic area 550 is performed, the logical-to-physical address mapping table corresponding to the updated logical unit (hereinafter referred to as the logical-to-physical address mapping table to be updated) needs to be updated. Therefore, in another exemplary embodiment, the memory controller 104 (or the memory management circuit 202 ) can also identify the data fragmentation degree of the global chaos area 550 by the number of logical-to-physical address mapping tables to be updated. For example, if the number of logical-to-physical address mapping tables to be updated is greater than a preset value, the memory controller 104 (or the memory management circuit 202 ) will identify that the current data fragmentation degree of the global chaos area 550 is not less than the data fragmentation degree threshold.

在本范例实施例中,倘若对应目前全域混乱区550的数据零散程度非小于此数据零散程度阈值时,存储器控制器104(或存储器管理电路202)会使用子物理抹除单元来写入来自于主机系统1000的数据并且更新对应的逻辑转物理地址映射表。In this exemplary embodiment, if the data fragmentation degree corresponding to the current global chaos area 550 is not less than the data fragmentation degree threshold, the memory controller 104 (or the memory management circuit 202) will use the sub-physical erase unit to write data from the data from the host system 1000 and update the corresponding logical-to-physical address mapping table.

图22~图24是绘示使用子物理抹除单元来写入更新数据的范例。22 to 24 illustrate examples of using sub-physical erasing units to write update data.

请同时参照图22~图24,例如,在逻辑单元LBA(0)是映射至物理抹除单元410(0)的映射状态下,当存储器控制器104(或存储器管理电路202)从主机系统1000中接收到写入指令而欲写入数据至属于逻辑单元LBA(0)的逻辑页面时,存储器控制器104(或存储器管理电路202)依据逻辑转物理地址映射表识别逻辑单元LBA(0)目前是映射至物理抹除单元410(0)并且从闲置区504中提取物理抹除单元410(H+1)来轮替物理抹除单元410(0)。然而,当新数据写入至物理抹除单元410(H+1)的同时,存储器控制器104(或存储器管理电路202)可不用立刻将物理抹除单元410(0)中的所有有效数据搬移至物理抹除单元410(H+1)而抹除物理抹除单元410(0)。具体来说,存储器控制器104(或存储器管理电路202)会从物理抹除单元410(0)中读取欲写入物理编程单元之前的有效数据(即,物理抹除单元410(0)的第0物理编程单元与第1物理编程单元中的数据)。之后,存储器控制器104(或存储器管理电路202)会将物理抹除单元410(0)中欲写入物理编程单元之前的有效数据写入至物理抹除单元410(H+1)的第0物理编程单元与第1物理编程单元中(如图22所示),并且将新数据写入至物理抹除单元410(H+1)的第2~4个物理编程单元中(如图23所示)。此时,存储器控制器104(或存储器管理电路202)即完成写入的运作。因为物理抹除单元410(0)中的有效数据有可能在下个操作(例如,写入指令)中变成无效,因此立刻将物理抹除单元410(0)中的有效数据搬移至物理抹除单元410(H+1)可能会造成无谓的搬移。此外,数据必须依序地写入至物理抹除单元内的物理编程单元,因此,存储器控制器104(或存储器管理电路202)可先搬移欲写入物理编程单元之前的有效数据(即,存储在物理抹除单元410(0)的第0物理编程单元与第0物理编程单元中数据),并且暂不搬移其余有效数据(即,存储在物理抹除单元410(0)的第5~K物理编程单元中数据)。Please refer to FIGS. 22 to 24 at the same time. For example, in the mapping state where the logical unit LBA(0) is mapped to the physical erasing unit 410(0), when the memory controller 104 (or the memory management circuit 202) from the host system 1000 When receiving a write command and wanting to write data to a logical page belonging to the logical unit LBA(0), the memory controller 104 (or memory management circuit 202) identifies the current state of the logical unit LBA(0) according to the logical-to-physical address mapping table Yes maps to physical erase unit 410(0) and extracts physical erase unit 410(H+1) from spare area 504 to alternate physical erase unit 410(0). However, when new data is written into the physical erasing unit 410(H+1), the memory controller 104 (or the memory management circuit 202) may not immediately move all valid data in the physical erasing unit 410(0) Go to physical erase unit 410(H+1) to erase physical erase unit 410(0). Specifically, the memory controller 104 (or the memory management circuit 202) will read from the physical erasing unit 410(0) the valid data to be written before the physical programming unit (that is, the data of the physical erasing unit 410(0) Data in the 0th physical programming unit and the 1st physical programming unit). Afterwards, the memory controller 104 (or the memory management circuit 202) will write the valid data in the physical erasing unit 410(0) before the physical programming unit to the 0th bit of the physical erasing unit 410(H+1). The physical programming unit and the first physical programming unit (as shown in FIG. 22 ), and write new data into the second to fourth physical programming units of the physical erasing unit 410 (H+1) (as shown in FIG. 23 Show). At this point, the memory controller 104 (or the memory management circuit 202 ) completes the writing operation. Because the valid data in the physical erase unit 410(0) may become invalid in the next operation (for example, a write command), the valid data in the physical erase unit 410(0) is immediately moved to the physical erase unit 410(0). Unit 410(H+1) may cause unnecessary movement. In addition, data must be sequentially written to the physical programming units in the physical erasing unit, therefore, the memory controller 104 (or the memory management circuit 202) can first move the valid data (ie, storage Data in the 0th physical programming unit and the 0th physical programming unit of the physical erasing unit 410 (0), and the remaining valid data (that is, stored in the 5th to Kth physical programming unit 410 (0) of the physical erasing unit 410 (0) data in physical programming units).

在本范例实施例中,暂时地维持此等暂态关系的运作称为开启(open)母子物理抹除单元,并且原物理抹除单元(例如,上述物理抹除单元410(0))称为母物理抹除单元而用以替换母物理抹除单元的物理抹除单元(例如,上述与物理抹除单元410(H+1))称为子物理抹除单元。In this exemplary embodiment, the operation of temporarily maintaining these transient relationships is called opening (opening) the parent-child physical erasing unit, and the original physical erasing unit (for example, the above-mentioned physical erasing unit 410(0)) is called The physical erasing unit (for example, the above physical erasing unit 410(H+1)) used to replace the mother physical erasing unit is called a child physical erasing unit.

之后,当需要将物理抹除单元410(0)与物理抹除单元410(H+1)的数据合并(merge)时,存储器控制器104(或存储器管理电路202)会将物理抹除单元410(0)与物理抹除单元410(H+1)的数据整并至一个物理抹除单元,由此提升物理抹除单元的使用效率。在此,合并母子物理抹除单元的运作称为数据合并程序或关闭(close)母子物理抹除单元。例如,如图24所示,当进行关闭母子区块时,存储器控制器104(或存储器管理电路202)会从物理抹除单元410(0)中读取剩余的有效数据(即,物理抹除单元410(0)的第5~K物理编程单元中的数据),将物理抹除单元410(0)中剩余的有效数据写入至物理抹除单元410(H+1)的第5物理编程单元~第K物理编程单元中,对物理抹除单元410(0)执行抹除操作,抹除后的物理抹除单元410(0)关联至闲置区504并且将物理抹除单元410(H+1)关联至数据区502。也就是说,存储器控制器104(或存储器管理电路202)会在逻辑转物理地址映射表中将逻辑单元LBA(0)重新映射至物理抹除单元410(H+1)。值得一提的是,闲置区504中物理抹除单元的数目是有限的,基此,在存储器存储装置100运作期间,已开启的母子物理抹除单元组的数目亦会受到限制。因此,当存储器存储装置100接收到来自于主机系统1000的写入指令时,倘若已开启母子物理抹除单元组的数目达到上限时,存储器控制器104需关闭至少一组目前已开启的母子物理抹除单元组后才可执行此写入指令。Afterwards, when the data of the physical erasing unit 410 (0) and the physical erasing unit 410 (H+1) need to be merged (merge), the memory controller 104 (or memory management circuit 202) will physically erase the unit 410 (0) and the data of the physical erasing unit 410 (H+1) are merged into one physical erasing unit, thereby improving the usage efficiency of the physical erasing unit. Here, the operation of merging the parent-child physical erasing unit is called a data merging procedure or closing (close) the parent-child physical erasing unit. For example, as shown in FIG. 24 , when the parent-child block is closed, the memory controller 104 (or the memory management circuit 202) will read the remaining valid data from the physical erase unit 410 (0) (that is, the physical erase Data in the 5th to K physical programming units of unit 410 (0), write the remaining valid data in physical erasing unit 410 (0) to the fifth physical programming of physical erasing unit 410 (H+1) In the unit to the Kth physical programming unit, the erase operation is performed on the physical erase unit 410(0), and the erased physical erase unit 410(0) is associated with the idle area 504 and the physical erase unit 410 (H+ 1) Link to the data area 502 . That is to say, the memory controller 104 (or the memory management circuit 202 ) remaps the logical unit LBA(0) to the physical erasing unit 410(H+1) in the logical-to-physical address mapping table. It is worth mentioning that the number of physical erasing units in the spare area 504 is limited. Therefore, during the operation of the memory storage device 100 , the number of activated parent-child physical erasing unit groups is also limited. Therefore, when the memory storage device 100 receives a write command from the host system 1000, if the number of the opened mother-child physical erasing unit groups reaches the upper limit, the memory controller 104 needs to close at least one group of currently opened mother-child physical erasing units. This write command can only be executed after the cell group is erased.

图25是根据本发明一范例实施例所绘示的数据写入方法的流程图。FIG. 25 is a flowchart of a data writing method according to an exemplary embodiment of the present invention.

请参照图25,在步骤S2501中,至少一个物理抹除单元会从闲置区504被提取作为全域混乱区550的物理抹除单元。Referring to FIG. 25 , in step S2501 , at least one physical erasing unit is extracted from the spare area 504 as a physical erasing unit of the global chaotic area 550 .

在步骤S2503中,全域混乱区搜寻表会被建立并存储在缓冲存储器208中以记录在全域混乱区550中对应多个已更新逻辑页面的更新信息。In step S2503 , a global chaotic area search table is established and stored in the buffer memory 208 to record update information corresponding to a plurality of updated logical pages in the global chaotic area 550 .

在步骤S2505中,指示写入数据至一个逻辑单元(以下称为第一逻辑单元)的一个逻辑页面(以下称为第一逻辑页面)的写入指令与对应此写入指令的更新数据会被接收。In step S2505, the write command indicating to write data to a logical page (hereinafter referred to as the first logical page) of a logical unit (hereinafter referred to as the first logical unit) and the update data corresponding to the write command will be take over.

在步骤S2507中,目前全域混乱区550的数据零散程度会被记录并且被判断是否小于数据零散程度阈值。In step S2507, the current data fragmentation degree of the global chaos area 550 will be recorded and judged whether it is smaller than the data fragmentation degree threshold.

倘若目前全域混乱区550的数据零散程度小于数据零散程度阈值时,则在步骤S2509中,此更新数据会被写入至全域混乱区550中并且对应此第一逻辑页面的更新信息会被记录在全域混乱区搜寻表中。写入更新数据至全域混乱区550以及在全域混乱区搜寻表中记录更新信息的方式已配合图8~15详细描述如上,在此不再赘述。If the current fragmentation of data in the global chaos area 550 is less than the data fragmentation threshold, then in step S2509, the update data will be written into the global chaos area 550 and the update information corresponding to the first logical page will be recorded in In the global chaos area search table. The manner of writing update data into the global chaos area 550 and recording the update information in the search table of the global chaos area has been described in detail above with reference to FIGS. 8-15 , and will not be repeated here.

倘若目前全域混乱区550的数据零散程度非小于数据零散程度阈值时,则在步骤S2511中,一个物理抹除单元(以下称为第一物理抹除单元)会从闲置区504中被提取作为对应第一逻辑单元的子物理抹除单元并且更新数据会被写入至对应第一逻辑单元的子物理抹除单元中。以子物理抹除单元来写入更新数据的方式已配合图22~24详细描述如上,在此不再赘述。If the fragmentation degree of data in the global chaotic area 550 is not less than the data fragmentation degree threshold, then in step S2511, a physical erasing unit (hereinafter referred to as the first physical erasing unit) will be extracted from the spare area 504 as a corresponding The sub-physical erasing unit of the first logical unit and update data are written into the sub-physical erasing unit corresponding to the first logical unit. The manner of writing update data in sub-physical erasing units has been described above in detail with reference to FIGS. 22-24 , and will not be repeated here.

值得一提的是,倘若全域混乱区已存有属于目前欲写入更新数据的逻辑单元时,将更新数据写入至全域混乱区550中并不会增加全域混乱区550的数据零散程度,因此,可直接将更新数据存入至全域混乱区550。例如,在本发明另一范例实施例中,在上述步骤S2507之前,可更判断全域混乱区550是否存有属于第一逻辑单元的有效数据。并且,倘若全域混乱区550存有属于第一逻辑单元的有效数据时,步骤S2509会被执行。倘若全域混乱区550未存有属于第一逻辑单元的有效数据时,才执行步骤S2507。It is worth mentioning that if the global chaotic area already has logical units that belong to the current data to be written into, writing the update data into the global chaotic area 550 will not increase the fragmentation of data in the global chaotic area 550, so , the update data can be directly stored in the global chaos area 550 . For example, in another exemplary embodiment of the present invention, before the above step S2507, it may be further determined whether the global chaos area 550 stores valid data belonging to the first logic unit. Moreover, if the global chaos area 550 stores valid data belonging to the first logic unit, step S2509 will be executed. Step S2507 is executed only if no valid data belonging to the first logical unit is stored in the global chaos area 550 .

综上所述,本发明范例实施例的数据写入方法、存储器控制器与存储器存储装置在将更新数据写入至全域混乱区之前会计算全域混乱区的数据零散程度,并且仅当全域混乱区的数据零散程度小于数据零散程度阈值才将更新数据暂存于全域混乱区中,由此可避免在执行全域混乱物理抹除单元有效数据合并运作时耗费过多时间于更新逻辑转物理地址表,而延迟写入指令的执行。因此,本发明范例实施例的数据写入方法、存储器控制器与存储器存储装置可有效地提升数据写入的效能。To sum up, the data writing method, memory controller and memory storage device of the exemplary embodiments of the present invention will calculate the data fragmentation degree of the global chaotic area before writing the update data into the global chaotic area, and only when the global chaotic area The updated data is temporarily stored in the global chaos area only when the fragmentation degree of the data is less than the threshold value of the fragmentation degree of data, thereby avoiding wasting too much time on updating the logical-to-physical address table when performing the effective data merging operation of the global chaos physical erasing unit, Instead, the execution of the write instruction is delayed. Therefore, the data writing method, the memory controller and the memory storage device of the exemplary embodiments of the present invention can effectively improve the performance of data writing.

Claims (21)

1. a method for writing data, for writing data to reproducible nonvolatile memorizer module, wherein this reproducible nonvolatile memorizer module has multiple physics erased cell, each these physics erased cell has multiple physics programming unit, these physics erased cell are at least grouped into a data field and an idle district, the physics erased cell in this idle district is in order to replace the physics erased cell of this data field to write data, multiple logical block is configured to these physics erased cell mapping this data field, and each these logical block has multiple logical page (LPAGE), this method for writing data comprises:
At least one physics erased cell is extracted as the chaotic district of a universe from these physics erased cell in this idle district, wherein the chaotic district of this universe is in order to the temporary data belonging to multiple more new logical page, and these more new logical page to belong among these logical blocks multiple upgrades logical block;
Set up the chaotic district's search table of a universe to be recorded in multiple lastest imformations of these more new logical page corresponding in the chaotic district of this universe;
Receive a write instruction with to a more new data that should write instruction, wherein this more new data be belong to one first logical page (LPAGE) and this first logical page (LPAGE) belongs to one first logical block among these logical blocks;
Record should the scattered degree of data in the chaotic district of universe;
Judge the scattered degree of these data in the chaotic district of universe whether being less than the scattered degree threshold value of data; And
If to should the scattered degree of these data in the chaotic district of universe be less than these data scattered degree threshold value time, by this more new data to write in the chaotic district of this universe and record should a lastest imformation of the first logical page (LPAGE) in the chaotic district's search table of this universe.
2. method for writing data as claimed in claim 1, also comprises:
If to should the scattered degree of these data in the chaotic district of universe is non-be less than these data scattered degree threshold value time, one first physics erased cell is extracted as to should a muon physics erased cell of the first logical block among these physics erased cell in this idle district, by this more new data write in this muon physics erased cell, and upgrade a logic of the first logical block turning physical address mapping table, wherein this muon physics erased cell is only in order to store the data belonging to this first logical block.
3. method for writing data as claimed in claim 1, also comprises:
These logical blocks are grouped into multiple logic region; And
Configure multiple logic and turn physical address mapping table to be assigned to these logic regions respectively, wherein these logics turn physical address mapping table in order to record multiple mapping relations between the logical block of these logic regions and the physics erased cell of this data field and each these logic turns physical address mapping table is configured independently to one of them of these logic regions.
4. method for writing data as claimed in claim 3, wherein these have upgraded multiple that logical block belongs among these logic regions and have upgraded logic region,
Wherein record should the step of the scattered degree of these data in the chaotic district of universe comprise:
Calculate the number that these have upgraded logic region; And
Record these numbers having upgraded logic region as to should the scattered degree of these data in the chaotic district of universe.
5. method for writing data as claimed in claim 1, wherein records should the step of the scattered degree of these data in the chaotic district of universe comprise:
Calculate the number that these have upgraded logical block; And
Record these numbers having upgraded logical block as to should the scattered degree of these data in the chaotic district of universe.
6. method for writing data as claimed in claim 1, wherein records should the step of the scattered degree of these data in the chaotic district of universe comprise:
Calculate the number that multiple logic to be updated turns physical address mapping table, wherein these logics to be updated turn physical address mapping table in order to the mapping between the physics erased cell that records these and upgraded logical block and this data field; And
Record number that these logics to be updated turn physical address mapping table as to should the scattered degree of these data in the chaotic district of universe.
7. method for writing data as claimed in claim 1, also comprises:
Judge whether there are the valid data belonging to this first logical block in the chaotic district of this universe; And
If when having the valid data belonging to this first logical block in the chaotic district of this universe, by this more new data write in the chaotic district of this universe,
Wherein above-mentioned judgement to should the scattered degree of these data in the chaotic district of the universe step that whether is less than the scattered degree threshold value of these data be and do not have the valid data belonging to this first logical block in the chaotic district of this universe time be performed.
8. a Memory Controller, for controlling a reproducible nonvolatile memorizer module, this Memory Controller comprises:
One host interface, in order to be electrically connected to a host computer system;
One memory interface, in order to be electrically connected to this reproducible nonvolatile memorizer module, wherein this reproducible nonvolatile memorizer module has multiple physics erased cell, each these physics erased cell has multiple physics programming unit, these physics erased cell are at least grouped into a data field and an idle district, and the physics erased cell in this idle district is in order to replace the physics erased cell of this data field to write data; And
One memory management circuitry, is electrically connected to this host interface and this memory interface, and in order to configure multiple logical block to map these physics erased cell of this data field, wherein each these logical block has multiple logical page (LPAGE),
Wherein this memory management circuitry also in order to extract at least one physics erased cell as the chaotic district of a universe from these physics erased cell in this idle district, wherein the chaotic district of this universe is in order to the temporary data belonging to multiple more new logical page, and these more new logical page to belong among these logical blocks multiple upgrades logical block
Wherein this memory management circuitry is also in order to set up the chaotic district's search table of a universe to be recorded in multiple lastest imformations of these more new logical page corresponding in the chaotic district of this universe,
Wherein this memory management circuitry also in order to receive a write instruction with to a more new data that should write instruction, this more new data be belong to one first logical page (LPAGE) and this first logical page (LPAGE) belongs to one first logical block among these logical blocks,
Wherein this memory management circuitry also in order to record to should the chaotic district of universe the scattered degree of data and judge the scattered degree of these data in universe confusion district whether being less than the scattered degree threshold value of data,
If wherein to should the scattered degree of these data in the chaotic district of universe be less than these data scattered degree threshold value time, this memory management circuitry by this more new data to write in the chaotic district of this universe and record should a lastest imformation of the first logical page (LPAGE) in the chaotic district's search table of this universe.
9. Memory Controller as claimed in claim 8, if wherein to should the scattered degree of these data in the chaotic district of universe is non-be less than these data scattered degree threshold value time, this memory management circuitry extracts one first physics erased cell as to should a muon physics erased cell of the first logical block among these physics erased cell in this idle district, by this more new data write in this muon physics erased cell, and upgrade a logic of the first logical block turning physical address mapping table
Wherein this muon physics erased cell is only in order to store the data belonging to this first logical block.
10. Memory Controller as claimed in claim 8, wherein this memory management circuitry also turns physical address mapping table to be assigned to these logic regions respectively in order to these logical blocks are grouped into multiple logic region and configure multiple logic,
Wherein these logics turn physical address mapping table in order to record multiple mapping relations between the logical block of these logic regions and the physics erased cell of this data field and each these logic turns physical address mapping table is configured independently to one of them of these logic regions.
11. Memory Controllers as claimed in claim 10, wherein these have upgraded multiple that logical block belongs among these logic regions and have upgraded logic region,
Wherein record to should the chaotic district of universe the scattered degree of these data running in, this memory management circuitry calculates these numbers having upgraded logic region and records these numbers having upgraded logic region as to should the scattered degree of these data in the chaotic district of universe.
12. Memory Controllers as claimed in claim 8, wherein record to should the chaotic district of universe the scattered degree of these data running in, this memory management circuitry calculates these numbers having upgraded logical block and records these numbers having upgraded logical block as to should the scattered degree of these data in the chaotic district of universe.
13. Memory Controllers as claimed in claim 8, wherein record to should the chaotic district of universe the scattered degree of these data running in, this memory management circuitry calculates multiple logic to be updated and turns the number of physical address mapping table and record number that these logics to be updated turn physical address mapping table as to should the scattered degree of these data in the chaotic district of universe
Wherein these logics to be updated turn physical address mapping table in order to the mapping between the physics erased cell that records these and upgraded logical block and this data field.
14. Memory Controllers as claimed in claim 8, wherein this memory management circuitry is also in order to judge whether there are the valid data belonging to this first logical block in the chaotic district of this universe,
If when wherein having the valid data belonging to this first logical block in the chaotic district of this universe, this memory management circuitry by this more new data write in the chaotic district of this universe,
Above-mentioned judgement is performed to the scattered degree of these data in the chaotic district of universe whether being less than the running of these data scattered degree threshold value when wherein this memory management circuitry is and does not have the valid data belonging to this first logical block in the chaotic district of this universe.
15. 1 kinds of memory storage apparatus, comprising:
A connector, in order to be electrically connected to a host computer system;
One reproducible nonvolatile memorizer module, there is multiple physics erased cell, each these physics erased cell has multiple physics programming unit, these physics erased cell are at least grouped into a data field and an idle district, and the physics erased cell in this idle district is in order to replace the physics erased cell of this data field to write data; And
One Memory Controller, is electrically connected to this connector and this reproducible nonvolatile memorizer module, and in order to configure multiple logical block to map these physics erased cell of this data field, wherein each these logical block has multiple logical page (LPAGE),
Wherein this Memory Controller also in order to extract at least one physics erased cell as the chaotic district of a universe from these physics erased cell in this idle district, wherein the chaotic district of this universe is in order to the temporary data belonging to multiple more new logical page, and these more new logical page to belong among these logical blocks multiple upgrades logical block
Wherein this Memory Controller is also in order to set up the chaotic district's search table of a universe to be recorded in multiple lastest imformations of these more new logical page corresponding in the chaotic district of this universe,
Wherein this Memory Controller also in order to receive a write instruction with to a more new data that should write instruction, this more new data be belong to one first logical page (LPAGE) and this first logical page (LPAGE) belongs to one first logical block among these logical blocks,
Wherein this Memory Controller also in order to record to should the chaotic district of universe the scattered degree of data and judge the scattered degree of these data in universe confusion district whether being less than the scattered degree threshold value of data,
If wherein to should the scattered degree of these data in the chaotic district of universe be less than these data scattered degree threshold value time, this Memory Controller by this more new data to write in the chaotic district of this universe and record should a lastest imformation of the first logical page (LPAGE) in the chaotic district's search table of this universe.
16. memory storage apparatus as claimed in claim 15, if wherein to should the scattered degree of these data in the chaotic district of universe is non-be less than these data scattered degree threshold value time, this Memory Controller extracts one first physics erased cell as to should a muon physics erased cell of the first logical block among these physics erased cell in this idle district, by this more new data write in this muon physics erased cell, and upgrade a logic of the first logical block turning physical address mapping table
Wherein this muon physics erased cell is only in order to store the data belonging to this first logical block.
17. memory storage apparatus as claimed in claim 15, wherein this Memory Controller also turns physical address mapping table to be assigned to these logic regions respectively in order to these logical blocks are grouped into multiple logic region and configure multiple logic,
Wherein these logics turn physical address mapping table in order to record multiple mapping relations between the logical block of these logic regions and the physics erased cell of this data field and each these logic turns physical address mapping table is configured independently to one of them of these logic regions.
18. memory storage apparatus as claimed in claim 17, wherein these have upgraded multiple that logical block belongs among these logic regions and have upgraded logic region,
Wherein record to should the chaotic district of universe the scattered degree of these data running in, this Memory Controller calculates these numbers having upgraded logic region and records these numbers having upgraded logic region as to should the scattered degree of these data in the chaotic district of universe.
19. memory storage apparatus as claimed in claim 15, wherein record to should the chaotic district of universe the scattered degree of these data running in, this Memory Controller calculates these numbers having upgraded logical block and records these numbers having upgraded logical block as to should the scattered degree of these data in the chaotic district of universe.
20. memory storage apparatus as claimed in claim 15, wherein record to should the chaotic district of universe the scattered degree of these data running in, this Memory Controller calculates multiple logic to be updated and turns the number of physical address mapping table and record number that these logics to be updated turn physical address mapping table as to should the scattered degree of these data in the chaotic district of universe
Wherein these logics to be updated turn physical address mapping table in order to the mapping between the physics erased cell that records these and upgraded logical block and this data field.
21. memory storage apparatus as claimed in claim 15, wherein this Memory Controller is also in order to judge whether there are the valid data belonging to this first logical block in the chaotic district of this universe,
If when wherein having the valid data belonging to this first logical block in the chaotic district of this universe, this Memory Controller by this more new data write in the chaotic district of this universe,
Above-mentioned judgement is performed to the scattered degree of these data in the chaotic district of universe whether being less than the running of these data scattered degree threshold value when wherein this Memory Controller is and does not have the valid data belonging to this first logical block in the chaotic district of this universe.
CN201310253210.7A 2013-06-24 2013-06-24 Data writing method, memory controller and memory storage device Pending CN104238956A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310253210.7A CN104238956A (en) 2013-06-24 2013-06-24 Data writing method, memory controller and memory storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310253210.7A CN104238956A (en) 2013-06-24 2013-06-24 Data writing method, memory controller and memory storage device

Publications (1)

Publication Number Publication Date
CN104238956A true CN104238956A (en) 2014-12-24

Family

ID=52227125

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310253210.7A Pending CN104238956A (en) 2013-06-24 2013-06-24 Data writing method, memory controller and memory storage device

Country Status (1)

Country Link
CN (1) CN104238956A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106469122A (en) * 2015-08-14 2017-03-01 群联电子股份有限公司 Effective data merging method, memory controller and memory storage device
CN107132989A (en) * 2016-02-26 2017-09-05 群联电子股份有限公司 Data programming method, memory control circuit unit and memory storage device
CN113312274A (en) * 2020-02-27 2021-08-27 群联电子股份有限公司 Data sorting method of memory, memory storage device and control circuit unit
CN114415934A (en) * 2020-10-28 2022-04-29 上海川源信息科技有限公司 Data access system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332730A1 (en) * 2009-06-30 2010-12-30 Royer Jr Robert J Method and system for managing a nand flash memory
CN102053920A (en) * 2009-10-30 2011-05-11 群联电子股份有限公司 Data writing method, flash memory controller and flash memory system
CN102467460A (en) * 2010-11-12 2012-05-23 群联电子股份有限公司 Data management method, memory controller and memory storage device
CN102543183A (en) * 2010-12-21 2012-07-04 群联电子股份有限公司 Data writing method, memory controller and storage device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100332730A1 (en) * 2009-06-30 2010-12-30 Royer Jr Robert J Method and system for managing a nand flash memory
CN102053920A (en) * 2009-10-30 2011-05-11 群联电子股份有限公司 Data writing method, flash memory controller and flash memory system
CN102467460A (en) * 2010-11-12 2012-05-23 群联电子股份有限公司 Data management method, memory controller and memory storage device
CN102543183A (en) * 2010-12-21 2012-07-04 群联电子股份有限公司 Data writing method, memory controller and storage device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106469122A (en) * 2015-08-14 2017-03-01 群联电子股份有限公司 Effective data merging method, memory controller and memory storage device
CN106469122B (en) * 2015-08-14 2019-11-19 群联电子股份有限公司 Effective data combination method, memory controller and memory storage device
CN107132989A (en) * 2016-02-26 2017-09-05 群联电子股份有限公司 Data programming method, memory control circuit unit and memory storage device
CN113312274A (en) * 2020-02-27 2021-08-27 群联电子股份有限公司 Data sorting method of memory, memory storage device and control circuit unit
CN113312274B (en) * 2020-02-27 2024-03-22 群联电子股份有限公司 Data sorting method of memory, memory storage device and control circuit unit
CN114415934A (en) * 2020-10-28 2022-04-29 上海川源信息科技有限公司 Data access system

Similar Documents

Publication Publication Date Title
CN103530062B (en) Data storage method, memory controller and memory storage device
CN104102585B (en) Mapping information recording method, memory controller and memory storage device
TWI470431B (en) Data writing method, memory controller and memory storage apparatus
TWI436212B (en) Data writing method, memory controller and memory storage apparatus
CN104765569B (en) Data writing method, memory control circuit unit and memory storage device
CN103514096B (en) Data storage method, memory controller and memory storage device
CN104732153A (en) Data erasing method, memory control circuit unit 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
TW201351137A (en) Memory management method, memory controller and memory storage device using the same
CN102968385B (en) Data writing method, memory controller and storage device
CN102567221B (en) Data management method, memory controller and memory storage device
CN102446137B (en) Data writing method, memory controller and memory storage device
CN104536906A (en) Data writing method, memory controller and memory storage device
CN105630687A (en) Data writing method, memory control circuit unit and memory storage device
CN104238956A (en) Data writing method, memory controller and memory storage device
CN104731710B (en) Memory management method, memory control circuit unit and memory storage device
CN104657083B (en) Data writing method, memory storage device, memory control circuit unit
CN109273033B (en) Memory management method, memory control circuit unit and memory storage device
CN103513930A (en) Memory management method, memory controller and memory storage device
CN110442299B (en) Data writing method, memory control circuit unit and memory storage device
US8832358B2 (en) Data writing method, memory controller and memory storage apparatus
CN102467459B (en) Data writing method, memory controller and memory storage device
CN102736985B (en) data merging method, controller and storage device
CN107103930A (en) Data writing method, memory control circuit unit and memory storage device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20141224

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载