[go: up one dir, main page]

TWI712882B - Data storage device and control method for non-volatile memory - Google Patents

Data storage device and control method for non-volatile memory Download PDF

Info

Publication number
TWI712882B
TWI712882B TW108107913A TW108107913A TWI712882B TW I712882 B TWI712882 B TW I712882B TW 108107913 A TW108107913 A TW 108107913A TW 108107913 A TW108107913 A TW 108107913A TW I712882 B TWI712882 B TW I712882B
Authority
TW
Taiwan
Prior art keywords
data
block
source block
controller
source
Prior art date
Application number
TW108107913A
Other languages
Chinese (zh)
Other versions
TW202011199A (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 CN201910445239.2A priority Critical patent/CN110888593B/en
Priority to US16/505,192 priority patent/US11036414B2/en
Publication of TW202011199A publication Critical patent/TW202011199A/en
Application granted granted Critical
Publication of TWI712882B publication Critical patent/TWI712882B/en

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)
  • Read Only Memory (AREA)

Abstract

High-efficiency control technology for non-volatile memory. A controller moves valid data from a first source block to an active block in batches and, between the different batches, write data from a host is allowed to be stored to the active block. In the absence of a second source block, the controller moves each batch with a first amount of data to the active block. On the contrary, the controller moves each batch with a second amount of data to the active block. The second amount of data is greater than the first amount of data, and such a design is intended to accelerate data movement of the first source block.

Description

資料儲存裝置以及非揮發式記憶體控制方法Data storage device and non-volatile memory control method

本案係有關於非揮發式記憶體之控制。This case is about the control of non-volatile memory.

非揮發式記憶體有多種形式─例如,快閃記憶體(flash memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式隨機存取記憶體(Resistive RAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,用於長時間資料保存,可做為儲存媒體實現一資料儲存裝置。Non-volatile memory has many forms-for example, flash memory (flash memory), magnetoresistive RAM (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive random access Memory (Resistive RAM), Spin Transfer Torque-RAM (STT-RAM), etc., are used for long-term data storage and can be used as storage media to realize a data storage device.

非揮發式記憶體通常有其特殊的儲存特性。本技術領域需要相應非揮發式記憶體的儲存特性發展相應的控制技術。Non-volatile memory usually has its special storage characteristics. The technical field needs to develop corresponding control technology corresponding to the storage characteristics of non-volatile memory.

根據本案一種實施方式所實現的一資料儲存裝置包括一非揮發式記憶體以及一控制器。該控制器根據一主機之要求操作該非揮發式記憶體。該控制器自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料。該控制器更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地。該控制器以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊。該控制器在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量。該控制器在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量。該第二資料量高於該第一資料量。A data storage device implemented according to an embodiment of this case includes a non-volatile memory and a controller. The controller operates the non-volatile memory according to the request of a host. The controller configures an active block from a plurality of idle blocks of the non-volatile memory to fill in the write data required by the host. The controller further uses the active block as a transfer destination of valid data of a first source block in the non-volatile memory. The controller moves the effective data of the first source block to the active block in a plurality of batches, and allows the write data requested by the host to be filled in the active block between different batches. When there is no second source block, the controller causes the batches that move the first source block to each move a first amount of data. When the second source block exists, the controller causes the batches that move the first source block to each move a second amount of data. The second data amount is higher than the first data amount.

一種實施方式中,該控制器在更存在一第三來源區塊時,調升該第二資料量。In one embodiment, the controller increases the amount of second data when there is a third source block.

一種實施方式中,該控制器令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。In one embodiment, the controller allows the valid data of the first source block to be completely moved to the active block before allowing the valid data of the second source block to be moved to the active block.

一種實施方式中,該控制器是在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的資料量。In one embodiment, the controller sets the amount of data to be moved by each of the batches of the first source block before moving the valid data of the first source block.

一種實施方式中,該控制器根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n。該控制器根據來源區塊的總數設定一數值a。該控制器在僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值。該控制器以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。In one embodiment, the controller estimates a ratio x:(y-x) based on the number of effective pages x of the first source block and the number of idle pages y of the active block, which is equivalent to 1:n. The controller sets a value a according to the total number of source blocks. The controller sets the value a as a normal value when only the first source block exists, and sets the value a to be greater than the normal value when not only the first source block exists. The controller implements a batch of movement of the first source block and writing of the writing data requested by the host with a ratio a:n.

一種實施方式中,該控制器更根據該非揮發式記憶體程式化的反應時間設定一數值M。該控制器自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。In one embodiment, the controller further sets a value M according to the programmed response time of the non-volatile memory. After the controller moves a*M pages of valid data from the first source block to the active block, it allows the n*M pages of write data requested by the host to fill in the active block.

一種實施方式中,該控制器估算上述數值a*M以及n*M後,先搬移a*M頁有效資料至該主動區塊,方允許該主機要求的n*M頁寫入資料填入該主動區塊。In one embodiment, after the controller estimates the aforementioned values a*M and n*M, it first moves a*M pages of valid data to the active block, so as to allow the n*M pages of write data requested by the host to be filled into the Active block.

一種實施方式中,來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。In one embodiment, the source block is selected because it should wait for the number of idle blocks to be less than a critical number, or find that the error correction fails, or perform preventive removal, or meet the loss average.

一種實施方式中,該控制器將該第一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。In one embodiment, after the controller moves all the valid data of the first source block to the active block, it releases the first source block as an idle block before the end writing of the active block is completed .

以上控制器對非揮發式記憶體之操作也可以由其他結構實現。本案更可以前述概念實現非揮發式記憶體的控制方法,包括:根據一主機之要求操作一非揮發式記憶體;自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地;以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊;在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量;且在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量。該第二資料量高於該第一資料量。The operation of the above controller on the non-volatile memory can also be realized by other structures. This case can also realize the control method of non-volatile memory with the aforementioned concepts, including: operating a non-volatile memory according to the requirements of a host; configuring an active block from a plurality of idle blocks of the non-volatile memory and filling in the host The requested write data; the active block is used as the destination of the effective data of a first source block in the non-volatile memory; the effective data of the first source block is moved to the active block in multiple batches Block, and allow the write data requested by the host to be filled in the active block between different batches; when there is no second source block, the batches that move the first source block are moved by one A first amount of data; and when the second source block exists, the batches that move the first source block each move a second amount of data. The second data amount is higher than the first data amount.

下文特舉實施例,並配合所附圖示,詳細說明本發明內容。Hereinafter, specific embodiments are given in conjunction with accompanying drawings to illustrate the content of the present invention in detail.

以下敘述列舉本發明的多種實施例。以下敘述介紹本發明的基本概念,且並非意圖限制本發明內容。實際發明範圍應依照申請專利範圍界定之。The following description lists various embodiments of the present invention. The following description introduces the basic concept of the present invention, and is not intended to limit the content of the present invention. The actual scope of invention shall be defined in accordance with the scope of patent application.

非揮發式記憶體可以是快閃記憶體(Flash Memory)、磁阻式隨機存取記憶體(Magnetoresistive RAM)、鐵電隨機存取記憶體(Ferroelectric RAM)、電阻式記憶體(Resistive RAM,RRAM)、自旋轉移力矩隨機存取記憶體(Spin Transfer Torque-RAM, STT-RAM)…等,提供長時間資料保存之儲存媒體。以下特別以快閃記憶體為例進行討論。Non-volatile memory can be flash memory (Flash Memory), magnetoresistive RAM (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive RAM (RRAM) ), Spin Transfer Torque-RAM (STT-RAM), etc., provide storage media for long-term data storage. The following discussion takes the flash memory as an example.

現今資料儲存裝置常以快閃記憶體為儲存媒體,用以儲存來自於主機的使用者資料。資料儲存裝置的種類眾多,包括記憶卡(Memory Card)、通用序列匯流排閃存裝置(USB Flash Device)、固態硬碟(SSD) …等產品。有一種應用是採多晶片封裝、將快閃記憶體與其控制器包裝在一起─稱為嵌入式快閃記憶體模組(如eMMC)。Nowadays, data storage devices often use flash memory as storage media to store user data from the host. There are many types of data storage devices, including memory cards (Memory Card), universal serial bus flash devices (USB Flash Device), solid state drives (SSD)... and other products. One application is to use multi-chip packaging to package flash memory and its controller together-called embedded flash memory modules (such as eMMC).

以快閃記憶體為儲存媒體的資料儲存裝置可應用於多種電子裝置中。所述電子裝置包括智慧型手機、穿戴裝置、平板電腦、虛擬實境設備…等。電子裝置的運算模塊可視為主機(Host),操作所使用的資料儲存裝置,以存取其中快閃記憶體。The data storage device using flash memory as the storage medium can be applied to a variety of electronic devices. The electronic devices include smart phones, wearable devices, tablet computers, virtual reality equipment, etc. The computing module of the electronic device can be regarded as a host, which operates the data storage device used to access the flash memory therein.

以快閃記憶體為儲存媒體的資料儲存裝置也可用於建構數據中心。例如,伺服器可操作固態硬碟(SSD)陣列形成數據中心。伺服器即可視為主機,操作所連結之固態硬碟,以存取其中快閃記憶體。Data storage devices using flash memory as storage media can also be used to construct data centers. For example, the server can operate a solid state drive (SSD) array to form a data center. The server can be regarded as the host, operating the connected solid-state drive to access the flash memory.

第1圖根據本案一種實施方式圖解資料儲存裝置100。資料儲存裝置100包括快閃記憶體102以及控制器104。主機106透過控制器104而間接存取快閃記憶體102。控制器104除了接收及執行來自主機(Host)106的寫入命令,更主動搬移快閃記憶體102所儲存的使用者資料。FIG. 1 illustrates a data storage device 100 according to an embodiment of the present invention. The data storage device 100 includes a flash memory 102 and a controller 104. The host 106 indirectly accesses the flash memory 102 through the controller 104. In addition to receiving and executing write commands from the host 106, the controller 104 also actively moves the user data stored in the flash memory 102.

快閃記憶體有其特殊的儲存特性,以下敘述之。Flash memory has its special storage characteristics, which are described below.

主機106端是以邏輯位址(例如,邏輯區塊位址LBA或全域主機頁編號GHP…等)區別使用者資料。快閃記憶體102之物理空間則是劃分為複數個區塊(Blocks)配置使用。各區塊(Block)包括複數頁(Pages)。各頁包括N個區段(Sectors),N為大於一的整數,如:4。16KB空間的頁可分為四個區段,各區段為4KB。一種實施方式中,一區塊係根據頁編號,由低至高編號配置來儲存資料。The host 106 uses logical addresses (for example, logical block address LBA or global host page number GHP... etc.) to distinguish user data. The physical space of the flash memory 102 is divided into a plurality of blocks (Blocks) for allocation. Each block (Block) includes multiple pages (Pages). Each page includes N sectors (Sectors), N is an integer greater than one, such as: 4. A page of 16KB space can be divided into four sectors, each of which is 4KB. In one embodiment, a block is arranged to store data according to page numbers, from low to high numbers.

一種實施方式中,資料儲存裝置採用多通道技術,可將不同通道的多個區塊可以虛擬成一個超級區塊,多個頁面可以虛擬成一個超級頁面,並以超級區塊、超級頁面進行資料儲存空間的管理,可加快資料儲存裝置的資料吞吐量。In one embodiment, the data storage device adopts multi-channel technology, which can virtualize multiple blocks of different channels into a super block, and multiple pages can be virtualized into a super page, and use super blocks and super pages to perform data Storage space management can speed up the data throughput of data storage devices.

資料儲存裝置將使用者資料的邏輯位址與物理位址的對應關係記錄在邏輯-物理位址映射表(Logical-Physical Mapping Table,L2P Table)中。The data storage device records the correspondence between the logical address and the physical address of the user data in a logical-physical address mapping table (Logical-Physical Mapping Table, L2P Table).

快閃記憶體102的儲存空間需先抹除方能再次使用,抹除(Erase)的最小單位為區塊。區塊可區分成資料區塊、主動區塊以及閒置區塊。閒置區塊可作為主動區塊以寫入使用者資料。當主動區塊寫滿使用者資料後,經過關閉處理(寫入EOB(End of Block)資訊),主動區塊變更為資料區塊。隨著使用者資料的更新,部份儲存在資料區塊的使用者資料會由有效資料變更為無效資料。當資料區塊所儲存的使用者資料皆為無效資料時,經抹除處理後則變更為閒置區塊。在另一種實施例中,充滿無效資料的資料區塊會變更為閒置區塊,而抹除處理乃等到閒置區塊作為主動區塊時再予以執行。The storage space of the flash memory 102 needs to be erased before it can be used again, and the smallest unit of erase (Erase) is a block. Blocks can be divided into data blocks, active blocks and idle blocks. Idle blocks can be used as active blocks to write user data. When the active block is filled with user data, after closing processing (writing EOB (End of Block) information), the active block is changed to a data block. As user data is updated, some user data stored in the data block will be changed from valid data to invalid data. When the user data stored in the data block are all invalid data, it will be changed to an idle block after erasure. In another embodiment, a data block full of invalid data is changed to an idle block, and the erasing process is performed when the idle block becomes an active block.

快閃記憶體的使用涉及資料搬移程序,可分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量不足時(例如,少於一臨界數量TH1),可對儲存空間進行垃圾回收(Garbage Collection)處理。例如,當多個資料區塊(又稱來源區塊)僅儲存零星有效資料時,可進行垃圾回收處理而將有效資料集中到一個主動區塊(又稱目的區塊),以回收多個資料區塊,增加閒置區塊數量。The use of flash memory involves data movement procedures, which can be divided into garbage collection procedures and non-garbage collection procedures. When the number of free blocks is insufficient (for example, less than a critical number TH1), the storage space can be garbage collected (garbage collection) processing. For example, when multiple data blocks (also called source blocks) only store sporadic valid data, garbage collection can be performed and the valid data can be collected into one active block (also called destination block) to recover multiple data Block, increase the number of idle blocks.

非垃圾回收程序的種類很多,是根據瀕損條件判斷。例如,產生錯誤更正失效(ECC failed)的資料區塊(來源區塊)也需要進行資料搬移以及時搶救其中尚可讀出的使用者資料。另外,過於頻繁讀取的資料區塊(來源區塊)也需要進行資料搬移,避免資料區塊的資料保存能力降低所導致的使用者資料損壞,此操作又稱預防性搬移(Early Move)。另外,資料搬移也可能因應區塊間的損耗平均(Wear Leveling)考量而啟動,例如,將讀取次數低的資料區塊(來源區塊)的使用者資料(包括有效資料及無效資料)全部搬移到抹除計數較高的主動區塊(目的區塊),以回收該資料區塊。另外,損耗平均程序亦可與垃圾回收程序予以結合,即損耗平均程序中搬移多個資料區塊(來源區塊)的有效資料至抹除計數較高的主動區塊(目的區塊)。There are many types of non-garbage collection programs, which are judged based on the endangered condition. For example, the data block (source block) where the error correction failure (ECC failed) is generated also needs to be moved to timely rescue the user data that can still be read. In addition, data blocks (source blocks) that are read too frequently also need to be moved to avoid user data damage caused by the reduction of the data storage capacity of the data block. This operation is also called preventive move (Early Move). In addition, data migration may also be initiated in response to wear leveling considerations between blocks, for example, all user data (including valid data and invalid data) in the data block (source block) with a low number of reads Move to the active block (destination block) with a higher erase count to recover the data block. In addition, the loss averaging process can also be combined with the garbage collection process, that is, the loss averaging process moves the valid data of multiple data blocks (source blocks) to the active block (destination block) with a higher erasure count.

需注意的是,資料搬移較佳是以資料複製的方式來實現。It should be noted that the data transfer is preferably realized by data copying.

本案對以上有效資料搬移提出一種高效能方案。一旦有資料搬移需求,例如,以上垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,都可採用本案搬移技巧。This case proposes a high-performance plan for the transfer of the above effective data. Once there is a need for data transfer, for example, the above garbage collection, error correction and failure removal, preventive removal, loss-average removal, or others, you can use this case removal technique.

圖中將快閃記憶體102的閒置區塊歸屬至閒置區塊池108,資料區塊歸屬至資料區塊池110。當有主機106提出寫入命令、或控制器104啟動資料搬移程序時,控制器104自閒置區塊池108中選擇一個閒置區塊作為主動區塊A0,此時閒置區塊池108的閒置區塊數量會減一。之後,將使用者資料寫入至主動區塊A0中。當主動區塊A0關閉而成為資料區塊後,資料區塊數量會加一。In the figure, the idle blocks of the flash memory 102 belong to the idle block pool 108, and the data blocks belong to the data block pool 110. When the host 106 submits a write command or the controller 104 starts the data transfer procedure, the controller 104 selects an idle block from the idle block pool 108 as the active block A0. At this time, the idle area of the idle block pool 108 The number of blocks will be reduced by one. Afterwards, the user data is written into the active block A0. When the active block A0 is turned off and becomes a data block, the number of data blocks will increase by one.

快閃記憶體一般以主動區塊A0接收主機的使用者資料,此使用者資料通常由寫入命令所提供(參閱主機寫入資料路徑Host_Data)。特別是,相較於以另一個主動區塊(稱之A1以與A0區別)儲存來自來源區塊的使用者資料,本案控制器104令主動區塊A0也作為資料搬移程序的目的地,而不是使用主動區塊A1。一旦有資料搬移需求,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,本案可將資料搬移程序中的來源區塊的使用者資料收集至主動區塊A0(參閱資料搬移路徑Blk_Data)。。特別是,本案令同一區塊的有效資料係分割成多個批次搬移到該主動區塊A0。本案為不同區塊,適應性設定單批次搬移的有效資料量。越多資料區塊產生有效資料搬移需求,單批次搬移的有效資料量越高。主機寫入資料路徑Host_Data以及資料搬移路徑Blk_Data所提供給主動區塊A0的資料量係動態調配。以下更詳細討論之。Flash memory generally uses active block A0 to receive user data from the host. This user data is usually provided by a write command (see Host_Data for host write data path). In particular, instead of using another active block (called A1 to distinguish it from A0) to store user data from the source block, the controller 104 in this case makes the active block A0 also serve as the destination of the data transfer process, and Instead of using active block A1. Once there is a need for data movement, such as garbage collection, error correction invalidation movement, preventive movement, loss-average movement, or other, this case can collect user data from the source block in the data movement process to active block A0( (Refer to the data transfer path Blk_Data). . In particular, in this case, the effective data of the same block is divided into multiple batches and moved to the active block A0. This case is for different blocks, and the effective data volume of a single batch is set adaptively. The more data blocks generate effective data transfer requirements, the higher the amount of effective data transferred in a single batch. The amount of data provided to the active block A0 by the host write data path Host_Data and the data transfer path Blk_Data is dynamically allocated. It is discussed in more detail below.

相較於傳統技術同時配置主動區塊A0以及主動區塊A1,如本案善用主動區塊A0有數種優點,並描述如下。Compared with the traditional technology where the active block A0 and the active block A1 are configured at the same time, the active block A0 in this case has several advantages, which are described as follows.

首先,本案中主動區塊A0不只可以儲存來自主機以寫入指令要求寫入的使用者資料,更可以儲存來自來源區塊的使用者資料,因此,可降低閒置區塊的使用量。First of all, the active block A0 in this case can not only store user data requested by the host with a write command, but also store user data from the source block. Therefore, the usage of idle blocks can be reduced.

在傳統有使用主動區塊A1的例子中,因應突發斷電事件,突發斷電事件回復(Sudden Power Off Recovery,SPOR)程序須特別考量資料可靠度,會捨棄尚未關閉(Closed)的主動區塊A1,仍以來源區塊上的使用者資料為準。因此,只要主動區塊A1尚未關閉,資料搬移程序中的所有來源區塊都必須留存,不能釋出。上述設計明顯地拖累來源區塊的回收,造成閒置區塊數量無法及時地增加,甚至導致不同種類的資料搬移程序的啟動。In the traditional example of using active block A1, in response to sudden power outages, the Sudden Power Off Recovery (SPOR) program must take special consideration of data reliability, and will discard the closed active Block A1 is still subject to the user data on the source block. Therefore, as long as the active block A1 is not closed, all source blocks in the data transfer process must be retained and cannot be released. The above design obviously drags down the recovery of source blocks, causing the number of idle blocks to not increase in time, and even leading to the start of different types of data transfer procedures.

相較傳統技術,本案是以主動區塊A0作為資料搬移程序中的目的區塊。突發斷電事件回復(SPOR)程序不會全然丟棄該主動區塊A0。在資料搬移完成後,資料搬移程序中的來源區塊即可回收,無須為了SPOR程序而留存。因此,相較於傳統特別再以主動區塊A1作為目的區塊的技術,本案的閒置區塊數量可有效地增加,克服上述問題。Compared with the traditional technology, this case uses the active block A0 as the target block in the data transfer process. The SPOR procedure will not completely discard the active block A0. After the data transfer is completed, the source block in the data transfer process can be recovered, and there is no need to save it for the SPOR process. Therefore, compared with the traditional technology that specifically uses the active block A1 as the target block, the number of idle blocks in this case can be effectively increased to overcome the above-mentioned problems.

此外,傳統技術為了令作為目的區塊的主動區塊A1及早關閉,可能會填入部份虛假資料(dummy data),這將降低資料區塊的資料儲存量,也增加區塊的抹寫頻率,縮短快閃記憶體壽命。相較之,以主動區塊A0作資料搬移程序的目的地,可以避免虛假資料的寫入,克服上述問題。In addition, in order to close the active block A1 as the target block in the traditional technology, some dummy data may be filled in, which will reduce the data storage capacity of the data block and increase the erasure frequency of the block. , Shorten the life of flash memory. In contrast, using the active block A0 as the destination of the data transfer program can avoid the writing of false data and overcome the above-mentioned problems.

一種實施方式中,控制器104令一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料完全搬移到該主動區塊A0後,方允許另一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料搬移到該主動區塊A0。In one implementation, the controller 104 allows the valid data of a source block (whether garbage collection or non-garbage collection) to be completely moved to the active block A0 before allowing another source block (regardless of garbage collection or non-garbage collection). Valid data of garbage collection) is moved to the active block A0.

本案特別令同一來源區塊的有效資料係分批搬移至主動區塊A0。各批次間,主機要求的寫入資料可填入該主動區塊A0。有效資料搬移以及來自主機之寫入資料的填寫之間可存在比例關係。本案適應性設定該比例關係。若發生資料搬移需求的來源區塊並不只單一個,本案提高單批次所搬移的有效資料量,及早結束當前來源區塊之有效資料搬移,以應付下一個來源區塊。In this case, the effective data of the same source block is moved to the active block A0 in batches. Between each batch, the write data required by the host can be filled in the active block A0. There may be a proportional relationship between the effective data transfer and the filling of the written data from the host. This case adapts to set the proportional relationship. If there is more than one source block that requires data movement, this project increases the amount of effective data moved in a single batch and ends the effective data movement of the current source block as soon as possible to cope with the next source block.

第1圖中,主機106要求的寫入資料係經主機寫入資料路徑Host_Data)。垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移等等,各種以主動區塊A0為目的地的有效資料搬移,在第1圖是以資料搬移路徑Blk_Data表示。凡是自資料區塊池110選定資料區塊作為來源區塊,將其中有效資料搬移到主動區塊A0者,都屬於該資料搬移路徑Blk_Data所涵蓋技術。本案係動態調配路徑Host_Data以及路徑Blk_Data之使用。In Figure 1, the write data requested by the host 106 is written to the data path Host_Data via the host. Garbage collection, error correction and failure migration, preventive migration, loss-average migration, etc., various valid data migrations with active block A0 as the destination are represented by the data migration path Blk_Data in Figure 1. Any data block selected from the data block pool 110 as the source block and the valid data is moved to the active block A0 belong to the technology covered by the data moving path Blk_Data. This case is to dynamically allocate the path Host_Data and the use of path Blk_Data.

一種實施方式中,控制器104在前一個來源區塊搬移完畢後,又允許其他來源區塊同樣以主動區塊A0為有效資料搬移目的地。例如,一來源區塊的垃圾回收完成後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,進行非垃圾回收(錯誤更正失效搬移、預防性搬移、損耗平均搬移等等)的有效資料搬移。例如,對一來源區塊進行非垃圾回收的有效資料搬移後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,再次實施非垃圾回收的有效資料搬移。如此一來,主動區塊A0關閉(例如,以是否完成EOB資訊為判斷標準)前,閒置區塊數量有機會被充分補充(可補充不只一個閒置區塊)。In one implementation, the controller 104 allows other source blocks to also use the active block A0 as the effective data transfer destination after the previous source block is moved. For example, after the garbage collection of one source block is completed, the controller 104 allows another source block to use the same active block A0 as the destination for non-garbage collection (error correction failure removal, preventive removal, loss average removal, etc.) Etc.) effective data transfer. For example, after the effective data transfer of a source block that is not garbage collected is performed, the controller 104 allows another source block to use the same active block A0 as the destination to perform the effective data transfer that is not garbage collected again. In this way, before the active block A0 is closed (for example, based on whether the EOB information is completed as the criterion), the number of idle blocks has a chance to be fully replenished (more than one idle block can be added).

一種實施方式中,同一來源區塊的有效資料係分批搬移至主動區塊A0。各批次間,主機106要求的寫入資料填入該主動區塊A0。或者,各批次間,控制器104是令該快閃記憶體102回覆主機106的讀取要求。不同批次的間距可以由寫入該主動區塊A0的主機106資料量決定、或是計時定義。批次間可能有新的有效資料搬移需求發生。控制器104是待當前來源區塊的批次搬移結束後,才會處理另一個來源區塊的批次搬移。In one implementation, the valid data of the same source block is moved to the active block A0 in batches. In each batch, the write data required by the host 106 is filled in the active block A0. Or, between batches, the controller 104 makes the flash memory 102 respond to the read request of the host 106. The interval between different batches can be determined by the amount of data written in the host 106 of the active block A0 or defined by timing. There may be new and effective data transfer requirements between batches. The controller 104 will process the batch transfer of another source block after the batch transfer of the current source block is completed.

一種實施方式中,該控制器104根據一來源區塊的有效資料量以及該主動區塊A0的閒置空間估算一比例,並根據該比例設定各批次搬移的有效資料量。根據該比例,該控制器104更可設定兩個批次之間允許該主機106填入該主動區塊A0的寫入資料量。In one embodiment, the controller 104 estimates a ratio based on the effective data amount of a source block and the idle space of the active block A0, and sets the effective data amount for each batch transfer according to the ratio. According to the ratio, the controller 104 can further set the amount of data written by the host 106 to fill the active block A0 between two batches.

面臨資料搬移需求的來源區塊可能不只單一個。一種實施方式動態調配上述比例,對正要處理的該個來源區塊作設定,決定各批次搬移的有效資料量。一種實施方式中,有資料搬移需求的來源區塊有兩個。第一來源區塊的有效資料有x頁。該主動區塊A0有y頁閒置空間。本案可估算出一比例x:(y-x),等效為1:n。本案可調整該比例為a:n,a為大於一常態值的數值。例如,常態值可為1,a可為2。考量快閃記憶體102程式化(包括主機106寫入以及來源區塊搬移)的反應時間,本案發展出的搬移策略為:每將a*M頁有效資料自第一來源區塊搬移到主動區塊A0(對應路徑Blk_Data),即穿插以主動區塊A0儲存主機106發下的n*M頁寫入資料(對應路徑Host_Data)。倍數a使得第一來源區塊的有效資料及早收集至主動區塊A0。控制器104得以及時進行第二來源區塊的有效資料搬移。控制器104將針對第二來源區塊的有效資料量以及主動區塊A0此時的閒置空間,估算出新的比例。控制器104也會確認是否又有其他來源區塊待搬移,以調整該比例,產生適合該第二來源區塊的搬移策略。There may be more than one source block facing data movement needs. One embodiment dynamically allocates the above-mentioned ratio, sets the source block to be processed, and determines the effective amount of data transferred in each batch. In one implementation, there are two source blocks that require data movement. There are x pages of valid data in the first source block. The active block A0 has y pages of free space. In this case, a ratio of x:(y-x) can be estimated, which is equivalent to 1:n. In this case, the ratio can be adjusted to a:n, where a is a value greater than a normal value. For example, the normal value can be 1, and a can be 2. Considering the response time of flash memory 102 programming (including host 106 writing and source block transfer), the migration strategy developed in this project is: every a*M page of valid data is moved from the first source block to the active area Block A0 (corresponding to the path Blk_Data), that is, the active block A0 is interspersed to store the n*M page write data sent by the host 106 (corresponding to the path Host_Data). The multiple a enables the effective data of the first source block to be collected in the active block A0 early. The controller 104 can move the effective data of the second source block in time. The controller 104 will estimate a new ratio for the effective data amount of the second source block and the idle space of the active block A0 at this time. The controller 104 also confirms whether there are other source blocks to be moved, so as to adjust the ratio and generate a moving strategy suitable for the second source block.

一種實施方式中,第一來源區塊設定搬移策略時,不只有第二來源區塊在等待,更有第三來源區塊需要搬移。a值可設定成更大(相較於只有第一以及第二來源區塊的例子)。In one embodiment, when the first source block sets the moving strategy, not only the second source block is waiting, but the third source block needs to be moved. The value of a can be set to be larger (compared to the example of only the first and second source blocks).

快閃記憶體102程式化(包括主機106寫入以及來源區塊搬移)的反應時間受到多種因素影響。本案特別考量該反應時間,設定前述M值。一種實施方式中,一次程式化M頁可使快閃記憶體102寫入時序最佳化。例如,在等待第一筆M頁程式化的確收回應時,第二筆M頁即可快取至控制器104等待存入該快閃記憶體102:操作效能遠優於單頁程式化。The response time of flash memory 102 programming (including host 106 writing and source block transfer) is affected by many factors. In this case, the reaction time is specially considered, and the aforementioned M value is set. In one embodiment, programming M pages at a time can optimize the write timing of the flash memory 102. For example, while waiting for the confirmation response of the first M-page programming, the second M-page can be cached to the controller 104 and waiting to be stored in the flash memory 102: the operating efficiency is much better than single-page programming.

一種實施方式中,控制器104是優先進行資料搬移,次而才考量主機106之寫入要求。例如,一有需要資料搬移的來源區塊,控制器104評估出搬移策略後,即進行第一批資料搬移。第一批資料搬移結束後,才允許再接收主機106要求的寫入資料。此設計確保同一來源區塊收集在同一主動區塊A0上。In one embodiment, the controller 104 prioritizes the data transfer, and then considers the write request of the host 106. For example, once there is a source block for which data needs to be moved, the controller 104 performs the first batch of data movement after evaluating the movement strategy. After the transfer of the first batch of data is completed, the write data requested by the host 106 is allowed to be received again. This design ensures that the same source block is collected on the same active block A0.

第2圖以流程圖圖解根據本案一種實施方式對快閃記憶體102所實施的資料搬移。FIG. 2 is a flowchart illustrating the data transfer performed on the flash memory 102 according to an embodiment of the present invention.

步驟S202:控制器104配置主動區塊A0。控制器104自閒置區塊池108配置其中之一閒置區塊作為主動區塊A0。Step S202: The controller 104 configures the active block A0. The controller 104 allocates one of the idle blocks from the idle block pool 108 as the active block A0.

步驟S204:控制器104判斷是否執行資料搬移程序?如果是則執行步驟S212,如果否則執行步驟S206。當預設條件滿足時,例如,閒置區塊數量少於臨界數量TH1,或是產生錯誤更正失效搬移、預防性搬移、損耗平均搬移任一,則控制器104啟動(執行)資料搬移程序。Step S204: The controller 104 judges whether to execute the data transfer procedure? If yes, execute step S212, if otherwise, execute step S206. When the preset conditions are met, for example, the number of idle blocks is less than the critical number TH1, or any one of error correction failure removal, preventive removal, and loss-average removal occurs, the controller 104 starts (executes) the data removal process.

步驟S206:控制器104判斷是否關閉主動區塊A0?如果是則執行步驟S210,如果否則執行步驟S208。假如主動區塊A0仍有閒置空間以儲存資料,則控制器104不關閉主動區塊A0。Step S206: The controller 104 determines whether to close the active block A0? If yes, execute step S210, if otherwise, execute step S208. If the active block A0 still has free space to store data, the controller 104 does not close the active block A0.

步驟S208:控制器104將來自主機106的使用者資料寫入主動區塊A0,之後,回到步驟S204。在上述中控制器104先執行步驟S204,之後,才會執行步驟S206以及步驟S208/S210,這表示控制器104會優先搬移資料搬移程序的使用者資料。在另一實施例中,控制器104可將步驟S204排在主機106使用者資料填寫之後;在此設定下,控制器104會優先將主機106的使用者資料寫入主動區塊A0。Step S208: The controller 104 writes the user data from the host 106 into the active block A0, and then returns to step S204. In the above, the controller 104 executes step S204 first, and then steps S206 and steps S208/S210 are executed, which means that the controller 104 will preferentially move the user data of the data movement procedure. In another embodiment, the controller 104 can arrange step S204 after the user data of the host 106 is filled in; under this setting, the controller 104 will write the user data of the host 106 into the active block A0 first.

步驟S210:控制器104關閉主動區塊A0。假如主動區塊A0已無閒置空間以儲存資料,則控制器104關閉主動區塊A0,並將EOB資訊寫入主動區塊A0的最後一個頁面中。Step S210: The controller 104 closes the active block A0. If the active block A0 has no free space to store data, the controller 104 closes the active block A0 and writes EOB information into the last page of the active block A0.

倘若步驟S204顯示存在資料搬移需求,流程進入步驟S212,規劃一來源區塊之有效資料的搬移策略。控制器104除了考量來源區塊的有效資料量、主動區塊A0的閒置狀況,更考量是否還有更多來源區塊待搬移。控制器104因而評估得一搬移策略。例如,每搬移a*M頁有效資料,即穿插n*M頁的主機106寫入資料。步驟S214以及步驟S216即反覆執行以完成該搬移策略。If step S204 shows that there is a data transfer requirement, the process proceeds to step S212 to plan a source block's effective data transfer strategy. The controller 104 not only considers the effective data amount of the source block and the idle condition of the active block A0, but also considers whether there are more source blocks to be moved. The controller 104 thus evaluates a moving strategy. For example, every time a*M pages of valid data are moved, the host 106 inserts n*M pages to write data. Step S214 and step S216 are executed repeatedly to complete the moving strategy.

步驟S214以主動區塊A0為目的地,搬移來源區塊的a*M頁有效資料。步驟S216,主動區塊A0重啟對主機106發來的寫入資料之接收工作。控制器104允許主機106要求的n*M頁寫入資料填入該主動區塊A0。步驟S218,控制器104判斷是否完成該來源區塊的有效資料搬移。若否,流程回到步驟S214,繼續下一批次a*M頁的有效資料搬移。若步驟S218判定該來源區塊的有效資料搬移完成,流程進入步驟S204以及其後步驟,規劃如何使用主動區塊A0空間應付另一個資料搬移需求。In step S214, the active block A0 is used as the destination to move the valid data of pages a*M of the source block. In step S216, the active block A0 restarts the reception of the write data sent by the host 106. The controller 104 allows the n*M pages of writing data required by the host 106 to fill in the active block A0. In step S218, the controller 104 determines whether the effective data transfer of the source block is completed. If not, the process returns to step S214 to continue the effective data transfer of the next batch of a*M pages. If step S218 determines that the effective data movement of the source block is completed, the flow proceeds to step S204 and subsequent steps to plan how to use the active block A0 space to meet another data movement demand.

一種實施方式中,步驟S216可以包括一時限判斷。超過該時限,流程即進行步驟S218。In an implementation manner, step S216 may include a time limit judgment. When the time limit is exceeded, the flow proceeds to step S218.

第3圖更根據本案一種實施方式詳細說明步驟S212,其中決定步驟S214各批次所進行的資料搬移頁數a*M、以及步驟S216所穿插的主機106寫入頁數n*M。FIG. 3 further describes step S212 in detail according to an embodiment of the present case, in which the number of data transfer pages a*M of each batch in step S214 and the number of pages written by the host 106 interspersed in step S216 are determined.

步驟S302,該控制器104根據來源區塊的有效資料量以及該主動區塊A0的閒置空間估算一比例1:n。例如,來源區塊的有效資料有x頁。主動區塊A0有y頁閒置空間。根據步驟S302,控制器104估算出一比例x:(y-x),等效為1:n。In step S302, the controller 104 estimates a ratio of 1:n based on the effective data amount of the source block and the idle space of the active block A0. For example, there are x pages of valid data in the source block. Active block A0 has y-page free space. According to step S302, the controller 104 estimates a ratio x:(y-x), which is equivalent to 1:n.

步驟S304,控制器104判斷是否有複數個來源區塊有資料搬移需求。若否,流程進入步驟S306。控制器104令數值a為一常態值(例如,1),表示無加速搬移的必要。反之,若有複數個來源區塊需要搬移,流程進入步驟S308。控制器104令數值a大於該常態值(例如,2),以加速搬移。越多來源區塊等待資料搬移,數值a可設定越大。In step S304, the controller 104 determines whether there are a plurality of source blocks that require data movement. If not, the process goes to step S306. The controller 104 sets the value a to a normal value (for example, 1), indicating that there is no need to accelerate the movement. Conversely, if there are multiple source blocks that need to be moved, the process goes to step S308. The controller 104 makes the value a greater than the normal value (for example, 2) to accelerate the movement. The more source blocks wait for data to move, the larger the value a can be set.

第3圖程序所求出的n值以及所規劃的a值,即套用於步驟S214以及S216,決定各批次進行的資料搬移頁數a*M、以及各批次間允許穿插的主機106寫入頁數n*M。The n value and the planned a value obtained by the program in Figure 3 are applied to steps S214 and S216 to determine the number of data transfer pages a*M for each batch and the host 106 writes allowed to be interleaved between each batch Number of incoming pages n*M.

使用者操作習慣可能導致裝置反覆斷電、上電(稱為power cycling)。例如,手機使用者開蓋查看信息又蓋上。閒置區塊大量消耗,發生垃圾回收需求。特定區塊也有可能過於頻繁讀取,導致錯誤更正失效(ECC failed)搬移、預防性搬移(early move)、損耗平均(wear leveling)搬移、或是其他有效資料搬移求發生。本案使得過低的閒置區塊數量得以及時補足。The user's operating habits may cause the device to repeatedly power off and power on (called power cycling). For example, a mobile phone user opens the lid to view information and then closes the lid. A large amount of idle blocks are consumed, and garbage collection needs occur. Certain blocks may also be read too frequently, resulting in ECC failed movement, early move, wear leveling movement, or other effective data movement requests. This case allows the excessively low number of idle blocks to be filled in time.

以上控制器104對快閃記憶體102之操作也可以由其他結構實現。凡是動態調配主動區塊A0之使用方式(例如,動態調配路徑Blk_Data以及路徑Host_Data之使用比例),都屬於本案欲保護範圍。本案更可以前述概念實現非揮發式記憶體的控制方法。The operation of the above controller 104 on the flash memory 102 can also be implemented by other structures. All the usage methods of the dynamic allocation of active block A0 (for example, the usage ratio of the dynamic allocation path Blk_Data and the path Host_Data) belong to the scope of protection of this case. In this case, the aforementioned concept can be used to realize the control method of non-volatile memory.

雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed as above in the preferred embodiment, it is not intended to limit the present invention. Anyone familiar with the art can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall be subject to the scope of the attached patent application.

100:資料儲存裝置;102:快閃記憶體;104:控制器;106:主機;108:閒置區塊池;110:資料區塊池;A0:主動區塊;Blk_Data:資料搬移路徑;Host_Data:主機寫入資料路徑;S202…S218、S302…S308:步驟。100: data storage device; 102: flash memory; 104: controller; 106: host; 108: idle block pool; 110: data block pool; A0: active block; Blk_Data: data migration path; Host_Data: The host writes the data path; S202...S218, S302...S308: Steps.

第1圖根據本案一種實施方式圖解一資料儲存裝置100; 第2圖以流程圖圖解根據本案一種實施方式對快閃記憶體102所實施的資料搬移;以及 第3圖更根據本案一種實施方式詳細說明步驟S208,其中將決定步驟S210各批次所進行的資料搬移頁數a*M、以及步驟S212所穿插的主機106寫入頁數n*M。Fig. 1 illustrates a data storage device 100 according to an embodiment of the present case; Fig. 2 illustrates the data transfer performed on the flash memory 102 according to an embodiment of the present case in a flowchart; and Fig. 3 is more detailed according to an embodiment of the present case Step S208 is described, in which the number of data transfer pages a*M performed in each batch in step S210 is determined, and the number of pages written into the host 106 interspersed in step S212 is n*M.

100:資料儲存裝置 100: Data storage device

102:快閃記憶體 102: flash memory

104:控制器 104: Controller

106:主機 106: host

108:閒置區塊池 108: Idle block pool

110:資料區塊池 110: Data block pool

A0:主動區塊 A0: Active block

Blk_Data:資料搬移路徑 Blk_Data: data moving path

Host_Data:主機寫入資料路徑 Host_Data: host write data path

Claims (16)

一種資料儲存裝置,包括:一非揮發式記憶體;以及一控制器,根據一主機之要求操作該非揮發式記憶體,其中:該控制器自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;該控制器更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地;該控制器以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊;該控制器在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量;該控制器在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量;且該第二資料量高於該第一資料量。 A data storage device includes: a non-volatile memory; and a controller for operating the non-volatile memory according to a host's request, wherein: the controller is configured from a plurality of idle blocks of the non-volatile memory The active block fills in the write data requested by the host; the controller further uses the active block as the transfer destination of the valid data of a first source block in the non-volatile memory; the controller moves in multiple batches The valid data of the first source block is sent to the active block, and the write data required by the host is allowed to fill the active block between different batches; when the controller does not have a second source block, The batches that move the first source block each move a first amount of data; when the second source block exists, the controller makes the batches that move the first source block each move a second Data amount; and the second data amount is higher than the first data amount. 如申請專利範圍第1項所述之資料儲存裝置,其中:該控制器在更存在一第三來源區塊時,調升該第二資料量。 For the data storage device described in item 1 of the scope of patent application, wherein: the controller increases the amount of the second data when there is a third source block. 如申請專利範圍第1項所述之資料儲存裝置,其中:該控制器令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。 Such as the data storage device described in item 1 of the scope of patent application, wherein: the controller allows the effective data of the first source block to be completely moved to the active block before allowing the effective data of the second source block to be moved To the active block. 如申請專利範圍第3項所述之資料儲存裝置,其中:該控制器是在搬移該第一來源區塊的有效資料之初,就設定搬移 該第一來源區塊的上述批次各自搬移的該第一資料量、或該第二資料量。 For example, the data storage device described in item 3 of the scope of patent application, wherein: the controller is set to move at the beginning of moving the valid data of the first source block The first data amount or the second data amount moved by the batches of the first source block. 如申請專利範圍第4項所述之資料儲存裝置,其中:該控制器根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n;該控制器根據來源區塊的總數設定一數值a;該控制器在僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值;並且該控制器以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。 For the data storage device described in item 4 of the scope of patent application, wherein: the controller estimates a ratio x: (yx) based on the number of effective pages x of the first source block and the number of idle pages y of the active block, Equivalent to 1:n; the controller sets a value a according to the total number of source blocks; the controller sets the value a as a normal value when only the first source block exists, and when not only the first source block When the source block exists, the value a is set to be greater than the normal value; and the controller implements a batch of movement of the first source block and writing of the write data requested by the host with a ratio a:n. 如申請專利範圍第5項所述之資料儲存裝置,其中:該控制器更根據該非揮發式記憶體程式化的反應時間設定一數值M;且該控制器自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。 For the data storage device described in item 5 of the scope of patent application, wherein: the controller further sets a value M according to the programmed response time of the non-volatile memory; and the controller moves a* from the first source block After M pages of valid data are in the active block, n*M pages of write data requested by the host are allowed to fill in the active block. 如申請專利範圍第1項所述之資料儲存裝置,其中:來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。 For example, the data storage device described in item 1 of the scope of patent application, among which: the source block is selected because it should wait for the number of idle blocks to be less than a critical number, or find that the error correction is invalid, or perform preventive removal, or meet Average loss. 如申請專利範圍第1項所述之資料儲存裝置,其中:該控制器將該第一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。 The data storage device described in item 1 of the scope of patent application, wherein: after the controller moves all the valid data of the first source block to the active block, it releases before the end of the active block is written The first source block is an idle block. 一種非揮發式記憶體控制方法,包括: 根據一主機之要求操作一非揮發式記憶體;自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地;以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊;在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量;且在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量,其中,該第二資料量高於該第一資料量。 A non-volatile memory control method, including: Operate a non-volatile memory according to the request of a host; configure an active block from a plurality of idle blocks of the non-volatile memory to fill in the write data requested by the host; and use the active block as the non-volatile memory The transfer destination of the valid data of a first source block in the body; move the valid data of the first source block to the active block in multiple batches, and allow the write data requested by the host between different batches Fill in the active block; when there is no second source block, the batches that move the first source block each move a first amount of data; and when the second source block exists, let The batches that move the first source block each move a second data amount, wherein the second data amount is higher than the first data amount. 如申請專利範圍第9項所述之非揮發式記憶體控制方法,更包括:在更存在一第三來源區塊時,調升該第二資料量。 The non-volatile memory control method described in item 9 of the scope of the patent application further includes: when there is a third source block, increasing the amount of the second data. 如申請專利範圍第9項所述之非揮發式記憶體控制方法,更包括:令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。 For example, the non-volatile memory control method described in item 9 of the scope of patent application further includes: after the valid data of the first source block is completely moved to the active block, the second source block is allowed to be valid The data is moved to the active block. 如申請專利範圍第11項所述之非揮發式記憶體控制方法,更包括:在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的該第一資料量、或該第二資料量。 For example, the non-volatile memory control method described in item 11 of the scope of patent application further includes: at the beginning of moving the valid data of the first source block, setting the first source block to move each of the above batches The first amount of data, or the second amount of data. 如申請專利範圍第12項所述之非揮發式記憶體控 制方法,更包括:根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n;根據來源區塊的總數設定一數值a;僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值;並且以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。 Non-volatile memory control as described in item 12 of the scope of patent application The method further includes: estimating a ratio x: (yx) based on the number of effective pages x of the first source block and the number of idle pages y of the active block, which is equivalent to 1:n; according to the total number of source blocks Set a value a; when only the first source block exists, set the value a as a normal value, and when not only the first source block exists, set the value a to be greater than the normal value; and use a ratio a : N Implement a batch of movement of the first source block and write data requested by the host. 如申請專利範圍第13項所述之非揮發式記憶體控制方法,更包括:根據該非揮發式記憶體程式化的反應時間設定一數值M;且自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。 The non-volatile memory control method described in item 13 of the scope of patent application further includes: setting a value M according to the programmed response time of the non-volatile memory; and moving a*M pages from the first source block After valid data arrives in the active block, the n*M page write data requested by the host is allowed to fill in the active block. 如申請專利範圍第9項所述之非揮發式記憶體控制方法,其中:來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。 For example, the non-volatile memory control method described in item 9 of the scope of patent application, in which: the source block is selected because it should wait until the number of idle blocks is less than a critical number, or the error correction is found to be invalid, or preventive Move, or meet the loss average. 如申請專利範圍第9項所述之非揮發式記憶體控制方法,更包括:將該第一來源區塊的有效資料全數搬移到該主動區塊後,在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。 For example, the non-volatile memory control method described in item 9 of the scope of patent application further includes: after moving all the valid data of the first source block to the active block, before the end of the active block is written Release the first source block as an idle block.
TW108107913A 2018-09-07 2019-03-08 Data storage device and control method for non-volatile memory TWI712882B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910445239.2A CN110888593B (en) 2018-09-07 2019-05-27 Data storage device and non-volatile memory control method
US16/505,192 US11036414B2 (en) 2018-09-07 2019-07-08 Data storage device and control method for non-volatile memory with high-efficiency garbage collection

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201862728134P 2018-09-07 2018-09-07
US62/728,134 2018-09-07

Publications (2)

Publication Number Publication Date
TW202011199A TW202011199A (en) 2020-03-16
TWI712882B true TWI712882B (en) 2020-12-11

Family

ID=70766513

Family Applications (4)

Application Number Title Priority Date Filing Date
TW108106466A TWI696916B (en) 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory
TW109116356A TWI768346B (en) 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory
TW108107913A TWI712882B (en) 2018-09-07 2019-03-08 Data storage device and control method for non-volatile memory
TW108107912A TWI714975B (en) 2018-09-07 2019-03-08 Data storage device and control method for non-volatile memory

Family Applications Before (2)

Application Number Title Priority Date Filing Date
TW108106466A TWI696916B (en) 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory
TW109116356A TWI768346B (en) 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory

Family Applications After (1)

Application Number Title Priority Date Filing Date
TW108107912A TWI714975B (en) 2018-09-07 2019-03-08 Data storage device and control method for non-volatile memory

Country Status (1)

Country Link
TW (4) TWI696916B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI748542B (en) * 2020-07-01 2021-12-01 慧榮科技股份有限公司 Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module
TWI775143B (en) 2020-09-09 2022-08-21 群聯電子股份有限公司 Memory management method, memory storage device and memory control circuit unit
US11809314B2 (en) * 2021-11-21 2023-11-07 Silicon Motion, Inc. Method and apparatus for performing access control of memory device with aid of multi-stage garbage collection management

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110055455A1 (en) * 2009-09-03 2011-03-03 Apple Inc. Incremental garbage collection for non-volatile memories
US20120151124A1 (en) * 2010-12-08 2012-06-14 Sung Hoon Baek Non-Volatile Memory Device, Devices Having the Same, and Method of Operating the Same
US8626936B2 (en) * 2008-01-23 2014-01-07 International Business Machines Corporation Protocol independent server replacement and replication in a storage area network
TWI526830B (en) * 2013-11-14 2016-03-21 群聯電子股份有限公司 Data writing method, memory control circuit unit and memory storage apparatus
TWI563507B (en) * 2015-07-01 2016-12-21 Phison Electronics Corp Memory management method, memory control circuit unit and memry storage apparatus
US20170123682A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for precision interleaving of data writes in a non-volatile memory
US20170123666A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for managing maintenance scheduling in a non-volatile memory

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7412560B2 (en) * 2004-12-16 2008-08-12 Sandisk Corporation Non-volatile memory and method with multi-stream updating
CN101645309B (en) * 2008-08-05 2013-05-22 威刚科技(苏州)有限公司 Non-volatile memory device and control method thereof
US8688894B2 (en) * 2009-09-03 2014-04-01 Pioneer Chip Technology Ltd. Page based management of flash storage
US8463983B2 (en) * 2009-09-15 2013-06-11 International Business Machines Corporation Container marker scheme for reducing write amplification in solid state devices
US20120297121A1 (en) * 2011-05-17 2012-11-22 Sergey Anatolievich Gorobets Non-Volatile Memory and Method with Small Logical Groups Distributed Among Active SLC and MLC Memory Partitions
KR20130076429A (en) * 2011-12-28 2013-07-08 삼성전자주식회사 Method for managing storage space in memory device and storage device using method thereof
CN104732153B (en) * 2013-12-18 2018-01-12 群联电子股份有限公司 Data erasing method, memory control circuit unit and memory storage device
TWI524183B (en) * 2014-01-09 2016-03-01 群聯電子股份有限公司 Data writing method, memory control circuit unit and memory storage device
JP2016184402A (en) * 2015-03-26 2016-10-20 パナソニックIpマネジメント株式会社 MEMORY CONTROLLER, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY SYSTEM, AND MEMORY CONTROL METHOD
US10102119B2 (en) * 2015-10-30 2018-10-16 Sandisk Technologies Llc Garbage collection based on queued and/or selected write commands
US10229049B2 (en) * 2015-12-17 2019-03-12 Toshiba Memory Corporation Storage system that performs host-initiated garbage collection
CN107025941A (en) * 2016-01-29 2017-08-08 瑞昱半导体股份有限公司 Solid state disk control circuit
CN107817943B (en) * 2016-09-13 2020-12-15 深圳大心电子科技有限公司 Data transmission method, memory storage device and memory control circuit unit
TWI627531B (en) * 2016-11-28 2018-06-21 慧榮科技股份有限公司 Data storage device and operating method therefor
TWI615710B (en) * 2016-12-14 2018-02-21 群聯電子股份有限公司 Memory management method, memory storage device and memory control circuit unit
US10318423B2 (en) * 2016-12-14 2019-06-11 Macronix International Co., Ltd. Methods and systems for managing physical information of memory units in a memory device
TWI613652B (en) * 2017-03-27 2018-02-01 慧榮科技股份有限公司 Data storage device and operating method therefor

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8626936B2 (en) * 2008-01-23 2014-01-07 International Business Machines Corporation Protocol independent server replacement and replication in a storage area network
US20110055455A1 (en) * 2009-09-03 2011-03-03 Apple Inc. Incremental garbage collection for non-volatile memories
US20120151124A1 (en) * 2010-12-08 2012-06-14 Sung Hoon Baek Non-Volatile Memory Device, Devices Having the Same, and Method of Operating the Same
TWI526830B (en) * 2013-11-14 2016-03-21 群聯電子股份有限公司 Data writing method, memory control circuit unit and memory storage apparatus
TWI563507B (en) * 2015-07-01 2016-12-21 Phison Electronics Corp Memory management method, memory control circuit unit and memry storage apparatus
US20170123682A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for precision interleaving of data writes in a non-volatile memory
US20170123666A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for managing maintenance scheduling in a non-volatile memory

Also Published As

Publication number Publication date
TW202036300A (en) 2020-10-01
TWI714975B (en) 2021-01-01
TW202011196A (en) 2020-03-16
TW202011198A (en) 2020-03-16
TWI696916B (en) 2020-06-21
TW202011199A (en) 2020-03-16
TWI768346B (en) 2022-06-21

Similar Documents

Publication Publication Date Title
USRE49508E1 (en) Memory system and method for controlling nonvolatile memory
US10411024B2 (en) Memory system and method for controlling nonvolatile memory
US20160062885A1 (en) Garbage collection method for nonvolatile memory device
CN113168374A (en) Write command retention in partition namespaces
CN114746834A (en) Partition append command scheduling based on partition status
CN108877862B (en) Data organization of page stripes and method and apparatus for writing data to page stripes
CN112130749B (en) Data storage device and non-volatile memory control method
TWI712882B (en) Data storage device and control method for non-volatile memory
CN111610931B (en) Data storage device and non-volatile memory control method
TWI726381B (en) Data storage device and control method for non-volatile memory
US11599298B1 (en) Storage system and method for prediction-based pre-erase of blocks to improve sequential performance
TWI718710B (en) Data storage device and non-volatile memory control method
US11748027B2 (en) Storage system and method for avoiding clustering of reads during a program suspend
CN110888820B (en) Data storage device and non-volatile memory control method
CN111610930A (en) Data storage device and non-volatile memory control method
CN110888593B (en) Data storage device and non-volatile memory control method
US11487449B2 (en) Data storage device and method for enabling higher lane utilization in run time via device hints on workload patterns
CN110888591B (en) Data storage device and non-volatile memory control method
US11720280B2 (en) Storage system and method for improving utilization of a communication channel between a host and the storage system
CN118235118A (en) Data storage device and method for memory die-aware host command submission
US20210382649A1 (en) Storage System and Method for Using Proactive Device Timeout information
US20250217076A1 (en) Method of controlling storage device
US20240036764A1 (en) Storage System and Method for Optimizing Host-Activated Defragmentation and Proactive Garbage Collection Processes
TW202533047A (en) Devices and methods for improved workload-balancing processing bandwidth allocation