TW202015045A - Write control method, associated data storage device and controller thereof - Google Patents

Write control method, associated data storage device and controller thereof Download PDF

Info

Publication number
TW202015045A
TW202015045A TW108124909A TW108124909A TW202015045A TW 202015045 A TW202015045 A TW 202015045A TW 108124909 A TW108124909 A TW 108124909A TW 108124909 A TW108124909 A TW 108124909A TW 202015045 A TW202015045 A TW 202015045A
Authority
TW
Taiwan
Prior art keywords
write
commands
buffer
command
data
Prior art date
Application number
TW108124909A
Other languages
Chinese (zh)
Other versions
TWI697009B (en
Inventor
蕭鈺翰
沈揚智
葉寰融
Original Assignee
慧榮科技股份有限公司
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 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to CN201910690904.4A priority Critical patent/CN110989918B/en
Priority to US16/590,398 priority patent/US10990325B2/en
Publication of TW202015045A publication Critical patent/TW202015045A/en
Application granted granted Critical
Publication of TWI697009B publication Critical patent/TWI697009B/en

Links

Images

Abstract

A write control method, an associated data storage device and the controller thereof are provided. The write control method may include: receiving one or more commands from a host device and executing the one or more commands, and performing determining operations to generate determining results; in response to the determining results, starting performing write collection; collecting and handling one or more write commands to buffer data of the one or more write commands through a buffer memory, and performing other determining operations to generate other determining results; in response to the other determining results, according to a number of one or more collected and handled write commands, determining whether data thereof has filled up a write buffer region of the buffer memory; and in response to the data having filled up the write buffer region, flushing the write buffer region to write the data therein into a non-volatile memory.

Description

寫入控制方法以及資料儲存裝置及其控制器Writing control method, data storage device and its controller

本發明係有關於快閃記憶體(Flash memory)之存取(access),尤指一種寫入控制方法以及相關之資料儲存裝置及其控制器。The present invention relates to flash memory (Flash memory) access, in particular to a write control method and related data storage device and its controller.

快閃記憶體可廣泛地應用於各種可攜式或非可攜式資料儲存裝置(例如:符合SD/MMC、CF、MS、XD或UFS標準之記憶卡;又例如:固態硬碟;又例如:符合UFS或EMMC規格之嵌入式(embedded)儲存裝置)中。以常用的NAND型快閃記憶體而言,最初有單階細胞(single level cell,SLC)、多階細胞(multiple level cell,MLC)等類型的快閃記憶體。由於記憶體的技術不斷地發展,較新的資料儲存裝置產品可採用三階細胞(triple level cell,TLC)快閃記憶體,甚至四階細胞(quadruple level cell,QLC)快閃記憶體。為了確保資料儲存裝置對快閃記憶體之存取控制能符合相關規範,快閃記憶體的控制器通常備有某些管理機制以妥善地管理其內部運作。Flash memory can be widely used in various portable or non-portable data storage devices (for example: memory cards that comply with SD/MMC, CF, MS, XD or UFS standards; for example: solid-state hard drives; for example : Embedded storage devices that meet UFS or EMMC specifications). In terms of commonly used NAND flash memory, there are initially single-level cells (SLC), multiple-level cells (MLC) and other types of flash memory. Due to the continuous development of memory technology, newer data storage device products can use triple level cell (TLC) flash memory, or even quadruple level cell (QLC) flash memory. In order to ensure that the data storage device's access control to the flash memory can meet the relevant specifications, the controller of the flash memory is usually equipped with certain management mechanisms to properly manage its internal operations.

依據相關技術,有了這些管理機制的資料儲存裝置還是有不足之處。舉例來說,於一特定模式中,該資料儲存裝置從主機(host device)接收的資料可直接進入位於一控制器積體電路中的內部記憶體,而非進入位於該控制器積體電路以外的外部記憶體。由於該內部記憶體的儲存容量遠小於該外部記憶體的儲存容量,故該內部記憶體中的緩衝空間相當有限。雖然該特定模式可用來提升該資料儲存裝置的寫入效能,但該內部記憶體的有限緩衝空間可對應於將緩衝資料寫入快閃記憶體的提早觸發。由於緩衝資料的資料量不足,故快閃記憶體中的一部分的快閃記憶體裸晶(die)處於閒置狀態。當主機發出讀取命令時,快閃記憶體中的快閃記憶體裸晶的不同時閒置可造成該快閃記憶體的整體傳輸帶寬(bandwidth)下降,使該資料儲存裝置的整體效能下降。因此,需要一種新穎的方法及相關架構,以在沒有副作用或較不可能帶來副作用之狀況下實現具有可靠的管理機制之資料儲存裝置。According to related technologies, the data storage devices with these management mechanisms still have deficiencies. For example, in a specific mode, the data received by the data storage device from the host device can directly enter the internal memory located in a controller integrated circuit instead of entering outside the controller integrated circuit Of external memory. Since the storage capacity of the internal memory is much smaller than that of the external memory, the buffer space in the internal memory is quite limited. Although the specific mode can be used to improve the writing performance of the data storage device, the limited buffer space of the internal memory can correspond to an early trigger for writing buffered data to the flash memory. Since the amount of buffered data is insufficient, a part of the flash memory die in the flash memory is in an idle state. When the host issues a read command, the flash memory die in the flash memory is not idle at the same time, which may cause the overall transmission bandwidth of the flash memory to decrease, and the overall performance of the data storage device to decrease. Therefore, there is a need for a novel method and related architecture to implement a data storage device with a reliable management mechanism without side effects or less likely to cause side effects.

本發明之一目的在於提供一種寫入控制方法以及相關之資料儲存裝置及其控制器,以解決上述問題。An object of the present invention is to provide a write control method and related data storage device and its controller to solve the above problems.

本發明之另一目的在於提供一種寫入控制方法以及相關之資料儲存裝置及其控制器,以在沒有副作用或較不可能帶來副作用之狀況下將可靠的管理機制賦予資料儲存裝置。Another object of the present invention is to provide a write control method and related data storage device and its controller, so as to give a reliable management mechanism to the data storage device without side effects or less likely to cause side effects.

本發明之至少一實施例提供一種寫入控制方法,其中該寫入控制方法係應用於一資料儲存裝置,該資料儲存裝置包含一非揮發性記憶體(non-volatile memory,NV memory)以及用來控制該非揮發性記憶體的存取之一記憶體控制器,該非揮發性記憶體包含至少一非揮發性記憶體元件(NV memory element),以及上述至少一非揮發性記憶體元件包含複數個區塊。該寫入控制方法可包含:從一主機(host device)接收至少一命令且執行所述至少一命令;判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值;判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令;判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值;因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,開始進行寫入收集(write collection);針對該寫入收集,收集從該主機接收之一寫入命令,且處置該寫入命令以透過一緩衝記憶體緩衝該寫入命令的資料,其中該緩衝記憶體位於該記憶體控制器;判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值;判斷是否沒有額外的主機命令;因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令;以及因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,快刷(Flush)該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。At least one embodiment of the present invention provides a write control method, wherein the write control method is applied to a data storage device including a non-volatile memory (NV memory) and A memory controller to control access to the non-volatile memory, the non-volatile memory includes at least one non-volatile memory element (NV memory element), and the at least one non-volatile memory element includes a plurality of Block. The write control method may include: receiving at least one command from a host device and executing the at least one command; determining whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold Value; determine whether the number of multiple commands received from the host within the time interval reaches a predetermined command number threshold, where the multiple commands include the at least one command; determine multiple commands in the multiple commands Whether the respective numbers of read commands and multiple write commands are greater than a predetermined threshold of read commands and a predetermined threshold of write commands, respectively; as the length of the time interval reaches the predetermined time length threshold, the The number of the plurality of commands reaches the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands are respectively greater than the predetermined read command number threshold and the predetermined write command Threshold, start write collection; for the write collection, collect a write command received from the host, and handle the write command to buffer the write command data through a buffer memory , Where the buffer memory is located in the memory controller; determine whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; determine whether there are no additional host commands; Since the length of the other time interval is not greater than the threshold of the other predetermined time length, and no additional host command does not occur, according to the number of one or more collected and processed write commands Determine whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, wherein the one or more collected and processed write commands include the write Command; and because the data in response to one or more collected and disposed write commands has filled the write buffer, flush the write buffer to flush the data in the write buffer Write to the non-volatile memory.

本發明之至少一實施例提供一種資料儲存裝置,其可包含:一非揮發性記憶體,用來儲存資訊,其中該非揮發性記憶體包含至少一非揮發性記憶體元件,以及上述至少一非揮發性記憶體元件包含複數個區塊;以及一控制器,耦接至該非揮發性記憶體,用來控制該資料儲存裝置之運作。該控制器可包含一緩衝記憶體,用來暫時地儲存資訊;以及一處理電路,其中該處理電路可依據來自一主機(host device)的複數個主機命令(host command)控制該控制器,以容許該主機透過該控制器存取該非揮發性記憶體。例如:該控制器從該主機接收至少一命令,且執行所述至少一命令;該控制器判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值;該控制器判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令,且屬於該複數個主機命令;該控制器判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值;因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,該控制器開始進行寫入收集;針對該寫入收集,該控制器收集從該主機接收之一寫入命令,且處置該寫入命令以透過該緩衝記憶體緩衝該寫入命令的資料;該控制器判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值;該控制器判斷是否沒有額外的主機命令;因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,該控制器依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令,且屬於該複數個主機命令;以及因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,該控制器快刷該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。At least one embodiment of the present invention provides a data storage device, which may include: a non-volatile memory for storing information, wherein the non-volatile memory includes at least one non-volatile memory element, and the at least one non-volatile memory element The volatile memory element includes a plurality of blocks; and a controller, coupled to the non-volatile memory, is used to control the operation of the data storage device. The controller may include a buffer memory for temporarily storing information; and a processing circuit, wherein the processing circuit may control the controller according to a plurality of host commands from a host device (host device), to Allow the host to access the non-volatile memory through the controller. For example: the controller receives at least one command from the host and executes the at least one command; the controller determines whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold; the The controller determines whether the number of multiple commands received from the host within the time interval reaches a predetermined command number threshold, wherein the multiple commands include the at least one command and belong to the multiple host commands; the control The device determines whether the respective numbers of the multiple read commands and the multiple write commands in the plurality of commands are greater than a predetermined read command threshold and a predetermined write command threshold respectively; depending on the time interval The length reaches the predetermined time length threshold, the number of the plurality of commands reaches the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands are respectively greater than the predetermined read Taking the command number threshold and the predetermined write command number threshold, the controller starts a write collection; for the write collection, the controller collects a write command received from the host and handles the write command To buffer the data of the write command through the buffer memory; the controller determines whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; the controller determines Whether there is no additional host command; because the length of another time interval is not greater than the threshold of the other predetermined time length, and there is no case where the additional host command is not present, the controller is based on one or more The number of collected and processed write commands determines whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, wherein the one or more collected commands are collected And the write command to be processed includes the write command and belongs to the plurality of host commands; and because the data corresponding to one or more collected and processed write commands has filled the write buffer, the controller Quickly flash the write buffer to write the data in the write buffer to the non-volatile memory.

本發明之至少一實施例提供一種資料儲存裝置之控制器,其中該資料儲存裝置包含該控制器與一非揮發性記憶體,該非揮發性記憶體包含至少一非揮發性記憶體元件,以及上述至少一非揮發性記憶體元件包含複數個區塊。該控制器可包含一緩衝記憶體,用來暫時地儲存資訊;以及一處理電路,其中該處理電路可依據來自一主機的複數個主機命令控制該控制器,以容許該主機透過該控制器存取該非揮發性記憶體。例如:該控制器從該主機接收至少一命令,且執行所述至少一命令;該控制器判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值;該控制器判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令,且屬於該複數個主機命令;該控制器判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值;因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,該控制器開始進行寫入收集;針對該寫入收集,該控制器收集從該主機接收之一寫入命令,且處置該寫入命令以透過該緩衝記憶體緩衝該寫入命令的資料;該控制器判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值;該控制器判斷是否沒有額外的主機命令;因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,該控制器依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令,且屬於該複數個主機命令;以及因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,該控制器快刷該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。At least one embodiment of the present invention provides a controller for a data storage device, wherein the data storage device includes the controller and a non-volatile memory, the non-volatile memory includes at least one non-volatile memory element, and the above At least one non-volatile memory device includes a plurality of blocks. The controller may include a buffer memory for temporarily storing information; and a processing circuit, wherein the processing circuit may control the controller according to a plurality of host commands from a host to allow the host to store data through the controller Take the non-volatile memory. For example: the controller receives at least one command from the host and executes the at least one command; the controller determines whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold; the The controller determines whether the number of multiple commands received from the host within the time interval reaches a predetermined command number threshold, wherein the multiple commands include the at least one command and belong to the multiple host commands; the control The device determines whether the respective numbers of the multiple read commands and the multiple write commands in the plurality of commands are greater than a predetermined read command threshold and a predetermined write command threshold respectively; depending on the time interval The length reaches the predetermined time length threshold, the number of the plurality of commands reaches the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands are respectively greater than the predetermined read Taking the command number threshold and the predetermined write command number threshold, the controller starts a write collection; for the write collection, the controller collects a write command received from the host and handles the write command To buffer the data of the write command through the buffer memory; the controller determines whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; the controller determines Whether there is no additional host command; because the length of another time interval is not greater than the threshold of the other predetermined time length, and there is no case where the additional host command is not present, the controller is based on one or more The number of collected and processed write commands determines whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, wherein the one or more collected commands are collected And the write command to be processed includes the write command and belongs to the plurality of host commands; and because the data corresponding to one or more collected and processed write commands has filled the write buffer, the controller Quickly flash the write buffer to write the data in the write buffer to the non-volatile memory.

本發明的好處之一是,透過仔細設計之管理機制,本發明能針對該控制器的運作進行妥善的控制,尤其,使資料儲存裝置能於接收到包含寫入命令與讀取命令的眾多命令時進行命令重新排列(command rearrangement)。由於資料儲存裝置能於接收到上述眾多命令時進行命令重新排列,故本發明能大幅地降低快閃記憶體中的快閃記憶體裸晶的不同時閒置的機率,以提升快閃記憶體的整體傳輸帶寬(bandwidth),並且提升該資料儲存裝置的整體效能。另外,依據本發明之實施例來實施並不會增加許多額外的成本。因此,相關技術的問題可被解決,且整體成本不會增加太多。相較於傳統架構,本發明能在沒有副作用或較不可能帶來副作用之狀況下達到資料儲存裝置之最佳化效能。One of the benefits of the present invention is that through carefully designed management mechanisms, the present invention can properly control the operation of the controller, in particular, enable the data storage device to receive numerous commands including write commands and read commands Command rearrangement. Since the data storage device can rearrange the commands when receiving the above many commands, the present invention can greatly reduce the probability of the flash memory die in the flash memory not being idle at the same time, so as to improve the flash memory The overall transmission bandwidth (bandwidth), and improve the overall performance of the data storage device. In addition, implementation according to the embodiments of the present invention does not increase many additional costs. Therefore, the problems of the related art can be solved without increasing the overall cost much. Compared with the traditional architecture, the present invention can achieve the optimized performance of the data storage device without side effects or less likely to cause side effects.

請參考第1圖,第1圖為依據本發明一第一實施例之一種資料儲存裝置100與一主機(Host Device)50的示意圖。例如:資料儲存裝置100可為固態硬碟(Solid State Drive,SSD)。另外,主機50的例子可包含(但不限於):多功能行動電話(Multifunctional Mobile Phone)、平板電腦(Tablet)、以及個人電腦(Personal Computer)諸如桌上型電腦與膝上型電腦。依據本實施例,資料儲存裝置100可包含一控制器諸如記憶體控制器110,且可另包含一非揮發性記憶體(Non-Volatile Memory,NV Memory)120,其中該控制器係用來存取(Access)非揮發性記憶體120,且非揮發性記憶體120係用來儲存資訊。Please refer to FIG. 1, which is a schematic diagram of a data storage device 100 and a host device (Host Device) 50 according to a first embodiment of the present invention. For example, the data storage device 100 may be a solid state drive (SSD). In addition, examples of the host 50 may include (but are not limited to): multifunctional mobile phones (Multifunctional Mobile Phone), tablet computers (Tablet), and personal computers (Personal Computer) such as desktop computers and laptop computers. According to this embodiment, the data storage device 100 may include a controller such as a memory controller 110, and may further include a non-volatile memory (Non-Volatile Memory, NV Memory) 120, wherein the controller is used to store Access (non-volatile) memory 120, and non-volatile memory 120 is used to store information.

非揮發性記憶體120可包含複數個非揮發性記憶體元件(NV memory element)122-1、122-2、…與122-N,其中符號「N」可代表大於一的正整數。例如:非揮發性記憶體120可為一快閃記憶體(Flash memory),而非揮發性記憶體元件122-1、122-2、…與122-N可分別為複數個快閃記憶體晶片或複數個快閃記憶體裸晶(Die),但本發明並不限於此。此外,資料儲存裝置100可更包括揮發性記憶體元件130以供進行資料緩衝,其中,揮發性記憶體元件130較佳為動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)。在記憶體控制器110的控制下,資料儲存裝置100可利用揮發性記憶體元件130的儲存空間的至少一部分(例如一部分或全部)作為資料緩衝空間,以供暫時地儲存資料,例如在存取非揮發性記憶體120的期間。另外,揮發性記憶體元件130為非必要元件。The non-volatile memory 120 may include a plurality of non-volatile memory elements (NV memory elements) 122-1, 122-2, ..., and 122-N, where the symbol "N" may represent a positive integer greater than one. For example, the non-volatile memory 120 may be a flash memory, and the non-volatile memory elements 122-1, 122-2, ..., and 122-N may be a plurality of flash memory chips, respectively. Or a plurality of flash memory die (Die), but the present invention is not limited to this. In addition, the data storage device 100 may further include a volatile memory element 130 for data buffering, wherein the volatile memory element 130 is preferably a dynamic random access memory (Dynamic Random Access Memory, DRAM). Under the control of the memory controller 110, the data storage device 100 may use at least a portion (eg, part or all) of the storage space of the volatile memory element 130 as a data buffer space for temporarily storing data, for example, during access The period of non-volatile memory 120. In addition, the volatile memory element 130 is an unnecessary element.

記憶體控制器110可包含處理電路諸如微處理器112、儲存器諸如一唯讀記憶體(Read Only Memory,ROM)112M、控制邏輯電路114、緩衝記憶體116、與傳輸介面電路118,其中這些元件可透過一匯流排彼此耦接。緩衝記憶體116較佳為靜態隨機存取記憶體(Static Random Access Memory,SRAM)。舉例來說,記憶體控制器110可利用緩衝記憶體116諸如SRAM作為第一層快取(Cache),並利用揮發性記憶體元件130諸如DRAM作為第二層快取。DRAM的資料儲存量較佳大於緩衝記憶體116的資料儲存量,而緩衝記憶體116所緩衝處理的資料可源自於DRAM或非揮發性記憶體120。The memory controller 110 may include a processing circuit such as a microprocessor 112, a storage such as a read-only memory (Read Only Memory, ROM) 112M, a control logic circuit 114, a buffer memory 116, and a transmission interface circuit 118, of which The components can be coupled to each other through a bus bar. The buffer memory 116 is preferably a static random access memory (SRAM). For example, the memory controller 110 may use the buffer memory 116 such as SRAM as the first layer cache and the volatile memory element 130 such as DRAM as the second layer cache. The data storage capacity of the DRAM is preferably greater than the data storage capacity of the buffer memory 116, and the data buffered by the buffer memory 116 may originate from the DRAM or the non-volatile memory 120.

本實施例之唯讀記憶體112M係用來儲存一程式碼112C,而微處理器112則用來執行程式碼112C以控制對非揮發性記憶體120之存取。請注意,程式碼112C亦得儲存在緩衝記憶體116或任何形式之記憶體內。此外,控制邏輯電路114可包含至少一錯誤更正碼(Error Correction Code,簡稱ECC)電路(未顯示),以保護資料、及/或進行錯誤更正,而傳輸介面電路118可符合一特定通訊標準(諸如串列高級技術附件(Serial Advanced Technology Attachment,SATA)標準、快捷外設互聯(Peripheral Component Interconnect Express,PCIE)標準或非揮發性記憶體快捷(Non-Volatile Memory Express,NVME)標準)且可依據該特定通訊標準進行通訊,尤其,可依據該特定通訊標對主機50進行通訊。The read-only memory 112M of this embodiment is used to store a code 112C, and the microprocessor 112 is used to execute the code 112C to control access to the non-volatile memory 120. Please note that the code 112C must also be stored in the buffer memory 116 or any form of memory. In addition, the control logic circuit 114 may include at least one Error Correction Code (ECC) circuit (not shown) to protect data and/or perform error correction, and the transmission interface circuit 118 may conform to a specific communication standard ( Such as Serial Advanced Technology Attachment (SATA) standard, Peripheral Component Interconnect Express (PCIE) standard or Non-Volatile Memory Express (NVME) standard) and can be based on The specific communication standard communicates, and in particular, the host 50 can be communicated according to the specific communication standard.

於本實施例中,主機50可傳送複數個主機命令(Host Command)至資料儲存裝置100,記憶體控制器110再依據主機命令而對非揮發性記憶體120進行存取(例如讀取或寫入資料),其中上述資料較佳為源自於主機50之使用者資料。主機命令包括邏輯位址,例如:邏輯區塊位址(Logical Block Address)。記憶體控制器110可接收主機命令並將主機命令分別轉譯成記憶體操作命令(簡稱操作命令),再以操作命令控制非揮發性記憶體120讀取、寫入(Write)/編程(Program)非揮發性記憶體120當中特定實體位址之頁面(Page)。記憶體控制器110將資料的邏輯位址與實體位址之間的映射關係記錄於邏輯對實體位址映射表(Logical-to-Physical Address Mapping Table,簡稱「L2P映射表」),其中,實體位址可由通道(Channel)編號、邏輯單元編號(Logical Unit Number,LUN)、平面(Plane)編號、區塊編號、頁面編號以及偏移量(Offset)所組成。於某些實施例中,實體位址的實施可予以變化。例如,實體位址可包含通道編號、邏輯單元編號、平面編號、區塊編號、頁面編號、及/或偏移量。In this embodiment, the host 50 can send a plurality of host commands (Host Command) to the data storage device 100, and the memory controller 110 can access the non-volatile memory 120 according to the host commands (such as reading or writing Data), wherein the above data is preferably user data derived from the host 50. The host command includes a logical address, for example: logical block address (Logical Block Address). The memory controller 110 can receive host commands and translate the host commands into memory operation commands (abbreviated as operation commands), and then use the operation commands to control the non-volatile memory 120 to read, write/program A page with a specific physical address in the non-volatile memory 120. The memory controller 110 records the mapping relationship between the logical address of the data and the physical address in a logical-to-physical address mapping table ("L2P mapping table"), in which The address can be composed of Channel number, Logical Unit Number (LUN), Plane number, Block number, Page number, and Offset. In some embodiments, the implementation of the physical address may be changed. For example, the physical address may include channel number, logical unit number, plane number, block number, page number, and/or offset.

L2P映射表可儲存於非揮發性記憶體120中之一系統區塊中,且可分割成多個群組(Group)映射表,系統區塊較佳為加密區塊且以SLC模式進行資料的編程。記憶體控制器110可依緩衝記憶體116的容量大小而將該多個群組映射表中的一部分或全部群組映射表從非揮發性記憶體120載入緩衝記憶體116,以供快速參考,但本發明不限於此。當使用者資料更新時,記憶體控制器110可依據使用者資料的最新映射關係來更新群組映射表。該多個群組映射表中的任何群組映射表的大小較佳等於非揮發性記憶體元件122-n的一個頁面(Page)的大小,例如16KB(kilobytes;千位元組),其中符號「n」可代表區間[1, N]中之任一正整數,但本發明不限於此。例如,上述任何群組映射表的大小可小於頁面的大小,例如4 KB或1 KB。當然,上述任何群組映射表的大小亦可等於多個非揮發性記憶體元件122-n的一個頁面的大小。The L2P mapping table can be stored in a system block in the non-volatile memory 120, and can be divided into multiple group (Group) mapping tables. The system block is preferably an encrypted block and the data is processed in SLC mode Programming. The memory controller 110 may load part or all of the plurality of group mapping tables from the non-volatile memory 120 into the buffer memory 116 according to the capacity of the buffer memory 116 for quick reference , But the invention is not limited to this. When the user data is updated, the memory controller 110 may update the group mapping table according to the latest mapping relationship of the user data. The size of any group mapping table in the plurality of group mapping tables is preferably equal to the size of one page of the non-volatile memory element 122-n, for example, 16KB (kilobytes; kilobytes), where the symbol "N" can represent any positive integer in the interval [1, N], but the invention is not limited thereto. For example, the size of any of the above group mapping tables may be smaller than the size of the page, such as 4 KB or 1 KB. Of course, the size of any of the above group mapping tables may also be equal to the size of one page of multiple non-volatile memory elements 122-n.

非揮發性記憶體元件122-n可包含多個平面(Planes),諸如平面#0與#1,每一個平面包含多個區塊,每一區塊包含多個頁面。在此情況下,記憶體控制器110可將平面#0與#1之各自的一個頁面組合成一個大頁面,則大頁面的大小等於一個頁面的大小的2倍,諸如32 KB。The non-volatile memory device 122-n may include multiple planes (Planes), such as planes #0 and #1, each plane includes multiple blocks, and each block includes multiple pages. In this case, the memory controller 110 may combine one page of each of planes #0 and #1 into one large page, and the size of the large page is equal to twice the size of one page, such as 32 KB.

另外,記憶體控制器110可將多個通道,例如4個通道CH0~CH3,中各自的一個非揮發性記憶體元件122-n之各自的一個大頁面組合成一個超級頁面(Super Page),且此4個非揮發性記憶體元件122-n可由同一晶片啟用(Chip Enable,CE)訊號所控制。在此設定下,超級頁面的大小SP_SIZE等於128 KB(例如:(32 KB) * 4 = 128 KB),但本發明不限於此。例如,在通道數量等於8的設定下,諸如通道CH0~CH7,通道CH0~CH7中的各自的一個非揮發性記憶體元件之各自的一個大頁面所組成的超級頁面的大小SP_SIZE等於256 KB(例如:(32 KB) * 8 = 256 KB)。In addition, the memory controller 110 can combine a large page of each of the non-volatile memory elements 122-n in multiple channels, for example, four channels CH0~CH3, into a Super Page. And the four non-volatile memory elements 122-n can be controlled by the same chip enable (CE) signal. Under this setting, the size of the super page SP_SIZE is equal to 128 KB (for example: (32 KB) * 4 = 128 KB), but the present invention is not limited to this. For example, under the setting that the number of channels is equal to 8, such as channels CH0~CH7, each of the non-volatile memory elements in channels CH0~CH7, a large page composed of a super page size SP_SIZE equal to 256 KB ( For example: (32 KB) * 8 = 256 KB).

此外,記憶體控制器110對非揮發性記憶體120進行編程運作的最小單位可為一個頁面,而記憶體控制器110對非揮發性記憶體120進行抹除(Erase)運作的最小單位可為一個區塊。In addition, the smallest unit for the memory controller 110 to program the non-volatile memory 120 may be one page, and the smallest unit for the memory controller 110 to perform the erase operation for the non-volatile memory 120 may be A block.

在寫入快取(Write Cache)模式中,主機50可發出寫入命令以請求記憶體控制器110將一筆使用者資料(簡稱資料)寫入非揮發性記憶體120。記憶體控制器110可從主機50接收或下載這筆資料、利用緩衝記憶體116對該筆資料進行緩衝、且利用揮發性記憶體元件130暫存該筆資料,接著,直接回覆寫入命令執行完成的訊息至主機50。之後,當寫入條件滿足時,例如累積的資料長度等於或大於頁面長度或超級頁面長度,記憶體控制器110再將快取的資料寫入至非揮發性記憶體120之資料,但本發明不限於此。In the Write Cache mode, the host 50 can issue a write command to request the memory controller 110 to write a piece of user data (referred to as data) to the non-volatile memory 120. The memory controller 110 can receive or download the data from the host 50, buffer the data using the buffer memory 116, and temporarily store the data using the volatile memory element 130, and then directly reply to the write command execution The completed message is sent to the host 50. After that, when the writing condition is satisfied, for example, the accumulated data length is equal to or greater than the page length or the super page length, the memory controller 110 then writes the cached data to the data of the non-volatile memory 120, but the present invention Not limited to this.

另外,在寫入快取(Write Cache)模式下,揮發性記憶體元件130為非必要(Optional)元件。舉例來說,資料儲存裝置100將從主機50接收的資料暫存在緩衝記憶體116諸如SRAM,接著,直接回覆寫入命令執行完成的訊息至主機50。由於SRAM的儲存容量遠小於DRAM的儲存容量,故SRAM中的寫入緩衝區的大小相當有限,例如可為512 KB。以4個通道CH0~CH3為例,超級頁面的大小SP_SIZE等於128 KB,因此,緩衝記憶體116可暫存4筆超級頁面大小的資料。以8個通道CH0~CH7為例,超級頁面的大小SP_SIZE等於256 KB,因此,緩衝記憶體116僅可暫存2筆超級頁面大小的資料。In addition, in the write cache (Write Cache) mode, the volatile memory element 130 is an optional element. For example, the data storage device 100 temporarily stores the data received from the host 50 in the buffer memory 116 such as SRAM, and then directly responds to the host 50 with the message that the write command execution is completed. Since the storage capacity of SRAM is much smaller than that of DRAM, the size of the write buffer in SRAM is quite limited, for example, it can be 512 KB. Taking the four channels CH0~CH3 as an example, the size of the super page SP_SIZE is equal to 128 KB. Therefore, the buffer memory 116 can temporarily store four pieces of data of the super page size. Taking 8 channels CH0~CH7 as an example, the size of the super page SP_SIZE is equal to 256 KB, therefore, the buffer memory 116 can only temporarily store two pieces of data of the super page size.

在真實的情況下,主機50的邏輯區塊位址(Logical Block Address,LBA)序列可以相當複雜,例如,主機50通常會發出混和寫入命令以及讀取命令至資料儲存裝置100的記憶體控制器110,如第2圖所示,如果可以將寫入命令(標示為「W」)以及讀取命令(標示為「R」)進行命令重新排列(Command Rearrangement),再將寫入命令的資料暫存在緩衝記憶體116,待已暫存在緩衝記憶體116中的資料之大小等於一預定資料大小諸如一或多個超級頁面的大小(例如:該預定資料大小等於512KB)時,再將已暫存在緩衝記憶體116中的資料寫入非揮發性記憶體120中的超級頁面,則可顯著地提升寫入命令的執行效率。In a real situation, the logical block address (Logical Block Address, LBA) sequence of the host 50 can be quite complicated. For example, the host 50 usually issues mixed write commands and read commands to the memory control of the data storage device 100 As shown in Figure 2, if the write command (marked as "W") and read command (marked as "R") can be rearranged (Command Rearrangement), as shown in Figure 2, then the data of the written command Temporarily stored in the buffer memory 116. When the size of the data temporarily stored in the buffer memory 116 is equal to a predetermined data size such as the size of one or more super pages (for example: the predetermined data size is equal to 512KB), the temporary data When the data stored in the buffer memory 116 is written to the super page in the non-volatile memory 120, the execution efficiency of the write command can be significantly improved.

第3圖繪示依據本發明一實施例之一種寫入控制方法的流程圖。此寫入控制方法可應用於資料儲存裝置100,並由資料儲存裝置100的記憶體控制器110所執行,且可針對主機50發出混和寫入命令以及讀取命令進行資料儲存裝置100的寫入控制。本發明寫入控制方法可使資料儲存裝置100能進行上述命令重新排列以大幅地提升寫入命令的執行效率,且不影響讀取命令的執行效率,進而提升資料儲存裝置100的整體效能。FIG. 3 is a flowchart of a write control method according to an embodiment of the invention. This write control method can be applied to the data storage device 100 and executed by the memory controller 110 of the data storage device 100, and can issue a mixed write command and a read command to the host 50 to write to the data storage device 100 control. The write control method of the present invention enables the data storage device 100 to perform the above-mentioned command rearrangement to greatly improve the execution efficiency of the write command without affecting the execution efficiency of the read command, thereby improving the overall performance of the data storage device 100.

在第3圖所示工作流程中,記憶體控制器110可透過步驟S10~S18偵測主機50是否有顯著的混和讀取與寫入行為,並且於偵測到主機50有顯著的混和讀取與寫入行為時,透過從步驟S20起的一系列步驟在不導致任何超時(Timeout)的情況下進行上述命令重新排列。步驟S10~S18可統稱為本發明寫入控制方法的初始步驟,步驟S20~S36可統稱為本發明寫入控制方法的寫入收集(Write Collection)步驟且其一部分步驟諸如S26~S30可視為超時管理步驟,每一步驟的說明如下所述。In the workflow shown in FIG. 3, the memory controller 110 can detect whether the host 50 has a significant mixed read and write behavior through steps S10 to S18, and detects that the host 50 has a significant mixed read and write behavior With the writing action, the above command rearrangement is performed without causing any timeout (Timeout) through a series of steps from step S20. Steps S10~S18 can be collectively referred to as the initial steps of the write control method of the present invention, steps S20~S36 can be collectively referred to as the write collection step of the write control method of the present invention and some of its steps such as S26~S30 can be regarded as super Time management steps, the description of each step is as follows.

於步驟S10中,記憶體控制器110記錄一起始時間T_start0。起始時間T_start0可代表用來觀測主機50的行為的一時間視窗的參考時間。記憶體控制器110可進行時間量測以依據從起始時間T_start0開始的一時間區間的長度判斷該時間區間是否達到這個時間視窗的預定大小。In step S10, the memory controller 110 records a start time T_start0. The start time T_start0 may represent the reference time of a time window for observing the behavior of the host 50. The memory controller 110 may perform time measurement to determine whether the time interval reaches the predetermined size of the time window according to the length of a time interval starting from the start time T_start0.

於步驟S12中,記憶體控制器110從主機50接收至少一命令(例如一或多個命令)諸如命令CMD,且執行上述至少一命令諸如命令CMD。In step S12, the memory controller 110 receives at least one command (eg, one or more commands) such as a command CMD from the host 50, and executes the above-mentioned at least one command such as a command CMD.

於步驟S14中,記憶體控制器110判斷一目前時間T_current0與起始時間T_start0之間的時間區間[T_start0, T_current0]的長度(T_current0 - T_start0)是否達到(例如大於或等於)一預定時間長度門檻值Th_Time0。如果是,進入步驟S16;如果否,進入步驟S12。依據本實施例,預定時間長度門檻值Th_Time0等於20 ms(millisecond;毫秒),但本發明並不限於此。In step S14, the memory controller 110 determines whether the length of the time interval [T_start0, T_current0] (T_current0-T_start0) between the current time T_current0 and the start time T_start0 reaches (eg, greater than or equal to) a predetermined time length threshold The value Th_Time0. If yes, go to step S16; if no, go to step S12. According to this embodiment, the predetermined time length threshold Th_Time0 is equal to 20 ms (millisecond; milliseconds), but the present invention is not limited to this.

於步驟S16中,記憶體控制器110判斷在時間區間[T_start0, T_current0]以內從主機50接收到的複數個命令{CMD}的數量N_CMD是否達到(例如大於或等於)一預定命令數門檻值Th_CMD。如果是,進入步驟S18;如果否,進入步驟S10。依據本實施例,Th_CMD = 256,但本發明並不限於此。這個判斷操作中的該複數個命令{CMD}包含上述至少一命令諸如命令CMD(例如步驟S12的多次執行之各自的命令CMD)。另外,步驟S16中的時間區間[T_start0, T_current0]的長度(T_current0 - T_start0)可等於或略大於預定時間長度門檻值Th_Time0,尤其,可在忽略時間誤差的狀況下被視為等於預定時間長度門檻值Th_Time0。In step S16, the memory controller 110 determines whether the number N_CMD of the plurality of commands {CMD} received from the host 50 within the time interval [T_start0, T_current0] reaches (eg, greater than or equal to) a predetermined command number threshold Th_CMD . If yes, go to step S18; if no, go to step S10. According to this embodiment, Th_CMD = 256, but the invention is not limited to this. The plurality of commands {CMD} in this judgment operation include at least one command such as the command CMD described above (for example, the respective command CMD for multiple executions of step S12). In addition, the length of the time interval [T_start0, T_current0] in step S16 (T_current0-T_start0) may be equal to or slightly greater than the predetermined time length threshold Th_Time0, in particular, it may be regarded as equal to the predetermined time length threshold when ignoring the time error The value Th_Time0.

於步驟S18中,記憶體控制器110判斷在該複數個命令{CMD}中的多個讀取命令{RCMD}與多個寫入命令{WCMD}之各自的數量N_RCMD與N_WCMD是否分別大於一預定讀取命令數門檻值Th_RCMD與一預定寫入命令數門檻值Th_WCMD。如果是,進入步驟S20;如果否,進入步驟S10。依據本實施例,Th_RCMD = 16且Th_WCMD = 16,但本發明並不限於此。這個判斷操作的判斷結果可指出主機50是否有顯著的混和讀取與寫入行為。因應連續執行的步驟S14、S16與S18之各自的判斷結果均為「是」(這表示主機50有顯著的混和讀取與寫入行為),記憶體控制器110開始進行寫入收集,例如,進行從步驟S20起的某些後續步驟。由於預定時間長度門檻值Th_Time0典型地很小,故在進入步驟S20時,這些混和讀取與寫入行為剛開始出現。In step S18, the memory controller 110 determines whether the respective numbers N_RCMD and N_WCMD of the plurality of read commands {RCMD} and the plurality of write commands {WCMD} in the plurality of commands {CMD} are greater than a predetermined Th_RCMD for the number of read commands and Th_WCMD for a predetermined number of write commands. If yes, go to step S20; if no, go to step S10. According to this embodiment, Th_RCMD = 16 and Th_WCMD = 16, but the invention is not limited to this. The judgment result of this judgment operation can indicate whether the host 50 has significant mixed read and write behavior. In response to the continuous execution of steps S14, S16, and S18, the judgment results are "Yes" (this indicates that the host 50 has a significant mixed read and write behavior), the memory controller 110 starts to write collection, for example, Some subsequent steps from step S20 are performed. Since the threshold value Th_Time0 of the predetermined time length is typically very small, these mixed read and write behaviors have just begun to appear when step S20 is entered.

於步驟S20中,記憶體控制器110記錄一起始時間T_start1。起始時間T_start1可代表用來偵測是否即將發生超時的參考時間。記憶體控制器110可進行時間量測以依據從起始時間T_start1開始的一時間區間的長度判斷是否即將發生超時。In step S20, the memory controller 110 records a start time T_start1. The start time T_start1 may represent a reference time used to detect whether a timeout is about to occur. The memory controller 110 may perform time measurement to determine whether a timeout is about to occur according to the length of a time interval starting from the start time T_start1.

於步驟S22中,記憶體控制器110將索引i設定為初始值諸如0。In step S22, the memory controller 110 sets the index i to an initial value such as 0.

於步驟S24中,記憶體控制器110收集從主機50接收之一寫入命令WCMD(i),且處置寫入命令WCMD(i)以透過緩衝記憶體116諸如SRAM緩衝寫入命令WCMD(i)的資料。例如,透過多次執行包含步驟S24、S26、S30、S32等的迴圈,記憶體控制器110可開始收集並處置該複數個命令{CMD}的後續命令中的寫入命令{WCMD(0), WCMD(1), …},但本發明不限於此。In step S24, the memory controller 110 collects a write command WCMD(i) received from the host 50, and handles the write command WCMD(i) to buffer the write command WCMD(i) through the buffer memory 116 such as SRAM data of. For example, by executing the loops including steps S24, S26, S30, S32, etc. multiple times, the memory controller 110 may start to collect and process the write command {WCMD(0) in subsequent commands of the plurality of commands {CMD} , WCMD(1), …}, but the invention is not limited to this.

於步驟S26中,記憶體控制器110判斷是否一目前時間T_current1與起始時間T_start1之間的時間區間[T_start1, T_current1]的長度(T_current1 - T_start1)大於一預定時間長度門檻值Th_Time1或一累積資料量ACCU_DATA大於一預定累積資料量門檻值Th_Data。如果是(例如:(T_current1 - T_start1) > Th_Time1或ACCU_DATA > Th_Data),進入步驟S28;如果否(例如:(T_current1 - T_start1) > Th_Time1且ACCU_DATA > Th_Data),進入步驟S30。依據本實施例,預定時間長度門檻值Th_Time1等於10 ms,預定累積資料量門檻值Th_Data等於51200 KB,且累積資料量ACCU_DATA等於(SP_SIZE * (i + 1)),但本發明並不限於此。例如,預定時間長度門檻值Th_Time1及/或預定累積資料量門檻值Th_Data可予以變化。於某些實施例中,累積資料量ACCU_DATA與預定累積資料量門檻值Th_Data可分別被取代為索引i與一預定索引門檻值Th_Index,其中預定索引門檻值Th_Index等於399,但本發明並不限於此。例如,預定索引門檻值Th_Index可予以變化。In step S26, the memory controller 110 determines whether the length of a time interval [T_start1, T_current1] (T_current1-T_start1) between the current time T_current1 and the start time T_start1 is greater than a predetermined time length threshold Th_Time1 or a cumulative data The amount ACCU_DATA is greater than a predetermined accumulated data amount threshold Th_Data. If it is (for example: (T_current1-T_start1)> Th_Time1 or ACCU_DATA> Th_Data), go to step S28; if not (for example: (T_current1-T_start1)> Th_Time1 and ACCU_DATA> Th_Data), go to step S30. According to this embodiment, the predetermined time length threshold Th_Time1 is equal to 10 ms, the predetermined cumulative data amount threshold Th_Data is equal to 51200 KB, and the cumulative data amount ACCU_DATA is equal to (SP_SIZE * (i + 1)), but the present invention is not limited to this. For example, the predetermined time threshold Th_Time1 and/or the predetermined accumulated data threshold Th_Data may be changed. In some embodiments, the accumulative data amount ACCU_DATA and the predetermined accumulative data amount threshold Th_Data can be replaced by index i and a predetermined index threshold value Th_Index, respectively, where the predetermined index threshold value Th_Index is equal to 399, but the invention is not limited to this . For example, the predetermined index threshold Th_Index may be changed.

於步驟S28中,記憶體控制器110快刷(Flush)緩衝記憶體116諸如SRAM中的該寫入緩衝區,以將該寫入緩衝區中的任何資料(例如任何寫入命令WCMD的資料)寫入非揮發性記憶體120。In step S28, the memory controller 110 flushes the write buffer in the buffer memory 116, such as SRAM, to write any data in the buffer (for example, any data written to the WCMD command) Write to non-volatile memory 120.

於步驟S30中,記憶體控制器110判斷是否沒有額外的主機命令,諸如來自主機50的額外的命令CMD(例如額外的讀取命令RCMD與額外的寫入命令WCMD)。如果是,進入步驟S28;如果否,進入步驟S32。In step S30, the memory controller 110 determines whether there are no additional host commands, such as an additional command CMD from the host 50 (for example, an additional read command RCMD and an additional write command WCMD). If yes, go to step S28; if no, go to step S32.

於步驟S32中,記憶體控制器110判斷是否索引i除以預定命令數量BW的餘數(i % BW)小於(BW - 1),以依據一或多個已收集且處置的寫入命令WCMD的數量判斷該一或多個已收集且處置的寫入命令WCMD的資料是否已填滿該寫入緩衝區(例如512 KB的緩衝空間),其中預定命令數量BW是大於一的正整數,且符號「%」代表模運算符(modulo operator)。如果是,進入步驟S34;如果否,進入步驟S36。In step S32, the memory controller 110 determines whether the remainder (i% BW) of the index i divided by the predetermined command number BW is less than (BW-1), according to one or more collected and processed write commands WCMD The quantity determines whether the data of the one or more collected and processed write commands WCMD has filled the write buffer (for example, 512 KB of buffer space), where the predetermined command number BW is a positive integer greater than one, and the sign "%" stands for modulo operator. If yes, go to step S34; if no, go to step S36.

預定命令數量BW可依該超級頁面的大小SP_SIZE來決定。記憶體控制器110可利用該超級頁面的大小SP_SIZE(例如128 KB)為基底來收集寫入命令{WCMD(0), WCMD(1), …},尤其,寫入命令{WCMD(0), WCMD(1), …}中的每一寫入命令WCMD的資料之資料量可等於該超級頁面的大小SP_SIZE。記憶體控制器110可將預定命令數量BW決定為該寫入緩衝區的大小WBUF_SIZE除以該超級頁面的大小SP_SIZE的商(WBUF_SIZE / SP_SIZE)。例如,當WBUF_SIZE = 512(KB)且SP_SIZE = 128(KB)時,BW = (512 / 128) = 4。此情況下,記憶體控制器110可透過執行步驟S24四次,於該寫入緩衝區中緩衝4個連續的寫入命令的資料,以填滿該寫入緩衝區(例如512 KB的緩衝空間)。The predetermined number of commands BW can be determined according to the size of the super page SP_SIZE. The memory controller 110 can use the size of the super page SP_SIZE (for example, 128 KB) as a base to collect write commands {WCMD(0), WCMD(1), …}, in particular, write commands {WCMD(0), In WCMD(1), …}, the data amount of each data written to the WCMD command can be equal to the size of the super page SP_SIZE. The memory controller 110 may determine the predetermined number of commands BW as the quotient of the size of the write buffer WBUF_SIZE divided by the size of the super page SP_SIZE (WBUF_SIZE / SP_SIZE). For example, when WBUF_SIZE = 512 (KB) and SP_SIZE = 128 (KB), BW = (512 / 128) = 4. In this case, the memory controller 110 can buffer four consecutive write commands in the write buffer by executing step S24 four times to fill the write buffer (for example, 512 KB of buffer space ).

於步驟S34中,記憶體控制器110以一增量諸如1來增加索引i(於第3圖中標示為「i++」,以求簡明)。之後,進入步驟S24。記憶體控制器110可透過再一次執行步驟S24,收集且處置下一個寫入命令諸如最新的寫入命令WCMD(i)。In step S34, the memory controller 110 increases the index i by an increment such as 1 (marked as "i++" in FIG. 3 for simplicity). Then, it progresses to step S24. The memory controller 110 may collect and process the next write command such as the latest write command WCMD(i) by executing step S24 again.

於步驟S36中,記憶體控制器110快刷緩衝記憶體116諸如SRAM中的該寫入緩衝區,以將該寫入緩衝區中的資料(例如最新收集的BW個寫入命令的資料,諸如對應索引i目前值之目前的寫入命令{WCMD(i - (BW - 1)), …, WCMD(i - 1), WCMD(i)}的資料)寫入非揮發性記憶體120。In step S36, the memory controller 110 flashes the write buffer in the memory 116, such as SRAM, to write the data in the write buffer (for example, the latest collected data of the BW write commands, such as The current write command {WCMD(i-(BW-1)), …, WCMD(i-1), WCMD(i)} corresponding to the current value of index i is written to the non-volatile memory 120.

依據本實施例,透過多次執行包含步驟S24、S26、S30、S32等的迴圈,記憶體控制器110可處置其所收集的寫入命令{WCMD(0), WCMD(1), …}中的這一組寫入命令{WCMD(i - (BW - 1)), …, WCMD(i - 1), WCMD(i)},尤其,將這一組寫入命令{WCMD(i - (BW - 1)), …, WCMD(i - 1), WCMD(i)}的資料緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以將這一組寫入命令{WCMD(i - (BW - 1)), …, WCMD(i - 1), WCMD(i)}的資料寫入非揮發性記憶體120。例如,當WBUF_SIZE = 512(KB)且SP_SIZE = 128(KB)時,BW = 4。此情況下,記憶體控制器110可將寫入命令{WCMD(0), WCMD(1), WCMD(2), WCMD(3)}之各自的資料DATA(0)、DATA(1)、DATA(2)與DATA(3)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以分別將資料DATA(0)、DATA(1)、DATA(2)與DATA(3)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122(例如N = 16)的四個超級頁面SP(0)、SP(1)、SP(2)與SP(3),如第4圖所示。According to this embodiment, by repeatedly performing loops including steps S24, S26, S30, S32, etc., the memory controller 110 can process the write commands it collects {WCMD(0), WCMD(1), …} This group of write commands {WCMD(i-(BW-1)), …, WCMD(i-1), WCMD(i)}, in particular, this group of write commands {WCMD(i-( BW-1)), …, WCMD(i-1), WCMD(i)} data is buffered in the write buffer, and quickly flash the write buffer to write this set of write commands {WCMD( i-(BW-1)), …, WCMD(i-1), WCMD(i)} data is written to the non-volatile memory 120. For example, when WBUF_SIZE = 512 (KB) and SP_SIZE = 128 (KB), BW = 4. In this case, the memory controller 110 can write the respective data DATA(0), DATA(1), DATA of the write commands {WCMD(0), WCMD(1), WCMD(2), WCMD(3)} (2) and DATA(3) are buffered in the write buffer, and flash the write buffer to write data DATA(0), DATA(1), DATA(2) and DATA(3), respectively In the non-volatile memory 120, there are four super pages SP(0), SP(1), SP(2) and SP(3) distributed in 16 non-volatile memory elements 122 (eg N=16) , As shown in Figure 4.

這四個超級頁面SP(0)、SP(1)、SP(2)與SP(3)分別包含四列(Row)對應的非揮發性記憶體元件之各自的四個大頁面(於第4圖中以陰影表示),且後續的四個超級頁面分別包含這四列對應的非揮發性記憶體元件之各自的四個後續大頁面(於第4圖中以符號「…」表示),依此類推。由於快刷該寫入緩衝區的操作容許記憶體控制器110繼續緩衝後續收集的寫入命令的資料,故記憶體控制器110可連續地寫入這四個超級頁面SP(0)、SP(1)、SP(2)與SP(3)及後續的多組四個超級頁面,直到至少一超時避免(Timeout Avoidance)條件滿足(例如從步驟S26或S30進入步驟S28的情況)。針對主機50之顯著的混和讀取與寫入行為,本發明寫入控制方法能大幅地提升非揮發性記憶體120(諸如快閃記憶體)的整體傳輸帶寬,並且提升資料儲存裝置100的整體效能。These four super pages SP(0), SP(1), SP(2) and SP(3) respectively contain four large pages of non-volatile memory elements corresponding to four rows (Row) (on page 4). (Indicated by shading in the figure), and the following four super pages respectively contain the four subsequent large pages of the corresponding non-volatile memory elements in these four columns (indicated by the symbol "..." in Figure 4) And so on. Since the operation of flashing the write buffer allows the memory controller 110 to continue buffering the data of the write command collected subsequently, the memory controller 110 can continuously write the four super pages SP(0), SP( 1), SP(2) and SP(3) and subsequent sets of four super pages, until at least one Timeout Avoidance condition is satisfied (for example, when step S26 or S30 enters step S28). For the significant mixed read and write behavior of the host 50, the write control method of the present invention can greatly increase the overall transmission bandwidth of the non-volatile memory 120 (such as flash memory), and enhance the overall data storage device 100 efficacy.

另外,該超級頁面的大小SP_SIZE可予以擴大。例如,當WBUF_SIZE = 512(KB)且SP_SIZE = 256(KB)時,BW = (512 / 256) = 2。此情況下,記憶體控制器110可將寫入命令{WCMD(0), WCMD(1)}之各自的資料DATA(0)與DATA(1)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以分別將資料DATA(0)與DATA(1)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122(例如N = 16)的二個超級頁面SP(0)與SP(1),如第5圖所示。例如,超級頁面SP(0)包含第一列及第二列非揮發性記憶體元件之各自的大頁面群組PR0(0)與PR1(0),且超級頁面SP(1)包含第三列及第四列非揮發性記憶體元件之各自的大頁面群組PR2(0)與PR3(0);超級頁面SP(2)包含第一列及第二列非揮發性記憶體元件之各自的後續的大頁面群組,且超級頁面SP(3)包含第三列及第四列非揮發性記憶體元件之各自的後續的大頁面群組PR2(0)與PR3(0);依此類推。In addition, the size of the super page SP_SIZE can be expanded. For example, when WBUF_SIZE = 512 (KB) and SP_SIZE = 256 (KB), BW = (512 / 256) = 2. In this case, the memory controller 110 can buffer the respective data DATA(0) and DATA(1) of the write command {WCMD(0), WCMD(1)} in the write buffer, and quickly refresh The write buffer is used to write data DATA(0) and DATA(1) into the non-volatile memory 120, respectively, and become two super-distributed in 16 non-volatile memory elements 122 (eg N=16) Pages SP(0) and SP(1) are shown in Figure 5. For example, the super page SP(0) includes the respective large page groups PR0(0) and PR1(0) of the first row and the second row of non-volatile memory elements, and the super page SP(1) includes the third row The large page groups PR2(0) and PR3(0) of the fourth row of non-volatile memory elements; the super page SP(2) includes the first row and the second row of non-volatile memory elements Subsequent large page groups, and the super page SP(3) includes the subsequent large page groups PR2(0) and PR3(0) of the third and fourth rows of non-volatile memory elements; and so on .

此外,該超級頁面的大小SP_SIZE可進一步擴大。例如,當WBUF_SIZE = 512(KB)且SP_SIZE = 512(KB)時,BW = (512 / 512) = 1。此情況下,記憶體控制器110可將寫入命令WCMD(0)的資料DATA(0)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以將資料DATA(0)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122-n(例如N = 16)的一個超級頁面SP(0),如第6圖所示。例如,超級頁面SP(0)包含第一列至第四列非揮發性記憶體元件之各自的大頁面群組PR0(0)、PR1(0)、PR2(0)與PR3(0);超級頁面SP(1)包含第一列至第四列非揮發性記憶體元件之各自的後續的大頁面群組;依此類推。In addition, the size of the super page SP_SIZE can be further expanded. For example, when WBUF_SIZE = 512 (KB) and SP_SIZE = 512 (KB), BW = (512 / 512) = 1. In this case, the memory controller 110 can buffer the data DATA(0) of the write command WCMD(0) in the write buffer, and quickly refresh the write buffer to write the data DATA(0) In the non-volatile memory 120, it becomes a super page SP(0) distributed among 16 non-volatile memory elements 122-n (for example, N=16), as shown in FIG. For example, the super page SP(0) includes the respective large page groups PR0(0), PR1(0), PR2(0), and PR3(0) of the first row to the fourth row of non-volatile memory elements; the super Page SP(1) includes the subsequent large page groups of the first to fourth rows of non-volatile memory elements; and so on.

因應非揮發性記憶體120的架構的變化,上述寫入緩衝區的大小WBUF_SIZE可予以擴大。例如,非揮發性記憶體元件122-n可包含4個平面,諸如平面#0、#1、#2與#3。此情況下,平面#0、#1、#2與#3之各自的一個頁面可被組合成一個大頁面,且大頁面的大小可等於一個頁面的大小的4倍,諸如64 KB。另外,於非揮發性記憶體120中,分別對應於多個通道(例如通道CH0、CH1、CH2與CH3)的某些非揮發性記憶體元件之各自的一個大頁面可被組合成一個超級頁面,且這個超級頁面的大小SP_SIZE可包含上述4倍的因子。尤其,該多個通道可包含通道CH0、CH1、CH2與CH3,且通道CH0、CH1、CH2與CH3之各自的晶片啟用訊號CE0、CE1、CE2與CE3可分別用來控制對應的非揮發性記憶體元件。In response to changes in the structure of the non-volatile memory 120, the size of the write buffer WBUF_SIZE can be enlarged. For example, the non-volatile memory element 122-n may include 4 planes, such as planes #0, #1, #2, and #3. In this case, one page of each of planes #0, #1, #2, and #3 can be combined into one large page, and the size of the large page can be equal to 4 times the size of one page, such as 64 KB. In addition, in the non-volatile memory 120, a large page of each non-volatile memory element corresponding to multiple channels (eg, channels CH0, CH1, CH2, and CH3) can be combined into a super page , And the size of this super page SP_SIZE can include the factor of 4 times. In particular, the plurality of channels may include channels CH0, CH1, CH2, and CH3, and the respective chip enable signals CE0, CE1, CE2, and CE3 of channels CH0, CH1, CH2, and CH3 may be used to control the corresponding non-volatile memories, respectively.体元件。 Body components.

當該超級頁面包含通道CH0、CH1、CH2與CH3之各自的晶片啟用訊號CE0所控制的4個非揮發性記憶體元件122-n之各自的一個大頁面時,該超級頁面的大小SP_SIZE等於256 KB(例如:(64 KB) * 4 = 256 KB)。例如,當WBUF_SIZE = 1024(KB)且SP_SIZE = 256(KB)時,BW = (1024/ 256) = 4。此情況下,記憶體控制器110可將寫入命令{WCMD(0), WCMD(1), WCMD(2), WCMD(3)}之各自的資料DATA(0)、DATA(1)、DATA(2)與DATA(3)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以分別將資料DATA(0)、DATA(1)、DATA(2)與DATA(3)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122(例如N = 16)的四個超級頁面SP(0)、SP(1)、SP(2)與SP(3),如第4圖所示。When the super page includes a large page of each of the four non-volatile memory elements 122-n controlled by the chip enable signal CE0 of the channels CH0, CH1, CH2, and CH3, the size of the super page SP_SIZE is equal to 256 KB (for example: (64 KB) * 4 = 256 KB). For example, when WBUF_SIZE = 1024 (KB) and SP_SIZE = 256 (KB), BW = (1024/256) = 4. In this case, the memory controller 110 can write the respective data DATA(0), DATA(1), DATA of the write commands {WCMD(0), WCMD(1), WCMD(2), WCMD(3)} (2) and DATA(3) are buffered in the write buffer, and flash the write buffer to write data DATA(0), DATA(1), DATA(2) and DATA(3), respectively In the non-volatile memory 120, there are four super pages SP(0), SP(1), SP(2) and SP(3) distributed in 16 non-volatile memory elements 122 (eg N=16) , As shown in Figure 4.

當該超級頁面包含通道CH0、CH1、CH2與CH3之各自的晶片啟用訊號CE0與CE1所控制的8個非揮發性記憶體元件122-n之各自的一個大頁面時,該超級頁面的大小SP_SIZE等於512 KB(例如:(64 KB) * 8 = 512 KB)。例如,當WBUF_SIZE = 1024(KB)且SP_SIZE = 512(KB)時,BW = (1024 / 512) = 2。此情況下,記憶體控制器110可將寫入命令{WCMD(0), WCMD(1)}之各自的資料DATA(0)與DATA(1)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以分別將資料DATA(0)與DATA(1)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122-n(例如N = 16)的二個超級頁面SP(0)與SP(1),如第5圖所示。When the super page includes a large page of each of the eight non-volatile memory elements 122-n controlled by the chip enable signals CE0 and CE1 of the channels CH0, CH1, CH2, and CH3, the size of the super page SP_SIZE Equal to 512 KB (for example: (64 KB) * 8 = 512 KB). For example, when WBUF_SIZE = 1024 (KB) and SP_SIZE = 512 (KB), BW = (1024 / 512) = 2. In this case, the memory controller 110 can buffer the respective data DATA(0) and DATA(1) of the write command {WCMD(0), WCMD(1)} in the write buffer, and quickly refresh The write buffer is used to write data DATA(0) and DATA(1) into the non-volatile memory 120, respectively, and becomes the second distributed in 16 non-volatile memory elements 122-n (for example, N=16) A super page SP (0) and SP (1), as shown in Figure 5.

當該超級頁面包含通道CH0、CH1、CH2與CH3之各自的晶片啟用訊號CE0、CE1、CE2與CE3所控制的16個非揮發性記憶體元件122-n之各自的一個大頁面時,該超級頁面的大小SP_SIZE等於1024 KB(例如:(64 KB) * 16 = 1024 KB)。例如,當WBUF_SIZE = 1024(KB)且SP_SIZE = 1024(KB)時,BW = (1024 / 1024) = 1。此情況下,記憶體控制器110可將寫入命令WCMD(0)的資料DATA(0)緩衝於該寫入緩衝區中,並且快刷該寫入緩衝區以將資料DATA(0)寫入非揮發性記憶體120中,成為分佈於16個非揮發性記憶體元件122-n(例如N = 16)的一個超級頁面SP(0),如第6圖所示。When the super page contains a large page of each of the 16 non-volatile memory elements 122-n controlled by the chip enable signals CE0, CE1, CE2, and CE3 of the channels CH0, CH1, CH2, and CH3, the super page The size of the page SP_SIZE is equal to 1024 KB (for example: (64 KB) * 16 = 1024 KB). For example, when WBUF_SIZE = 1024 (KB) and SP_SIZE = 1024 (KB), BW = (1024 / 1024) = 1. In this case, the memory controller 110 can buffer the data DATA(0) of the write command WCMD(0) in the write buffer, and quickly refresh the write buffer to write the data DATA(0) In the non-volatile memory 120, it becomes a super page SP(0) distributed among 16 non-volatile memory elements 122-n (for example, N=16), as shown in FIG.

在第3圖所示工作流程中的某些步驟可包含判斷操作,而記憶體控制器110可依據這些判斷操作之各自的判斷結果執行這個工作流程中的後續步驟之操作,諸如對應於這些判斷結果之後續操作,以達到資料儲存裝置100之最佳化效能。 以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。Certain steps in the workflow shown in FIG. 3 may include judgment operations, and the memory controller 110 may perform subsequent operations in the workflow according to the respective judgment results of these judgment operations, such as corresponding to these judgments Subsequent operation of the result can achieve the optimized performance of the data storage device 100. The above are only the preferred embodiments of the present invention, and all changes and modifications made in accordance with the scope of the patent application of the present invention shall fall within the scope of the present invention.

50:主機 100:資料儲存裝置 110:記憶體控制器 112:微處理器 112C:程式碼 112M:唯讀記憶體 114:控制邏輯電路 116:緩衝記憶體 118:傳輸介面電路 120:非揮發性記憶體 122、122-1、122-2、…、122-N:非揮發性記憶體元件 130:揮發性記憶體元件 R、W:資料 S10、S12、S14、S16、S18、S20、S22、S24、S26、S28、S30、S32、S34、S36:步驟 CH0、CH1、CH2、CH3:通道 CE0、CE1、CE2、CE3:晶片啟用訊號 SP(0)、SP(1)、SP(2)、SP(3)、…:超級頁面 PR0(0)、PR1(0)、PR2(0)、PR3(0):大頁面群組50: host 100: data storage device 110: memory controller 112: Microprocessor 112C: Code 112M: read-only memory 114: control logic circuit 116: Buffer memory 118: Transmission interface circuit 120: Non-volatile memory 122, 122-1, 122-2, ..., 122-N: non-volatile memory device 130: volatile memory device R, W: data S10, S12, S14, S16, S18, S20, S22, S24, S26, S28, S30, S32, S34, S36: steps CH0, CH1, CH2, CH3: channels CE0, CE1, CE2, CE3: chip enable signal SP(0), SP(1), SP(2), SP(3), ...: super page PR0(0), PR1(0), PR2(0), PR3(0): large page group

第1圖為依據本發明一實施例之一種資料儲存裝置與一主機(host device)的示意圖。 第2圖繪示依據本發明一實施例之一命令重新排列(command rearrangement)控制方案。 第3圖繪示依據本發明一實施例之一種寫入控制方法的流程圖。 第4圖繪示依據本發明一實施例之如第3圖所示寫入控制方法的寫入控制方案。 第5圖繪示依據本發明另一實施例之如第3圖所示寫入控制方法的寫入控制方案。 第6圖繪示依據本發明另一實施例之如第3圖所示寫入控制方法的寫入控制方案。FIG. 1 is a schematic diagram of a data storage device and a host device according to an embodiment of the invention. FIG. 2 illustrates a command rearrangement control scheme according to an embodiment of the invention. FIG. 3 is a flowchart of a write control method according to an embodiment of the invention. FIG. 4 illustrates a write control scheme according to the write control method shown in FIG. 3 according to an embodiment of the invention. FIG. 5 illustrates a write control scheme according to another embodiment of the present invention as shown in FIG. 3 in the write control method. FIG. 6 illustrates a write control scheme according to another embodiment of the present invention as shown in FIG. 3 in the write control method.

S10、S12、S14、S16、S18、S20、S22、S24、S26、S28、S30、S32、S34、S36:步驟 S10, S12, S14, S16, S18, S20, S22, S24, S26, S28, S30, S32, S34, S36: steps

Claims (20)

一種寫入控制方法,該寫入控制方法係應用於一資料儲存裝置,該資料儲存裝置包含一非揮發性記憶體(non-volatile memory,NV memory)以及用來控制該非揮發性記憶體的存取之一記憶體控制器,該非揮發性記憶體包含至少一非揮發性記憶體元件(NV memory element),該至少一非揮發性記憶體元件包含複數個區塊,該寫入控制方法包含有: 從一主機(host device)接收至少一命令,且執行所述至少一命令; 判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值; 判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令; 判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值; 因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,開始進行寫入收集(write collection); 針對該寫入收集,收集從該主機接收之一寫入命令,且處置該寫入命令以透過一緩衝記憶體緩衝該寫入命令的資料,其中該緩衝記憶體位於該記憶體控制器; 判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值; 判斷是否沒有額外的主機命令; 因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令;以及 因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,快刷(Flush)該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。A write control method, which is applied to a data storage device including a non-volatile memory (NV memory) and a memory used to control the non-volatile memory Taking a memory controller, the non-volatile memory includes at least one non-volatile memory element (NV memory element), the at least one non-volatile memory element includes a plurality of blocks, and the writing control method includes: : Receiving at least one command from a host (host device), and executing the at least one command; Determine whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold; Judging whether the number of the plurality of commands received from the host within the time interval reaches a predetermined command number threshold, wherein the plurality of commands includes the at least one command; Judging whether the respective numbers of the plurality of read commands and the plurality of write commands in the plurality of commands are respectively greater than a predetermined threshold of read commands and a threshold of predetermined numbers of write commands; In response to the length of the time interval reaching the predetermined time length threshold, the number of the plurality of commands reaching the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands When the threshold value of the predetermined number of read commands and the threshold value of the number of predetermined write commands are respectively greater than that, a write collection is started; For the write collection, collect a write command received from the host, and process the write command to buffer the data of the write command through a buffer memory, where the buffer memory is located in the memory controller; Determine whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; Determine if there are no additional host commands; Since the length of the other time interval is not greater than the threshold of the other predetermined time length, and no additional host command does not occur, according to the number of one or more collected and processed write commands Determine whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, wherein the one or more collected and processed write commands include the write Order; and Since the data in response to one or more collected and processed write commands has filled the write buffer, flush the write buffer to write the data in the write buffer to the non-volatile Volatile memory. 如申請專利範圍第1項所述之寫入控制方法,其中從該主機接收所述至少一命令的步驟被執行多次,且該複數個命令包含從該主機接收所述至少一命令的步驟的多次執行之各自的命令。The write control method as described in item 1 of the patent application scope, wherein the step of receiving the at least one command from the host is executed multiple times, and the plurality of commands include the step of receiving the at least one command from the host Execute their respective commands multiple times. 如申請專利範圍第1項所述之寫入控制方法,其中判斷該另一目前時間與該另一起始時間之間的該另一時間區間的該長度是否大於該另一預定時間長度門檻值的步驟被執行多次以分別產生一第一判斷結果與一第二判斷結果,其中該第一判斷結果與該第二判斷結果分別指出該另一時間區間的該長度並未大於該另一預定時間長度門檻值以及該另一時間區間的該長度大於該另一預定時間長度門檻值;依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的步驟是因應該第一判斷結果來進行;以及該方法另包含: 因應該第二判斷結果,快刷該寫入緩衝區,以將該寫入緩衝區中的任何資料寫入該非揮發性記憶體。The writing control method as described in item 1 of the patent application scope, wherein it is judged whether the length of the other time interval between the other current time and the other start time is greater than the threshold of the other predetermined time length Steps are performed multiple times to generate a first judgment result and a second judgment result, respectively, wherein the first judgment result and the second judgment result indicate that the length of the other time interval is not greater than the other predetermined time The length threshold and the length of the other time interval are greater than the other predetermined time length threshold; the one or more collected and disposed write commands are determined based on the number of the one or more collected and disposed write commands The step of whether the data of the write command has filled the write buffer in the buffer memory is performed according to the first judgment result; and the method further includes: In response to the second judgment result, the write buffer is quickly refreshed to write any data in the write buffer to the non-volatile memory. 如申請專利範圍第3項所述之寫入控制方法,其中判斷是否沒有所述額外的主機命令的步驟被執行多次以分別產生一第三判斷結果與一第四判斷結果,其中該第三判斷結果與該第四判斷結果中的每一判斷結果指出並未發生沒有所述額外的主機命令的該情況。The write control method as described in item 3 of the patent application scope, wherein the step of judging whether there is no additional host command is executed multiple times to generate a third judgment result and a fourth judgment result, respectively, wherein the third Each of the judgment result and the fourth judgment result indicates that the situation where the additional host command does not occur does not occur. 如申請專利範圍第4項所述之寫入控制方法,其中依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的步驟被執行多次以分別產生一第五判斷結果與一第六判斷結果,其中該第五判斷結果與該第六判斷結果分別指出該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區以及該一或多個已收集且處置的寫入命令的該資料並未填滿該寫入緩衝區;快刷該寫入緩衝區以將該寫入緩衝區中的該資料寫入該非揮發性記憶體的步驟是因應該第五判斷結果來進行;以及該方法另包含: 因應該第六判斷結果,收集從該主機接收之另一寫入命令且處置該另一寫入命令以透過該緩衝記憶體緩衝該另一寫入命令的資料。The write control method as described in item 4 of the patent application scope, wherein the data of the one or more collected and processed write commands are determined based on the number of the one or more collected and processed write commands The step of whether the write buffer in the buffer memory has been filled is executed multiple times to generate a fifth judgment result and a sixth judgment result, respectively, wherein the fifth judgment result and the sixth judgment result indicate respectively The data of the one or more collected and processed write commands has filled the write buffer and the data of the one or more collected and processed write commands has not filled the write buffer The step of flashing the write buffer to write the data in the write buffer to the non-volatile memory is based on the fifth judgment result; and the method further includes: In response to the sixth judgment result, another write command received from the host is collected and the other write command is processed to buffer the data of the other write command through the buffer memory. 如申請專利範圍第1項所述之寫入控制方法,其中判斷該另一目前時間與該另一起始時間之間的該另一時間區間的該長度是否大於該另一預定時間長度門檻值的步驟被執行多次以分別產生一第一判斷結果與一第二判斷結果,其中該第一判斷結果與該第二判斷結果中的每一判斷結果指出該另一時間區間的該長度並未大於該另一預定時間長度門檻值。The writing control method as described in item 1 of the patent application scope, wherein it is judged whether the length of the other time interval between the other current time and the other start time is greater than the threshold of the other predetermined time length The step is performed multiple times to generate a first judgment result and a second judgment result, wherein each of the first judgment result and the second judgment result indicates that the length of the other time interval is not greater than The threshold value of the other predetermined time length. 如申請專利範圍第6項所述之寫入控制方法,其中判斷是否沒有所述額外的主機命令的步驟被執行多次以分別產生一第三判斷結果與一第四判斷結果,其中該第三判斷結果與該第四判斷結果分別指出並未發生沒有所述額外的主機命令的該情況以及發生沒有所述額外的主機命令的情況;依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的步驟是因應該第三判斷結果來進行;以及該方法另包含: 因應該第四判斷結果,快刷該寫入緩衝區,以將該寫入緩衝區中的任何資料寫入該非揮發性記憶體。The write control method as described in item 6 of the patent application scope, wherein the step of judging whether there is no additional host command is executed multiple times to generate a third judgment result and a fourth judgment result, respectively, wherein the third The judgment result and the fourth judgment result respectively indicate that the case without the additional host command and the case without the additional host command occur; according to the one or more collected and disposed write commands The step of determining whether the data of the one or more collected and processed write commands has filled the write buffer in the buffer memory is based on the third judgment result; and the method contain: In response to the fourth judgment result, the write buffer is quickly refreshed to write any data in the write buffer to the non-volatile memory. 如申請專利範圍第7項所述之寫入控制方法,其中依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的步驟被執行多次以分別產生一第五判斷結果與一第六判斷結果,其中該第五判斷結果與該第六判斷結果分別指出該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區以及該一或多個已收集且處置的寫入命令的該資料並未填滿該寫入緩衝區;快刷該寫入緩衝區以將該寫入緩衝區中的該資料寫入該非揮發性記憶體的步驟是因應該第五判斷結果來進行;以及該方法另包含: 因應該第六判斷結果,收集從該主機接收之另一寫入命令且處置該另一寫入命令以透過該緩衝記憶體緩衝該另一寫入命令的資料。The write control method as described in item 7 of the patent application scope, wherein the data of the one or more collected and processed write commands is determined based on the number of the one or more collected and processed write commands The step of whether the write buffer in the buffer memory has been filled is executed multiple times to generate a fifth judgment result and a sixth judgment result, respectively, wherein the fifth judgment result and the sixth judgment result indicate respectively The data of the one or more collected and processed write commands has filled the write buffer and the data of the one or more collected and processed write commands has not filled the write buffer The step of flashing the write buffer to write the data in the write buffer to the non-volatile memory is based on the fifth judgment result; and the method further includes: In response to the sixth judgment result, another write command received from the host is collected and the other write command is processed to buffer the data of the other write command through the buffer memory. 如申請專利範圍第1項所述之寫入控制方法,其中依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的步驟被執行多次以分別產生一第五判斷結果與一第六判斷結果,其中該第五判斷結果與該第六判斷結果分別指出該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區以及該一或多個已收集且處置的寫入命令的該資料並未填滿該寫入緩衝區;快刷該寫入緩衝區以將該寫入緩衝區中的該資料寫入該非揮發性記憶體的步驟是因應該第五判斷結果來進行;以及該方法另包含: 因應該第六判斷結果,收集從該主機接收之另一寫入命令且處置該另一寫入命令以透過該緩衝記憶體緩衝該另一寫入命令的資料。The write control method as described in item 1 of the patent application scope, wherein the data of the one or more collected and processed write commands are determined based on the number of the one or more collected and processed write commands The step of whether the write buffer in the buffer memory has been filled is executed multiple times to generate a fifth judgment result and a sixth judgment result, respectively, wherein the fifth judgment result and the sixth judgment result indicate respectively The data of the one or more collected and processed write commands has filled the write buffer and the data of the one or more collected and processed write commands has not filled the write buffer The step of flashing the write buffer to write the data in the write buffer to the non-volatile memory is based on the fifth judgment result; and the method further includes: In response to the sixth judgment result, another write command received from the host is collected and the other write command is processed to buffer the data of the other write command through the buffer memory. 如申請專利範圍第1項所述之寫入控制方法,其中該一或多個已收集且處置的寫入命令是從該複數個命令的後續命令中收集的。The write control method as described in item 1 of the patent application scope, wherein the one or more write commands that have been collected and disposed are collected from subsequent commands of the plurality of commands. 一種資料儲存裝置,包含有: 一非揮發性記憶體(non-volatile memory,NV memory),用來儲存資訊,其中該非揮發性記憶體包含至少一非揮發性記憶體元件(NV memory element),以及該至少一非揮發性記憶體元件包含複數個區塊;以及 一控制器,耦接至該非揮發性記憶體,用來控制該資料儲存裝置之運作,其中該控制器包含: 一緩衝記憶體,用來暫時地儲存資訊;以及 一處理電路,用來依據來自一主機(host device)的複數個主機命令(host command)控制該控制器,以容許該主機透過該控制器存取(access)該非揮發性記憶體,其中: 該控制器從該主機接收至少一命令,且執行所述至少一命令; 該控制器判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值; 該控制器判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令,且屬於該複數個主機命令; 該控制器判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值; 因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,該控制器開始進行寫入收集(write collection); 針對該寫入收集,該控制器收集從該主機接收之一寫入命令,且處置該寫入命令以透過該緩衝記憶體緩衝該寫入命令的資料; 該控制器判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值; 該控制器判斷是否沒有額外的主機命令; 因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,該控制器依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令,且屬於該複數個主機命令;以及 因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,該控制器快刷(Flush)該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。A data storage device, including: A non-volatile memory (NV memory) for storing information, wherein the non-volatile memory includes at least one non-volatile memory element (NV memory element), and the at least one non-volatile memory The body element contains multiple blocks; and A controller, coupled to the non-volatile memory, is used to control the operation of the data storage device. The controller includes: A buffer memory for temporarily storing information; and A processing circuit for controlling the controller according to a plurality of host commands from a host device to allow the host to access the non-volatile memory through the controller, wherein: The controller receives at least one command from the host and executes the at least one command; The controller determines whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold; The controller determines whether the number of commands received from the host within the time interval reaches a predetermined command number threshold, where the commands include the at least one command and belong to the host commands; The controller judges whether the respective numbers of the plurality of read commands and the plurality of write commands in the plurality of commands are respectively greater than a predetermined threshold value of the read command number and a predetermined threshold value of the write command number; In response to the length of the time interval reaching the predetermined time length threshold, the number of the plurality of commands reaching the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands When the threshold value of the predetermined number of read commands and the threshold value of the number of predetermined write commands are respectively greater than that, the controller starts a write collection; For the write collection, the controller collects a write command received from the host, and processes the write command to buffer the data of the write command through the buffer memory; The controller determines whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; The controller determines whether there are no additional host commands; Since the length of another time interval is not greater than the threshold of the other predetermined time length, and there is no case where the additional host command is not present, the controller is based on one or more collected and processed writes The number of commands determines whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, wherein the one or more collected and processed write commands include The write command, and belongs to the plurality of host commands; and Since the data in response to one or more collected and processed write commands has filled the write buffer, the controller flushes the write buffer to write the data in the write buffer Write to the non-volatile memory. 如申請專利範圍第11項所述之資料儲存裝置,其中從該主機接收所述至少一命令的操作被執行多次,且該複數個命令包含從該主機接收所述至少一命令的操作的多次執行之各自的命令。The data storage device as described in item 11 of the patent application range, wherein the operation of receiving the at least one command from the host is performed multiple times, and the plurality of commands includes the number of operations of receiving the at least one command from the host The respective commands executed at this time. 如申請專利範圍第11項所述之資料儲存裝置,其中判斷該另一目前時間與該另一起始時間之間的該另一時間區間的該長度是否大於該另一預定時間長度門檻值的操作被執行多次以分別產生一第一判斷結果與一第二判斷結果,其中該第一判斷結果與該第二判斷結果分別指出該另一時間區間的該長度並未大於該另一預定時間長度門檻值以及該另一時間區間的該長度大於該另一預定時間長度門檻值;依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的操作是因應該第一判斷結果來進行;以及因應該第二判斷結果,該控制器快刷該寫入緩衝區,以將該寫入緩衝區中的任何資料寫入該非揮發性記憶體。The data storage device as described in item 11 of the patent application scope, wherein the operation of determining whether the length of the other time interval between the other current time and the other start time is greater than the threshold of the other predetermined time length Is executed multiple times to generate a first judgment result and a second judgment result respectively, wherein the first judgment result and the second judgment result respectively indicate that the length of the other time interval is not greater than the other predetermined time length The threshold and the length of the other time interval are greater than the threshold of the other predetermined time length; the one or more collected and processed writes are determined based on the number of the one or more collected and processed write commands Whether the data entered in the command has filled the write buffer in the buffer memory is due to the first judgment result; and according to the second judgment result, the controller quickly flushes the write buffer To write any data in the write buffer to the non-volatile memory. 如申請專利範圍第13項所述之資料儲存裝置,其中判斷是否沒有所述額外的主機命令的操作被執行多次以分別產生一第三判斷結果與一第四判斷結果,其中該第三判斷結果與該第四判斷結果中的每一判斷結果指出並未發生沒有所述額外的主機命令的該情況。A data storage device as described in item 13 of the patent application scope, wherein the operation of determining whether there is no additional host command is performed multiple times to generate a third determination result and a fourth determination result, respectively, wherein the third determination Each of the judgment result and the fourth judgment result indicates that the situation without the additional host command does not occur. 如申請專利範圍第14項所述之資料儲存裝置,其中依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的操作被執行多次以分別產生一第五判斷結果與一第六判斷結果,其中該第五判斷結果與該第六判斷結果分別指出該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區以及該一或多個已收集且處置的寫入命令的該資料並未填滿該寫入緩衝區;快刷該寫入緩衝區以將該寫入緩衝區中的該資料寫入該非揮發性記憶體的操作是因應該第五判斷結果來進行;以及因應該第六判斷結果,該控制器收集從該主機接收之另一寫入命令且處置該另一寫入命令以透過該緩衝記憶體緩衝該另一寫入命令的資料。The data storage device as described in item 14 of the patent application scope, wherein whether the data of the one or more collected and processed write commands is judged based on the number of the one or more collected and processed write commands The operation of filling the write buffer in the buffer memory is performed multiple times to generate a fifth judgment result and a sixth judgment result, wherein the fifth judgment result and the sixth judgment result indicate that the The data of one or more collected and processed write commands has filled the write buffer and the data of the one or more collected and processed write commands has not filled the write buffer; The operation of flashing the write buffer to write the data in the write buffer to the non-volatile memory is performed according to the fifth judgment result; and according to the sixth judgment result, the controller collects The host receives another write command and processes the other write command to buffer the data of the other write command through the buffer memory. 如申請專利範圍第11項所述之資料儲存裝置,其中判斷該另一目前時間與該另一起始時間之間的該另一時間區間的該長度是否大於該另一預定時間長度門檻值的操作被執行多次以分別產生一第一判斷結果與一第二判斷結果,其中該第一判斷結果與該第二判斷結果中的每一判斷結果指出該另一時間區間的該長度並未大於該另一預定時間長度門檻值。The data storage device as described in item 11 of the patent application scope, wherein the operation of determining whether the length of the other time interval between the other current time and the other start time is greater than the threshold of the other predetermined time length Is executed multiple times to generate a first judgment result and a second judgment result respectively, wherein each of the first judgment result and the second judgment result indicates that the length of the other time interval is not greater than the Threshold value for another predetermined length of time. 如申請專利範圍第16項所述之資料儲存裝置,其中判斷是否沒有所述額外的主機命令的操作被執行多次以分別產生一第三判斷結果與一第四判斷結果,其中該第三判斷結果與該第四判斷結果分別指出並未發生沒有所述額外的主機命令的該情況以及發生沒有所述額外的主機命令的情況;依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的操作是因應該第三判斷結果來進行;以及因應該第四判斷結果,該控制器快刷該寫入緩衝區,以將該寫入緩衝區中的任何資料寫入該非揮發性記憶體。The data storage device according to item 16 of the patent application scope, wherein the operation of judging whether or not the additional host command is executed multiple times to generate a third judgment result and a fourth judgment result respectively, wherein the third judgment The result and the fourth judgment result respectively indicate that the case without the additional host command and the case without the additional host command occur; according to the one or more write commands that have been collected and disposed of The quantity determines whether the data of the one or more collected and processed write commands has filled the write buffer in the buffer memory according to the third judgment result; and according to the fourth As a result of the judgment, the controller quickly flashes the write buffer to write any data in the write buffer to the non-volatile memory. 如申請專利範圍第17項所述之資料儲存裝置,其中依據該一或多個已收集且處置的寫入命令的該數量判斷該一或多個已收集且處置的寫入命令的該資料是否已填滿該緩衝記憶體中的該寫入緩衝區的操作被執行多次以分別產生一第五判斷結果與一第六判斷結果,其中該第五判斷結果與該第六判斷結果分別指出該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區以及該一或多個已收集且處置的寫入命令的該資料並未填滿該寫入緩衝區;快刷該寫入緩衝區以將該寫入緩衝區中的該資料寫入該非揮發性記憶體的操作是因應該第五判斷結果來進行;以及因應該第六判斷結果,該控制器收集從該主機接收之另一寫入命令且處置該另一寫入命令以透過該緩衝記憶體緩衝該另一寫入命令的資料。The data storage device as described in item 17 of the patent application scope, wherein whether the data of the one or more collected and processed write commands is determined according to the number of the one or more collected and processed write commands The operation of filling the write buffer in the buffer memory is performed multiple times to generate a fifth judgment result and a sixth judgment result, wherein the fifth judgment result and the sixth judgment result indicate that the The data of one or more collected and processed write commands has filled the write buffer and the data of the one or more collected and processed write commands has not filled the write buffer; The operation of flashing the write buffer to write the data in the write buffer to the non-volatile memory is performed according to the fifth judgment result; and according to the sixth judgment result, the controller collects The host receives another write command and processes the other write command to buffer the data of the other write command through the buffer memory. 一種資料儲存裝置之控制器,該資料儲存裝置包含該控制器與一非揮發性記憶體(non-volatile memory,NV memory),該非揮發性記憶體包含至少一非揮發性記憶體元件(NV memory element),該至少一非揮發性記憶體元件包含複數個區塊,該控制器包含有: 一緩衝記憶體,用來暫時地儲存資訊;以及 一處理電路,用來依據來自一主機(host device)的複數個主機命令(host command)控制該控制器,以容許該主機透過該控制器存取(access)該非揮發性記憶體,其中: 該控制器從該主機接收至少一命令,且執行所述至少一命令; 該控制器判斷一目前時間與一起始時間之間的一時間區間的長度是否達到一預定時間長度門檻值; 該控制器判斷在該時間區間以內從該主機接收到的複數個命令的數量是否達到一預定命令數門檻值,其中該複數個命令包含所述至少一命令,且屬於該複數個主機命令; 該控制器判斷在該複數個命令中的多個讀取命令與多個寫入命令之各自的數量是否分別大於一預定讀取命令數門檻值與一預定寫入命令數門檻值; 因應該時間區間的該長度達到該預定時間長度門檻值、該複數個命令的該數量達到該預定命令數門檻值、且該多個讀取命令與該多個寫入命令之各自的所述數量分別大於該預定讀取命令數門檻值與該預定寫入命令數門檻值,該控制器開始進行寫入收集(write collection); 針對該寫入收集,該控制器收集從該主機接收之一寫入命令,且處置該寫入命令以透過該緩衝記憶體緩衝該寫入命令的資料; 該控制器判斷另一目前時間與另一起始時間之間的另一時間區間的長度是否大於另一預定時間長度門檻值; 該控制器判斷是否沒有額外的主機命令; 因應該另一時間區間的該長度並未大於該另一預定時間長度門檻值、且並未發生沒有所述額外的主機命令的情況,該控制器依據一或多個已收集且處置的寫入命令的數量判斷該一或多個已收集且處置的寫入命令的資料是否已填滿該緩衝記憶體中的一寫入緩衝區,其中該一或多個已收集且處置的寫入命令包含該寫入命令,且屬於該複數個主機命令;以及 因應該一或多個已收集且處置的寫入命令的該資料已填滿該寫入緩衝區,該控制器快刷(Flush)該寫入緩衝區,以將該寫入緩衝區中的資料寫入該非揮發性記憶體。A controller for a data storage device includes the controller and a non-volatile memory (NV memory), the non-volatile memory includes at least one non-volatile memory element (NV memory element), the at least one non-volatile memory element includes a plurality of blocks, and the controller includes: A buffer memory for temporarily storing information; and A processing circuit for controlling the controller according to a plurality of host commands from a host device to allow the host to access the non-volatile memory through the controller, wherein: The controller receives at least one command from the host and executes the at least one command; The controller determines whether the length of a time interval between a current time and a start time reaches a predetermined time length threshold; The controller determines whether the number of commands received from the host within the time interval reaches a predetermined command number threshold, wherein the commands include the at least one command and belong to the host commands; The controller judges whether the respective numbers of the plurality of read commands and the plurality of write commands in the plurality of commands are respectively greater than a predetermined threshold value of the read command number and a predetermined threshold value of the write command number; In response to the length of the time interval reaching the predetermined time length threshold, the number of the plurality of commands reaching the predetermined command number threshold, and the respective numbers of the plurality of read commands and the plurality of write commands When the threshold value of the predetermined number of read commands and the threshold value of the number of predetermined write commands are respectively greater than that, the controller starts a write collection; For the write collection, the controller collects a write command received from the host, and processes the write command to buffer the data of the write command through the buffer memory; The controller determines whether the length of another time interval between another current time and another start time is greater than another predetermined time length threshold; The controller determines whether there are no additional host commands; Since the length of the other time interval is not greater than the threshold of the other predetermined time length, and no additional host command does not occur, the controller is based on one or more collected and processed writes The number of commands determines whether the data of the one or more collected and processed write commands has filled a write buffer in the buffer memory, where the one or more collected and processed write commands include The write command belongs to the plural host commands; and Since the data in response to one or more collected and processed write commands has filled the write buffer, the controller flushes the write buffer to write the data in the write buffer Write to the non-volatile memory. 如申請專利範圍第19項所述之控制器,其中從該主機接收所述至少一命令的操作被執行多次,且該複數個命令包含從該主機接收所述至少一命令的操作的多次執行之各自的命令。The controller of claim 19, wherein the operation of receiving the at least one command from the host is performed multiple times, and the plurality of commands includes the operation of receiving the at least one command from the host multiple times Execute their respective commands.
TW108124909A 2018-10-03 2019-07-15 Write control method, associated data storage device and controller thereof TWI697009B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910690904.4A CN110989918B (en) 2018-10-03 2019-07-29 Write control method, data storage device and controller thereof
US16/590,398 US10990325B2 (en) 2018-10-03 2019-10-02 Write control method, associated data storage device and controller thereof

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862740439P 2018-10-03 2018-10-03
US62/740,439 2018-10-03

Publications (2)

Publication Number Publication Date
TW202015045A true TW202015045A (en) 2020-04-16
TWI697009B TWI697009B (en) 2020-06-21

Family

ID=70413304

Family Applications (3)

Application Number Title Priority Date Filing Date
TW108116832A TWI684988B (en) 2018-10-03 2019-05-16 Error handling method, associated data storage device and controller thereof
TW109116137A TWI709975B (en) 2018-10-03 2019-07-15 Write control method, associated data storage device and controller thereof
TW108124909A TWI697009B (en) 2018-10-03 2019-07-15 Write control method, associated data storage device and controller thereof

Family Applications Before (2)

Application Number Title Priority Date Filing Date
TW108116832A TWI684988B (en) 2018-10-03 2019-05-16 Error handling method, associated data storage device and controller thereof
TW109116137A TWI709975B (en) 2018-10-03 2019-07-15 Write control method, associated data storage device and controller thereof

Country Status (1)

Country Link
TW (3) TWI684988B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI748507B (en) * 2020-06-08 2021-12-01 瑞昱半導體股份有限公司 Data access system, and method for operating a data access system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11366618B2 (en) * 2020-03-02 2022-06-21 Silicon Motion, Inc. All flash array server and control method thereof
JP2022147448A (en) 2021-03-23 2022-10-06 キオクシア株式会社 Memory system and data management method

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69027491T2 (en) * 1989-08-01 1997-02-06 Digital Equipment Corp Software error handling procedures
JPH0799512B2 (en) * 1992-11-18 1995-10-25 インターナショナル・ビジネス・マシーンズ・コーポレイション Programmable external storage controller
US6762733B2 (en) * 1993-06-24 2004-07-13 Nintendo Co. Ltd. Electronic entertainment and communication system
US6804794B1 (en) * 2001-02-28 2004-10-12 Emc Corporation Error condition handling
US7096407B2 (en) * 2003-02-18 2006-08-22 Hewlett-Packard Development Company, L.P. Technique for implementing chipkill in a memory system
US9063836B2 (en) * 2010-07-26 2015-06-23 Intel Corporation Methods and apparatus to protect segments of memory
US9262270B2 (en) * 2012-12-28 2016-02-16 Intel Corporation Live error recovery
US10042750B2 (en) * 2013-03-15 2018-08-07 Micron Technology, Inc. Apparatuses and methods for adaptive control of memory using an adaptive memory controller with a memory management hypervisor
US10592122B2 (en) * 2015-03-31 2020-03-17 Sandisk Technologies Llc Inherent adaptive trimming
US20170177276A1 (en) * 2015-12-21 2017-06-22 Ocz Storage Solutions, Inc. Dual buffer solid state drive
KR102527992B1 (en) * 2016-03-14 2023-05-03 삼성전자주식회사 Data storage device and data processing system having the same
US10534709B2 (en) * 2016-08-31 2020-01-14 Sandisk Technologies Llc Flush command consolidation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI748507B (en) * 2020-06-08 2021-12-01 瑞昱半導體股份有限公司 Data access system, and method for operating a data access system

Also Published As

Publication number Publication date
TWI684988B (en) 2020-02-11
TWI709975B (en) 2020-11-11
TWI697009B (en) 2020-06-21
TW202032547A (en) 2020-09-01
TW202015065A (en) 2020-04-16

Similar Documents

Publication Publication Date Title
US11237765B2 (en) Data writing method and storage device
CN110989918B (en) Write control method, data storage device and controller thereof
US10339046B1 (en) Data moving method and storage controller
US10599345B2 (en) Memory device that writes data into a block based on time passage since erasure of data from the block
JP2011522350A (en) Hybrid memory management
TWI697009B (en) Write control method, associated data storage device and controller thereof
US11734178B2 (en) Storage device performing cache read operation using page buffer and operating method thereof
US20160027518A1 (en) Memory device and method for controlling the same
US11036429B2 (en) Memory control method, memory storage device and memory control circuit unit to determine a source block using interleaving information
TWI802068B (en) Memory performance optimization method, memory control circuit unit and memory storage device
US11543986B2 (en) Electronic system including host, memory controller and memory device and method of operating the same
US11573891B2 (en) Memory controller for scheduling commands based on response for receiving write command, storage device including the memory controller, and operating method of the memory controller and the storage device
US10339045B2 (en) Valid data management method and storage controller
US11334273B1 (en) Valid data merging method, memory storage device and memory control circuit unit
TWI805445B (en) Method for performing access control of memory device with aid of additional physical address information, memory device, and controller of memory device
US11755492B2 (en) Storage device and operating method thereof
WO2023115308A1 (en) System and method for defragmentation of memory device
US20210132804A1 (en) Storage device and method of operating the storage device
TWI721365B (en) High efficiency garbage collection method, and associated data storage device and controller thereof
US11694728B2 (en) Storage device and operating method thereof
TWI823792B (en) Mapping table updating method, memory storage device and memory control circuit unit
TWI828391B (en) Data storage device and method for estimating buffer size of the data storage device
US11645197B2 (en) Memory controller and method of operating the same
US20240143226A1 (en) Data storage device and method for managing a write buffer
US20240126473A1 (en) Data storage device and method for managing a write buffer