CN103914391A - Data reading method, memory controller and memory storage device - Google Patents
Data reading method, memory controller and memory storage device Download PDFInfo
- Publication number
- CN103914391A CN103914391A CN201310005604.0A CN201310005604A CN103914391A CN 103914391 A CN103914391 A CN 103914391A CN 201310005604 A CN201310005604 A CN 201310005604A CN 103914391 A CN103914391 A CN 103914391A
- Authority
- CN
- China
- Prior art keywords
- logical
- memory
- logical address
- range
- read
- 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.)
- Granted
Links
Landscapes
- Read Only Memory (AREA)
Abstract
Description
技术领域technical field
本发明是有关于一种数据读取方法,且特别是有关于一种用于可擦写式非易失性存储器模块的数据读取方法、存储器控制器与存储器存储装置。The present invention relates to a data reading method, and in particular to a data reading method, a memory controller and a memory storage device for a rewritable non-volatile memory module.
背景技术Background technique
数码相机、移动电话与MP3播放器在这几年来的成长十分迅速,使得消费者对存储媒体的需求也急速增加。由于可擦写式非易失性存储器模块(例如,闪速存储器)具有数据非易失性、省电、体积小,以及无机械结构等特性,所以非常适合内置在上述所举例的各种便携式多媒体装置中。Digital cameras, mobile phones, and MP3 players have grown rapidly in recent years, making consumers' demand for storage media also increase rapidly. Since the rewritable non-volatile memory module (for example, flash memory) has the characteristics of data non-volatility, power saving, small size, and no mechanical structure, it is very suitable for being built in various portable devices such as the above examples. in the multimedia device.
一般来说,可擦写式非易失性存储器模块会由一个存储器控制器来控制,并且存储器控制器会接收来自于主机系统的读取指令。存储器控制器会根据所接收到的读取指令从可擦写式非易失性存储器模块中读取数据。存储器控制器可建立一个指令阵列,其中存储了来自于主机系统的读取指令。存储器控制器可自行决定指令阵列中读取指令的执行顺序。并且,存储器控制器可从可擦写式非易失性存储器模块预读(pre-read)一些数据至一个缓冲存储器,以便当主机系统要读取多个连续的地址时可增加读取数据的速度。然而,主机系统下达读取指令给存储器控制器不一定会依序,此会造成预读的数据从缓冲存储器中被清除。因此,如何增加读取数据的速度,为此领域技术人员所关心的议题。Generally, the erasable non-volatile memory module is controlled by a memory controller, and the memory controller receives a read command from a host system. The memory controller reads data from the erasable non-volatile memory module according to the received read command. The memory controller can create a command array in which read commands from the host system are stored. The memory controller is free to determine the execution order of the read commands in the command array. Also, the memory controller can pre-read some data from the erasable non-volatile memory module to a buffer memory, so that when the host system reads a plurality of consecutive addresses, the read data can be increased. speed. However, the read commands issued by the host system to the memory controller may not be sequential, which will cause the pre-read data to be cleared from the buffer memory. Therefore, how to increase the speed of reading data is a topic concerned by those skilled in the art.
发明内容Contents of the invention
本发明的范例实施例中提出一种数据读取方法、存储器控制器与存储器存储装置,可以增加读取数据的速度。An exemplary embodiment of the present invention proposes a data reading method, a memory controller and a memory storage device, which can increase the speed of reading data.
本发明一范例实施例提出一种数据读取方法,用于控制一可擦写式非易失性存储器模块。此可擦写式非易失性存储器模块包括多个实体擦除单元。上述的数据读取方法包括:配置多个逻辑地址以映射至部分的实体擦除单元;接收来自主机系统的多个第一读取指令,其中第一读取指令指示读取上述逻辑地址中的多个第一逻辑地址;执行第一读取指令,并且判断第一逻辑地址是否为连续;以及若第一逻辑地址为连续,从实体擦除单元中预读取属于第一逻辑范围的数据至缓冲存储器。An exemplary embodiment of the invention provides a data reading method for controlling a rewritable non-volatile memory module. The rewritable non-volatile memory module includes a plurality of physical erasable units. The above data reading method includes: configuring a plurality of logical addresses to map to a part of the entity erasing unit; receiving a plurality of first read instructions from the host system, wherein the first read instruction indicates to read the A plurality of first logical addresses; execute the first read instruction, and judge whether the first logical addresses are continuous; and if the first logical addresses are continuous, pre-read data belonging to the first logical range from the entity erasing unit to buffer memory.
在一范例实施例中,上述的数据读取方法,还包括:接收来自于主机系统的一个第二读取指令,其中第二读取指令指示读取一个第二逻辑地址;判断第二逻辑地址是否在上述逻辑地址中的一预定范围内,其中预定范围包括第一逻辑范围;若第二逻辑地址在预定范围内,判断第二逻辑地址是否为第一逻辑范围的起始逻辑地址;以及若第二逻辑地址为起始逻辑地址,则传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above data reading method further includes: receiving a second read instruction from the host system, wherein the second read instruction indicates to read a second logical address; judging the second logical address Whether it is within a predetermined range of the above-mentioned logical addresses, wherein the predetermined range includes the first logical range; if the second logical address is within the predetermined range, judging whether the second logical address is the initial logical address of the first logical range; and if If the second logical address is the initial logical address, the data belonging to the second logical address is sent to the host system.
在一范例实施例中,上述的数据读取方法,还包括:若第二逻辑地址为起始逻辑地址,从实体擦除单元中预读取属于一个第二逻辑范围的数据至缓冲存储器中,其中第二逻辑范围是接续在第一逻辑范围之后。In an exemplary embodiment, the above data reading method further includes: if the second logical address is the initial logical address, pre-reading data belonging to a second logical range from the physical erasing unit into the buffer memory, Wherein the second logical range follows the first logical range.
在一范例实施例中,上述的数据读取方法还包括:若第二逻辑地址不为起始逻辑地址,维持属于第一逻辑范围的数据在缓冲存储器中并且启动一个计时器;以及若计时器所记录的数值大于一个临界值,清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, the above data reading method further includes: if the second logical address is not the initial logical address, maintaining data belonging to the first logical range in the buffer memory and starting a timer; and if the timer If the recorded value is greater than a critical value, the data belonging to the first logical range in the buffer memory is cleared.
在一范例实施例中,上述的临界值正比于可擦写式非易失性存储器模块的读取时间。In an exemplary embodiment, the aforementioned threshold is proportional to the read time of the rewritable non-volatile memory module.
在一范例实施例中,上述的数据读取方法还包括:接收来自于主机系统的一个第三读取指令,其中第三读取指令指示读取逻辑地址中的一个第三逻辑地址;以及若第三逻辑地址为起始逻辑地址,重置计时器并且传送属于第三逻辑地址的数据至主机系统。In an exemplary embodiment, the above data reading method further includes: receiving a third read instruction from the host system, wherein the third read instruction indicates to read a third logical address in the logical addresses; and if The third logical address is the initial logical address, the timer is reset and the data belonging to the third logical address is sent to the host system.
在一范例实施例中,上述的数据读取方法还包括:若第二逻辑地址不在预定范围内,清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, the above data reading method further includes: if the second logical address is not within the predetermined range, clearing the data belonging to the first logical range in the buffer memory.
在一范例实施例中,上述的数据读取方法还包括:接收来自于主机系统的一个第二读取指令,其中第二读取指令指示读取逻辑地址中的一个第二逻辑地址;判断第二逻辑地址是否在预定范围内,其中预定范围包括第一逻辑范围;若第二逻辑地址在预定范围内,判断第二逻辑地址是否在第一逻辑范围内;若第二逻辑地址在第一逻辑范围内,传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above data reading method further includes: receiving a second read instruction from the host system, wherein the second read instruction indicates to read a second logical address among the logical addresses; Whether the second logical address is within a predetermined range, wherein the predetermined range includes the first logical range; if the second logical address is within the predetermined range, judge whether the second logical address is within the first logical range; if the second logical address is within the first logical range Within range, data belonging to the second logical address is transmitted to the host system.
在一范例实施例中,上述的数据读取方法还包括:若第二逻辑地址不在第一逻辑范围内,维持属于第一逻辑范围的数据在缓冲存储器中并且启动一计时器;以及若计时器所记录的数值大于临界值,清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, the above data reading method further includes: if the second logical address is not within the first logical range, maintaining data belonging to the first logical range in the buffer memory and starting a timer; and if the timer The recorded value is greater than the critical value, and the data belonging to the first logical range in the buffer memory is cleared.
在一范例实施例中,上述第一逻辑范围的大小等于缓冲存储器的存储器空间的大小。In an exemplary embodiment, the size of the above-mentioned first logical range is equal to the size of the memory space of the buffer memory.
以另外一个角度来说,本发明一范例实施例提出一种存储器存储装置,包括连接器、可擦写式非易失性存储器模块与存储器控制器。连接器是用以电性连接至一主机系统。可擦写式非易失性存储器模块包括多个实体擦除单元。存储器控制器是电性连接至连接器与可擦写式非易失性存储器模块,用以配置多个逻辑地址以映射至部分的实体擦除单元,并且接收来自主机系统的多个第一读取指令。这些第一读取指令指示读取上述逻辑地址中的多个第一逻辑地址。存储器控制器也用以执行这些第一读取指令,并且判断第一逻辑地址是否为连续。若第一逻辑地址为连续,存储器控制器用以从实体擦除单元中预读取属于上述逻辑地址中第一逻辑范围的数据至一个缓冲存储器。From another perspective, an exemplary embodiment of the present invention provides a memory storage device, including a connector, a rewritable non-volatile memory module, and a memory controller. The connector is used to electrically connect to a host system. The rewritable non-volatile memory module includes multiple physical erasing units. The memory controller is electrically connected to the connector and the rewritable non-volatile memory module for configuring a plurality of logical addresses to map to a part of the physical erase unit, and receiving a plurality of first reads from the host system Fetch instructions. These first read instructions indicate to read a plurality of first logical addresses among the above logical addresses. The memory controller is also used to execute the first read commands and determine whether the first logical addresses are continuous. If the first logical address is continuous, the memory controller is used to pre-read data belonging to the first logical range in the above logical address from the physical erasing unit to a buffer memory.
在一范例实施例中,上述的存储器控制器还用以接收来自于主机系统的第二读取指令,其中第二读取指令指示读取逻辑地址中的第二逻辑地址。存储器控制器还用以判断第二逻辑地址是否在逻辑地址中的预定范围内,其中预定范围包括第一逻辑范围。若第二逻辑地址在预定范围内,存储器控制器还用以判断第二逻辑地址是否为第一逻辑范围的起始逻辑地址。若第二逻辑地址为起始逻辑地址,存储器控制器还用以传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above-mentioned memory controller is further configured to receive a second read command from the host system, wherein the second read command indicates to read a second logical address among the logical addresses. The memory controller is also used to determine whether the second logical address is within a predetermined range of logical addresses, wherein the predetermined range includes the first logical range. If the second logical address is within the predetermined range, the memory controller is also used to determine whether the second logical address is the initial logical address of the first logical range. If the second logical address is the initial logical address, the memory controller is further configured to transmit data belonging to the second logical address to the host system.
在一范例实施例中,若第二逻辑地址不为起始逻辑地址,存储器控制器还用以维持属于第一逻辑范围的数据在缓冲存储器中并且启动计时器。若计时器所记录的数值大于临界值,存储器控制器还用以清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, if the second logical address is not the initial logical address, the memory controller is further configured to maintain data belonging to the first logical range in the buffer memory and start a timer. If the value recorded by the timer is greater than the critical value, the memory controller is also used to clear the data belonging to the first logical range in the buffer memory.
在一范例实施例中,上述的存储器控制器还用以接收来自于主机系统的第三读取指令,其中第三读取指令指示读取逻辑地址中的第三逻辑地址。若第三逻辑地址为起始逻辑地址,存储器控制器还用以重置计时器并且传送属于第三逻辑地址的数据至主机系统。In an exemplary embodiment, the above-mentioned memory controller is further configured to receive a third read command from the host system, wherein the third read command indicates to read a third logical address among the logical addresses. If the third logical address is the initial logical address, the memory controller is also used to reset the timer and transmit the data belonging to the third logical address to the host system.
在一范例实施例中,上述的存储器控制器还用以接收来自于主机系统的第二读取指令,其中第二读取指令指示读取逻辑地址中的第二逻辑地址。存储器控制器还用以判断第二逻辑地址是否在逻辑地址中的预定范围内。若第二逻辑地址在预定范围内,存储器控制器还用以判断第二逻辑地址是否在第一逻辑范围内。若第二逻辑地址在第一逻辑范围内,存储器控制器还用以传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above-mentioned memory controller is further configured to receive a second read command from the host system, wherein the second read command indicates to read a second logical address among the logical addresses. The memory controller is also used to determine whether the second logical address is within a predetermined range of logical addresses. If the second logical address is within the predetermined range, the memory controller is also used to determine whether the second logical address is within the first logical range. If the second logical address is within the first logical range, the memory controller is further configured to transmit data belonging to the second logical address to the host system.
在一范例实施例中,若第二逻辑地址不在第一逻辑范围内,存储器控制器还用以维持属于第一逻辑范围的数据在缓冲存储器中并且启动计时器。若计时器所记录的数值大于临界值,存储器控制器还用以清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, if the second logical address is not within the first logical range, the memory controller is further configured to maintain data belonging to the first logical range in the buffer memory and start a timer. If the value recorded by the timer is greater than the critical value, the memory controller is also used to clear the data belonging to the first logical range in the buffer memory.
以另外一个角度来说,本发明一范例实施例提出一种存储器控制器,用于控制一可擦写式非易失性存储器模块。此存储器控制器包括主机接口、存储器接口与存储器管理电路。主机接口是用以电性连接至一主机系统。存储器接口是用以电性连接至可擦写式非易失性存储器模块,并且此可擦写式非易失性存储器模块包括多个实体擦除单元。存储器管理电路是电性连接至主机接口与存储器接口,用以配置多个逻辑地址以映射至部分的实体擦除单元,并且接收来自主机系统的多个第一读取指令。其中这些第一读取指令指示读取上述逻辑地址中的多个第一逻辑地址。存储器管理电路也用以执行第一读取指令,并且判断第一逻辑地址是否为连续。若第一逻辑地址为连续,存储器管理电路用以从实体擦除单元中预读取属于上述逻辑地址中第一逻辑范围的数据至一个缓冲存储器。From another point of view, an exemplary embodiment of the present invention provides a memory controller for controlling a rewritable non-volatile memory module. The memory controller includes a host interface, a memory interface and a memory management circuit. The host interface is used to electrically connect to a host system. The memory interface is used to electrically connect to the rewritable nonvolatile memory module, and the rewritable nonvolatile memory module includes a plurality of physical erasing units. The memory management circuit is electrically connected to the host interface and the memory interface, and is used to configure a plurality of logical addresses to be mapped to part of the physical erasing units, and receive a plurality of first read commands from the host system. Wherein these first read instructions indicate to read multiple first logical addresses in the above logical addresses. The memory management circuit is also used for executing the first read command and judging whether the first logical addresses are consecutive. If the first logical address is continuous, the memory management circuit is used to pre-read data belonging to the first logical range in the above logical address from the physical erasing unit to a buffer memory.
在一范例实施例中,上述的存储器管理电路还用以接收来自于主机系统的第二读取指令,其中第二读取指令指示读取逻辑地址中的第二逻辑地址。存储器管理电路还用以判断第二逻辑地址是否在逻辑地址中的预定范围内,其中预定范围包括第一逻辑范围。若第二逻辑地址在预定范围内,存储器管理电路还用以判断第二逻辑地址是否为第一逻辑范围的起始逻辑地址。若第二逻辑地址为起始逻辑地址,存储器管理电路还用以传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above-mentioned memory management circuit is further configured to receive a second read command from the host system, wherein the second read command indicates to read a second logical address among the logical addresses. The memory management circuit is also used to determine whether the second logical address is within a predetermined range of logical addresses, wherein the predetermined range includes the first logical range. If the second logical address is within the predetermined range, the memory management circuit is also used to determine whether the second logical address is the initial logical address of the first logical range. If the second logical address is the initial logical address, the memory management circuit is also used to transmit data belonging to the second logical address to the host system.
在一范例实施例中,若第二逻辑地址为起始逻辑地址,存储器管理电路还用以从实体擦除单元中预读取属于第二逻辑范围的数据至缓冲存储器中,其中第二逻辑范围是接续在第一逻辑范围之后。In an exemplary embodiment, if the second logical address is the initial logical address, the memory management circuit is further used to pre-read data belonging to the second logical range from the physical erase unit into the buffer memory, wherein the second logical range is after the first logical range.
在一范例实施例中,若第二逻辑地址不为起始逻辑地址,存储器管理电路还用以维持属于第一逻辑范围的数据在缓冲存储器中并且启动计时器。若计时器所记录的数值大于临界值,存储器管理电路还用以清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, if the second logical address is not the initial logical address, the memory management circuit is further configured to maintain data belonging to the first logical range in the buffer memory and start a timer. If the value recorded by the timer is greater than the critical value, the memory management circuit is also used to clear the data belonging to the first logic range in the buffer memory.
在一范例实施例中,上述的存储器管理电路还用以接收来自于主机系统的第三读取指令,其中第三读取指令指示读取逻辑地址中的第三逻辑地址。若第三逻辑地址为起始逻辑地址,存储器管理电路还用以重置计时器并且传送属于第三逻辑地址的数据至主机系统。In an exemplary embodiment, the above memory management circuit is further configured to receive a third read command from the host system, wherein the third read command indicates to read a third logical address among the logical addresses. If the third logical address is the initial logical address, the memory management circuit is further used to reset the timer and transmit the data belonging to the third logical address to the host system.
在一范例实施例中,若第二逻辑地址不在预定范围内,存储器管理电路还用以清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, if the second logical address is not within the predetermined range, the memory management circuit is further configured to clear data belonging to the first logical range in the buffer memory.
在一范例实施例中,上述的存储器管理电路还用以接收来自于主机系统的第二读取指令,其中第二读取指令指示读取逻辑地址中的第二逻辑地址。存储器管理电路还用以判断第二逻辑地址是否在逻辑地址中的预定范围内。若第二逻辑地址在预定范围内,存储器管理电路还用以判断第二逻辑地址是否在第一逻辑范围内。若第二逻辑地址在第一逻辑范围内,存储器管理电路还用以传送属于第二逻辑地址的数据给主机系统。In an exemplary embodiment, the above-mentioned memory management circuit is further configured to receive a second read command from the host system, wherein the second read command indicates to read a second logical address among the logical addresses. The memory management circuit is also used to determine whether the second logical address is within a predetermined range of logical addresses. If the second logical address is within the predetermined range, the memory management circuit is also used to determine whether the second logical address is within the first logical range. If the second logical address is within the first logical range, the memory management circuit is further configured to transmit data belonging to the second logical address to the host system.
在一范例实施例中,若第二逻辑地址不在第一逻辑范围内,存储器管理电路还用以维持属于第一逻辑范围的数据在缓冲存储器中并且启动计时器。若计时器所记录的数值大于临界值,存储器管理电路还用以清除缓冲存储器中属于第一逻辑范围的数据。In an exemplary embodiment, if the second logical address is not within the first logical range, the memory management circuit is further configured to maintain data belonging to the first logical range in the buffer memory and start a timer. If the value recorded by the timer is greater than the critical value, the memory management circuit is also used to clear the data belonging to the first logic range in the buffer memory.
基于上述,本发明所提出的数据读取方法、存储器控制器与存储器存储装置会根据已经执行完毕的读取指令是否读取了连续的逻辑地址来判断是否要预读数据。由此,可以增加读取数据的速度。Based on the above, the data reading method, the memory controller and the memory storage device proposed by the present invention judge whether to pre-read data according to whether the executed read command reads continuous logical addresses. Thus, the speed at which data is read can be increased.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。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
图1A是根据一范例实施例所示出的主机系统与存储器存储装置的示意图;FIG. 1A is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment;
图1B是根据一范例实施例所示出的电脑、输入/输出装置与存储器存储装置的示意图;FIG. 1B is a schematic diagram of a computer, an input/output device and a memory storage device according to an exemplary embodiment;
图1C是根据一范例实施例所示出的主机系统与存储器存储装置的示意图;FIG. 1C is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment;
图2是示出图1A所示的存储器存储装置的概要方块图;FIG. 2 is a schematic block diagram illustrating the memory storage device shown in FIG. 1A;
图3是根据一范例实施例所示出的存储器控制器的概要方块图;FIG. 3 is a schematic block diagram of a memory controller according to an exemplary embodiment;
图4是根据一范例实施例所示出的管理可擦写式非易失性存储器模块的范例示意图;Fig. 4 is an exemplary schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment;
图5是根据一范例实施例示出记录档的范例示意图;Fig. 5 is an exemplary schematic diagram illustrating a log file according to an exemplary embodiment;
图6A是根据一范例实施例示出预读取属于一个逻辑范围的数据的示意图;FIG. 6A is a schematic diagram illustrating prefetching data belonging to a logical range according to an exemplary embodiment;
图6B是根据一范例实施例示出判断预读取数据以后的系统流程图;FIG. 6B is a flow chart of the system after judging the pre-read data according to an exemplary embodiment;
图7是根据一范例实施例示出数据读取方法的流程图。FIG. 7 is a flowchart illustrating a data reading method according to an exemplary embodiment.
附图标记说明:Explanation of reference signs:
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:U盘;1212: U disk;
1214:存储卡;1214: memory card;
1216:固态硬盘;1216: SSD;
1310:数码相机;1310: digital camera;
1312:SD卡;1312: SD card;
1314:MMC卡;1314: MMC card;
1316:存储卡;1316: memory card;
1318:CF卡;1318: CF card;
1320:嵌入式存储装置;1320: embedded storage device;
100:存储器存储装置;100: memory storage device;
102:连接器;102: connector;
104:存储器控制器;104: memory controller;
106:可擦写式非易失性存储器模块;106: erasable non-volatile memory module;
304(0)~304(R):实体擦除单元;304(0)~304(R): entity erasing unit;
202:存储器管理电路;202: memory management circuit;
204:主机接口;204: host interface;
206:存储器接口;206: memory interface;
252:缓冲存储器;252: buffer memory;
254:电源管理电路;254: power management circuit;
256:错误检查与校正电路;256: error checking and correction circuit;
410:数据区;410: data area;
420:闲置区;420: idle area;
430:系统区;430: system area;
440:取代区;440: replacement area;
450(0)~450(E):逻辑地址450(0)~450(E): logical address
510:记录档;510: record file;
511~515:读取指令;511~515: read instruction;
610、640:逻辑范围;610, 640: logical range;
620:逻辑地址;620: logical address;
630:预定范围;630: predetermined range;
S602、S604、S606、S608、S610、S612、S614:系统流程图的步骤;S602, S604, S606, S608, S610, S612, S614: steps of the system flowchart;
S702、S704、S706、S708:数据读取方法的步骤。S702, S704, S706, S708: steps of the data reading method.
具体实施方式Detailed ways
[第一范例实施例][First Exemplary Embodiment]
一般而言,存储器存储装置(也称,存储器存储系统)包括可擦写式非易失性存储器模块与控制器(也称,控制电路)。通常存储器存储装置是与主机系统一起使用,以使主机系统可将数据写入至存储器存储装置或从存储器存储装置中读取数据。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.
图1A是根据一范例实施例所示出的主机系统与存储器存储装置的示意图。FIG. 1A is a schematic diagram of a host system and a memory storage device according to an exemplary embodiment.
请参照图1A,主机系统1000一般包括电脑1100与输入/输出(input/output,I/O)装置1106。电脑1100包括微处理器1102、随机存取存储器(random access memory,RAM)1104、系统总线1108与数据传输接口1110。图1B是根据一范例实施例所示出的电脑、输入/输出装置与存储器存储装置的示意图,参照图1B,输入/输出装置1106包括如图1B的鼠标1202、键盘1204、显示器1206与打印机1208。必须了解的是,图1B所示的装置非限制输入/输出装置1106,输入/输出装置1106可还包括其他装置。Referring to FIG. 1A , 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 . 1B is a schematic diagram of a computer, an input/output device and a memory storage device according to an exemplary embodiment. Referring to FIG. . It must be understood that the device shown in FIG. 1B is not limited to the I/O device 1106, and the I/O device 1106 may also include other devices.
在本发明实施例中,存储器存储装置100是通过数据传输接口1110与主机系统1000的其他元件电性连接。通过微处理器1102、随机存取存储器1104与输入/输出装置1106的运作可将数据写入至存储器存储装置100或从存储器存储装置100中读取数据。例如,存储器存储装置100可以是如图1B所示的U盘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 USB flash drive 1212, a memory card 1214, or a solid state drive (Solid State Drive, SSD) 1216 as shown in FIG. 1B.
一般而言,主机系统1000为可实质地与存储器存储装置100配合以存储数据的任意系统。虽然在本范例实施例中,主机系统1000是以电脑系统来作说明,然而,在本发明另一范例实施例中主机系统1000可以是数码相机、摄像机、通信装置、音频播放器或视频播放器等系统。例如,在主机系统为数码相机(摄像机)1310时,可擦写式非易失性存储器存储装置则为其所使用的SD卡1312、MMC卡1314、记忆棒(memory stick)1316、CF卡1318或嵌入式存储装置1320(如图1C所示)。嵌入式存储装置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 described 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, and a CF card 1318. Or an embedded storage device 1320 (as shown in FIG. 1C ). 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.
图2是示出图1A所示的存储器存储装置的概要方块图。FIG. 2 is a schematic block diagram showing the memory storage device shown in FIG. 1A.
请参照图2,存储器存储装置100包括连接器102、存储器控制器104与可擦写式非易失性存储器模块106。Please refer to FIG. 2 , 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也可以是符合并列先进附件(Parallel Advanced TechnologyAttachment,PATA)标准、电气和电子工程师协会(Institute of Electrical andElectronic Engineers,IEEE)1394标准、高速外围零件连接接口(PeripheralComponent Interconnect Express,PCI Express)标准、通用串行总线(UniversalSerial Bus,USB)标准、安全数位(Secure Digital,SD)接口标准、超高速一代(UltraHigh Speed-I,UHS-I)接口标准、超高速二代(Ultra High Speed-II,UHS-II)接口标准、存储卡(Memory Stick,MS)接口标准、多媒体存储卡(Multi MediaCard,MMC)接口标准、崁入式多媒体存储卡(Embedded Multimedia Card,eMMC)接口标准、通用闪速存储器(Universal Flash Storage,UFS)接口标准、小型闪速(Compact Flash,CF)接口标准、整合式驱动电子接口(Integrated DeviceElectronics,DE)标准或其他适合的标准。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 in accordance with the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (Institute of Electrical and Electronic Engineers, IEEE) 1394 standard, high-speed Peripheral Component Interconnect Express (PCI Express) standard, Universal Serial Bus (Universal Serial Bus, USB) standard, Secure Digital (SD) interface standard, Ultra High Speed-I (UHS-I) Interface standard, Ultra High Speed-II (UHS-II) interface standard, memory card (Memory Stick, MS) interface standard, multimedia memory card (Multi MediaCard, MMC) interface standard, plug-in multimedia memory card (Embedded Multimedia Card, eMMC) interface standard, Universal Flash Storage (UFS) interface standard, Compact Flash (CF) interface standard, Integrated Device Electronics (DE) standard or others suitable standard.
存储器控制器104用以执行以硬件形式或固体形式实作的多个逻辑门或控制指令,并且根据主机系统1000的指令在可擦写式非易失性存储器模块106中进行数据的写入、读取与擦除等运作。The memory controller 104 is used to execute a plurality of logic gates or control instructions implemented in hardware or solid form, and perform data writing, Read and erase operations.
可擦写式非易失性存储器模块106是电性连接至存储器控制器104,并且用以存储主机系统1000所写入的数据。可擦写式非易失性存储器模块106具有实体擦除单元304(0)~304(R)。例如,实体擦除单元304(0)~304(R)可属于同一个存储器晶粒(die)或者属于不同的存储器晶粒。每一实体擦除单元分别具有复数个实体程序化单元,并且属于同一个实体擦除单元的实体程序化单元可被独立地写入且被同时地擦除。例如,每一实体擦除单元是由128个实体程序化单元所组成。然而,必须了解的是,本发明不限于此,每一实体擦除单元是可由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 304(0)˜304(R). For example, the physical erase units 304(0)˜304(R) may belong to the same memory die or belong to different memory dies. Each physical erasing unit has a plurality of physical programming units, and the physical programming units belonging to the same physical erasing unit can be written independently and erased simultaneously. For example, each physical erase unit is composed of 128 physical program units. 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,B)。然而,在其他范例实施例中,数据位区中也可包含8个、16个或数目更多或更少的实体存取地址,本发明并不限制实体存取地址的大小以及个数。例如,实体擦除单元为实体区块,并且实体程序化单元为实体页面或实体扇。In more detail, the physical erasing unit is the smallest unit of erasing. That is, each physical erase unit contains the minimum number of units to be erased together. Entity programming unit is the smallest unit of programming. That is, the entity programming unit is the smallest unit for writing data. Each physical programming unit generally includes a data bit field and a redundant bit field. The data bit field contains a plurality of physical access addresses for storing user data, and the redundant bit field is used for storing system data (eg, control information and error correction code). In this exemplary embodiment, the data bit area of each physical programming unit includes 4 physical access addresses, and the size of one physical access address is 512 bytes (byte, B). However, in other exemplary embodiments, the data bit area may also include 8, 16 or more or less physical access addresses, and the present invention does not limit the size and number of physical access addresses. For example, the physical erasing unit is a physical block, and the physical programming unit is a physical page or a physical sector.
在本范例实施例中,可擦写式非易失性存储器模块106为多层单元(MultiLevel Cell,MLC)NAND型闪速存储器模块,即一个存储包中可存储至少2个比特数据。然而,本发明不限于此,可擦写式非易失性存储器模块106也可是单层单元(Single Level Cell,SLC)NAND型闪速存储器模块、复数层单元(Trinary Level Cell,TLC)NAND型闪速存储器模块、其他闪速存储器模块或其他具有相同特性的存储器模块。In this exemplary embodiment, the rewritable non-volatile memory module 106 is a multi-level cell (MultiLevel Cell, MLC) NAND flash memory module, that is, at least 2 bits of data can be stored in one storage package. However, the present invention is not limited thereto, and the rewritable nonvolatile memory module 106 may also be a single-level cell (Single Level Cell, SLC) NAND flash memory module, a multi-level cell (Trinary Level Cell, TLC) NAND type Flash memory modules, other flash memory modules, or other memory modules with the same characteristics.
图3是根据一范例实施例所示出的存储器控制器的概要方块图。FIG. 3 is a schematic block diagram of a memory controller according to an exemplary embodiment.
请参照图3,存储器控制器104包括存储器管理电路202、主机接口204与存储器接口206。Referring to FIG. 3 , 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 solid form. For example, the memory management circuit 202 has a microprocessor unit (not shown) and a read-only memory (not shown), and these control instructions are burned into the read-only memory. When the memory storage device 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 can also be stored in a specific area of the rewritable non-volatile memory module 106 in the form of program codes (for example, in the memory module dedicated to storing system data system 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 data stored in the erasable non-volatile memory module 106. The control instructions are loaded into the random access memory of the memory management circuit 202 . Afterwards, the microprocessor unit executes 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 management unit, a memory writing unit, a memory reading unit, a memory erasing unit and a data processing unit. The memory management unit, the memory writing unit, the memory reading unit, the memory erasing unit and the data processing unit are electrically connected to the microcontroller. Wherein, the memory management unit is used to manage the physical block of the erasable nonvolatile memory module 106; the memory writing unit is used to issue a write command to the erasable nonvolatile memory module 106 to write data into the erasable nonvolatile memory module 106; the memory read unit is used to issue a read instruction to the erasable nonvolatile memory module 106 to read from the erasable nonvolatile memory module 106 Read data in; The memory erasing unit is used for erasing the erasable non-volatile memory module 106 to erase data from the erasable non-volatile memory module 106; and the data processing unit It is used for processing data to be written into the erasable non-volatile memory module 106 and data read from the erasable non-volatile memory module 106 .
主机接口204是电性连接至存储器管理电路202并且用以接收与识别主机系统1000所传送的指令与数据。也就是说,主机系统1000所传送的指令与数据会通过主机接口204来传送至存储器管理电路202。在本范例实施例中,主机接口204是兼容于SATA标准。然而,必须了解的是本发明不限于此,主机接口204也可以是兼容于PATA标准、IEEE 1394标准、PCI Express标准、USB标准、SD标准、UHS-I标准、UHS-II标准、MS标准、MMC标准、eMMC标准、UFS标准、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 may also be compatible with PATA standard, IEEE 1394 standard, PCI Express standard, USB standard, SD standard, UHS-I standard, UHS-II standard, MS standard, MMC standard, eMMC standard, UFS 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 erasable nonvolatile memory module 106 is converted into a format acceptable to the erasable nonvolatile memory module 106 via the memory interface 206 .
在本发明一范例实施例中,存储器控制器104还包括缓冲存储器252、电源管理电路254与错误检查与校正电路256。In an exemplary embodiment of the present invention, the memory controller 104 further includes a buffer memory 252 , a power management circuit 254 and an error checking and correction circuit 256 .
缓冲存储器252是电性连接至存储器管理电路202并且用以暂存来自于主机系统1000的数据与指令或来自于可擦写式非易失性存储器模块106的数据。The buffer memory 252 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 erasable non-volatile memory module 106 .
电源管理电路254是电性连接至存储器管理电路202并且用以控制存储器存储装置100的电源。The power management circuit 254 is electrically connected to the memory management circuit 202 and used to control the power of the memory storage device 100 .
错误检查与校正电路256是电性连接至存储器管理电路202并且用以执行错误检查与校正程序以确保数据的正确性。具体来说,当存储器管理电路202从主机系统1000中接收到写入指令时,错误检查与校正电路256会为对应此写入指令的数据产生对应的错误检查与校正码(Error Checking andCorrecting Code,ECC Code),并且存储器管理电路202会将对应此写入指令的数据与对应的错误检查与校正码写入至可擦写式非易失性存储器模块106中。之后,当存储器管理电路202从可擦写式非易失性存储器模块106中读取数据时会同时读取此数据对应的错误检查与校正码,并且错误检查与校正电路256会依据此错误检查与校正码对所读取的数据执行错误检查与校正程序。The error checking and correcting circuit 256 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 256 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 erasable 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 256 will check the error code according to the error checking and correction code. and correction code to perform error checking and correction procedures on the read data.
图4是根据一范例实施例所示出的管理可擦写式非易失性存储器模块的范例示意图。FIG. 4 is an exemplary schematic diagram of managing a rewritable non-volatile memory module according to an exemplary embodiment.
必须了解的是,在此描述可擦写式非易失性存储器模块106的实体区块的运作时,以“提取”、“交换”、“分组”、“轮替”等词来操作实体区块是逻辑上的概念。也就是说,可擦写式非易失性存储器模块的实体区块的实际位置并未更动,而是逻辑上对可擦写式非易失性存储器模块的实体区块进行操作。It must be understood that when describing the operation of the physical blocks of the rewritable non-volatile memory module 106, words such as "extract", "exchange", "group", and "rotate" are used to operate the physical areas. Blocks are logical concepts. That is to say, the actual location of the physical block of the erasable nonvolatile memory module is not changed, but the physical block of the erasable nonvolatile memory module is logically operated.
请参照图4,存储器控制器104可将可擦写式非易失性存储器模块的实体区块304(0)~304(R)逻辑地分组为多个区域,例如为数据区410、闲置区420、系统区430与取代区440。在另一范例实施例中,取代区440也可与闲置区420共用包含无效数据的实体区块。Referring to FIG. 4, the memory controller 104 can logically group the physical blocks 304(0)-304(R) of the rewritable non-volatile memory module into multiple areas, such as a data area 410, a free area 420 , a system area 430 and a replacement area 440 . In another exemplary embodiment, the replacement area 440 may also share a physical block containing invalid data with the spare area 420 .
数据区410与闲置区420的实体区块是用以存储来自于主机系统1000的数据。具体来说,数据区410是存储数据的实体区块,而闲置区420的实体区块是用以替换数据区410的实体区块。因此,闲置区420的实体区块为空或可使用的实体区块,其中并没有存储数据或是存储了标记为已没用的无效数据。也就是说,在闲置区420中的实体区块已被执行擦除运作,或者当闲置区420中的实体区块被提取用于存储数据之前所提取的实体区块会先被执行擦除运作。因此,闲置区420的实体区块为可被使用的实体区块。The physical blocks of the data area 410 and the spare area 420 are used to store data from the host system 1000 . Specifically, the data area 410 is a physical block for storing data, and the physical blocks of the idle area 420 are used to replace the physical blocks of the data area 410 . Therefore, the physical blocks of the spare area 420 are empty or usable physical blocks, in which no data is stored or invalid data marked as useless is stored. That is to say, the physical blocks in the spare area 420 have been erased, or the physical blocks extracted before the physical blocks in the spare area 420 are extracted for storing data will be erased first . Therefore, the physical blocks in the spare area 420 are usable physical blocks.
逻辑上属于系统区430的实体区块是用以记录系统数据,其中此系统数据包括关于存储器晶片的制造商与型号、存储器晶片的实体区块数、每一实体区块的实体页面数等。The physical blocks logically belonging to the system area 430 are used to record system data, wherein the system data includes the manufacturer and model of the memory chip, the number of physical blocks of the memory chip, the number of physical pages of each physical block, and the like.
逻辑上属于取代区440中的实体区块是替代实体区块。例如,可擦写式非易失性存储器模块在出厂时会预留4%的实体区块作为更换使用。也就是说,当数据区410、闲置区420与系统区430中的实体区块损毁时,预留在取代区440中的实体区块是用以取代损坏的实体区块(即,坏实体区块(badblock))。因此,倘若取代区440中仍存有正常的实体区块且发生实体区块损毁时,存储器控制器104会从取代区440中提取正常的实体区块来更换损毁的实体区块。倘若取代区440中无正常的实体区块且发生实体区块损毁时,则存储器控制器104会将整个存储器存储装置100宣告为写入保护(writeprotect)状态,而无法再写入数据。Physical blocks logically belonging to the replacement area 440 are replacement physical blocks. For example, the rewritable non-volatile memory module will reserve 4% of the physical blocks for replacement when it leaves the factory. That is to say, when the physical blocks in the data area 410, the free area 420, and the system area 430 are damaged, the physical blocks reserved in the replacement area 440 are used to replace the damaged physical blocks (ie, bad physical blocks block (badblock)). Therefore, if a normal physical block still exists in the replacement area 440 and the physical block is damaged, the memory controller 104 will extract a normal physical block from the replacement area 440 to replace the damaged physical block. If there is no normal physical block in the replacement area 440 and the physical block is damaged, the memory controller 104 will declare the entire memory storage device 100 as a write-protected state, and data cannot be written any more.
特别是,数据区410、闲置区420、系统区430与取代区440的实体区块的数量会依据不同的存储器规格而有所不同。此外,必须了解的是,在存储器存储装置100的运作中,实体区块关联至数据区410、闲置区420、系统区430与取代区440的分组关系会动态地变动。例如,当闲置区中的实体区块损坏而被取代区的实体区块取代时,则原本取代区的实体区块会被关联至闲置区。In particular, the number of physical blocks in the data area 410 , the spare area 420 , the system area 430 and the replacement area 440 varies 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 blocks associated with the data area 410 , the idle area 420 , the system area 430 and the replacement area 440 will change dynamically. For example, when a physical block in the spare area is damaged and replaced by a physical block in the replacement area, the original physical block in the replacement area will be associated with the spare area.
在本范例实施例中,存储器控制器104会配置逻辑地址450(0)~450(E)以利于在存储数据的实体区块中进行数据存取。例如,当存储器存储装置100被作业系统1110通过档案系统(例如,FAT 32)格式化时,逻辑地址450(0)~450(E)分别地映射至数据区410的实体区块304(0)~304(A)。在此,存储器管理电路202(或存储器控制器104)会建立逻辑地址-实体擦除单元映射表(logical address-physical erasing unit mapping table),以记录逻辑区块地址与实体擦除单元之间的映射关系。在此范例实施例中,每一个逻辑地址450(0)~450(E)的大小相同于一个实体擦除单元的大小,即,逻辑地址也可被称为逻辑区块地址(logical block address,LBA)。然而,在其他范例实施例中,每一个逻辑地址450(0)~450(E)的大小也可以是一个实体程序化单元的大小,本发明并不限制逻辑地址450(0)~450(E)的大小。In this exemplary embodiment, the memory controller 104 allocates logical addresses 450(0)˜450(E) to facilitate data access in physical blocks storing data. For example, when the memory storage device 100 is formatted by the operating system 1110 through the file system (for example, FAT 32), the logical addresses 450(0)-450(E) are respectively mapped to the physical block 304(0) of the data area 410 ~304(A). Here, the memory management circuit 202 (or the memory controller 104) will establish a logical address-physical erasing unit mapping table (logical address-physical erasing unit mapping table) to record the relationship between the logical block address and the physical erasing unit Mapping relations. In this exemplary embodiment, the size of each logical address 450(0)-450(E) is the same as the size of a physical erase unit, that is, the logical address can also be called a logical block address (logical block address, LBA). However, in other exemplary embodiments, the size of each logical address 450(0)-450(E) may also be the size of a physical programming unit, and the present invention does not limit the logical addresses 450(0)-450(E) )the size of.
主机系统1000会下达多个读取指令给存储器管理电路202(或存储器控制器104),并且这些读取指令是指示读取逻辑地址450(0)~450(E)中的一或多个逻辑地址。存储器管理电路202(或存储器控制器104)会将这些读取指令放入一个指令阵列(command queue)当中,并且存储器管理电路202(或存储器控制器104)会决定执行这些读取指令的顺序。若存储器管理电路202(或存储器控制器104)要执行一个读取指令,则存储器管理电路202(或存储器控制器104)会取得此读取指令所要读取的逻辑地址,并取得此逻辑地址所映射的一个实体擦除单元,从此实体擦除单元中读取数据,并将这些数据传送给主机系统1000。然而,在执行一个读取指令之前,存储器管理电路202(或存储器控制器104)会从实体擦除单元304(0)~304(B)中预读一些数据至存储器控制器104中的缓冲存储器252;接下来,若此读取指令所要读取的数据已经在缓冲存储器252中,存储器管理电路202(或存储器控制器104)便可以将缓冲存储器252中的数据传送给主机系统1000,由此增加读取数据的速度。在另一范例实施例中,存储器管理电路202(或存储器控制器104)预读的数据也可以放在存储器控制器104以外的一个缓冲存储器中,本发明并不在此限。The host system 1000 will issue a plurality of read commands to the memory management circuit 202 (or the memory controller 104), and these read commands are instructions to read one or more logical addresses 450(0)-450(E) address. The memory management circuit 202 (or the memory controller 104 ) puts these read commands into a command queue, and the memory management circuit 202 (or the memory controller 104 ) determines the order of executing the read commands. If the memory management circuit 202 (or the memory controller 104) is to execute a read instruction, the memory management circuit 202 (or the memory controller 104) will obtain the logical address to be read by the read instruction, and obtain the logical address of the logical address. A mapped physical erasing unit reads data from the physical erasing unit and transmits the data to the host system 1000 . However, before executing a read command, the memory management circuit 202 (or the memory controller 104) pre-reads some data from the physical erase units 304(0)-304(B) into the buffer memory in the memory controller 104 252; Next, if the data to be read by the read command is already in the buffer memory 252, the memory management circuit 202 (or the memory controller 104) can transmit the data in the buffer memory 252 to the host system 1000, thereby Increase the speed of reading data. In another exemplary embodiment, the data pre-read by the memory management circuit 202 (or the memory controller 104 ) may also be placed in a buffer memory other than the memory controller 104 , the invention is not limited thereto.
图5是根据一范例实施例示出记录档的范例示意图。FIG. 5 is an exemplary diagram illustrating a log file according to an exemplary embodiment.
请参照图5,存储器管理电路202(或存储器控制器104)从主机系统1000接收到多个读取指令(也称第一读取指令)并且执行完这些读取指令以后,会把执行完毕的读取指令存在记录档510中。例如,记录档510中记录了已被执行完毕的读取指令511~515,其分别指示读取逻辑地址450(2)、450(4)、450(1)、450(0)与450(3)(也称第一逻辑地址)。存储器管理电路202(或存储器控制器104)是先从主机系统1000接收到读取指令511、再依序地接收到读取指令512~515;换言之,依照接收到读取指令511~515的顺序,存储器管理电路202(或存储器控制器104)并不会发现主机系统1000要读取连续的逻辑地址。然而,在此范例实施例中,存储器管理电路202(或存储器控制器104)在执行完读取指令511~515后会判断读取指令511~515所要读取的逻辑地址是否为连续。例如,存储器管理电路202(或存储器控制器104)在排序完读取指令511~515所要读取的逻辑地址以后,会发现逻辑地址450(0)~450(4)为连续。此表示虽然主机系统1000是依序的传送读取指令511~515给存储器管理电路202(或存储器控制器104),但主机系统1000正在读取连续的逻辑地址450(0)~450(4)。由于逻辑地址450(0)~450(4)为连续,主机系统1000接下来要读取的逻辑地址也可能是连续。因此,存储器管理电路202(或存储器控制器104)会预读取属于一个逻辑范围的数据。Please refer to FIG. 5, after the memory management circuit 202 (or memory controller 104) receives multiple read commands (also called first read commands) from the host system 1000 and executes these read commands, it will The read command is stored in log file 510 . For example, the read commands 511-515 that have been executed are recorded in the record file 510, which respectively indicate to read logical addresses 450(2), 450(4), 450(1), 450(0) and 450(3 ) (also called the first logical address). The memory management circuit 202 (or the memory controller 104) first receives the read command 511 from the host system 1000, and then sequentially receives the read commands 512-515; in other words, according to the order in which the read commands 511-515 are received Therefore, the memory management circuit 202 (or the memory controller 104 ) will not find that the host system 1000 wants to read consecutive logical addresses. However, in this exemplary embodiment, the memory management circuit 202 (or the memory controller 104 ) will determine whether the logical addresses to be read by the read commands 511 - 515 are consecutive after executing the read commands 511 - 515 . For example, after the memory management circuit 202 (or the memory controller 104 ) sorts the logical addresses to be read by the read instructions 511 - 515 , it will find that the logical addresses 450 ( 0 ) - 450 ( 4 ) are continuous. This means that although the host system 1000 is sequentially sending read commands 511-515 to the memory management circuit 202 (or the memory controller 104), the host system 1000 is reading consecutive logical addresses 450(0)-450(4) . Since the logical addresses 450(0)-450(4) are consecutive, the logical addresses to be read by the host system 1000 next may also be consecutive. Therefore, the memory management circuit 202 (or the memory controller 104) prefetches data belonging to a logical range.
在此范例实施例中,记录档510中记录了5个读取指令511~515。然而,在其他范例实施例中,记录档5 10中也可以记录数目更多或更少的读取指令。并且,存储器管理电路202(或存储器控制器104)是在判断记录档510中有n个读取指令为连续以后开始预读取数据,其中n为正整数。然而,本发明并不限制n的数值。In this exemplary embodiment, five read commands 511 - 515 are recorded in the log file 510 . However, in other exemplary embodiments, the record file 510 may also record a greater or lesser number of read commands. Moreover, the memory management circuit 202 (or the memory controller 104 ) starts to pre-read data after judging that n read commands in the record file 510 are continuous, wherein n is a positive integer. However, the present invention does not limit the value of n.
图6A是根据一范例实施例示出预读取属于一个逻辑范围的数据的示意图。FIG. 6A is a schematic diagram illustrating prefetching data belonging to a logical range according to an exemplary embodiment.
请参照图6A,由于记录档510中的读取指令所读取的逻辑地址450(0)~450(4)为连续,因此存储器管理电路202(或存储器控制器104)会预读取属于逻辑范围610的数据至缓冲存储器252。存储器管理电路202(或存储器控制器104)也会设定一个预定范围630,并且预定范围630会包括逻辑范围610。然而,本发明并不限制逻辑范围610以及预定范围630的大小。接下来,存储器管理电路202(或存储器控制器104)会接收来自主机系统1000的一个读取指令(也称第二读取指令)。此第二读取指令指示读取逻辑地址620(也称第二逻辑地址)。存储器管理电路202(或存储器控制器104)会先判断逻辑地址620是否在预定范围630内。若逻辑地址620在预定范围630内,存储器管理电路202(或存储器控制器104)还会判断逻辑地址620是否为逻辑范围610的起始逻辑地址(即,逻辑地址450(5))。若逻辑地址620为逻辑地址450(5),则存储器管理电路202(或存储器控制器104)会从缓冲存储器252中读取属于逻辑地址620的数据,并将这些数据传送给主机系统1000。Please refer to FIG. 6A, since the logical addresses 450(0)-450(4) read by the read command in the record file 510 are continuous, the memory management circuit 202 (or the memory controller 104) will pre-read the logic address The data of range 610 is sent to buffer memory 252 . The memory management circuit 202 (or the memory controller 104 ) also sets a predetermined range 630 , and the predetermined range 630 includes the logical range 610 . However, the present invention does not limit the size of the logical range 610 and the predetermined range 630 . Next, the memory management circuit 202 (or the memory controller 104 ) receives a read command (also called a second read command) from the host system 1000 . The second read command indicates to read the logical address 620 (also referred to as the second logical address). The memory management circuit 202 (or the memory controller 104 ) first determines whether the logical address 620 is within the predetermined range 630 . If the logical address 620 is within the predetermined range 630, the memory management circuit 202 (or the memory controller 104) also determines whether the logical address 620 is the initial logical address of the logical range 610 (ie, logical address 450(5)). If the logical address 620 is the logical address 450 (5), the memory management circuit 202 (or the memory controller 104 ) reads the data belonging to the logical address 620 from the buffer memory 252 and transmits the data to the host system 1000 .
另一方面,若逻辑地址620在预定范围630内但不为逻辑地址450(5),则存储器管理电路202(或存储器控制器104)会维持属于逻辑范围610的数据在缓冲存储器252中并且启动一个计时器。本发明并不限制用软件或是硬件的方式实现此计时器。在此,虽然主机系统1000目前没有要读取逻辑地址450(5),但由于逻辑地址620还在预定范围630内,因此主机系统1000在接下来的一段时间内有可能会再读取逻辑地址450(5)。所以,存储器管理电路202(或存储器控制器104)并不会在取得第二读取指令以后就清除缓冲存储器252中属于逻辑范围610的数据。然而,若此计时器所记录的数值大于一个临界值,则存储器管理电路202(或存储器控制器104)会清除缓冲存储器252中属于逻辑范围610的数据。此外,若逻辑地址620不在预定范围630内,则存储器管理电路202(或存储器控制器104)也会清除缓冲存储器252中属于逻辑范围610的数据。On the other hand, if logical address 620 is within predetermined range 630 but not logical address 450(5), memory management circuit 202 (or memory controller 104) will maintain data belonging to logical range 610 in buffer memory 252 and start a timer. The present invention does not limit the implementation of the timer by software or hardware. Here, although the host system 1000 does not currently want to read the logical address 450(5), since the logical address 620 is still within the predetermined range 630, the host system 1000 may read the logical address again in the next period of time 450(5). Therefore, the memory management circuit 202 (or the memory controller 104 ) will not clear the data belonging to the logic range 610 in the buffer memory 252 after obtaining the second read command. However, if the value recorded by the timer is greater than a threshold value, the memory management circuit 202 (or the memory controller 104 ) will clear the data belonging to the logic range 610 in the buffer memory 252 . In addition, if the logical address 620 is not within the predetermined range 630 , the memory management circuit 202 (or the memory controller 104 ) will also clear the data belonging to the logical range 610 in the buffer memory 252 .
在计时器被启动以后,若存储器管理电路202(或存储器控制器104)接收到来自主机系统1000的下一个读取指令(也称第三读取指令),并且此第三读取指令指示读取的逻辑地址(也称第三逻辑地址)为逻辑地址450(5)时,则存储器管理电路202(或存储器控制器104)会重置此计时器,并且将属于逻辑地址450(5)的数据传送给主机系统1000。After the timer is started, if the memory management circuit 202 (or the memory controller 104) receives the next read command (also called the third read command) from the host system 1000, and the third read command indicates to read When the fetched logical address (also called the third logical address) is logical address 450(5), the memory management circuit 202 (or memory controller 104) will reset this timer, and will belong to logical address 450(5) The data is transferred to the host system 1000 .
换句话说,存储器管理电路202(或存储器控制器104)会维持属于逻辑范围610的数据在缓冲存储器252中,直到主机系统1000要读取预定范围630以外的逻辑地址或是在一预设时间内主机系统1000都没有读取逻辑地址450(5)(即,计时器所记录的数值大于一个临界值)。在一范例实施例中,此临界值是正比于可擦写式非易失性存储器模块106的一个读取时间。此读取时间表示可擦写式非易失性存储器模块106执行一个读取指令所需要的时间。若此读取时间越大,存储器管理电路202(或存储器控制器104)会增加此临界值,由此增加属于逻辑范围610的数据存储在缓冲存储器252的时间。例如,存储器管理电路202(或存储器控制器104)可设定此临界值为两倍的读取时间,但本发明并不在此限。In other words, the memory management circuit 202 (or the memory controller 104) will maintain the data belonging to the logical range 610 in the buffer memory 252 until the host system 1000 reads a logical address outside the predetermined range 630 or within a predetermined time None of the internal host system 1000 reads the logical address 450(5) (ie, the value recorded by the timer is greater than a threshold value). In an exemplary embodiment, the threshold is proportional to a read time of the erasable non-volatile memory module 106 . The read time represents the time required for the erasable non-volatile memory module 106 to execute a read command. If the read time is greater, the memory management circuit 202 (or the memory controller 104 ) will increase the threshold, thereby increasing the time for data belonging to the logical range 610 to be stored in the buffer memory 252 . For example, the memory management circuit 202 (or the memory controller 104 ) can set the threshold to be twice the read time, but the invention is not limited thereto.
在一范例实施例中,存储器管理电路202(或存储器控制器104)也可以一次传送属于多个逻辑地址的数据给主机系统1000。例如,存储器管理电路202(或存储器控制器104)是先接收到读取逻辑地址450(6)的读取指令再接收到读取逻辑地址450(5)的读取指令,并且读取逻辑地址450(6)的读取指令会先被存储在指令阵列当中。当判断主机系统1000要读取逻辑地址450(5)时,存储器管理电路202(或存储器控制器104)会将属于逻辑地址450(5)、450(6)的数据传送给主机系统1000。在一范例实施例中,将属于逻辑地址450(5)、450(6)的数据传送给主机系统1000的步骤也可以由另一个电路(未示出)来执行,本发明并不在此限。In an exemplary embodiment, the memory management circuit 202 (or the memory controller 104 ) can also transmit data belonging to multiple logical addresses to the host system 1000 at one time. For example, the memory management circuit 202 (or the memory controller 104) first receives the read instruction to read the logical address 450(6) and then receives the read instruction to read the logical address 450(5), and reads the logical address The read command of 450(6) will be stored in the command array first. When it is determined that the host system 1000 is going to read the logical address 450(5), the memory management circuit 202 (or the memory controller 104) transmits the data belonging to the logical addresses 450(5), 450(6) to the host system 1000. In an exemplary embodiment, the step of transmitting the data belonging to the logical addresses 450(5), 450(6) to the host system 1000 may also be performed by another circuit (not shown), the invention is not limited thereto.
在此范例实施例中,逻辑范围610的大小等于缓冲存储器252的存储器空间的大小。但在另一范例实施例中,逻辑范围610的大小也可以小于缓冲存储器252的存储器空间的大小,本发明并不在此限。并且,当逻辑地址620为逻辑地址450(5),并且属于逻辑地址450(5)的数据已被传送给主机系统1000以后,存储器管理电路202(或存储器控制器104)也可以从实体擦除单元304(0)~304(R)中预读取属于逻辑范围640(也称第二逻辑范围)的数据至缓冲存储器252。逻辑范围640是接续在逻辑范围610之后,但本发明并不限制逻辑范围640的大小。例如,若存储器管理电路202(或存储器控制器104)一次将属于逻辑地址450(5)、450(6)的数据传送给主机系统1000,则逻辑范围640可以包括两个逻辑地址。然而,在另一范例实施例中,存储器管理电路202(或存储器控制器104)也可以在主机系统1000读取至逻辑地址450(F)或其它逻辑地址时,预读取属于逻辑范围640的数据,本发明并不在此限。In this exemplary embodiment, the size of the logical range 610 is equal to the size of the memory space of the buffer memory 252 . However, in another exemplary embodiment, the size of the logical range 610 may also be smaller than the size of the memory space of the buffer memory 252 , the invention is not limited thereto. And, when the logical address 620 is the logical address 450(5), and the data belonging to the logical address 450(5) has been transferred to the host system 1000, the memory management circuit 202 (or the memory controller 104) can also be erased from the physical The data belonging to the logical range 640 (also referred to as the second logical range) in the units 304 ( 0 )˜304 (R) is pre-read to the buffer memory 252 . The logical range 640 follows the logical range 610 , but the present invention does not limit the size of the logical range 640 . For example, logical range 640 may include two logical addresses if memory management circuit 202 (or memory controller 104 ) transfers data belonging to logical addresses 450(5), 450(6) to host system 1000 at one time. However, in another exemplary embodiment, the memory management circuit 202 (or the memory controller 104) may also pre-read the memory belonging to the logical range 640 when the host system 1000 reads to the logical address 450(F) or other logical addresses. data, the present invention is not limited thereto.
在此范例实施例中,逻辑范围610是接续在逻辑地址450(0)~450(4)之后。然而,在其他范例实施例中,逻辑范围610也可以在逻辑地址450(0)~450(4)之前。举例来说,主机系统1000是从大到小地读取连续的逻辑地址,因此在执行完多个逻辑地址为连续的读取指令以后,存储器管理电路202(或存储器控制器104)所预读取的逻辑范围610会在这些连续逻辑地址之前。并且,逻辑范围640会在逻辑范围610之前。In this exemplary embodiment, logical range 610 follows logical addresses 450(0)˜450(4). However, in other exemplary embodiments, the logical range 610 may also be before the logical addresses 450(0)˜450(4). For example, the host system 1000 reads consecutive logical addresses from large to small, so after executing multiple read instructions with consecutive logical addresses, the memory management circuit 202 (or memory controller 104) pre-reads The fetched logical range 610 will precede these consecutive logical addresses. Also, the logical range 640 will be before the logical range 610 .
图6B是根据一范例实施例示出判断预读取数据以后的系统流程图。FIG. 6B is a flow chart showing the system after judging the pre-read data according to an exemplary embodiment.
请参照图6B,在步骤S602中,存储器管理电路202(或存储器控制器104)会预读取属于逻辑范围610的数据至缓冲存储器252。Referring to FIG. 6B , in step S602 , the memory management circuit 202 (or the memory controller 104 ) pre-reads data belonging to the logical range 610 into the buffer memory 252 .
在步骤S604中,存储器管理电路202(或存储器控制器104)会接收一个读取指令,并且此读取指令指示读取逻辑地址620。In step S604 , the memory management circuit 202 (or the memory controller 104 ) receives a read command, and the read command indicates to read the logical address 620 .
在步骤S606中,存储器管理电路202(或存储器控制器104)会判断此逻辑地址620是否在预定范围630内。In step S606 , the memory management circuit 202 (or the memory controller 104 ) determines whether the logical address 620 is within the predetermined range 630 .
若步骤S606的结果为否,在步骤S608中,存储器管理电路202(或存储器控制器104)清除缓冲存储器252中属于逻辑范围610的数据。If the result of step S606 is negative, in step S608 , the memory management circuit 202 (or the memory controller 104 ) clears the data belonging to the logical range 610 in the buffer memory 252 .
若步骤S606的结果为是,在步骤S610中,存储器管理电路202(或存储器控制器104)判断逻辑地址620是否为逻辑范围610的起始逻辑地址450(5)。If the result of step S606 is yes, in step S610 , the memory management circuit 202 (or the memory controller 104 ) determines whether the logical address 620 is the initial logical address 450 ( 5 ) of the logical range 610 .
若步骤S610的结果为否,在步骤S612中,存储器管理电路202(或存储器控制器104)会等待一段时间,若超过此时间则清除缓冲存储器252中属于逻辑范围610的数据。If the result of step S610 is negative, in step S612, the memory management circuit 202 (or the memory controller 104) waits for a period of time, and clears the data belonging to the logical range 610 in the buffer memory 252 if the time exceeds.
若步骤S610的结果为是,在步骤S614中,存储器管理电路202(或存储器控制器104)会将属于逻辑地址620的数据传送给主机系统1000。If the result of step S610 is yes, in step S614 , the memory management circuit 202 (or the memory controller 104 ) transmits the data belonging to the logical address 620 to the host system 1000 .
[第二范例实施例][Second Exemplary Embodiment]
第二范例实施例与第一范例实施例类似,在此仅描述不同之处。请参照图6A,在第一范例实施例中,存储器管理电路202(或存储器控制器104)是在逻辑地址620为逻辑地址450(5)时传送数据给主机系统。但在第二范例实施例中,存储器管理电路202(或存储器控制器104)可以在逻辑地址620为逻辑范围610中的任何一个逻辑地址时便传送数据给主机系统1000。The second exemplary embodiment is similar to the first exemplary embodiment, and only the differences are described here. Referring to FIG. 6A, in the first exemplary embodiment, the memory management circuit 202 (or the memory controller 104) transmits data to the host system when the logical address 620 is the logical address 450(5). But in the second exemplary embodiment, the memory management circuit 202 (or the memory controller 104 ) can transmit data to the host system 1000 when the logical address 620 is any logical address in the logical range 610 .
具体来说,在预读取属于逻辑范围610的数据以及接收到读取逻辑地址620的读取指令以后,存储器管理电路202(或存储器控制器104)会判断逻辑地址620是否在预定范围630之内。若逻辑地址620不在预定范围630之内,存储器管理电路202(或存储器控制器104)会清除缓冲存储器252中属于逻辑范围610的数据。若逻辑地址620是在逻辑范围630之内,存储器管理电路202(或存储器控制器104)会再判断逻辑地址620是否在逻辑范围610内。若逻辑地址620是在逻辑范围610内,则存储器管理电路202(或存储器控制器104)会将属于逻辑地址620的数据传送给主机系统1000。若逻辑地址620在预定范围630之内但不在逻辑范围610之内,则存储器管理电路202(或存储器控制器104)会维持属于逻辑范围610的数据在缓冲存储器252中并且启动计时器。若此计时器所记录的数值大于临界值,存储器管理电路202(或存储器控制器104)会清除缓冲存储器252中属于逻辑范围610的数据。Specifically, after pre-reading the data belonging to the logical range 610 and receiving the read command to read the logical address 620, the memory management circuit 202 (or the memory controller 104) will determine whether the logical address 620 is within the predetermined range 630 Inside. If the logical address 620 is not within the predetermined range 630 , the memory management circuit 202 (or the memory controller 104 ) clears the data belonging to the logical range 610 in the buffer memory 252 . If the logical address 620 is within the logical range 630 , the memory management circuit 202 (or the memory controller 104 ) will further determine whether the logical address 620 is within the logical range 610 . If the logical address 620 is within the logical range 610 , the memory management circuit 202 (or the memory controller 104 ) will transmit the data belonging to the logical address 620 to the host system 1000 . If the logical address 620 is within the predetermined range 630 but not within the logical range 610, the memory management circuit 202 (or the memory controller 104) maintains the data belonging to the logical range 610 in the buffer memory 252 and starts a timer. If the value recorded by the timer is greater than the threshold value, the memory management circuit 202 (or the memory controller 104 ) clears the data belonging to the logic range 610 in the buffer memory 252 .
图7是根据一范例实施例示出数据读取方法的流程图。值得注意的是,图7所示的流程图可以搭配第一范例实施例或第二范例实施例一起实施,或是单独实施,本发明并不在此限。FIG. 7 is a flowchart illustrating a data reading method according to an exemplary embodiment. It should be noted that the flowchart shown in FIG. 7 can be implemented together with the first exemplary embodiment or the second exemplary embodiment, or implemented independently, and the present invention is not limited thereto.
请参照图7,在步骤S702中,存储器管理电路202(或存储器控制器104)会配置多个逻辑地址以映射至部分的实体擦除单元。Referring to FIG. 7 , in step S702 , the memory management circuit 202 (or the memory controller 104 ) configures a plurality of logical addresses to map to some of the physical erasing units.
在步骤S704中,存储器管理电路202(或存储器控制器104)会接收来自主机系统的多个读取指令并且执行这些读取指令。其中这些读取指令指示读取多个第一逻辑地址。In step S704, the memory management circuit 202 (or the memory controller 104) receives a plurality of read commands from the host system and executes the read commands. Wherein these read instructions indicate to read a plurality of first logical addresses.
在步骤S706中,存储器管理电路202(或存储器控制器104)会判断第一逻辑地址是否为连续。若步骤S706的结果为否,存储器管理电路202(或存储器控制器104)会回到步骤S704,接收下一个读取指令并且判断已经执行完毕的n个读取指令所要读取的逻辑地址是否为连续。若步骤S706的结果为是,存储器管理电路202(或存储器控制器104)会进行步骤S708。In step S706, the memory management circuit 202 (or the memory controller 104) determines whether the first logical addresses are consecutive. If the result of step S706 is negative, the memory management circuit 202 (or memory controller 104) will return to step S704, receive the next read instruction and judge whether the logical address to be read by the executed n read instructions is continuous. If the result of step S706 is yes, the memory management circuit 202 (or the memory controller 104) will proceed to step S708.
在步骤S708中,存储器管理电路202(或存储器控制器104)会从实体擦除单元中预读取属于一个逻辑范围的数据至一个缓冲存储器中。此缓冲存储器可以配置在存储器控制器104之内或之外。In step S708, the memory management circuit 202 (or the memory controller 104) pre-reads data belonging to a logical range from the physical erase unit into a buffer memory. This cache memory can be configured inside or outside the memory controller 104 .
图7中各步骤已详细说明如上,在此便不再赘述。另一方面,图7中各步骤可被实作为多个程序码或是电路,本发明并不限制用软件或硬件的方式来实作图7所示的数据读取方法。Each step in FIG. 7 has been described in detail above, and will not be repeated here. On the other hand, each step in FIG. 7 can be implemented as a plurality of program codes or circuits, and the present invention does not limit the implementation of the data reading method shown in FIG. 7 by means of software or hardware.
综上所述,本发明实施例提出的数据读取方法、存储器控制器与存储器存储装置可以判断主机系统是否进行读取连续的逻辑地址,由此判断是否要预读取数据。并且,会根据主机系统下一个要读取的逻辑地址(或者是在指令阵列中一个读取指令所要读取的逻辑地址)是否在一个预定范围内,由此判断是否要将被预读的数据维持在缓冲存储器中。如此一来,可以增加读取数据的速度。To sum up, the data reading method, memory controller and memory storage device proposed by the embodiments of the present invention can determine whether the host system reads consecutive logical addresses, thereby determining whether to pre-read data. And, according to whether the logical address to be read next by the host system (or the logical address to be read by a read command in the command array) is within a predetermined range, it is judged whether the data to be pre-read maintained in buffer memory. In this way, the speed of reading data can be increased.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.
Claims (26)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310005604.0A CN103914391B (en) | 2013-01-07 | 2013-01-07 | Data reading method, memory controller and memory storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310005604.0A CN103914391B (en) | 2013-01-07 | 2013-01-07 | Data reading method, memory controller and memory storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103914391A true CN103914391A (en) | 2014-07-09 |
CN103914391B CN103914391B (en) | 2016-12-28 |
Family
ID=51040092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310005604.0A Active CN103914391B (en) | 2013-01-07 | 2013-01-07 | Data reading method, memory controller and memory storage device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103914391B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105930278A (en) * | 2015-02-26 | 2016-09-07 | 爱思开海力士有限公司 | Data storage device and operating method thereof |
CN109634517A (en) * | 2017-10-06 | 2019-04-16 | 慧荣科技股份有限公司 | Carry out method, memory storage, electronic device and its controller of access management |
CN109933545A (en) * | 2017-12-18 | 2019-06-25 | 慧荣科技股份有限公司 | Data storage device and data processing method of memory device |
CN110286846A (en) * | 2018-03-19 | 2019-09-27 | 深圳大心电子科技有限公司 | Data movement method and store controller |
CN111833949A (en) * | 2019-04-16 | 2020-10-27 | 三星电子株式会社 | Memory controller, memory system and method of operating the same |
CN116504293A (en) * | 2023-06-27 | 2023-07-28 | 芯天下技术股份有限公司 | Method and device for reading non flash, memory chip and equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101202537B1 (en) * | 2006-05-12 | 2012-11-19 | 애플 인크. | Combined distortion estimation and error correction coding for memory devices |
US7958301B2 (en) * | 2007-04-10 | 2011-06-07 | Marvell World Trade Ltd. | Memory controller and method for memory pages with dynamically configurable bits per cell |
CN101303685B (en) * | 2007-05-09 | 2010-10-13 | 瑞昱半导体股份有限公司 | Method for raising read-write data rate of universal sequence bus storage equipment |
CN101853216B (en) * | 2009-04-03 | 2012-05-23 | 群联电子股份有限公司 | Data processing system, controller and method for searching specific memory area |
CN102045258B (en) * | 2010-12-22 | 2012-12-12 | 北京星网锐捷网络技术有限公司 | Data caching management method and device |
CN102543187B (en) * | 2011-12-30 | 2015-10-28 | 泰斗微电子科技有限公司 | A kind of serial Flash buffer control circuit of efficient reading |
-
2013
- 2013-01-07 CN CN201310005604.0A patent/CN103914391B/en active Active
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105930278A (en) * | 2015-02-26 | 2016-09-07 | 爱思开海力士有限公司 | Data storage device and operating method thereof |
US11741016B2 (en) | 2017-10-06 | 2023-08-29 | Silicon Motion, Inc. | Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device |
CN109634517A (en) * | 2017-10-06 | 2019-04-16 | 慧荣科技股份有限公司 | Carry out method, memory storage, electronic device and its controller of access management |
US12038849B2 (en) | 2017-10-06 | 2024-07-16 | Silicon Motion, Inc. | Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device |
CN109634517B (en) * | 2017-10-06 | 2022-08-23 | 慧荣科技股份有限公司 | Method for performing access management, memory device, electronic device and controller thereof |
US11449435B2 (en) | 2017-10-06 | 2022-09-20 | Silicon Motion, Inc. | Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device |
US11550730B2 (en) | 2017-10-06 | 2023-01-10 | Silicon Motion, Inc. | Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device |
CN109933545A (en) * | 2017-12-18 | 2019-06-25 | 慧荣科技股份有限公司 | Data storage device and data processing method of memory device |
CN110286846A (en) * | 2018-03-19 | 2019-09-27 | 深圳大心电子科技有限公司 | Data movement method and store controller |
CN110286846B (en) * | 2018-03-19 | 2023-03-14 | 深圳大心电子科技有限公司 | Data moving method and storage controller |
CN111833949A (en) * | 2019-04-16 | 2020-10-27 | 三星电子株式会社 | Memory controller, memory system and method of operating the same |
CN116504293A (en) * | 2023-06-27 | 2023-07-28 | 芯天下技术股份有限公司 | Method and device for reading non flash, memory chip and equipment |
CN116504293B (en) * | 2023-06-27 | 2023-10-13 | 芯天下技术股份有限公司 | Method and device for reading non flash, memory chip and equipment |
Also Published As
Publication number | Publication date |
---|---|
CN103914391B (en) | 2016-12-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104423888B (en) | Data writing method, memory control circuit unit and memory storage device | |
US9176865B2 (en) | Data writing method, memory controller, and memory storage device | |
US9304900B2 (en) | Data reading method, memory controller, and memory storage device | |
CN104765569B (en) | Data writing method, memory control circuit unit and memory storage device | |
CN107818808B (en) | Data writing method, memory control circuit unit and memory storage device | |
CN106557432B (en) | Buffer memory management method, memory control circuit unit and storage device | |
CN113885808B (en) | Mapping information recording method, memory control circuit unit and memory device | |
CN111078146B (en) | Memory management method, memory storage device and memory control circuit unit | |
CN105005450A (en) | Data writing method, memory storage device and memory control circuit unit | |
CN103914391B (en) | Data reading method, memory controller and memory storage device | |
CN103136111B (en) | Data writing method, memory controller and memory storage device | |
CN106484307A (en) | Memory management method, memory control circuit unit and memory storage device | |
CN108959109A (en) | Data reading method, memory control circuit unit and memory storage device | |
CN102567221B (en) | Data management method, memory controller and memory storage device | |
CN103544118B (en) | Memory storage device, its memory controller and data writing method | |
CN103577344B (en) | Data writing method, memory controller and memory storage device | |
CN109273033B (en) | Memory management method, memory control circuit unit and memory storage device | |
CN103513930A (en) | Memory management method, memory controller and memory storage device | |
CN103218308B (en) | Buffer memory management method, memory controller and memory storage device | |
CN102543184B (en) | Memory storage device, its memory controller and data writing method | |
CN106325764A (en) | Memory management method, memory control circuit unit and memory storage device | |
CN104731710A (en) | Memory management method, memory control circuit unit and memory storage device | |
CN103984635A (en) | Data writing method, memory controller and memory storage device | |
CN104238956A (en) | Data writing method, memory controller and memory storage device | |
CN106201932A (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 | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |