TWI709855B - Method for performing writing management in a memory device, and associated memory device and controller thereof - Google Patents
Method for performing writing management in a memory device, and associated memory device and controller thereof Download PDFInfo
- Publication number
- TWI709855B TWI709855B TW108111650A TW108111650A TWI709855B TW I709855 B TWI709855 B TW I709855B TW 108111650 A TW108111650 A TW 108111650A TW 108111650 A TW108111650 A TW 108111650A TW I709855 B TWI709855 B TW I709855B
- Authority
- TW
- Taiwan
- Prior art keywords
- data
- volatile memory
- memory
- block
- partial data
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 239000000872 buffer Substances 0.000 claims abstract description 77
- 238000012790 confirmation Methods 0.000 claims abstract description 36
- 239000012634 fragment Substances 0.000 claims description 39
- 238000012545 processing Methods 0.000 claims description 7
- 238000005516 engineering process Methods 0.000 description 10
- 230000008859 change Effects 0.000 description 8
- 230000004044 response Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000012937 correction Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 239000002356 single layer Substances 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011022 operating instruction Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本發明係有關於快閃記憶體(Flash memory)之存取(access),尤指一種用來於一記憶裝置中進行寫入管理之方法以及相關之記憶裝置及其控制器。The present invention relates to flash memory (Flash memory) access, in particular to a method for writing management in a memory device and related memory devices and their controllers.
近年來由於記憶體的技術不斷地發展,各種可攜式或非可攜式記憶裝置(例如:符合SD/MMC、CF、MS、XD或UFS標準之記憶卡;又例如:固態硬碟;又例如:符合UFS或EMMC規格之嵌入式(embedded)儲存裝置)被廣泛地實施於諸多應用中。因此,這些記憶裝置中之記憶體的存取控制遂成為相當熱門的議題。In recent years, due to the continuous development of memory technology, various portable or non-portable memory devices (for example: memory cards that conform to SD/MMC, CF, MS, XD or UFS standards; another example: solid state drives; and For example, embedded storage devices complying with UFS or EMMC specifications are widely implemented in many applications. Therefore, the access control of the memory in these memory devices has become a very hot topic.
以常用的NAND型快閃記憶體而言,其主要可區分為單階細胞(single level cell, SLC)與多階細胞(multiple level cell, MLC)兩大類之快閃記憶體。單階細胞快閃記憶體中之每個被當作記憶細胞(memory cell)的電晶體只有兩種電荷值,分別用來表示邏輯值0與邏輯值1。另外,多階細胞快閃記憶體中之每個被當作記憶單元的電晶體的儲存能力則被充分利用,係採用較高的電壓來驅動,以透過不同級別的電壓在一個電晶體中記錄至少兩組位元資訊(諸如00、01、11、10);理論上,多階細胞快閃記憶體的記錄密度可以達到單階細胞快閃記憶體的記錄密度之至少兩倍,這對於曾經在發展過程中遇到瓶頸的NAND型快閃記憶體之相關產業而言,是非常好的消息。In terms of commonly used NAND-type flash memory, it can be mainly divided into two types of flash memory, single level cell (SLC) and multiple level cell (MLC). Each transistor used as a memory cell in a single-level cell flash memory has only two charge values, which are used to represent a logic value of 0 and a logic value of 1. In addition, the storage capacity of each transistor used as a memory cell in the multi-level cell flash memory is fully utilized. It is driven by a higher voltage to record in a transistor through different levels of voltage. At least two sets of bit information (such as 00, 01, 11, 10); theoretically, the recording density of a multi-level cell flash memory can reach at least twice the recording density of a single-level cell flash memory. It is very good news for the related industries of NAND flash memory that have encountered bottlenecks in the development process.
相較於單階細胞快閃記憶體,由於多階細胞快閃記憶體之價格較便宜,並且在有限的空間裡可提供較大的容量,故多階細胞快閃記憶體很快地成為市面上之記憶裝置競相採用的主流。然而,多階細胞快閃記憶體的不穩定性所導致的問題也一一浮現。為了確保記憶裝置對快閃記憶體之存取控制能符合相關規範,快閃記憶體的控制器通常備有某些管理機制以妥善地管理資料之存取。Compared with single-level cell flash memory, multi-level cell flash memory is cheaper in price and can provide larger capacity in a limited space, so multi-level cell flash memory quickly becomes the market The mainstream memory devices are competing to adopt. However, the problems caused by the instability of multi-level cell flash memory have also emerged one by one. In order to ensure that the memory device's access control to the flash memory can comply with relevant specifications, the flash memory controller is usually equipped with some management mechanism to properly manage data access.
依據相關技術,有了這些管理機制的記憶裝置還是有不足之處。舉例來說,在採用較新的技術製造快閃記憶體的狀況下,某些設計理念可導致記憶裝置的緩衝器大小的需求變為原來的兩倍,就有預算控制以及產品效能之間的權衡(trade-off),其可視為於採用較新的技術製造快閃記憶體時的瓶頸。因此,需要一種新穎的方法及相關架構,以在沒有副作用或較不可能帶來副作用之狀況下提昇記憶裝置之效能。According to related technologies, memory devices with these management mechanisms still have shortcomings. For example, under the condition of using newer technology to manufacture flash memory, certain design concepts can cause the buffer size of the memory device to double the original requirement. There is a gap between budget control and product performance. The trade-off can be regarded as a bottleneck in the use of newer technologies to manufacture flash memory. Therefore, a novel method and related architecture are needed to improve the performance of the memory device without side effects or less likely to cause side effects.
本發明之一目的在於提供一種用來於一記憶裝置中進行寫入管理之方法以及相關之記憶裝置及其控制器,以解決上述問題。An object of the present invention is to provide a method for writing management in a memory device and related memory device and its controller to solve the above problems.
本發明之另一目的在於提供一種用來於一記憶裝置中進行寫入管理之方法以及相關之記憶裝置及其控制器,以在沒有副作用或較不可能帶來副作用之狀況下達到記憶裝置之最佳化(optimal)效能。Another object of the present invention is to provide a method for writing management in a memory device and related memory device and its controller, so as to achieve the performance of the memory device without side effects or less likely to cause side effects. Optimal performance.
本發明之至少一實施例提供一種用來於一記憶裝置中進行寫入管理之方法,其中該記憶裝置包含一非揮發性記憶體(non-volatile memory, NV memory),該非揮發性記憶體包含一或多個非揮發性記憶體元件(NV memory element),該一或多個非揮發性記憶體元件中之任一者包含多個區塊(block),且該多個區塊中之任一者包含多頁。該方法包含有:從一主裝置(host device)接收一系列資料,以從該系列資料取出偶頁資料與奇頁資料;將該偶頁資料中之第一局部(partial)資料寫入至該非揮發性記憶體;傳送不帶有一確認指令之一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器(internal buffer),其中該確認指令是用來觸發該非揮發性記憶體執行至少一指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行編程(programming)運作;傳送一第二組指令與該確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該至少一指令包含該第二組指令,且該確認指令觸發該非揮發性記憶體執行該第二組指令;將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體;以及將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁。At least one embodiment of the present invention provides a method for writing management in a memory device, wherein the memory device includes a non-volatile memory (NV memory), and the non-volatile memory includes One or more non-volatile memory elements (NV memory element), any of the one or more non-volatile memory elements includes multiple blocks, and any of the multiple blocks One contains multiple pages. The method includes: receiving a series of data from a host device to take out even-page data and odd-page data from the series of data; writing the first partial (partial) data of the even-page data to the non- Volatile memory; send a first group of commands without a confirmation command to the non-volatile memory to write the first partial data and the second partial data of the even page data into the non-volatile memory An internal buffer, wherein the confirmation command is used to trigger the non-volatile memory to execute at least one command to program at least one non-volatile memory element in the non-volatile memory ; Send a second set of commands and the confirmation command to the non-volatile memory to write the first partial data and the second partial data to a block in the non-volatile memory, wherein the at least one command Includes the second set of commands, and the confirmation command triggers the non-volatile memory to execute the second set of commands; writes the third partial data in the odd page data to the non-volatile memory; and the first partial Data and the second partial data are written to an even page of another block in the non-volatile memory, and the third partial data and the fourth partial data of the odd page data are written to the other An odd page of the block.
本發明之至少一實施例提供一種記憶裝置,其可包含:一非揮發性記憶體,用來儲存資訊,其中該非揮發性記憶體包含一或多個非揮發性記憶體元件,該一或多個非揮發性記憶體元件中之任一者包含多個區塊,且該多個區塊中之任一者包含多頁;以及一控制器,耦接至該非揮發性記憶體,用來控制該記憶裝置之運作。該控制器可包含一處理電路,而該處理電路可依據來自一主裝置的複數個主裝置指令控制該控制器,以容許該主裝置透過該控制器存取(access)該非揮發性記憶體。例如:該控制器從該主裝置接收一系列資料,以從該系列資料取出偶頁資料與奇頁資料;該控制器將該偶頁資料中之第一局部資料寫入至該非揮發性記憶體;該控制器傳送不帶有一確認指令之一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器,其中該確認指令是用來觸發該非揮發性記憶體執行至少一指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行編程運作;該控制器傳送一第二組指令與該確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該至少一指令包含該第二組指令,且該確認指令觸發該非揮發性記憶體執行該第二組指令;該控制器將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體;以及該控制器將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁。At least one embodiment of the present invention provides a memory device, which may include: a non-volatile memory for storing information, wherein the non-volatile memory includes one or more non-volatile memory elements, the one or more Any one of a non-volatile memory device includes multiple blocks, and any one of the multiple blocks includes multiple pages; and a controller coupled to the non-volatile memory for controlling The operation of the memory device. The controller may include a processing circuit, and the processing circuit may control the controller according to a plurality of master device commands from a master device to allow the master device to access the non-volatile memory through the controller. For example: the controller receives a series of data from the main device to retrieve even page data and odd page data from the series of data; the controller writes the first partial data of the even page data to the non-volatile memory ; The controller sends a first set of commands without a confirmation command to the non-volatile memory to write the first partial data and the second partial data in the even page data into the non-volatile memory An internal buffer, wherein the confirmation command is used to trigger the non-volatile memory to execute at least one command to program at least one non-volatile memory element in the non-volatile memory; the controller sends a second Group command and the confirmation command to the non-volatile memory to write the first partial data and the second partial data to a block in the non-volatile memory, wherein the at least one command includes the second group Command, and the confirmation command triggers the non-volatile memory to execute the second set of commands; the controller writes the third partial data in the odd page data to the non-volatile memory; and the controller uses the first The partial data and the second partial data are written to an even page of another block in the non-volatile memory, and the third partial data and the fourth partial data of the odd page data are written to the other An odd page of a block.
本發明之至少一實施例提供一種記憶裝置之控制器,其中該記憶裝置包含該控制器與一非揮發性記憶體,該非揮發性記憶體包含一或多個非揮發性記憶體元件,該一或多個非揮發性記憶體元件中之任一者包含多個區塊,且該多個區塊中之任一者包含多頁。該控制器可包含一處理電路,而該處理電路可依據來自一主裝置的複數個主裝置指令控制該控制器,以容許該主裝置透過該控制器存取該非揮發性記憶體。例如:該控制器從該主裝置接收一系列資料,以從該系列資料取出偶頁資料與奇頁資料;該控制器將該偶頁資料中之第一局部資料寫入至該非揮發性記憶體;該控制器傳送不帶有一確認指令之一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器,其中該確認指令是用來觸發該非揮發性記憶體執行至少一指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行編程運作;該控制器傳送一第二組指令與該確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該至少一指令包含該第二組指令,且該確認指令觸發該非揮發性記憶體執行該第二組指令;該控制器將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體;以及該控制器將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁。At least one embodiment of the present invention provides a controller for a memory device, wherein the memory device includes the controller and a non-volatile memory, the non-volatile memory includes one or more non-volatile memory elements, and the one Any one of the or multiple non-volatile memory devices includes multiple blocks, and any one of the multiple blocks includes multiple pages. The controller may include a processing circuit, and the processing circuit may control the controller according to a plurality of master device commands from a master device to allow the master device to access the non-volatile memory through the controller. For example: the controller receives a series of data from the main device to retrieve even page data and odd page data from the series of data; the controller writes the first partial data of the even page data to the non-volatile memory ; The controller sends a first set of commands without a confirmation command to the non-volatile memory to write the first partial data and the second partial data in the even page data into the non-volatile memory An internal buffer, wherein the confirmation command is used to trigger the non-volatile memory to execute at least one command to program at least one non-volatile memory element in the non-volatile memory; the controller sends a second Group command and the confirmation command to the non-volatile memory to write the first partial data and the second partial data to a block in the non-volatile memory, wherein the at least one command includes the second group Command, and the confirmation command triggers the non-volatile memory to execute the second set of commands; the controller writes the third partial data in the odd page data to the non-volatile memory; and the controller uses the first The partial data and the second partial data are written to an even page of another block in the non-volatile memory, and the third partial data and the fourth partial data of the odd page data are written to the other An odd page of a block.
本發明的好處之一是,透過寫入管理,本發明能針對該控制器的運作進行妥善的控制,以突破於採用較新的技術製造快閃記憶體時的瓶頸。另外,依據本發明之實施例來實施並不會增加許多額外的成本。因此,相關技術的問題可被解決,且整體成本不會增加太多。相較於相關技術,本發明能在沒有副作用或較不可能帶來副作用之狀況下達到記憶裝置之最佳化效能。One of the advantages of the present invention is that, through write management, the present invention can properly control the operation of the controller to break through the bottleneck when using newer technology to manufacture flash memory. In addition, the implementation according to the embodiments of the present invention does not increase a lot of additional costs. Therefore, the related technical problems can be solved, and the overall cost will not increase too much. Compared with the related art, the present invention can achieve the optimized performance of the memory device without side effects or less likely to cause side effects.
I. 記憶體系統I. Memory System
請參考第1圖,第1圖為依據本發明一第一實施例之一種記憶裝置100與一主裝置(host device)50的示意圖。例如:記憶裝置100可為一可攜式記憶裝置(例如:符合SD/MMC、CF、MS、或XD標準之記憶卡)或固態硬碟(solid state drive, SSD)。另外,主裝置50的例子可包含(但不限於):多功能行動電話(multifunctional mobile phone)、平板電腦(tablet)、可穿戴裝置(wearable device)、以及個人電腦(personal computer)諸如桌上型電腦與膝上型電腦。依據本實施例,記憶裝置100可包含一控制器諸如記憶體控制器110,且可另包含一非揮發性記憶體(non-volatile memory, NV memory)120,其中該控制器係用來存取(access)非揮發性記憶體120,且非揮發性記憶體120係用來儲存資訊。非揮發性記憶體120可包含一或多個非揮發性記憶體元件(NV memory element),諸如非揮發性記憶體元件122-1、122-2、…與122-N,其中符號「N」可代表大於一的正整數。例如:非揮發性記憶體120可為一快閃記憶體(Flash memory),而非揮發性記憶體元件122-1、122-2、…與122-N可分別為複數個快閃記憶體晶片(Flash memory chip;可簡稱為快閃晶片)或複數個快閃記憶體裸晶(Flash memory die;可簡稱為快閃裸晶),但本發明並不限於此。Please refer to FIG. 1, which is a schematic diagram of a
如第1圖所示,記憶體控制器110可包含處理電路諸如微處理器112、儲存器諸如一唯讀記憶體(read only memory, ROM)112M、控制邏輯電路114、緩衝記憶體116、與傳輸介面電路118,其中這些元件可透過一匯流排彼此耦接。緩衝記憶體116係以隨機存取記憶體(random access memory, RAM)來實施。另外,本實施例之唯讀記憶體112M係用來儲存一程式碼112C,而微處理器112則用來執行程式碼112C以控制對非揮發性記憶體120之存取。請注意,程式碼112C亦得儲存在緩衝記憶體116或任何形式之記憶體內。此外,控制邏輯電路114可包含一錯誤更正碼電路(未顯示),以保護資料、及/或進行錯誤更正,而傳輸介面電路118可符合一特定通訊標準(諸如串列高級技術附件(Serial Advanced Technology Attachment, SATA)標準、通用序列匯流排(Universal Serial Bus, USB)標準、或快捷外設互聯 (Peripheral Component Interconnect Express,PCIE) 標準)且可依據該特定通訊標準進行通訊。As shown in Figure 1, the
於本實施例中,主裝置50可藉由傳送複數個主裝置指令(host command)與對應的邏輯位址予記憶體控制器110來間接地存取記憶裝置100中之非揮發性記憶體120。記憶體控制器110接收該複數個主裝置指令與邏輯位址,並將該複數個主裝置指令分別轉譯成記憶體操作指令(簡稱操作指令),再以操作指令控制非揮發性記憶體120讀取、寫入(write)/編程(Program)非揮發性記憶體120當中特定實體位址之記憶單位(memory unit)或資料頁(page),其中實體位址對應於邏輯位址。例如記憶體控制器110可產生或更新至少一邏輯對實體位址映射表(logical-to-physical address mapping table)來管理實體位址與邏輯位址之間的關係。In this embodiment, the
II. 對應於區塊類型的存取控制II. Access control corresponding to the block type
於非揮發性記憶體120中,非揮發性記憶體元件122-1、122-2、…與122-N中之任一非揮發性記憶體元件122-n(符號「n」可代表區間[1, N]中之任一整數)可包含多個區塊(block),且該多個區塊中之一區塊可包含且可記錄特定數量的頁,其中記憶體控制器110對非揮發性記憶體120進行抹除資料之運作的最小單位可為區塊,而記憶體控制器110對非揮發性記憶體120進行寫入資料之運作的最小單位可為頁,但本發明不限於此。關於非揮發性記憶體120的存取架構,該區塊可包含M個字線(word-line){WL(0), WL(1), …, WL(M - 1)}。例如:記憶體控制器110可透過單階細胞(SLC)寫入模式來寫入資訊至該區塊中之任一字線。此狀況下,該字線可包含單一的頁。又例如:記憶體控制器110可透過多階細胞(MLC)寫入模式來寫入資訊至該區塊中之任一字線。此狀況下,該字線可包含至少兩頁。依據某些實施例,當記憶體控制器110透過三階細胞(triple level cell, TLC)寫入模式來寫入資訊至該區塊中之一字線時,該字線可包含三頁。In the
第2圖繪示第1圖所示記憶裝置100於一實施例中之區塊管理方案。記憶體控制器110可將非揮發性記憶體120中之複數個區塊(其可包含非揮發性記憶體元件122-1、122-2、…與122-N的各自的區塊)區分為多個類型的區塊,諸如母區塊210、子區塊220與快取(cache)區塊230,且可分別對該多個類型的區塊進行對應的控制,以增進記憶體控制器110存取(例如讀取或寫入)非揮發性記憶體120時的效能,其中於需要時,一個區塊所屬的類型可以改變。記憶體控制器110可選擇某些區塊諸如區塊231與232作為快取區塊230以供暫時地儲存資訊,且可採用該單階細胞寫入模式來進行這些區塊的任一者的寫入運作,以節省時間。另外,記憶體控制器110可採用該多階細胞寫入模式來進行某些區塊的寫入運作,以充分利用這些區塊的儲存能力,其中母區塊210與子區塊220的寫入運作都可以採用該多階細胞寫入模式來進行。例如:區塊211與212可為完全編程(fully programmed)區塊、且可以屬於母區塊210,其中區塊211與212可儲存使用者資料,但本發明不限於此。FIG. 2 shows a block management scheme of the
依據本實施例,主裝置50可傳送一請求至記憶體控制器110以透過記憶體控制器110對一母區塊(諸如區塊211或區塊212)進行資料更新或寫入,其中該請求可包含一主裝置指令與對應的邏輯位址。記憶體控制器110可檢查非揮發性記憶體120中是否儲存有映射到該母區塊之任一子區塊(諸如區塊221或區塊222)。如果非揮發性記憶體120中存在映射到該母區塊之該子區塊,則記憶體控制器110可將主裝置寫入資料(host write data)更新至該子區塊;否則,記憶體控制器110可選擇一空白(blank)區塊作為映射到該母區塊之子區塊。舉例來說,該母區塊可代表區塊211,且映射到該母區塊之該子區塊可代表區塊221。該請求可指出主裝置50欲更新或寫入區塊211之子集合211B(例如第10至20頁)之資料。記憶體控制器110可將區塊211之子集合211A(例如第0至9頁)的資料複製到區塊221之相對應的子集合221A(例如第0至9頁)使它儲存所複製的資料,且可將該主裝置寫入資料寫入至區塊221之子集合221B(例如第10至20頁)使它儲存所更新的資料,以更新或寫入至與母區塊中相同或相對應位址之位置,但本發明不限於此。當需要時,記憶體控制器110可將區塊211之子集合211C(例如第21頁起的後續頁)的資料複製到區塊221之子集合221C(例如第21頁起的後續頁)、抹除區塊211使它變成空白區塊、解除區塊221與區塊211之間的映射關係、且更新區塊221所屬的類型使它屬於母區塊210,其中區塊211的結尾(例如最後一頁)與區塊221的結尾(例如最後一頁)可分別儲存相關的管理資訊,諸如它們的區塊關閉資訊(end-of-block information, EOB information),但本發明不限於此。According to this embodiment, the
另外,該請求可被取代為一系列請求,其可指出主裝置50欲多次更新該母區塊,其中該主裝置寫入資料可被取代為分別對應於該系列請求之多組主裝置寫入資料。舉例來說,該母區塊可代表區塊212,且映射到該母區塊之該子區塊可代表區塊222。該系列請求中之一第一請求可指出主裝置50欲更新或寫入區塊212之子集合212B(例如第10至20頁)之資料。記憶體控制器110可將區塊212之子集合212A(例如第0至9頁)的資料複製到區塊222之相對應的子集合222A(例如第0至9頁)使它儲存所複製的資料,且可將對應於該第一請求之主裝置寫入資料寫入至區塊222之子集合222B(例如第10至20頁)使它儲存所更新的資料,以更新或寫入至與母區塊中相同或相對應位址之位置。該系列請求中之一第二請求可指出主裝置50欲更新或寫入區塊212之子集合212B(例如第10至20頁)之資料。記憶體控制器110可將對應於該第二請求之主裝置寫入資料寫入至區塊222之子集合222C中的一後續部分,諸如與子集合222B相同大小的部分(例如第21至31頁),作為子集合222B中的先前更新資料之替代,其中子集合222B中的先前更新資料可視為無效資料。當需要時,記憶體控制器110可進行垃圾收集(garbage collection),尤其可選擇一空白區塊、將區塊212之子集合212A(例如第0至9頁)的資料複製到這個空白區塊之相對應位置(例如第0至9頁)、將子集合222C中的該後續部分(例如第21至31頁)的資料複製到這個空白區塊當中對應於子集合212B之位置(例如第10至20頁)、將區塊212之子集合212C(例如第21頁起的後續頁)的資料複製到這個空白區塊之相對應位置(例如第21頁起的後續頁)、抹除區塊212與222使它們變成空白區塊、解除區塊222與區塊212之間的映射關係、且更新這個空白區塊所屬的類型使它屬於母區塊210。In addition, the request can be replaced by a series of requests, which can indicate that the
此外,區塊223可以屬於子區塊220,但區塊223不必映射到任何母區塊。舉例來說,在主裝置50的硬體資源(諸如緩衝器)不足的狀況下,主裝置50可將連續的資料(諸如錄影資料)切割數量龐大的多個小片段的資料,且可分別傳送這些小片段的資料。這樣,從主裝置50傳送至記憶裝置100的這些小片段的資料對應於上述連續的資料。記憶體控制器110可分別將這些小片段的資料之至少一部分寫入至區塊223之子集合223A、223B、223C…以使其內儲存所寫入的資料,其中子集合223A、223B、223C…中之每一者可包含至少一頁(例如一或多頁),且當區塊223被寫滿時,記憶體控制器110可更新區塊223所屬的類型使它屬於母區塊210,但本發明不限於此。例如:這些小片段的資料之每一小片段的大小可等於32 KB(kilobyte;千位元組),且區塊223中之每一頁的大小可等於16 KB。又例如:這些小片段的資料之每一小片段的大小可等於16 KB,且區塊223中之每一頁的大小可等於16 KB。又例如:這些小片段的資料之每一小片段的大小可等於8 KB,且區塊223中之每一頁的大小可等於16 KB。依據某些實施例,記憶體控制器110可對所收到的小片段進行緩衝處理,使子集合223A、223B、223C…中之每一者可包含一頁,但本發明不限於此。In addition, the
依據某些實施例,緩衝記憶體116中之緩衝區116A的大小可以大於或等於一次寫入非揮發性記憶體120的資料量。當主裝置50將上述連續的資料(諸如該錄影資料,其資料長度可以很長)寫入記憶裝置100時,記憶體控制器110可利用沒有映射到任何母區塊之一系列子區塊(諸如子區塊223)來儲存及接收該多個小片段的資料,以避免額外工作,諸如垃圾收集操作。當需要時(例如該主裝置寫入資料不滿一頁而需要補開頭或結尾),記憶體控制器110可採用一快取區塊(諸如快取區塊230中之任一者)來進行資料寫入。According to some embodiments, the size of the
III. 資料寫入管理III. Data writing management
關於製造非揮發性記憶體120,有多種技術可供採用,例如:將記憶細胞排列成單層之平面NAND型快閃(2D/Planar NAND Flash)技術;以及將記憶細胞排列成多層垂直堆疊之立體NAND型快閃(3D NAND Flash)技術。依據某些實施例,非揮發性記憶體120可被實施成具有單層排列的記憶細胞之平面NAND型快閃架構。依據某些實施例,非揮發性記憶體120可被實施成具有以多層垂直堆疊的記憶細胞之立體NAND型快閃架構。例如:基於某些設計理念,非揮發性記憶體120可被設計成:在採用該多階細胞寫入模式來寫入資訊時必須一次寫入兩頁的資料,諸如偶頁加奇頁(even page plus odd page)的組合資料;這表示,緩衝區116A的大小的需求變為原來的兩倍。假設硬體資源充足(例如緩衝記憶體116的總儲存容量夠大),容許緩衝區116A的大小為兩頁以上。此狀況下,當主裝置50將上述連續的資料(諸如該錄影資料,其資料長度可以很長)寫入記憶裝置100時,微處理器112可動態地監控(monitor)緩衝區116A中之資料,諸如該多個小片段的資料中之一或多個小片段的資料,以準確地判斷該一或多個小片段的資料是否應該寫入至一快取區塊或一子區塊。例如:當該一或多個小片段的資料是前一個小片段的資料的後續資料,微處理器112可準確地判斷該一或多個小片段的資料應該寫入至該子區塊。於是,記憶體控制器110可利用該系列子區塊(諸如子區塊223)來儲存及接收該多個小片段的資料,其中記憶裝置100可具備極佳的寫入效能。Regarding the manufacture of
假設硬體資源不足(例如緩衝記憶體116的總儲存容量有限)使得緩衝區116A的大小等於一頁的大小。此狀況下,當主裝置50將上述連續的資料(諸如該錄影資料)寫入記憶裝置100時,微處理器112可能沒有足夠的資訊可供用來準確地判斷該一或多個小片段的資料是否應該寫入至一快取區塊或一子區塊,這可能使上述利用該系列子區塊來儲存及接收該多個小片段的資料的機制失效(例如記憶體控制器110可能無法避免額外工作,諸如垃圾收集操作),其中寫入效能可能降低。第3圖為依據本發明一實施例之一種用來於一記憶裝置中進行寫入管理之方法的示意圖,其中該方法可應用於記憶裝置100,且可應用於該控制器諸如記憶體控制器110。主裝置50可實施成錄影機、行車紀錄器等中之任一者,但本發明不限於此。由於錄影機、行車紀錄器等的緩衝空間有限,故上述連續的資料(諸如該錄影資料)可以被切割,尤其切割成上述許多小片段的資料。例如:該錄影資料的大小達1 MB(megabyte;百萬位元組)或更多,這些小片段的資料之每一小片段的大小可等於8 KB,且該系列子區塊中之任一個子區塊(諸如區塊223)中之每一頁的大小可等於16 KB。It is assumed that insufficient hardware resources (for example, the total storage capacity of the
依據本實施例,當偶頁的資料收滿時,透過一結尾程序(tail process),記憶體控制器110可使資料進入一子區塊的一偶頁、且以假資料(dummy data)或其它資料補上或填入該子區塊的一奇頁,諸如這個偶頁的下一頁,以完成該子區塊的雙頁寫入,但本發明不限於此。來自主裝置50之下一個小片段的資料原本需要進入該子區塊的該奇頁,但現在只能被寫入一快取區塊,這是因為該子區塊的該奇頁剛剛已透過該結尾程序而被使用了。於是,上述利用該系列子區塊來儲存及接收該多個小片段的資料的機制失效。在長時間錄影的狀況下,記憶體控制器110可能無法避免額外工作,諸如垃圾收集操作,其中寫入效能可能降低。According to this embodiment, when the data of the double page is full, through a tail process, the
為了便於理解,資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}可作為上述許多小片段的資料中之連續四個小片段的資料的例子,資料{1st-8K(1), 2nd-8K(1), 3rd-8K(1), 4th-8K(1)}分別代表資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}的位於記憶體控制器110(尤其是緩衝區116A)中的緩衝版本,且資料{1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)}分別代表資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}的位於非揮發性記憶體120中的寫入版本,其中符號「X」可代表「不予理會」(Don't Care)。主裝置50依序執行步驟{S01, S02, S03, S04},以分別寫入資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}至記憶裝置100。舉例來說,記憶體控制器110可從主裝置50接收一系列資料諸如資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K},以從資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}取出一部分作為偶頁資料、以及從資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K}取出另一部分作為奇頁資料,但本發明不以此為限。假設資料{1st-8K, 2nd-8K}與資料{3rd-8K, 4th-8K}是預計分別被寫入非揮發性記憶體120中之某區塊的一偶頁與一奇頁的資料(例如第0頁的資料以及第1頁的資料);這表示資料{1st-8K, 2nd-8K}與資料{3rd-8K, 4th-8K}可分別視為偶頁資料與奇頁資料,資料{1st-8K(1), 2nd-8K(1)}與資料{3rd-8K(1), 4th-8K(1)}可分別視為偶頁資料與奇頁資料,並且資料{1st-8K(2), 2nd-8K(2)}與資料{3rd-8K(2), 4th-8K(2)}可分別視為偶頁資料與奇頁資料(分別標示為「偶頁」與「奇頁」,以求簡明)。For ease of understanding, the data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} can be used as an example of four consecutive small fragments of the above-mentioned many small fragments of data, data {1st-8K(1) , 2nd-8K(1), 3rd-8K(1), 4th-8K(1)} respectively represent data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} located in the memory controller 110 ( Especially the buffer version in the
因應主裝置50的步驟S01,資料1st-8K可被儲存至緩衝區116A的第一部分作為資料1st-8K(1),且可被寫入至屬於快取區塊230之區塊231的一頁作為資料1st-8K(2),其中該第一部分的大小等於8 KB。例如:透過該結尾程序,記憶體控制器110可組合資料1st-8K(1)與8 KB大小的假資料(或其它資料)、且將所組合的資料寫入至區塊231的該頁。因應主裝置50的步驟S02,資料2nd-8K可被儲存至緩衝區116A的第二部分作為資料2nd-8K(1),以供被寫入至非揮發性記憶體120作為資料2nd-8K(2),其中該第二部分的大小等於8 KB。此狀況下,記憶體控制器110已於緩衝區116A中收到偶頁的資料,諸如資料{1st-8K(1), 2nd-8K(1)}。記憶體控制器110可能已偵測到主裝置50暫停或停止資料傳送(例如:於從主裝置50接收到資料2nd-8K(1)之後,記憶體控制器110可能收到來自主裝置50之停止指令),且於此時刻,無法確定是否下一筆資料和資料{1st-8K(1), 2nd-8K(1)}屬於同一系列資料,其中資料{1st-8K(1), 2nd-8K(1)}已佔滿了緩衝區116A。記憶體控制器110可組合(從區塊231的該頁取得的)資料1st-8K(2)以及(從自緩衝區116A取得的)資料2nd-8K(1),以利用所組合的資料作為預計寫入屬於子區塊220之區塊223的一偶頁(例如第0頁)之資料{1st-8K(2), 2nd-8K(2)}。例如:透過該結尾程序,記憶體控制器110可組合資料{1st-8K(2), 2nd-8K(2)}以及16 KB大小的假資料(或其它資料),以將資料{1st-8K(2), 2nd-8K(2)}以及上述16 KB大小的假資料分別寫入區塊223的該偶頁(例如第0頁)以及其下一頁諸如區塊223的一奇頁(例如第1頁),以完成對這個子區塊的一個雙頁寫入運作。因應主裝置50的步驟S03,資料3rd-8K可被儲存至緩衝區116A的該第一部分作為資料3rd-8K(1),且可被寫入至區塊231的另一頁作為資料3rd-8K(2)。例如:透過該結尾程序,記憶體控制器110可組合資料3rd-8K(1)與8 KB大小的假資料(或其它資料)、且將所組合的資料寫入至區塊231的該另一頁。因應主裝置50的步驟S04,資料4th-8K可被儲存至緩衝區116A的該第二部分作為資料4th-8K(1),以供被寫入至非揮發性記憶體120作為資料4th-8K(2)。此狀況下,記憶體控制器110已於緩衝區116A中收到奇頁的資料,諸如資料{3rd-8K(1), 4th-8K(1)}。由於區塊223的該奇頁(例如第1頁)已經被用來儲存上述16 KB大小的假資料(或其它資料),故資料{3rd-8K(2), 4th-8K(2)}是被儲存於區塊231,而非區塊223。例如:記憶體控制器110可組合(從區塊231的該另一頁取得的)資料3rd-8K(2)以及(從自緩衝區116A取得的)資料4th-8K(1),以將所組合的資料寫入區塊231的又一頁作為資料{3rd-8K(2), 4th-8K(2)}。在上列運作之後,由於有效的偶頁資料(諸如資料{1st-8K(2), 2nd-8K(2)})位於屬於子區塊220之區塊223、且有效的奇頁資料(諸如資料{3rd-8K(2), 4th-8K(2)})位於屬於快取區塊230之區塊231,故記憶體控制器110可能無法避免額外工作,諸如垃圾收集操作,但本發明不限於此。In response to step S01 of the
依據某些實施例,在緩衝記憶體116的總儲存容量有限(例如緩衝區116A的大小等於一頁的大小)的狀況下,記憶體控制器110可調整(例如暫緩、取消、及/或修改)對非揮發性記憶體120的一部分操作指令,以避免有效的偶頁資料(諸如資料{1st-8K(2), 2nd-8K(2)})與有效的奇頁資料(諸如資料{3rd-8K(2), 4th-8K(2)})分佈於不同類型的區塊;並且,記憶體控制器110能取得足夠的資訊以供用來準確地判斷該一或多個小片段的資料是否應該寫入至一快取區塊或一子區塊,以確保上述利用該系列子區塊來儲存及接收該多個小片段的資料的機制有效。例如:在非揮發性記憶體120的製造商沒有提供用來控制非揮發性記憶體120中之一內部緩衝器(internal buffer)121之一操作指令的狀況下,記憶體控制器110可透過指令調整來妥善地利用非揮發性記憶體120中之內部緩衝器121,尤其可先將資料傳入非揮發性記憶體120中,以將該資料暫存於內部緩衝器121。只要記憶體控制器110不傳送一確認指令至非揮發性記憶體120,非揮發性記憶體120不會執行編程,所以在傳送該確認指令至非揮發性記憶體120之前,記憶體控制器110可改變該資料之一目標寫入位置,例如可動態地決定是否將該目標寫入位置從屬於子區塊220之區塊223改變為屬於快取區塊230之區塊231。另外,為了避免於改變該目標寫入位置時所造成的資料不可讀取問題(諸如該資料的隨機化版本無法被正確地去隨機化之問題),記憶體控制器110可暫時改變於緩衝記憶體116中之很小的剩餘儲存空間中之至少一部分空間(例如剩餘儲存空間之一部分或全部)的用途,以於該很小的剩餘儲存空間中安排一資料交換區116B(其可能僅具有2 KB大小、或更小),且可透過資料交換區116B與內部緩衝器121之間的資料交換來修正隨機種子(random seed),尤其針對該資料進行多個隨機資料輸出(random data out)運作與多個隨機資料輸入(random data in)運作來修正隨機種子。假設該目標寫入位置原本是一第一區塊(例如區塊223)中之一第一位置,且在該資料被傳送至非揮發性記憶體120之前,記憶體控制器110已依據一第一隨機種子隨機化該資料以將它轉換為一第一組隨機化資料,作為該資料之一隨機化版本,其中該第一隨機種子對應於該第一區塊(例如區塊223)中之該第一位置。當決定將該目標寫入位置改變為一第二區塊(例如區塊231)中之一第二位置,透過輪流進行該多個隨機資料輸出運作與該多個隨機資料輸入運作,記憶體控制器110可依據該第一隨機種子去隨機化該第一組隨機化資料以重獲該資料,且可依據一第二隨機種子隨機化該資料以將它轉換為一第二組隨機化資料,作為該資料之另一隨機化版本,其中該第二隨機種子對應於該第二區塊(例如區塊231)中之該第二位置。於是,於內部緩衝器121中,該第一組隨機化資料變成該第二組隨機化資料。此狀況下,記憶體控制器110可傳送該確認指令至非揮發性記憶體120,以觸發非揮發性記憶體120將該第二組隨機化資料編程至區塊231中之該第二位置。相仿地,當有需要時,該第一區塊與該第二區塊可予以改變,例如該第一區塊與該第二區塊可分別代表區塊231與區塊223。因此,記憶體控制器110能在不發生上述資料不可讀取問題的狀況下,在傳送該確認指令至非揮發性記憶體120之前任意改變該目標寫入位置。According to some embodiments, when the total storage capacity of the
由於記憶體控制器110能在不發生上述資料不可讀取問題的狀況下任意改變該目標寫入位置,故記憶體控制器110可透過改變該目標寫入位置來避免第3圖所示實施例中之問題。第4圖為依據本發明另一實施例之一種用來於一記憶裝置中進行寫入管理之方法的示意圖,其中該方法可應用於記憶裝置100,且可應用於該控制器諸如記憶體控制器110。因應主裝置50的步驟S01,資料1st-8K可被儲存至緩衝區116A的該第一部分作為資料1st-8K(1),且可被寫入至屬於快取區塊230之區塊231的一頁作為資料1st-8K(2)。例如:透過該結尾程序,記憶體控制器110可組合資料1st-8K(1)與8 KB大小的假資料(或其它資料)、且將所組合的資料寫入至區塊231的該頁。因應主裝置50的步驟S02,資料2nd-8K可被儲存至緩衝區116A的該第二部分作為資料2nd-8K(1),以供被寫入至非揮發性記憶體120作為資料2nd-8K(2)。例如:透過一開頭程序(header process),記憶體控制器110可組合(從區塊231的該頁取得的)資料1st-8K(2)以及(從自緩衝區116A取得的)資料2nd-8K(1),且發出至少一資料寫入指令以指出記憶體控制器110欲將所組合的資料寫入至非揮發性記憶體120當中屬於子區塊220之區塊223的一偶頁作為資料{1st-8K(2), 2nd-8K(2)},但避免立即發出該確認指令至非揮發性記憶體120,其中該確認指令可觸發非揮發性記憶體120執行上述至少一資料寫入指令。記憶體控制器110可能已偵測到主裝置50暫停或停止資料傳送(例如:於從主裝置50接收到資料2nd-8K(1)之後,記憶體控制器110可能收到來自主裝置50之停止指令),且於此時刻,無法確定是否下一筆資料和資料{1st-8K(1), 2nd-8K(1)}屬於同一系列資料,其中資料{1st-8K(1), 2nd-8K(1)}已佔滿了緩衝區116A。記憶體控制器110可先將資料{1st-8K(2), 2nd-8K(2)}(尤其是,資料{1st-8K(2), 2nd-8K(2)}的於對應的多個隨機資料輸出運作與對應的多個隨機資料輸入運作之前的隨機化版本;此隨機化版本可作為該第一組隨機化資料之一例)傳入非揮發性記憶體120中且將它暫存於內部緩衝器121,且可輪流進行該對應的多個隨機資料輸出運作與該對應的多個隨機資料輸入運作,以於改變該目標寫入位置時避免上述資料不可讀取問題。例如:在改變該目標寫入位置之後,記憶體控制器110可傳送該確認指令至非揮發性記憶體120,以觸發非揮發性記憶體120將資料{1st-8K(2), 2nd-8K(2)}(尤其是,資料{1st-8K(2), 2nd-8K(2)}的於該對應的多個隨機資料輸出運作與該對應的多個隨機資料輸入運作之後的隨機化版本;此隨機化版本可作為該第二組隨機化資料之一例)編程至區塊231中。這樣,當下一頁的資料(諸如資料{3rd-8K(1), 4th-8K(1)})已完整地接收於緩衝區116A中時,記憶體控制器110可將屬於同一系列的資料儲存於區塊223,而不會遇到無關的資料(諸如上述16 KB大小的假資料或其它資料)佔據區塊223的問題。Since the
另外,因應主裝置50的步驟S03,資料3rd-8K可被儲存至緩衝區116A的該第一部分作為資料3rd-8K(1),且可被寫入至區塊231的另一頁作為資料3rd-8K(2)。例如:透過該結尾程序,記憶體控制器110可組合資料3rd-8K(1)與8 KB大小的假資料(或其它資料)、且將所組合的資料寫入至區塊231的該另一頁。因應主裝置50的步驟S04,資料4th-8K可被儲存至緩衝區116A的該第二部分作為資料4th-8K(1),以供被寫入至非揮發性記憶體120作為資料4th-8K(2)。例如:透過該開頭程序,記憶體控制器110可嘗試組合(從區塊231的該頁取得的)資料3rd-8K(2) 以及(從自緩衝區116A取得的)資料4th-8K(1),且偵測到資料{1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)}屬於同一系列資料,其中該確認指令尚未發出至非揮發性記憶體120,且資料{3rd-8K(1), 4th-8K(1)}已佔滿了緩衝區116A。例如:針對偶頁資料,諸如區塊231中之資料{1st-8K(2), 2nd-8K(2)},記憶體控制器110可進行多個隨機資料輸出運作與多個隨機資料輸入運作,以將資料{1st-8K(2), 2nd-8K(2)}的隨機化版本之隨機種子調整成對應於區塊223的一偶頁(例如第0頁),使它停留在內部緩衝器121中。於是,記憶體控制器110可進行資料{1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)}於區塊223的雙頁寫入,其中資料{1st-8K(2), 2nd-8K(2)}被寫入區塊223的該偶頁(例如第0頁),且資料{3rd-8K(2), 4th-8K(2)}被寫入該偶頁的下一頁(例如第1頁),但本發明不限於此。In addition, in response to step S03 of the
在上列運作之後,由於屬於同一系列資料的小片段的資料被連續地儲存於子區塊220中之區塊223(例如:有效的偶頁資料(諸如資料{1st-8K(2), 2nd-8K(2)})以及有效的奇頁資料(諸如資料{3rd-8K(2), 4th-8K(2)})位於子區塊220之區塊223中之連續兩頁),故記憶體控制器110可避免額外工作,諸如垃圾收集操作,其中記憶裝置100可具備極佳的寫入效能。After the above operation, the data belonging to the small fragments of the same series of data are continuously stored in the
依據某些實施例,小片段的資料的大小、一頁的大小、緩衝區116A的大小、及/或資料交換區116B的大小可予以變化。為了便於理解,上述至少一資料寫入指令可包含一第一組指令諸如指令{0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)},且該確認指令可包含指令{0x10},其可視為一確認寫入指令,其中0x80可代表在該多階細胞寫入模式中之寫入指令、且可視為用來預告(pre-announce)資料寫入之一預告寫入指令,Child_Addr(0)可代表區塊223的該偶頁於平面0的實體位址,DATA(0)可代表欲寫入的資料(諸如資料1st-8K(2)),0x11可代表切換平面指令,Child_Addr(1)可代表區塊223的該偶頁於平面1的實體位址,DATA(1)可代表欲寫入的資料(諸如資料2nd-8K(1)),但本發明不限於此。在該確認指令(諸如指令{0x10})還沒發出之前,資料{DATA(0), DATA(1)}(尤其是其隨機化版本)可停留在該內部緩衝區,且記憶體控制器110可透過改變位址來改變該目標寫入位置,使資料{DATA(0), DATA(1)}被寫入至區塊231(而非區塊223),以避免無關的資料(諸如上述16 KB大小的假資料或其它資料)佔據區塊223的問題。例如:對應於一單階細胞寫入運作的一第二組指令諸如指令{0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}可被納入上述至少一資料寫入指令,其中0xDA可代表切換至該單階細胞寫入模式,0x85可代表在該單階細胞寫入模式中之寫入指令、且可視為用來預告資料寫入之一預告寫入指令,Cache_Addr(0)可代表區塊231中之某一頁於平面0的實體位址,Cache_Addr(1)可代表區塊231中之這一頁於平面1的實體位址。記憶體控制器110可發出該第一組指令諸如指令{0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)}、該第二組指令諸如指令{0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}、以及該確認指令(諸如指令{0x10}),以於該單階細胞寫入模式中透過改變/更新位址(將位址{Child_Addr(0), Child_Addr(1)}改變/更新為位址{Cache_Addr(0), Cache_Addr(1)})來寫入資料{DATA(0), DATA(1)}至區塊231,但本發明不限於此。依據某些實施例,記憶體控制器110可在該第一組指令諸如指令{0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)}與該第二組指令諸如指令{0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}之間插入至少一組額外指令,諸如指令{0x00, 0x05, 0xE0}與{0x85},以透過上述至少一組額外指令調整隨機種子,以確保非揮發性記憶體120中之寫入資料的正確性及/或可讀性,尤其避免隨機化(randomizing)/去隨機化(de-randomizing)運作的機制受到改變/更新位址的影響,但本發明不限於此。例如:記憶體控制器110可針對偶頁執行指令{0x00, 0x05, 0xE0}與{0x85}一或多次,以進行回拷(copy-back)讀取及隨機化資料寫入,來改變內部緩衝器121中之隨機化資料應該使用的隨機種子。在上述至少一組額外指令中,指令{0x00, 0x05, 0xE0}與{0x85}可分別視為隨機資料輸出指令與隨機資料輸入指令,以供進行一隨機資料輸出運作與一隨機資料輸入運作。於是,記憶體控制器110可執行指令{0x00, 0x05, 0xE0}與{0x85}多次,以輪流進行多個隨機資料輸出運作與多個隨機資料輸入運作來修正隨機種子。例如:當資料交換區具有2 KB大小,記憶體控制器110可對於8 KB大小的隨機化資料執行指令{0x00, 0x05, 0xE0}與{0x85}四次,以來修正它的隨機種子。According to some embodiments, the size of the small fragment of data, the size of a page, the size of the
第5圖繪示第4圖所示方法於一實施例中之工作流程300。依據本實施例,記憶體控制器110可從主裝置50接收該系列資料諸如資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K},以從該系列資料取出一部分作為偶頁資料、以及從該系列資料取出另一部分作為奇頁資料,但本發明不以此為限。FIG. 5 shows the
於步驟S30中,記憶體控制器110可將該偶頁資料中之第一局部(partial)資料(諸如資料1st-8K)寫入至非揮發性記憶體120(例如:屬於快取區塊230之區塊231)。In step S30, the
於步驟S32中,記憶體控制器110可傳送不帶有該確認指令(諸如指令{0x10})之一第一組指令(例如:上述之該第一組指令,諸如指令{0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)})至非揮發性記憶體120,以將該第一局部資料(諸如資料1st-8K)以及該偶頁資料中之第二局部資料(諸如資料2nd-8K)寫入非揮發性記憶體120中之內部緩衝器121,其中該確認指令可用來觸發非揮發性記憶體120執行至少一指令,諸如上述至少一資料寫入指令之至少一部分(例如一部分或全部),以對非揮發性記憶體120中之至少一非揮發性記憶體元件(例如非揮發性記憶體元件122-1、122-2、…與122-N中之至少一者)進行編程運作。例如:該第一組指令可指出非揮發性記憶體120應當透過該多階細胞寫入模式來寫入該第一局部資料與該第二局部資料至非揮發性記憶體120中之一子區塊,諸如屬於子區塊220之區塊223。In step S32, the
於步驟S34中,針對該偶頁資料(諸如該第一局部資料與該第二局部資料),記憶體控制器110可傳送至少一組額外指令(例如:上述之至少一組額外指令,諸如指令{0x00, 0x05, 0xE0}與{0x85})至非揮發性記憶體120,以透過該至少一組額外指令調整隨機種子,以確保非揮發性記憶體120中之寫入資料的正確性及/或可讀性。依據本實施例,透過資料交換區116B與內部緩衝器121之間的資料交換,記憶體控制器110可修正內部緩衝器121中之至少一部分資料之隨機種子。In step S34, for the even page data (such as the first partial data and the second partial data), the
於步驟S36中,記憶體控制器110可傳送一第二組指令(例如:上述之該第二組指令,諸如指令{0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)})與該確認指令(諸如指令{0x10})至非揮發性記憶體120,以將該第一局部資料與該第二局部資料寫入至非揮發性記憶體120中之一快取區塊,諸如屬於快取區塊230之區塊231。例如:該第二組指令可指出非揮發性記憶體120應當透過該單階細胞寫入模式來寫入該第一局部資料與該第二局部資料至該快取區塊。依據本實施例,該至少一指令可包含該第二組指令,且該確認指令觸發非揮發性記憶體120執行該第二組指令,其中該第二組指令可取代該第一組指令之至少一部分(例如一部分或全部),且可視為該第一組指令之更新指令。例如:記憶體控制器110不必重新傳送某些資料(諸如DATA(0)與DATA(1))至非揮發性記憶體120,但本發明不限於此。另外,該第一組指令與該第二組指令分別對應於不同的目標寫入位置。例如:透過傳送該第二組指令,記憶體控制器110可將該第一組指令所指定之一第一目標寫入位置(諸如該第一位置)取代為該第二組指令所指定之一第二目標寫入位置(諸如該第二位置)。記憶體控制器110可修正內部緩衝器121中之該至少一部分資料之隨機種子,以符合該第二目標寫入位置。In step S36, the
於步驟S38中,記憶體控制器110可將該奇頁資料中之第三局部資料(諸如資料3rd-8K)寫入至非揮發性記憶體120(例如:屬於快取區塊230之區塊231)。In step S38, the
於步驟S40中,記憶體控制器110可檢查該奇頁資料是否已被完整地收到,尤其可檢查該第三局部資料(諸如資料3rd-8K)與該奇頁資料中之第四局部資料(諸如資料4th-8K)是否都已被收到,其中該奇頁資料是否已被完整地收到可對應於該第三局部資料(諸如資料3rd-8K)與該第四局部資料(諸如資料4th-8K)是否都已被收到。例如:記憶體控制器110可檢查該第四局部資料(諸如資料4th-8K)是否已被收到,以判斷該奇頁資料是否已被完整地收到。當該奇頁資料已被完整地收到時(例如:該第四局部資料(諸如資料4th-8K)已被收到),進入步驟S42;否則,工作流程300結束,但本發明不限於此。In step S40, the
於步驟S42中,針對該偶頁資料(諸如該第一局部資料與該第二局部資料),記憶體控制器110可傳送該至少一組額外指令(諸如指令{0x00, 0x05, 0xE0}與{0x85})至非揮發性記憶體120,以透過該至少一組額外指令調整隨機種子,以確保非揮發性記憶體120中之寫入資料的正確性及/或可讀性。In step S42, for the even page data (such as the first partial data and the second partial data), the
於步驟S44中,記憶體控制器110可將該第一局部資料(諸如資料1st-8K)與該第二局部資料(諸如資料2nd-8K)寫入至該子區塊(諸如區塊223)的一偶頁,且將該第三局部資料(諸如資料3rd-8K)與該第四局部資料(諸如資料4th-8K)寫入至該子區塊(諸如區塊223)的一奇頁,其中該奇頁是該偶頁的下一頁。In step S44, the
由於有效的偶頁資料(諸如資料{1st-8K(2), 2nd-8K(2)})以及有效的奇頁資料(諸如資料{3rd-8K(2), 4th-8K(2)})位於區塊223中之連續兩頁,故記憶體控制器110可具備極佳的寫入效能,且可避免額外工作(諸如垃圾收集操作)。為了簡明起見,本實施例與前述實施例相仿的內容在此不重複贅述。
以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。Due to valid even page data (such as data {1st-8K(2), 2nd-8K(2)}) and valid odd page data (such as data {3rd-8K(2), 4th-8K(2)}) Since the two consecutive pages are located in the
50‧‧‧主裝置 100‧‧‧記憶裝置 110‧‧‧記憶體控制器 112‧‧‧微處理器 112C‧‧‧程式碼 112M‧‧‧唯讀記憶體 114‧‧‧控制邏輯電路 116‧‧‧緩衝記憶體 116A‧‧‧緩衝區 116B‧‧‧資料交換區 118‧‧‧傳輸介面電路 120‧‧‧非揮發性記憶體 121‧‧‧內部緩衝器 122-1, 122-2, …, 122-N‧‧‧非揮發性記憶體元件 210‧‧‧母區塊 220‧‧‧子區塊 230‧‧‧快取區塊 211, 212, …,221, 222, 223, …,231, 232, …‧‧‧區塊 211A, 211B, 211C,212A, 212B, 212C,221A, 221B, 221C,222A, 222B, 222C, 1st-8K, 1st-8K(1), 1st-8K(2),2nd-8K, 2nd-8K(1), 2nd-8K(2),3rd-8K, 3rd-8K(1), 3rd-8K(2),4th-8K, 4th-8K(1), 4th-8K(2)‧‧‧資料 S01, S02, S03, S04,S30, S32, S34, S36,S38, S40, S42, S44‧‧‧步驟50‧‧‧Main unit 100‧‧‧Memory device 110‧‧‧Memory Controller 112‧‧‧Microprocessor 112C‧‧‧Code 112M‧‧‧Read only memory 114‧‧‧Control logic circuit 116‧‧‧Buffer memory 116A‧‧‧Buffer 116B‧‧‧Data Exchange Area 118‧‧‧Transmission Interface Circuit 120‧‧‧Non-volatile memory 121‧‧‧Internal buffer 122-1, 122-2, …, 122-N‧‧‧Non-volatile memory components 210‧‧‧Mother block 220‧‧‧subblock 230‧‧‧Cache block 211, 212, …,221, 222, 223, …,231, 232, …‧‧‧block 211A, 211B, 211C,212A, 212B, 212C,221A, 221B, 221C,222A, 222B, 222C, 1st-8K, 1st-8K(1), 1st-8K(2),2nd-8K, 2nd-8K(1), 2nd-8K(2),3rd-8K, 3rd-8K(1), 3rd-8K (2),4th-8K, 4th-8K(1), 4th-8K(2)‧‧‧Data S01, S02, S03, S04, S30, S32, S34, S36, S38, S40, S42, S44‧‧‧Step
第1圖為依據本發明一實施例之一種記憶裝置與一主裝置(host device)的示意圖。 第2圖繪示第1圖所示記憶裝置於一實施例中之區塊管理方案。 第3圖為依據本發明一實施例之一種用來於一記憶裝置中進行寫入管理之方法的示意圖。 第4圖為依據本發明另一實施例之一種用來於一記憶裝置中進行寫入管理之方法的示意圖。 第5圖繪示第4圖所示方法於一實施例中之工作流程。FIG. 1 is a schematic diagram of a memory device and a host device according to an embodiment of the invention. Fig. 2 shows a block management scheme of the memory device shown in Fig. 1 in an embodiment. FIG. 3 is a schematic diagram of a method for writing management in a memory device according to an embodiment of the present invention. FIG. 4 is a schematic diagram of a method for writing management in a memory device according to another embodiment of the present invention. Figure 5 shows the workflow of the method shown in Figure 4 in an embodiment.
116A‧‧‧緩衝區 116A‧‧‧Buffer
223,231‧‧‧區塊 Block 223,231‧‧‧
1st-8K,1st-8K(1),1st-8K(2),2nd-8K,2nd-8K(1),2nd-8K(2),3rd-8K,3rd-8K(1),3rd-8K(2),4th-8K,4th-8K(1),4th-8K(2)‧‧‧資料 1st-8K,1st-8K(1),1st-8K(2),2nd-8K,2nd-8K(1),2nd-8K(2),3rd-8K,3rd-8K(1),3rd-8K (2),4th-8K,4th-8K(1),4th-8K(2)‧‧‧Data
S01,S02,S03,S04‧‧‧步驟 S01,S02,S03,S04‧‧‧Step
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW108111650A TWI709855B (en) | 2018-01-26 | 2018-01-26 | Method for performing writing management in a memory device, and associated memory device and controller thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW108111650A TWI709855B (en) | 2018-01-26 | 2018-01-26 | Method for performing writing management in a memory device, and associated memory device and controller thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201941062A TW201941062A (en) | 2019-10-16 |
| TWI709855B true TWI709855B (en) | 2020-11-11 |
Family
ID=69023433
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW108111650A TWI709855B (en) | 2018-01-26 | 2018-01-26 | Method for performing writing management in a memory device, and associated memory device and controller thereof |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI709855B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI808384B (en) * | 2021-02-23 | 2023-07-11 | 慧榮科技股份有限公司 | Storage device, flash memory control and control method thereo |
| TWI821152B (en) * | 2021-02-23 | 2023-11-01 | 慧榮科技股份有限公司 | Storage device, flash memory control and control method thereo |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101494086A (en) * | 2008-01-24 | 2009-07-29 | 群联电子股份有限公司 | Flash memory storage device, flash memory controller and switching method thereof |
| US20100318720A1 (en) * | 2009-06-16 | 2010-12-16 | Saranyan Rajagopalan | Multi-Bank Non-Volatile Memory System with Satellite File System |
| US7885112B2 (en) * | 2007-09-07 | 2011-02-08 | Sandisk Corporation | Nonvolatile memory and method for on-chip pseudo-randomization of data within a page and between pages |
| CN103377686A (en) * | 2012-04-24 | 2013-10-30 | 北京兆易创新科技股份有限公司 | Nand Flash memory and method for implementing continuous reading operation of Nand Flash memory |
| CN104699621A (en) * | 2013-12-04 | 2015-06-10 | 慧荣科技股份有限公司 | Data storage device and flash memory control method |
| TW201704996A (en) * | 2015-07-23 | 2017-02-01 | 愛思開海力士有限公司 | Memory system including semiconductor memory device and operating method thereof |
| TW201705147A (en) * | 2015-07-17 | 2017-02-01 | 慧榮科技股份有限公司 | Data storage device and data maintenance method thereof |
| TWI590051B (en) * | 2016-06-21 | 2017-07-01 | 慧榮科技股份有限公司 | Data storage device and data maintenance method thereof |
| TWI607448B (en) * | 2016-09-07 | 2017-12-01 | 群聯電子股份有限公司 | Data writing method, memory control circuit unit and mempry storage apparatus |
-
2018
- 2018-01-26 TW TW108111650A patent/TWI709855B/en active
Patent Citations (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7885112B2 (en) * | 2007-09-07 | 2011-02-08 | Sandisk Corporation | Nonvolatile memory and method for on-chip pseudo-randomization of data within a page and between pages |
| CN101494086A (en) * | 2008-01-24 | 2009-07-29 | 群联电子股份有限公司 | Flash memory storage device, flash memory controller and switching method thereof |
| CN101494086B (en) | 2008-01-24 | 2011-12-07 | 群联电子股份有限公司 | Flash memory storage device, flash memory controller and switching method thereof |
| US20100318720A1 (en) * | 2009-06-16 | 2010-12-16 | Saranyan Rajagopalan | Multi-Bank Non-Volatile Memory System with Satellite File System |
| CN103377686A (en) * | 2012-04-24 | 2013-10-30 | 北京兆易创新科技股份有限公司 | Nand Flash memory and method for implementing continuous reading operation of Nand Flash memory |
| CN103377686B (en) | 2012-04-24 | 2016-03-30 | 北京兆易创新科技股份有限公司 | Nand Flash storer and realize the method for the continuous read operation of Nand Flash storer |
| CN104699621A (en) * | 2013-12-04 | 2015-06-10 | 慧荣科技股份有限公司 | Data storage device and flash memory control method |
| TW201705147A (en) * | 2015-07-17 | 2017-02-01 | 慧榮科技股份有限公司 | Data storage device and data maintenance method thereof |
| TW201704996A (en) * | 2015-07-23 | 2017-02-01 | 愛思開海力士有限公司 | Memory system including semiconductor memory device and operating method thereof |
| TWI590051B (en) * | 2016-06-21 | 2017-07-01 | 慧榮科技股份有限公司 | Data storage device and data maintenance method thereof |
| TWI607448B (en) * | 2016-09-07 | 2017-12-01 | 群聯電子股份有限公司 | Data writing method, memory control circuit unit and mempry storage apparatus |
Also Published As
| Publication number | Publication date |
|---|---|
| TW201941062A (en) | 2019-10-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI660269B (en) | Method for performing writing management in a memory device, and associated memory device and controller thereof | |
| CN102292711B (en) | Solid state memory formatting | |
| US9268687B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| US8812784B2 (en) | Command executing method, memory controller and memory storage apparatus | |
| US11030093B2 (en) | High efficiency garbage collection method, associated data storage device and controller thereof | |
| US11733895B2 (en) | Control method of flash memory controller and associated flash memory controller and storage device | |
| US9009399B2 (en) | Flash memory storage system and controller and data writing method thereof | |
| US9280460B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| US11748011B2 (en) | Control method of flash memory controller and associated flash memory controller and storage device | |
| US9619380B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| US11003373B2 (en) | Systems and methods for managing physical-to- logical address information | |
| CN109857584B (en) | Method for performing access control on memory device, memory device and controller thereof | |
| CN109753230B (en) | Method for controlling operation of data storage device, data storage device and controller thereof | |
| TWI693520B (en) | Method for performing system backup in a memory device, associated memory device and controller thereof, and associated electronic device | |
| US11630604B2 (en) | Methods for controlling data storage device, and associated flash memory controller | |
| TWI709855B (en) | Method for performing writing management in a memory device, and associated memory device and controller thereof | |
| US9830077B2 (en) | Data writing method, memory control circuit unit and memory storage apparatus | |
| US9652378B2 (en) | Writing method, memory controller and memory storage device | |
| TW202125206A (en) | Memory management method and memory device | |
| US12307088B2 (en) | Method and apparatus for performing data retention management of memory device with aid of pre-shutdown control |