TW202011199A - 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
TW202011199A
TW202011199A TW108107913A TW108107913A TW202011199A TW 202011199 A TW202011199 A TW 202011199A TW 108107913 A TW108107913 A TW 108107913A TW 108107913 A TW108107913 A TW 108107913A TW 202011199 A TW202011199 A TW 202011199A
Authority
TW
Taiwan
Prior art keywords
data
block
source block
controller
volatile memory
Prior art date
Application number
TW108107913A
Other languages
Chinese (zh)
Other versions
TWI712882B (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)…等,用於長時間資料保存,可做為儲存媒體實現一資料儲存裝置。There are many forms of non-volatile memory-for example, flash memory (flash memory), magnetoresistive random access memory (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive random access Memory (Resistive RAM), spin transfer torque random access memory (Spin Transfer Torque-RAM, STT-RAM), etc., used for long-term data storage, can be used as a storage medium to achieve a data storage device.

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

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

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

一種實施方式中,該控制器令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。In one embodiment, 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.

一種實施方式中,該控制器是在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的資料量。In one embodiment, the controller sets the amount of data to be moved by the batch of the first source block at the beginning of 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 valid 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 based on the total number of source blocks. The controller sets the value a to 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 a writing of writing data requested by the host at a ratio of a:n.

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

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

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

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

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

下文特舉實施例,並配合所附圖示,詳細說明本發明內容。The following describes the embodiments in detail and the accompanying drawings to explain 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 random access memory (Magnetoresistive RAM), ferroelectric random access memory (Ferroelectric RAM), resistive memory (Resistive RAM, RRAM ), spin transfer torque random access memory (Spin Transfer Torque-RAM, STT-RAM), etc., provide storage media for long-term data storage. The following uses flash memory as an example for discussion.

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

以快閃記憶體為儲存媒體的資料儲存裝置可應用於多種電子裝置中。所述電子裝置包括智慧型手機、穿戴裝置、平板電腦、虛擬實境設備…等。電子裝置的運算模塊可視為主機(Host),操作所使用的資料儲存裝置,以存取其中快閃記憶體。A data storage device using flash memory as a storage medium can be applied to various electronic devices. The electronic device includes a smart phone, a wearable device, a tablet computer, a virtual reality device, 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.

以快閃記憶體為儲存媒體的資料儲存裝置也可用於建構數據中心。例如,伺服器可操作固態硬碟(SSD)陣列形成數據中心。伺服器即可視為主機,操作所連結之固態硬碟,以存取其中快閃記憶體。A data storage device using flash memory as a storage medium can also be used to construct a data center. For example, a server may operate a solid state drive (SSD) array to form a data center. The server can be regarded as a 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 the data storage device 100 according to an embodiment of the present case. 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. The controller 104 not only receives and executes the write command from the host (Host) 106, but also actively moves the user data stored in the flash memory 102.

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

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

一種實施方式中,資料儲存裝置採用多通道技術,可將不同通道的多個區塊可以虛擬成一個超級區塊,多個頁面可以虛擬成一個超級頁面,並以超級區塊、超級頁面進行資料儲存空間的管理,可加快資料儲存裝置的資料吞吐量。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 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. 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. After the active block is filled with user data, after the closing process (writing EOB (End of Block) information), the active block is changed to a data block. With the update of user data, 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 is all invalid data, it will be changed to an idle block after being erased. In another embodiment, the data block filled with invalid data will be changed to an idle block, and the erasing process will not be executed until the idle block is used as the 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 idle blocks is insufficient (for example, less than a critical number TH1), garbage collection (Garbage Collection) can be performed on the storage space. For example, when multiple data blocks (also known as source blocks) only store sporadic valid data, garbage collection can be performed to collect valid data into one active block (also known as destination block) to recover multiple data Blocks, increase the number of idle blocks.

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

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

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

圖中將快閃記憶體102的閒置區塊歸屬至閒置區塊池108,資料區塊歸屬至資料區塊池110。當有主機106提出寫入命令、或控制器104啟動資料搬移程序時,控制器104自閒置區塊池108中選擇一個閒置區塊作為主動區塊A0,此時閒置區塊池108的閒置區塊數量會減一。之後,將使用者資料寫入至主動區塊A0中。當主動區塊A0關閉而成為資料區塊後,資料區塊數量會加一。In the figure, the idle blocks of the flash memory 102 are assigned to the idle block pool 108, and the data blocks are assigned to the data block pool 110. When a host 106 issues a write command, or the controller 104 initiates a data movement 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. After that, the user data is written into the active block A0. When the active block A0 is closed 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的資料量係動態調配。以下更詳細討論之。The flash memory generally receives the user data of the host in the active block A0. This user data is usually provided by the write command (refer to the host write data path Host_Data). In particular, compared to storing user data from the source block in another active block (called A1 to distinguish it from A0), the controller 104 in this case makes the active block A0 also serve as the destination of the data migration process, and Instead of using active block A1. Once there is a data movement requirement, for example, garbage collection, error correction failure movement, preventive movement, average loss movement, or other, the user data of the source block in the data movement process can be collected to the active block A0( (See the data migration 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 for single batch transfer is adaptively set. The more data blocks generate effective data movement requirements, the higher the effective data volume for single batch movement. The amount of data provided to the active block A0 by the host write data path Host_Data and the data migration path Blk_Data is dynamically allocated. This is discussed in more detail below.

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

首先,本案中主動區塊A0不只可以儲存來自主機以寫入指令要求寫入的使用者資料,更可以儲存來自來源區塊的使用者資料,因此,可降低閒置區塊的使用量。First of all, in this case, the active block A0 can not only store the user data written by the host by the write command, but also store the 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 the active block A1, in response to a sudden power failure event, the Sudden Power Off Recovery (SPOR) procedure must specifically consider the reliability of the data, and will discard the unclosed initiative. Block A1 is still subject to the user data on the source block. Therefore, as long as the active block A1 has not been closed, all source blocks in the data movement process must be retained and cannot be released. The above design obviously hinders the recovery of source blocks, resulting in the number of idle blocks not increasing in time, and even leading to the start of different types of data movement procedures.

相較傳統技術,本案是以主動區塊A0作為資料搬移程序中的目的區塊。突發斷電事件回復(SPOR)程序不會全然丟棄該主動區塊A0。在資料搬移完成後,資料搬移程序中的來源區塊即可回收,無須為了SPOR程序而留存。因此,相較於傳統特別再以主動區塊A1作為目的區塊的技術,本案的閒置區塊數量可有效地增加,克服上述問題。Compared with the traditional technology, this case takes the active block A0 as the target block in the data transfer procedure. The SPOR procedure will not completely discard the active block A0. After the data migration is completed, the source block in the data migration process can be recovered without the need to retain it for the SPOR process. Therefore, compared with the traditional technology in which the active block A1 is specifically used 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 early, the traditional technology may fill in some dummy data, which will reduce the data storage capacity of the data block and increase the frequency of block erasure , Shorten the life of flash memory. In contrast, using the active block A0 as the destination of the data movement process can avoid writing false data and overcome the above-mentioned problems.

一種實施方式中,控制器104令一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料完全搬移到該主動區塊A0後,方允許另一來源區塊(無論屬垃圾回收或非垃圾回收)的有效資料搬移到該主動區塊A0。In one embodiment, the controller 104 allows the effective data of one source block (whether it is garbage collection or non-garbage collection) to be completely moved to the active block A0 before allowing another source block (whether it is garbage collection or non-garbage collection). The effective 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 requested by the host can be filled into the active block A0. There can be a proportional relationship between the movement of valid data and the filling of written data from the host. This case adaptively sets the proportional relationship. If there is more than one source block for data movement, this case increases the amount of effective data moved in a single batch, and ends the effective data movement of the current source block early to meet 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 failure transfer, preventive transfer, loss average transfer, etc., all kinds of effective data transfer to the active block A0 as the destination, shown in Figure 1 is the data transfer path Blk_Data. Anyone who selects a data block from the data block pool 110 as a source block and moves valid data to the active block A0 belongs to the technology covered by the data transfer path Blk_Data. This case is to dynamically allocate the use of the path Host_Data and the path Blk_Data.

一種實施方式中,控制器104在前一個來源區塊搬移完畢後,又允許其他來源區塊同樣以主動區塊A0為有效資料搬移目的地。例如,一來源區塊的垃圾回收完成後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,進行非垃圾回收(錯誤更正失效搬移、預防性搬移、損耗平均搬移等等)的有效資料搬移。例如,對一來源區塊進行非垃圾回收的有效資料搬移後,控制器104允許另一個來源區塊以同樣的主動區塊A0為目的地,再次實施非垃圾回收的有效資料搬移。如此一來,主動區塊A0關閉(例如,以是否完成EOB資訊為判斷標準)前,閒置區塊數量有機會被充分補充(可補充不只一個閒置區塊)。In one embodiment, after the previous source block has been moved, the controller 104 allows other source blocks to also use the active block A0 as the effective data transfer destination. 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 transfer, preventive transfer, average loss transfer, etc.) Etc.) to move the effective data. For example, after the non-garbage-recovery effective data movement is performed on a source block, the controller 104 allows another source block to use the same active block A0 as a destination to perform non-garbage-recovery effective data movement again. In this way, before the active block A0 is closed (for example, based on whether the EOB information is completed as a 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 embodiment, the valid data of the same source block is moved to the active block A0 in batches. Between each batch, the write data requested by the host 106 is filled in the active block A0. Or, between batches, the controller 104 causes the flash memory 102 to respond to the host 106's read request. The interval between different batches can be determined by the amount of data written to the host 106 of the active block A0, or can be defined by timing. There may be new effective data transfer requirements between batches. The controller 104 does not process the batch transfer of another source block until 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 free space of the active block A0, and sets the effective data amount of each batch moved according to the ratio. According to this ratio, the controller 104 can further set the amount of write data that allows 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 the need for data movement. One embodiment dynamically allocates the above ratio, sets the source block to be processed, and determines the amount of effective data moved in each batch. In one embodiment, there are two source blocks that require data movement. The valid data of the first source block is x pages. The active block A0 has y pages of free space. In this case, a ratio 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 may be 1, and a may be 2. Considering the response time of flash memory 102 programming (including host 106 writing and source block migration), the migration strategy developed in this case is: each time a*M pages of valid data are moved from the first source block to the active area Block A0 (corresponding path Blk_Data) is interspersed with n*M page write data (corresponding path Host_Data) sent by the active block A0 to store the host 106. The multiple a enables the effective data of the first source block to be collected to 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 free space of the active block A0 at this time. The controller 104 will also confirm 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 migration strategy, not only the second source block is waiting, but also the third source block needs to be moved. The value of a can be set larger (compared to the example with 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 migration) is affected by various factors. In this case, the reaction time was specifically considered, and the aforementioned M value was set. In one embodiment, programming M pages at a time optimizes the writing timing of the flash memory 102. For example, while waiting for the acknowledgement response of the first M-page programming, the second M-page can be cached to the controller 104 to be stored in the flash memory 102: the operating performance is far superior to single-page programming.

一種實施方式中,控制器104是優先進行資料搬移,次而才考量主機106之寫入要求。例如,一有需要資料搬移的來源區塊,控制器104評估出搬移策略後,即進行第一批資料搬移。第一批資料搬移結束後,才允許再接收主機106要求的寫入資料。此設計確保同一來源區塊收集在同一主動區塊A0上。In one embodiment, the controller 104 prioritizes data movement, and then considers the host 106's writing requirements. For example, when there is a source block that requires data migration, the controller 104 performs the first batch of data migration after evaluating the migration strategy. After the transfer of the first batch of data is completed, it is allowed to receive the written data requested by the host 106 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 movement performed on the flash memory 102 according to an embodiment of the present case.

步驟S202:控制器104配置主動區塊A0。控制器104自閒置區塊池108配置其中之一閒置區塊作為主動區塊A0。Step S202: The controller 104 configures the active block A0. The controller 104 configures 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 determines whether to execute the data transfer procedure? If yes, go to step S212, otherwise go to step S206. When the preset conditions are met, for example, the number of idle blocks is less than the critical number TH1, or any of the error correction failure transfer, preventive transfer, and average loss transfer is generated, the controller 104 starts (executes) the data transfer procedure.

步驟S206:控制器104判斷是否關閉主動區塊A0?如果是則執行步驟S210,如果否則執行步驟S208。假如主動區塊A0仍有閒置空間以儲存資料,則控制器104不關閉主動區塊A0。Step S206: The controller 104 determines whether to close the active block A0? If yes, go to step S210, otherwise go to step S208. If the active block A0 still has free space to store data, the controller 104 does not turn off 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 to the active block A0, and then returns to step S204. In the above, the controller 104 executes step S204 first, and then executes steps S206 and S208/S210, which means that the controller 104 will preferentially move the user data of the data transfer process. In another embodiment, the controller 104 may arrange step S204 after the user data of the host 106 is filled; under this setting, the controller 104 will preferentially write the user data of the host 106 to the active block A0.

步驟S210:控制器104關閉主動區塊A0。假如主動區塊A0已無閒置空間以儲存資料,則控制器104關閉主動區塊A0,並將EOB資訊寫入主動區塊A0的最後一個頁面中。Step S210: The controller 104 turns off 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 to 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 movement requirement, the flow proceeds to step S212 to plan a migration strategy for valid data of a source block. The controller 104 not only considers the effective data amount of the source block, the idle state of the active block A0, but also considers whether there are more source blocks to be moved. The controller 104 thus evaluates a migration strategy. For example, each time a*M pages of valid data are moved, the host 106 interspersed with n*M pages writes data. Steps S214 and 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空間應付另一個資料搬移需求。Step S214 takes the active block A0 as the destination and moves a*M pages of valid data from the source block. In step S216, the active block A0 restarts the reception of the written data sent from the host 106. The controller 104 allows n*M pages written by the host 106 to fill 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 flow returns to step S214, and the effective data transfer of the next batch of a*M pages is continued. If step S218 determines that the effective data transfer 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 transfer requirement.

一種實施方式中,步驟S216可以包括一時限判斷。超過該時限,流程即進行步驟S218。In one embodiment, step S216 may include a time limit judgment. If 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 performed by each batch in step S214 and the number of pages n*M 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 free space of the active block A0. For example, the effective data of the source block has x pages. Active block A0 has y pages of 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 flow proceeds to step S306. The controller 104 sets the value a to a normal value (for example, 1), indicating that there is no need for accelerated movement. On the contrary, if there are multiple source blocks that need to be moved, the flow proceeds 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 movement, 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 FIG. 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 to allow interleaving between the batches to write Number of 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, mobile phone users open the cover to view the information and then cover it. Large amounts of idle blocks are consumed and garbage collection needs occur. Certain blocks may also be read too frequently, leading to ECC failed movement, early move, wear leveling movement, or other valid data movement requests. This case allowed the excessively low number of idle blocks to be replenished in time.

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

雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone who is familiar with this skill can do some modifications and retouching without departing from the spirit and scope of the present invention. Therefore, the present invention The scope of protection shall be as defined in 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。Figure 1 illustrates a data storage device 100 according to an embodiment of the case; Figure 2 illustrates in a flowchart the data movement performed on the flash memory 102 according to an embodiment of the case; and Figure 3 is more detailed according to an embodiment of the case Step S208 will be described, in which the number of data transfer pages a*M determined in each batch of step S210 and the number of pages n*M written by the host 106 interspersed in step S212 are written.

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 migration path

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

Claims (18)

一種資料儲存裝置,包括: 一非揮發式記憶體;以及 一控制器,根據一主機之要求操作該非揮發式記憶體, 其中: 該控制器自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料; 該控制器更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地; 該控制器以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊; 該控制器在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量; 該控制器在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量;且 該第二資料量高於該第一資料量。A data storage device includes: a non-volatile memory; and a controller to operate the non-volatile memory according to the requirements of a host, wherein: the controller configures one 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 uses the active block as the destination of the effective data of a first source block in the non-volatile memory; the controller moves in multiple batches Valid data from the first source block to the active block, and allowing the write data requested by the host to fill the active block between different batches; when there is no second source block in the controller, Causing the batches moving the first source block to move a first amount of data; when the controller exists the second source block, the controllers move the batches moving the first source block to a second The amount of data; and the second amount of data is higher than the first amount of data. 如申請專利範圍第1項所述之資料儲存裝置,其中: 該控制器在更存在一第三來源區塊時,調升該第二資料量。The data storage device as described in item 1 of the patent application scope, wherein: the controller increases the amount of the second data when there is a third source block. 如申請專利範圍第1項所述之資料儲存裝置,其中: 該控制器令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。The data storage device as described in item 1 of the patent application scope, 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項所述之資料儲存裝置,其中: 該控制器是在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的資料量。The data storage device as described in item 3 of the patent application scope, wherein: the controller sets the respective batches of the first source block to be moved when the valid data of the first source block is moved The amount of data. 如申請專利範圍第4項所述之資料儲存裝置,其中: 該控制器根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n; 該控制器根據來源區塊的總數設定一數值a; 該控制器在僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值;並且 該控制器以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。The data storage device as described in item 4 of the patent application scope, wherein: the controller estimates a ratio x:(yx) based on the number of valid 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 based on the total number of source blocks; the controller sets the value a as a normal value when only the first source block exists, and not only the first When the source block exists, the value a is set to be greater than the normal value; and the controller performs a batch of movement of the first source block and writing of the write data requested by the host at a ratio of a:n. 如申請專利範圍第5項所述之資料儲存裝置,其中: 該控制器更根據該非揮發式記憶體程式化的反應時間設定一數值M;且 該控制器自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。The data storage device as described in item 5 of the patent application scope, wherein: the controller further sets a value M according to the programmed reaction time of the non-volatile memory; and the controller moves a* from the first source block After M pages of valid data are sent to the active block, n*M pages requested by the host are allowed to write data to fill in the active block. 如申請專利範圍第6項所述之資料儲存裝置,其中: 該控制器估算上述數值a*M以及n*M後,先搬移a*M頁有效資料至該主動區塊,方允許該主機要求的n*M頁寫入資料填入該主動區塊。The data storage device as described in item 6 of the patent application scope, in which: after the controller estimates the above values a*M and n*M, it first moves a*M pages of valid data to the active block before allowing the host to request The n*M pages of written data are filled in the active block. 如申請專利範圍第1項所述之資料儲存裝置,其中: 來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。The data storage device as described in item 1 of the patent application scope, in which: The source block is selected because the number of idle blocks should be less than a critical number, or the error correction and failure are found, or the preventive removal is carried out, or meets Loss average. 如申請專利範圍第1項所述之資料儲存裝置,其中: 該控制器將該第一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。The data storage device as described in item 1 of the patent application scope, wherein: after the controller transfers all the valid data of the first source block to the active block, it is released before the end of the active block is written The first source block is an idle block. 一種非揮發式記憶體控制方法,包括: 根據一主機之要求操作一非揮發式記憶體; 自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料; 更以該主動區塊作為該非揮發式記憶體中一第一來源區塊的有效資料的搬移目的地; 以複數批次搬移該第一來源區塊的有效資料至該主動區塊,並在不同批次間允許該主機要求的寫入資料填入該主動區塊; 在沒有一第二來源區塊存在時,令搬移該第一來源區塊的上述批次各自搬移一第一資料量;且 在存在該第二來源區塊時,令搬移該第一來源區塊的上述批次各自搬移一第二資料量, 其中,該第二資料量高於該第一資料量。A non-volatile memory control method, 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 to fill in write data requested by the host; 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 Allowing the write data requested by the host to fill the active block between batches; when there is no second source block, the batches that move the first source block are each moved a first amount of data; and When the second source block exists, the batches that move the first source block are each moved a second amount of data, wherein the second amount of data is higher than the first amount of data. 如申請專利範圍第10項所述之非揮發式記憶體控制方法,更包括: 在更存在一第三來源區塊時,調升該第二資料量。The non-volatile memory control method as described in item 10 of the patent application scope further includes: when there is a third source block, increasing the amount of the second data. 如申請專利範圍第10項所述之非揮發式記憶體控制方法,更包括: 令該第一來源區塊的有效資料完全搬移到該主動區塊後,方允許該第二來源區塊的有效資料搬移到該主動區塊。The non-volatile memory control method as described in item 10 of the patent application scope further includes: allowing the effective data of the first source block to be completely moved to the active block before allowing the effective of the second source block The data is moved to the active block. 如申請專利範圍第12項所述之非揮發式記憶體控制方法,更包括: 在搬移該第一來源區塊的有效資料之初,就設定搬移該第一來源區塊的上述批次各自搬移的資料量。The non-volatile memory control method as described in item 12 of the patent application scope further includes: at the beginning of moving the valid data of the first source block, the above batches of the first source block are set to be moved individually The amount of data. 如申請專利範圍第13項所述之非揮發式記憶體控制方法,更包括: 根據該第一來源區塊的有效頁數x以及該主動區塊的閒置頁數y估算一比例x:(y-x),等效為1:n; 根據來源區塊的總數設定一數值a; 僅該第一來源區塊存在時,設定該數值a為一常態值,並在不只該第一來源區塊存在時,設定該數值a大於該常態值;並且 以一比例a:n實行該第一來源區塊一批次的搬移以及該主機要求的寫入資料之寫入。The non-volatile memory control method as described in item 13 of the patent application scope further includes: estimating a ratio x based on the number of valid pages x of the first source block and the number of idle pages y of the active block x: (yx ), equivalent to 1:n; set a value a according to the total number of source blocks; when only the first source block exists, set the value a to a normal value, and when not only the first source block exists , Set the value a to be greater than the normal value; and perform a batch of movement of the first source block and write of the write data requested by the host with a ratio of a:n. 如申請專利範圍第14項所述之非揮發式記憶體控制方法,更包括: 根據該非揮發式記憶體程式化的反應時間設定一數值M;且 自該第一來源區塊搬移a*M頁有效資料至該主動區塊後,允許該主機要求的n*M頁寫入資料填入該主動區塊。The non-volatile memory control method as described in item 14 of the patent application scope further includes: setting a value M according to the programmed reaction time of the non-volatile memory; and moving the a*M page from the first source block After valid data is sent to the active block, the n*M pages requested by the host are allowed to write data to fill in the active block. 如申請專利範圍第15項所述之非揮發式記憶體控制方法,更包括: 估算上述數值a*M以及n*M後,先搬移a*M頁有效資料至該主動區塊,方允許該主機要求的n*M頁寫入資料填入該主動區塊。The non-volatile memory control method described in item 15 of the patent application scope further includes: After estimating the above values a*M and n*M, first move the a*M pages of valid data to the active block before allowing the The n*M page write data requested by the host is filled in the active block. 如申請專利範圍第10項所述之非揮發式記憶體控制方法,其中: 來源區塊之選定,係因應該等閒置區塊之數量小於一臨界數量、或發現錯誤更正失效、或進行預防性搬移、或滿足損耗平均。The non-volatile memory control method as described in item 10 of the patent application scope, in which: The source block is selected due to the fact that the number of idle blocks should be less than a critical number, or if errors are found to be corrected, or preventive measures are taken. Move, or meet the average loss. 如申請專利範圍第10項所述之非揮發式記憶體控制方法,更包括: 將該第一來源區塊的有效資料全數搬移到該主動區塊後,在該主動區塊完成結尾寫入前釋出該第一來源區塊為閒置區塊。The non-volatile memory control method as described in item 10 of the patent application scope further includes: after all the valid data of the first source block is moved to the active block, before the end of the active block is written The first source block is released 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 true TW202011199A (en) 2020-03-16
TWI712882B 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
TW108107912A TWI714975B (en) 2018-09-07 2019-03-08 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

Family Applications Before (3)

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
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)

Cited By (2)

* 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
US11307982B2 (en) 2020-09-09 2022-04-19 Phison Electronics Corp. Memory management method with a data merging process based on risk physical units and distribution counts, memory storage device and memory control circuit unit

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (24)

* 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
US8626936B2 (en) * 2008-01-23 2014-01-07 International Business Machines Corporation Protocol independent server replacement and replication in a storage area network
CN101645309B (en) * 2008-08-05 2013-05-22 威刚科技(苏州)有限公司 Non-volatile memory device and control method thereof
US8463826B2 (en) * 2009-09-03 2013-06-11 Apple Inc. Incremental garbage collection for non-volatile memories
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
KR101774496B1 (en) * 2010-12-08 2017-09-05 삼성전자주식회사 Non-volatile memory device, devices having the same, method of operating the same
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
TWI526830B (en) * 2013-11-14 2016-03-21 群聯電子股份有限公司 Data writing method, memory control circuit unit and memory storage apparatus
CN104732153B (en) * 2013-12-18 2018-01-12 群联电子股份有限公司 Data erasing method, memorizer control circuit unit and memory storage apparatus
TWI524183B (en) * 2014-01-09 2016-03-01 群聯電子股份有限公司 Data writing method, memory control circuit unit and memory storage apparatus
JP2016184402A (en) * 2015-03-26 2016-10-20 パナソニックIpマネジメント株式会社 Memory controller, nonvolatile storage device, nonvolatile storage system, and memory control method
TWI563507B (en) * 2015-07-01 2016-12-21 Phison Electronics Corp Memory management method, memory control circuit unit and memry storage apparatus
US9778855B2 (en) * 2015-10-30 2017-10-03 Sandisk Technologies Llc System and method for precision interleaving of data writes in a non-volatile memory
US10102119B2 (en) * 2015-10-30 2018-10-16 Sandisk Technologies Llc Garbage collection based on queued and/or selected write commands
US20170123666A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for managing maintenance scheduling in a non-volatile memory
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 hard disc controls circuit
CN107817943B (en) * 2016-09-13 2020-12-15 深圳大心电子科技有限公司 Data transmission method, memory storage device and memory control circuit unit
TWI691839B (en) * 2016-11-28 2020-04-21 慧榮科技股份有限公司 Method for data management
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

Cited By (4)

* 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
US11194502B1 (en) 2020-07-01 2021-12-07 Silicon Motion, Inc. Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module
US11307982B2 (en) 2020-09-09 2022-04-19 Phison Electronics Corp. Memory management method with a data merging process based on risk physical units and distribution counts, memory storage device and memory control circuit unit
TWI775143B (en) * 2020-09-09 2022-08-21 群聯電子股份有限公司 Memory management method, memory storage device and memory control circuit unit

Also Published As

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

Similar Documents

Publication Publication Date Title
US20210073120A1 (en) Directed sanitization of memory
USRE49508E1 (en) Memory system and method for controlling nonvolatile memory
US10956083B2 (en) Method and system for input-output throttling to improve quality of service in a solid state drive
US9128618B2 (en) Non-volatile memory controller processing new request before completing current operation, system including same, and method
US20160062885A1 (en) Garbage collection method for nonvolatile memory device
US9189383B2 (en) Nonvolatile memory system and data processing method
KR20120030137A (en) Memory system having persistent garbage collection
KR20130032157A (en) Data storage device and data write method thereof
CN113168374A (en) Write command retention in partition namespaces
TWI712882B (en) Data storage device and control method for non-volatile memory
US11334480B2 (en) Data storage device and non-volatile memory control method
TWI718710B (en) Data storage device and non-volatile memory control method
CN114746834A (en) Partition append command scheduling based on partition status
CN117043753A (en) Different write priorities in ZNS devices
CN110888820B (en) Data storage device and non-volatile memory control method
CN110888593B (en) Data storage device and non-volatile memory control method
CN110888591B (en) Data storage device and non-volatile memory control method
TWI726381B (en) Data storage device and control method for non-volatile memory
CN114746835A (en) Keep partitions open with intermediate fills
TWI846532B (en) Data storage device and non-volatile memory control method
TWI724550B (en) Data storage device and non-volatile memory control method