TW202036300A - 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
TW202036300A
TW202036300A TW109116356A TW109116356A TW202036300A TW 202036300 A TW202036300 A TW 202036300A TW 109116356 A TW109116356 A TW 109116356A TW 109116356 A TW109116356 A TW 109116356A TW 202036300 A TW202036300 A TW 202036300A
Authority
TW
Taiwan
Prior art keywords
block
data
active block
volatile memory
controller
Prior art date
Application number
TW109116356A
Other languages
Chinese (zh)
Other versions
TWI768346B (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 慧榮科技股份有限公司
Publication of TW202036300A publication Critical patent/TW202036300A/en
Application granted granted Critical
Publication of TWI768346B publication Critical patent/TWI768346B/en

Links

Images

Abstract

High-efficiency control technology for non-volatile memory. A data storage device includes a non-volatile memory and a controller. The controller allocates an active block from a plurality of spare blocks of the non-volatile memory to fill in write data requested by the host. When performing garbage collection, the controller further regards the active block as the destination for collecting the valid data from another 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 configures an active block from a plurality of idle blocks of the non-volatile memory to fill in write data required by the host. When the controller performs garbage collection, the active block is also used as the destination of the effective data of other blocks.

該控制器在該等閒置區塊之數量小於一臨界數量時,可以該主動區塊為該來源區塊的有效資料的搬移目的地。When the number of the idle blocks is less than a critical number, the controller can use the active block as the transfer destination of the valid data of the source block.

該控制器更可在一第二來源區塊符合一瀕損條件時,可以該主動區塊為該第二來源區塊的有效資料的搬移目的地。The controller can also use the active block as a transfer destination of valid data of the second source block when a second source block meets an endangered condition.

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

一種實施方式中,該控制器以複數個批次將一來源區塊的有效資料搬移到該主動區塊,並於不同批次間允許該主機發出的寫入資料填入該主動區塊。In one embodiment, the controller moves valid data of a source block to the active block in a plurality of batches, and allows the write data sent by the host to fill the active block between different batches.

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

一種實施方式中,該控制器估算一來源區塊的有效資料量以及該主機要求的寫入資料量之間的一比例,並根據該比例設定各批次搬移的有效資料量。In one embodiment, the controller estimates a ratio between the effective data amount of a source block and the write data amount requested by the host, and sets the effective data amount of each batch transfer according to the ratio.

一種實施方式中,滿足該瀕損條件的該第二來源區塊為錯誤更正失效。In one embodiment, the second source block that meets the endangered condition is invalid for error correction.

一種實施方式中,滿足該瀕損條件的該第二來源區塊是做預防性搬移。In one embodiment, the second source block that meets the endangered condition is for preventive removal.

一種實施方式中,滿足該瀕損條件的該第二來源區塊是做損耗平均搬移。In one embodiment, the second source block that meets the endangered condition is moved with loss average.

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

一種實施方式中,該控制器操作一旗標。該控制器在一來源區塊的有效資料全數搬移到該主動區塊後,方以該旗標標示該主動區塊允許保存其他來源區塊的有效資料。In one embodiment, the controller operates a flag. The controller uses the flag to indicate that the active block is allowed to save valid data from other source blocks after all valid data in a source block is moved to the active block.

以上控制器對非揮發式記憶體之操作也可以由其他結構實現。本案更可以前述概念實現非揮發式記憶體的控制方法,包括:根據一主機之要求操作一非揮發式記憶體;自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;在該等閒置區塊之數量小於一臨界數量時,以該主動區塊為一第一來源區塊的有效資料的搬移目的地;且在一第二來源區塊符合一瀕損條件時,以該主動區塊為該第二來源區塊的有效資料的搬移目的地。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 required write data; when the number of idle blocks is less than a critical number, the active block is used as the transfer destination of the valid data of a first source block; and a second source block meets a In the end-of-loss condition, the active block is used as the transfer destination of the valid data of the second source block.

下文特舉實施例,並配合所附圖示,詳細說明本發明內容。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 may 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為大於1的整數,如:4。16KB空間的頁面可分為四個區段,各區段為4KB。一種實施方式中,一區塊係根據頁面編號,由低至高編號配置來儲存使用者資料。The host 106 distinguishes user data by logical addresses (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) for allocation. Each block (Block) includes a plurality of pages (Pages). Each page includes N sectors (Sectors), N is an integer greater than 1, 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 according to the page number, from low to high number to store user data.

一種實施方式中,資料儲存裝置採用多通道技術,可將不同通道的多個區塊可以虛擬成一個超級區塊,多個頁面可以虛擬成一個超級頁面,並以超級區塊、超級頁面進行資料儲存空間的管理,可加快資料儲存裝置的資料吞吐量。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).

快閃記憶體的儲存空間需先抹除方能再次使用,抹除(Erase)的最小單位為區塊。區塊可區分成資料區塊、主動區塊以及閒置區塊。閒置區塊可作為主動區塊以寫入使用者資料。當主動區塊寫滿使用者資料後,經過關閉處理(寫入EOB(End of Block)資訊),主動區塊變更為資料區塊。隨著使用者資料的更新,部份儲存在資料區塊的使用者資料會由有效資料變更為無效資料。當資料區塊所儲存的使用者資料皆為無效資料時,經抹除處理後則變更為閒置區塊。在另一種實施例中,充滿無效資料的資料區塊會變更為閒置區塊,而抹除處理乃等到閒置區塊作為主動區塊時再予以執行。The storage space of flash memory 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. 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.

快閃記憶體的使用涉及資料搬移程序,可分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量不足時,可對儲存空間進行垃圾回收(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, 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.

圖中將快閃記憶體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.

本案提出一種高效能資料儲存的方法,可滿足各種資料儲存的需求。除了儲存來自於主機的使用者資料(主機106以寫入指令要求寫入快閃記憶體102)之外,啟動資料搬移程序,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,都可以利用本案高效能資料儲存方法來儲存來源方塊(資料區塊)的使用者資料。This case proposes a high-performance data storage method that can meet various data storage needs. In addition to storing user data from the host (the host 106 requests to write to the flash memory 102 with a write command), start data migration procedures, such as garbage collection, error correction failing migration, preventive migration, and loss-averaging migration , Or other, you can use this high-performance data storage method to store user data in the source box (data block).

控制器104一般以一個主動區塊(標示為A0)接收來自主機的使用者資料,此使用者資料通常由寫入命令所提供。特別是,相較於以另一個主動區塊(稱之A1以與A0區別)儲存來自來源區塊的使用者資料,本案控制器104令主動區塊A0也作為資料搬移程序的目的地,而不是使用主動區塊A1。一旦有資料搬移需求,例如,垃圾回收、錯誤更正失效搬移、預防性搬移、損耗平均搬移、或是其他,本案可將資料搬移程序中的來源區塊的使用者資料收集至主動區塊A0。相較於傳統技術同時配置主動區塊A0以及主動區塊A1,本案設計有數種優點,並描述如下。The controller 104 generally uses an active block (labeled as A0) to receive user data from the host. The user data is usually provided by a write command. 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 data migration requirement, such as garbage collection, error correction and invalidation migration, preventive migration, loss-average migration, or others, this case can collect the user data of the source block in the data migration process to active block A0. Compared with the traditional technology that simultaneously configures the active block A0 and the active block A1, the design of 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.

如前述,資料搬移程序可區分成垃圾回收程序以及非垃圾回收程序。當閒置區塊數量少於臨界數量TH1,控制器104啟動垃圾回收程序,並以主動區塊A0作為垃圾回收程序中的目的區塊,如垃圾回收路徑GC所示。As mentioned above, data transfer procedures can be divided into garbage collection procedures and non-garbage collection procedures. When the number of idle blocks is less than the threshold TH1, the controller 104 starts the garbage collection process, and uses the active block A0 as the target block in the garbage collection process, as shown by the garbage collection path GC.

非垃圾回收程序,例如錯誤更正失效搬移、預防性搬移、損耗平均搬移等等,控制器104也以主動區塊A0作為非垃圾回收程序中的目的區塊,如非垃圾回收路徑Non_GC標示。For non-garbage collection procedures, such as error correction failure removal, preventive removal, loss average removal, etc., the controller 104 also uses the active block A0 as a target block in the non-garbage collection process, such as the non-garbage collection path Non_GC mark.

一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0也作為垃圾回收程序的目的區塊。主動區塊A0儲存來自主機106的使用者資料後,如果主動區塊A0未被關閉,則主動區塊A0可作為垃圾回收程序中的目的區塊以儲存來自來源區塊BLK#0之使用者資料。在此設定下,如果來源區塊(以BLK#0為例)的所有有效資料已完成搬移,則來源區塊BLK#0可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one implementation, in addition to storing user data from the host 106, the active block A0 is also used as the target block of the garbage collection process. After the active block A0 stores user data from the host 106, if the active block A0 is not closed, the active block A0 can be used as the destination block in the garbage collection process to store users from the source block BLK#0 data. Under this setting, if all valid data of the source block (take BLK#0 as an example) has been moved, the source block BLK#0 can be recycled and become an idle block without waiting for the active block A0 to close.

一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0可作為非垃圾回收程序的目的區塊。主動區塊A0儲存來自主機106的使用者資料後,如果主動區塊A0未被關閉,則主動區塊A0可作為非垃圾回收程序的目的區塊以儲存來自來源區塊(以BLK#1為例)之使用者資料。在此設定下,如果來源區塊BLK#1的所有有效資料已完成搬移,則來源區塊BLK#1可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one embodiment, in addition to storing user data from the host 106, the active block A0 can be used as a target block for the non-garbage collection process. After the active block A0 stores the user data from the host 106, if the active block A0 is not closed, the active block A0 can be used as the destination block of the non-garbage collection process to store the source block (take BLK#1 as Example) user data. Under this setting, if all the valid data of the source block BLK#1 has been moved, the source block BLK#1 can be recycled and become an idle block without waiting for the active block A0 to close.

一種實施方式中,除了儲存來自主機106的使用者資料之外,主動區塊A0可作為垃圾回收程序以及非垃圾回收程序的目的區塊。主動區塊A0儲存來自主機的使用者資料後,如果主動區塊A0未被關閉,控制器104可啟動垃圾回收程序而將來源區塊(以BLK#0為例)之使用者資料搬移至主動區塊A0。如果主動區塊A0仍未關閉,控制器104可啟動非垃圾回收程序而將來源區塊BLK#0之使用者資料搬移至主動區塊A0。更甚者,主動區塊A0可作為非垃圾回收程序的目的區塊以儲存來自來源區塊(以BLK#1為例)之使用者資料。在此設定下,如果來源區塊BLK#0或來源區塊BLK#1的所有有效資料已完成搬移,則來源區塊BLK#0或來源區塊BLK#1可被回收而成為閒置區塊,無須等待主動區塊A0關閉。In one embodiment, in addition to storing user data from the host 106, the active block A0 can be used as a target block for garbage collection procedures and non-garbage collection procedures. After the active block A0 stores the user data from the host, if the active block A0 is not closed, the controller 104 can start the garbage collection process to move the user data of the source block (take BLK#0 as an example) to the active block Block A0. If the active block A0 is still not closed, the controller 104 can start the non-garbage collection process and move the user data of the source block BLK#0 to the active block A0. What's more, the active block A0 can be used as the target block of the non-garbage collection process to store user data from the source block (take BLK#1 as an example). Under this setting, if all valid data of the source block BLK#0 or source block BLK#1 has been moved, the source block BLK#0 or source block BLK#1 can be recycled and become idle blocks. There is no need to wait for the active block A0 to close.

另外,來自主機、垃圾回收程序或非垃圾回收程序的使用者資料較佳為分段(分批次)地且交錯地儲存或搬移至主動區塊A0,其中,分段表示儲存或搬移一定數量的使用者資料至主動區塊A0,或在預設時間儲存或搬移一定數量的使用者資料至主動區塊A0;交錯表示資料由多個資料來源輪流提供,其中,資料來源可為主機、垃圾回收程序或非垃圾回收程序的來源區塊。In addition, user data from the host, garbage collection program, or non-garbage collection program is preferably stored or moved to active block A0 in sections (in batches) and staggered, where section means storing or moving a certain amount User data of to the active block A0, or store or move a certain amount of user data to the active block A0 at a preset time; staggered means that the data is provided by multiple data sources in turn, among which the data source can be the host or garbage The source block of the recycling program or non-garbage collection program.

一種實施方式中,控制器104估算來源區塊的有效資料量以及來自於主機106的使用者資料量的比例,並根據該比例設定分段搬移以及分段寫入的資料量。在另一種實施方式中,控制器104估算來源區塊的有效資料量以及主動區塊A0的閒置空間的比例,並根據該比例設定分段搬移以及分段寫入的資料量。In one embodiment, the controller 104 estimates the ratio of the effective data volume of the source block and the user data volume from the host 106, and sets the data volume for segment transfer and segment writing according to the ratio. In another embodiment, the controller 104 estimates the effective data amount of the source block and the ratio of the free space of the active block A0, and sets the amount of data to be moved and written in segments according to the ratio.

第2A-2B圖以流程圖圖解根據本案一種實施方式實現的高效能資料儲存方法,並使用旗標cleanflag來控制資料的搬移。Figures 2A-2B illustrate the high-efficiency data storage method implemented according to an embodiment of this case with a flowchart, and use the flag cleanflag to control the movement of data.

步驟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初始化旗標cleanflag為”DISABLE”。旗標cleanflag狀態”DISABLE”代表主動區塊A0也可配置為資料搬移程序的目的區塊。Step S204: The controller 104 initializes the flag cleanflag to "DISABLE". The flag cleanflag status "DISABLE" means that the active block A0 can also be configured as the destination block of the data transfer process.

步驟S206:控制器104判斷是否執行資料搬移程序?如果是則執行步驟S210,如果否則執行步驟S208。當預設條件滿足時,例如,閒置區塊數量少於臨界數量TH1,或是產生錯誤更正失效,則控制器104啟動(執行)資料搬移程序。Step S206: The controller 104 judges whether to execute the data transfer procedure? If yes, execute step S210, if otherwise, execute step S208. When the preset condition is met, for example, the number of idle blocks is less than the threshold TH1, or an error correction failure occurs, the controller 104 starts (executes) the data transfer process.

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

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

步驟S214:控制器104關閉主動區塊A0。假如主動區塊A0已無閒置空間以儲存資料,則控制器104關閉主動區塊A0,並將EOB資訊寫入主動區塊A0的最後一個頁面中。Step S214: 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.

步驟S210:控制器104決定資料搬移程序的資料搬移量,其中,資料搬移量可為固定值、由來源區塊的資料量與來自主機106的使用者資料量的比例所決定、或由來源區塊的資料量以及主動區塊A0的閒置空間的比例所決定。來源區塊可為垃圾回收程序或非垃圾回收程序的來源區塊。資料搬移量較佳為有效資料的數量。Step S210: The controller 104 determines the data transfer amount of the data transfer procedure, where the data transfer amount can be a fixed value, determined by the ratio of the data amount of the source block to the user data amount from the host 106, or the source zone The data volume of the block and the proportion of the free space of the active block A0 are determined. The source block can be a source block of a garbage collection program or a non-garbage collection program. The amount of data movement is preferably the amount of valid data.

步驟S216:控制器104將旗標cleanflag設為”START”,其中,”START” 代表主動區塊A0作為資料搬移的目的區塊,並準備執行資料的搬移。Step S216: The controller 104 sets the flag cleanflag to "START", where "START" represents the active block A0 as the target block for data transfer, and prepares to execute the data transfer.

步驟S218:控制器104從來源區塊搬移資料搬移量的使用者資料至主動區塊A0。控制器104可一次性或分段地將來源區塊的使用者資料搬移至主動區塊A0。假設來源區塊有x使用者資料,而來自主機106的使用者資料量為n*x,兩者的比例為1:n,x例如=16,n例如=10。如果為分段進行資料搬移,則每一次分段中控制器104可搬移M筆使用者資料至主動區塊A0,M例如=4,各段搬移的數量=4。第3圖圖解一種分段搬移的例子。使用者資料Data#0…Data#3搬移到主動區塊A0後,可穿插主機106寫入使用者資料至主動區塊A0,再將使用者資料Data#4…Data#7搬移到主動區塊A0;剩餘八筆使用者資料也是如是方式自來源區塊搬移到主動區塊A0。如果為一次性進行資料搬移,則不穿插主機106寫入使用者資料,控制器104將16筆使用者資料全部搬移到主動區塊A0。另外,在進行資料搬移時,M較佳為區段的倍數,且可涵蓋整數倍頁面。例如,控制器104一次只寫入一個頁面的資料,則M=4,表示一頁的四個區段一起搬移。一種實施方式中,控制器104一次寫入一個超級頁面的資料,M=16。Step S218: The controller 104 transfers the user data of the data transfer amount from the source block to the active block A0. The controller 104 can move the user data of the source block to the active block A0 all at once or in sections. Assuming that the source block has x user data, and the amount of user data from the host 106 is n*x, the ratio of the two is 1:n, x = 16, for example, n = 10. If the data is moved in segments, the controller 104 can move M user data to the active block A0 in each segment. M, for example, =4, and the number of segments to be moved=4. Figure 3 illustrates an example of segmented movement. After the user data Data#0...Data#3 is moved to the active block A0, the host 106 can be inserted to write the user data to the active block A0, and then the user data Data#4...Data#7 can be moved to the active block A0: The remaining eight user data are moved from the source block to the active block A0 in the same way. If it is a one-time data transfer, the host 106 is not inserted to write user data, and the controller 104 transfers all 16 user data to the active block A0. In addition, when data is moved, M is preferably a multiple of a section, and it can cover an integer multiple of pages. For example, the controller 104 only writes data of one page at a time, then M=4, which means that the four sections of one page are moved together. In one embodiment, the controller 104 writes the data of one super page at a time, M=16.

步驟S220:控制器104將旗標cleanflag設為”FINISH”,其中,”FINISH”表示一次性或分段地資料搬移已完成。Step S220: The controller 104 sets the flag cleanflag to "FINISH", where "FINISH" indicates that the one-time or segmented data transfer has been completed.

步驟S222:控制器104將來自主機106的使用者資料寫入至主動區塊A0。在資料搬移量的使用者資料該階段已搬移完成之後,控制器104將資料的來源改為主機106,即將來自主機106的使用者資料寫入至主動區塊A0。其中,控制器104可寫入固定筆數的使用者資料,或由上述比例計算出的40(n*M,n=10且M=4)筆使用者資料寫入至主動區塊A0。Step S222: The controller 104 writes the user data from the host 106 to the active block A0. After the user data of the data transfer amount has been transferred at this stage, the controller 104 changes the source of the data to the host 106, that is, writes the user data from the host 106 to the active block A0. Wherein, the controller 104 can write a fixed number of user data, or 40 (n*M, n=10 and M=4) user data calculated by the above ratio into the active block A0.

步驟S224:控制器104判斷資料搬移程序是否執行完畢?如果是則執行步驟S226,如果否則執行步驟S216。假如控制器104是分段地將來源區塊的使用者資料搬移至主動區塊A0,控制器104會重覆執行步驟S216~S224,例如重覆次數=4(共16筆且每段4筆,則重複4次,分四段搬移)。Step S224: The controller 104 judges whether the data transfer procedure is completed? If yes, execute step S226, if otherwise, execute step S216. If the controller 104 moves the user data of the source block to the active block A0 in sections, the controller 104 will repeat steps S216~S224, for example, the number of repetitions=4 (16 in total and 4 in each segment , Then repeat 4 times and move in four stages).

步驟S226:控制器104將旗標cleanflag設為” DISABLE”。Step S226: The controller 104 sets the flag cleanflag to "DISABLE".

步驟S228:控制器104將來源區塊變更為閒置區塊,此時,閒置區塊池的數量加1。步驟S228可無關主動區塊A0關閉與否。閒置區塊數量可及時被補上。Step S228: The controller 104 changes the source block to an idle block. At this time, the number of the idle block pool is increased by 1. Step S228 can be independent of whether the active block A0 is closed or not. The number of idle blocks can be made up in time.

在步驟S212、步驟S214、步驟S218以及步驟S222的其中之一,控制器104更包括依據主動區塊A0所儲存的使用者資料更新邏輯-物理位址映射表,其中,控制器104較佳先產生主動區塊A0的使用者資料的物理-邏輯位址映射表後,再以物理-邏輯位址映射表來更新邏輯-物理位址映射表。In one of step S212, step S214, step S218, and step S222, the controller 104 further includes updating the logical-physical address mapping table according to the user data stored in the active block A0. The controller 104 preferably first After generating the physical-logical address mapping table of the user data of the active block A0, the physical-logical address mapping table is used to update the logical-physical address mapping table.

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

一種實施方式中,分段搬移(S218)以及分段寫入(S222)的資料量係取決於來源區塊的有效資料量以及主動區塊A0的閒置空間的比例。若主動區塊A0僅餘少量閒置空間,但來源區塊的有效資料量很多,則控制器104調高各段搬移的有效資料(S218)、或/以及限制各段寫入的主機106使用者資料(S222)。如此一來,主機區塊A0關閉前,來源區塊可完全搬移。In one embodiment, the amount of data to be transferred in sections (S218) and written in sections (S222) depends on the effective data amount of the source block and the ratio of the free space of the active block A0. If the active block A0 has only a small amount of free space, but the amount of effective data in the source block is large, the controller 104 increases the effective data moved in each segment (S218), or/and restricts the host 106 user who writes in each segment Data (S222). In this way, the source block can be completely moved before the host block A0 is closed.

使用者操作習慣可能導致裝置反覆斷電、上電(稱為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之操作也可以由其他結構實現。凡是不為了資料於區塊間的搬移更配置主動區塊A1者,都屬於本案欲保護範圍。本案更可以前述概念實現非揮發式記憶體的控制方法。The operation of the above controller 104 on the flash memory 102 can also be implemented by other structures. Anyone who does not configure active block A1 for the purpose of moving data between blocks falls within 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:主動區塊; Data#0…Data#7:使用者資料; GC:垃圾回收路徑; Non_GC:非垃圾回收的其他有效資料搬移路徑; S202…S228:步驟。100: Data storage device; 102: Flash memory; 104: Controller; 106: host; 108: Idle block pool; 110: Data block pool; A0: Active block; Data#0...Data#7: User data; GC: garbage collection path; Non_GC: Other effective data movement paths that are not garbage collected; S202...S228: Steps.

第1圖根據本案一種實施方式圖解資料儲存裝置100;以及 第2A-2B圖以流程圖圖解根據本案一種實施方式實現的高效能資料儲存方法,並使用旗標cleanflag來控制資料的搬移;且 第3圖圖解一種分段搬移的例子。Figure 1 illustrates a data storage device 100 according to an embodiment of the present case; and Figures 2A-2B illustrate the high-efficiency data storage method implemented according to an embodiment of this case with a flowchart, and use the flag cleanflag to control the movement of data; and Figure 3 illustrates an example of segmented movement.

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

GC:垃圾回收路徑 GC: garbage collection path

Non_GC:非垃圾回收的其他有效資料搬移路徑 Non_GC: Other effective data movement paths for non-garbage collection

Claims (26)

一種資料儲存裝置,包括: 一非揮發式記憶體;以及 一控制器,根據一主機之要求操作該非揮發式記憶體, 其中: 該控制器自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;且 當該控制器進行垃圾回收時,亦以該主動區塊為其他區塊之有效資料的搬移目的地。A data storage device includes: A non-volatile memory; and A controller operates the non-volatile memory according to the request of a host, among them: 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; and When the controller performs garbage collection, it also uses the active block as the destination of the effective data of other blocks. 如請求項1之資料儲存裝置,其中: 該控制器在該等閒置區塊之數量小於一臨界數量時,以該主動區塊為一第一來源區塊的有效資料的搬移目的地。Such as the data storage device of request 1, where: When the number of the idle blocks is less than a critical number, the controller uses the active block as a transfer destination of valid data of a first source block. 如請求項2之資料儲存裝置,其中: 該控制器更在一第二來源區塊符合一瀕損條件時,以該主動區塊為該第二來源區塊的有效資料的搬移目的地。Such as the data storage device of request 2, where: The controller further uses the active block as a transfer destination of valid data of the second source block when a second source block meets an endangered condition. 如請求項3之資料儲存裝置,其中: 該控制器令一來源區塊的有效資料完全搬移到該主動區塊後,方允許另一來源區塊的有效資料搬移到該主動區塊。Such as the data storage device of request 3, where: The controller allows valid data from one source block to be completely moved to the active block before allowing valid data from another source block to be moved to the active block. 如請求項4之資料儲存裝置,其中: 該控制器以複數個批次將一來源區塊的有效資料搬移到該主動區塊,並於不同批次間允許該主機發出的寫入資料填入該主動區塊。Such as the data storage device of request 4, where: The controller moves the valid data of a source block to the active block in a plurality of batches, and allows the write data sent by the host to fill the active block between different batches. 如請求項5之資料儲存裝置,其中: 該控制器估算一來源區塊的有效資料量以及該主動區塊的閒置空間之間的一比例,並根據該比例設定各批次搬移的有效資料量。Such as the data storage device of request 5, where: The controller estimates a ratio between the effective data amount of a source block and the idle space of the active block, and sets the effective data amount moved in each batch according to the ratio. 如請求項6之資料儲存裝置,其中: 根據該比例,該控制器設定兩個批次之間允許該主機填入該主動區塊的寫入資料量。Such as the data storage device of request 6, where: According to the ratio, the controller sets the amount of data written in the active block that the host is allowed to fill in between the two batches. 如請求項5之資料儲存裝置,其中: 該控制器估算一來源區塊的有效資料量以及該主機要求的寫入資料量之間的一比例,並根據該比例設定各批次搬移的有效資料量。Such as the data storage device of request 5, where: The controller estimates a ratio between the effective data amount of a source block and the write data amount requested by the host, and sets the effective data amount of each batch to be moved according to the ratio. 如請求項3之資料儲存裝置,其中: 滿足該瀕損條件的該第二來源區塊為錯誤更正失效。Such as the data storage device of request 3, where: The second source block that meets the endangered condition is invalid for error correction. 如請求項3之資料儲存裝置,其中: 滿足該瀕損條件的該第二來源區塊是做預防性搬移。Such as the data storage device of request 3, where: The second source block that meets the endangered condition is for preventive removal. 如請求項3之資料儲存裝置,其中: 滿足該瀕損條件的該第二來源區塊是做損耗平均搬移。Such as the data storage device of request 3, where: The second source block that satisfies the endangered condition is a loss average shift. 如請求項3之資料儲存裝置,其中: 該控制器將一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該來源區塊為閒置區塊。Such as the data storage device of request 3, where: After the controller moves all valid data of a source block to the active block, it releases the source block as an idle block before the end of the active block is written. 如請求項4之資料儲存裝置,其中: 該控制器操作一旗標;且 該控制器在一來源區塊的有效資料全數搬移到該主動區塊後,方以該旗標標示該主動區塊允許保存其他來源區塊的有效資料。Such as the data storage device of request 4, where: The controller operates a flag; and The controller uses the flag to indicate that the active block is allowed to save valid data from other source blocks after all valid data in a source block is moved to the active block. 一種非揮發式記憶體控制方法,包括: 根據一主機之要求操作一非揮發式記憶體; 自該非揮發式記憶體的複數個閒置區塊配置一主動區塊填寫該主機要求的寫入資料;且 進行垃圾回收時,亦以該主動區塊為其他區塊之有效資料的搬移目的地。A non-volatile memory control method, including: Operate a non-volatile memory according to the requirements 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 When garbage collection is performed, the active block is also used as the destination of the effective data of other blocks. 如請求項14之非揮發式記憶體控制方法,更包括: 在該等閒置區塊之數量小於一臨界數量時,以該主動區塊為一第一來源區塊的有效資料的搬移目的地。For example, the non-volatile memory control method of claim 14 further includes: When the number of the idle blocks is less than a critical number, the active block is used as a transfer destination of valid data of a first source block. 如請求項15之非揮發式記憶體控制方法,更包括: 在一第二來源區塊符合一瀕損條件時,以該主動區塊為該第二來源區塊的有效資料的搬移目的地。For example, the non-volatile memory control method of claim 15, including: When a second source block meets an endangered condition, the active block is used as the transfer destination of the effective data of the second source block. 如請求項16之非揮發式記憶體控制方法,更包括: 令一來源區塊的有效資料完全搬移到該主動區塊後,方允許另一來源區塊的有效資料搬移到該主動區塊。For example, the non-volatile memory control method of claim 16 further includes: After the effective data of one source block is completely moved to the active block, the effective data of another source block is allowed to be moved to the active block. 如請求項17之非揮發式記憶體控制方法,更包括: 以複數個批次將一來源區塊的有效資料搬移到該主動區塊,並於不同批次間允許該主機發出的寫入資料填入該主動區塊。For example, the non-volatile memory control method of claim 17 further includes: The valid data of a source block is moved to the active block in a plurality of batches, and the write data sent by the host is allowed to fill the active block between different batches. 如請求項18之非揮發式記憶體控制方法,更包括: 估算一來源區塊的有效資料量以及該主動區塊的閒置空間之間的一比例,並根據該比例設定各批次搬移的有效資料量。For example, the non-volatile memory control method of claim 18 includes: Estimate a ratio between the effective data amount of a source block and the idle space of the active block, and set the effective data amount of each batch to be moved according to the ratio. 如請求項19之非揮發式記憶體控制方法,更包括: 根據該比例,設定兩個批次之間允許該主機填入該主動區塊的寫入資料量。For example, the non-volatile memory control method of claim 19 includes: According to the ratio, set the amount of data written by the host to fill the active block between two batches. 如請求項18之非揮發式記憶體控制方法,更包括: 估算一來源區塊的有效資料量以及該主機要求的寫入資料量之間的一比例,並根據該比例設定各批次搬移的有效資料量。For example, the non-volatile memory control method of claim 18 includes: Estimate a ratio between the effective data amount of a source block and the write data amount requested by the host, and set the effective data amount of each batch to move according to the ratio. 如請求項16之非揮發式記憶體控制方法,其中: 滿足該瀕損條件的該第二來源區塊為錯誤更正失效。Such as the non-volatile memory control method of claim 16, in which: The second source block that meets the endangered condition is invalid for error correction. 如請求項16之非揮發式記憶體控制方法,其中: 滿足該瀕損條件的該第二來源區塊是做預防性搬移。Such as the non-volatile memory control method of claim 16, in which: The second source block that meets the endangered condition is for preventive removal. 如請求項16之非揮發式記憶體控制方法,其中: 滿足該瀕損條件的該第二來源區塊是做損耗平均搬移。Such as the non-volatile memory control method of claim 16, in which: The second source block that satisfies the endangered condition is a loss average shift. 如請求項16所述之非揮發式記憶體控制方法,更包括: 將一來源區塊的有效資料全數搬移到該主動區塊後,是在該主動區塊完成結尾寫入前釋出該來源區塊為閒置區塊。The non-volatile memory control method described in claim 16 further includes: After all valid data of a source block is moved to the active block, the source block is released as an idle block before the end writing of the active block is completed. 如請求項17之非揮發式記憶體控制方法,更包括: 操作一旗標;且 在一來源區塊的有效資料全數搬移到該主動區塊後,方以該旗標標示該主動區塊允許保存其他來源區塊的有效資料。For example, the non-volatile memory control method of claim 17 further includes: Operate a flag; and After all the valid data of a source block is moved to the active block, the flag is used to indicate that the active block is allowed to save the valid data of other source blocks.
TW109116356A 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory TWI768346B (en)

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
TW202036300A true TW202036300A (en) 2020-10-01
TWI768346B TWI768346B (en) 2022-06-21

Family

ID=70766513

Family Applications (4)

Application Number Title Priority Date Filing Date
TW109116356A TWI768346B (en) 2018-09-07 2019-02-26 Data storage device and control method for non-volatile memory
TW108106466A TWI696916B (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 After (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
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

Country Status (1)

Country Link
TW (4) TWI768346B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI805449B (en) * 2021-11-21 2023-06-11 慧榮科技股份有限公司 Method for performing access control of memory device with aid of multi-stage garbage collection management, memory controller of memory device, and memory device

Families Citing this family (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
TWI775143B (en) 2020-09-09 2022-08-21 群聯電子股份有限公司 Memory management method, memory storage device and memory control circuit unit

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
US20170123666A1 (en) * 2015-10-30 2017-05-04 Sandisk Technologies Inc. System and method for managing maintenance scheduling in a non-volatile memory
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
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI805449B (en) * 2021-11-21 2023-06-11 慧榮科技股份有限公司 Method for performing access control of memory device with aid of multi-stage garbage collection management, memory controller of memory device, and memory device
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

Also Published As

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

Similar Documents

Publication Publication Date Title
TWI678619B (en) Memory devices including dynamic superblocks, and related methods and electronic systems
TWI647702B (en) Memory controller, memory system, and method for managing data configuration in a memory
US10817415B2 (en) Data storage device and method including device or controller-based space allocation and host-based mapping table searching
US20160062885A1 (en) Garbage collection method for nonvolatile memory device
CN110955384B (en) Data storage device and non-volatile memory control method
KR20120030137A (en) Memory system having persistent garbage collection
CN104461397A (en) Solid-state drive and read-write method thereof
CN107590080B (en) Mapping table updating method, memory control circuit unit and memory storage device
KR101718713B1 (en) Non-volatile memory system
TWI696916B (en) Data storage device and control method for non-volatile memory
CN114746834A (en) Partition append command scheduling based on partition status
US11334480B2 (en) Data storage device and non-volatile memory control method
TWI718710B (en) Data storage device and non-volatile memory control method
CN114077389A (en) Controller, memory system, and data processing system
CN111610930A (en) Data storage device and non-volatile memory control method
CN110888820B (en) Data storage device and non-volatile memory control method
CN111610931B (en) Data storage device and non-volatile memory control method
US9652172B2 (en) Data storage device performing merging process on groups of memory blocks and operation method thereof
CN110888591B (en) Data storage device and non-volatile memory control method
US11036414B2 (en) Data storage device and control method for non-volatile memory with high-efficiency garbage collection
TWI726381B (en) Data storage device and control method for non-volatile memory
CN112394878A (en) Storage device and operation method thereof, computing system and operation method thereof