[go: up one dir, main page]

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 PDF

Info

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
Application number
TW108111650A
Other languages
Chinese (zh)
Other versions
TW201941062A (en
Inventor
顏偉倫
林銘彥
張進邦
Original Assignee
慧榮科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 慧榮科技股份有限公司 filed Critical 慧榮科技股份有限公司
Priority to TW108111650A priority Critical patent/TWI709855B/en
Publication of TW201941062A publication Critical patent/TW201941062A/en
Application granted granted Critical
Publication of TWI709855B publication Critical patent/TWI709855B/en

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A method for performing writing management in a memory device, the memory device, and the controller thereof are provided. The method may include: writing first partial data of even-page data into a non-volatile (NV) memory; transmitting a first set of commands without a confirmation command to the NV memory, to write the first partial data and second partial data of the even-page data into an internal buffer within the NV memory; transmitting a second set of commands and the confirmation command to the NV memory, to write the first partial data and the second partial data into a block of the NV memory; writing third partial data of odd-page data into the NV memory; and writing the first and the second partial data into an even page of another block of the NV memory, and writing the third and fourth partial data into an odd page of this block.

Description

用來於一記憶裝置中進行寫入管理之方法以及記憶裝置及其控制器Method for writing management in a memory device, memory device and controller thereof

本發明係有關於快閃記憶體(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 memory device 100 and a host device 50 according to a first embodiment of the present invention. For example, the memory device 100 may be a portable memory device (for example, a memory card conforming to SD/MMC, CF, MS, or XD standards) or a solid state drive (SSD). In addition, examples of the main device 50 may include (but are not limited to): multifunctional mobile phone, tablet, wearable device, and personal computer such as desktop Computers and laptops. According to this embodiment, the memory device 100 may include a controller such as a memory controller 110, and may further include a non-volatile memory (NV memory) 120, where the controller is used to access (Access) The non-volatile memory 120, and the non-volatile memory 120 is used to store information. The non-volatile memory 120 may include one or more non-volatile memory elements (NV memory elements), such as non-volatile memory elements 122-1, 122-2, ... and 122-N, where the symbol "N" Can represent a positive integer greater than one. For example: the non-volatile memory 120 can be a flash memory, and the non-volatile memory devices 122-1, 122-2, ... and 122-N can be a plurality of flash memory chips, respectively (Flash memory chip; may be referred to as a flash chip for short) or a plurality of flash memory die (Flash memory die; may be referred to as a flash die for short), but the present invention is not limited to this.

如第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 memory controller 110 may include a processing circuit such as a microprocessor 112, a storage such as a read only memory (read only memory, ROM) 112M, a control logic circuit 114, a buffer memory 116, and In the transmission interface circuit 118, these components can be coupled to each other through a bus. The buffer memory 116 is implemented by random access memory (RAM). In addition, the read-only memory 112M of this embodiment is used to store a program code 112C, and the microprocessor 112 is used to execute the program code 112C to control access to the non-volatile memory 120. Please note that the program code 112C must also be stored in the buffer memory 116 or any form of memory. In addition, the control logic circuit 114 may include an error correction code circuit (not shown) to protect data and/or perform error correction, and the transmission interface circuit 118 may conform to a specific communication standard (such as serial advanced technology attachments (Serial Advanced) Technology Attachment (SATA) standard, Universal Serial Bus (USB) standard, or Peripheral Component Interconnect Express (PCIE) standard) and can communicate according to the specific communication standard.

於本實施例中,主裝置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 host device 50 can indirectly access the non-volatile memory 120 in the memory device 100 by sending a plurality of host commands and corresponding logical addresses to the memory controller 110 . The memory controller 110 receives the plurality of host device commands and logical addresses, and respectively translates the plurality of host device commands into memory operation commands (referred to as operation commands), and then controls the non-volatile memory 120 to read by the operation commands Fetching, writing/programming the memory unit (memory unit) or data page (page) of a specific physical address in the non-volatile memory 120, where the physical address corresponds to the logical address. For example, the memory controller 110 may generate or update at least one logical-to-physical address mapping table to manage the relationship between the physical address and the logical address.

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 non-volatile memory 120, any one of the non-volatile memory elements 122-1, 122-2, ... and 122-N is the non-volatile memory element 122-n (the symbol "n" can represent the interval [ 1, N] can contain multiple blocks, and one of the multiple blocks can contain and can record a specific number of pages. The memory controller 110 is non-volatile The smallest unit for the operation of erasing data by the non-volatile memory 120 can be a block, and the smallest unit for the operation of writing data to the non-volatile memory 120 by the memory controller 110 can be a page, but the invention is not limited to this . Regarding the access structure of the non-volatile memory 120, the block may include M word-lines {WL(0), WL(1), …, WL(M-1)}. For example, the memory controller 110 can write information to any word line in the block through a single-level cell (SLC) write mode. In this case, the word line can contain a single page. For another example, the memory controller 110 can write information to any word line in the block through a multi-level cell (MLC) write mode. In this case, the word line can include at least two pages. According to some embodiments, when the memory controller 110 writes information to a word line in the block through a triple level cell (TLC) write mode, the word line may include three pages.

第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 memory device 100 shown in FIG. 1 in an embodiment. The memory controller 110 can divide a plurality of blocks in the non-volatile memory 120 (which can include the respective blocks of the non-volatile memory elements 122-1, 122-2, ... and 122-N) into Multiple types of blocks, such as a parent block 210, a sub-block 220, and a cache block 230, which can be controlled respectively to improve the memory controller 110 The performance when accessing (for example, reading or writing) the non-volatile memory 120, in which the type of a block can be changed when needed. The memory controller 110 can select certain blocks, such as blocks 231 and 232, as the cache block 230 for temporarily storing information, and can use the single-stage cellular write mode to perform any of these blocks Write operation to save time. In addition, the memory controller 110 can use the multi-level cell write mode to perform the write operation of certain blocks to make full use of the storage capacity of these blocks. The write operations of the parent block 210 and the sub-block 220 All operations can be performed using the multi-stage cell writing mode. For example, the blocks 211 and 212 can be fully programmed blocks and can belong to the parent block 210, where the blocks 211 and 212 can store user data, but the invention is not limited thereto.

依據本實施例,主裝置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 host device 50 can send a request to the memory controller 110 to update or write data to a parent block (such as block 211 or block 212) through the memory controller 110, wherein the request It can include a host device command and corresponding logical address. The memory controller 110 can check whether any sub-block (such as the block 221 or the block 222) mapped to the parent block is stored in the non-volatile memory 120. If there is the sub-block mapped to the parent block in the non-volatile memory 120, the memory controller 110 can update the host write data to the sub-block; otherwise, the memory The controller 110 may select a blank block as a child block mapped to the parent block. For example, the parent block may represent the block 211, and the sub-block mapped to the parent block may represent the block 221. The request may indicate that the main device 50 wants to update or write the data of the sub-set 211B (eg, pages 10 to 20) of the block 211. The memory controller 110 can copy the data of the sub-set 211A (for example, pages 0-9) of the block 211 to the corresponding sub-set 221A (for example, the pages 0-9) of the block 221 so that it stores the copied data , And can write the master device write data to the sub-set 221B of block 221 (for example, pages 10 to 20) so that it stores the updated data to update or write to the same or corresponding to the parent block The location of the address, but the present invention is not limited to this. When needed, the memory controller 110 can copy the data of the sub-set 211C of the block 211 (for example, the subsequent pages from page 21) to the sub-set 221C of the block 221 (for example, the subsequent pages from the 21st page), and erase Block 211 makes it a blank block, removes the mapping relationship between block 221 and block 211, and updates the type of block 221 to make it belong to parent block 210. The end of block 211 (such as the last Page) and the end of the block 221 (such as the last page) can respectively store related management information, such as their end-of-block information (EOB information), but the invention is not limited to this.

另外,該請求可被取代為一系列請求,其可指出主裝置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 master device 50 wants to update the parent block multiple times, wherein the master device write data can be replaced by multiple sets of master device writes corresponding to the series of requests. Into the information. For example, the parent block may represent the block 212, and the sub-block mapped to the parent block may represent the block 222. The first request in the series of requests may indicate that the master device 50 wants to update or write data in the sub-set 212B (eg, pages 10 to 20) of the block 212. The memory controller 110 can copy the data of the sub-set 212A (for example, pages 0-9) of the block 212 to the corresponding sub-set 222A (for example, pages 0-9) of the block 222 so that it can store the copied data , And can write the master device write data corresponding to the first request to the sub-set 222B of block 222 (for example, pages 10 to 20) so that it can store the updated data to update or write to the parent area The position of the same or corresponding address in the block. The second request in the series of requests may indicate that the main device 50 wants to update or write data in the sub-set 212B (eg, pages 10-20) of the block 212. The memory controller 110 can write the master device write data corresponding to the second request to a subsequent part of the sub-set 222C of the block 222, such as a part of the same size as the sub-set 222B (for example, pages 21 to 31) ), as a replacement for the previously updated data in the subset 222B, where the previously updated data in the subset 222B can be regarded as invalid data. When necessary, the memory controller 110 can perform garbage collection, especially an empty block, and copy the data of the sub-set 212A of the block 212 (for example, pages 0 to 9) to this empty block. Corresponding position (for example, pages 0-9), copy the data of the subsequent part (for example, pages 21 to 31) in the sub-set 222C to this blank block corresponding to the position of the sub-set 212B (for example, the 10th to the 20), copy the data of the sub-set 212C of the block 212 (for example, the subsequent pages from page 21) to the corresponding position of the blank block (for example, the subsequent pages from the 21st page), erase the block 212 and 222 turns them into blank blocks, cancels the mapping relationship between the block 222 and the block 212, and updates the type of the blank block so that it belongs to the parent block 210.

此外,區塊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 block 223 may belong to the sub-block 220, but the block 223 need not be mapped to any parent block. For example, in the case of insufficient hardware resources (such as buffers) of the main device 50, the main device 50 can cut continuous data (such as video data) into a large number of small pieces of data, and can send them separately These small pieces of information. In this way, these small fragments of data transmitted from the main device 50 to the memory device 100 correspond to the aforementioned continuous data. The memory controller 110 can respectively write at least a part of the data of these small fragments to the sub-sets 223A, 223B, 223C... of the block 223 to store the written data in the sub-sets 223A, 223B, 223C... Each of them may include at least one page (for example, one or more pages), and when the block 223 is full, the memory controller 110 may update the type of the block 223 so that it belongs to the parent block 210, but The present invention is not limited to this. For example, the size of each small fragment of the data of these small fragments may be equal to 32 KB (kilobyte), and the size of each page in the block 223 may be equal to 16 KB. For another example, the size of each small fragment of the data of these small fragments may be equal to 16 KB, and the size of each page in the block 223 may be equal to 16 KB. For another example, the size of each small fragment of the data of these small fragments may be equal to 8 KB, and the size of each page in the block 223 may be equal to 16 KB. According to some embodiments, the memory controller 110 may buffer the received small fragments so that each of the subsets 223A, 223B, 223C... may include one page, but the invention is not limited to this.

依據某些實施例,緩衝記憶體116中之緩衝區116A的大小可以大於或等於一次寫入非揮發性記憶體120的資料量。當主裝置50將上述連續的資料(諸如該錄影資料,其資料長度可以很長)寫入記憶裝置100時,記憶體控制器110可利用沒有映射到任何母區塊之一系列子區塊(諸如子區塊223)來儲存及接收該多個小片段的資料,以避免額外工作,諸如垃圾收集操作。當需要時(例如該主裝置寫入資料不滿一頁而需要補開頭或結尾),記憶體控制器110可採用一快取區塊(諸如快取區塊230中之任一者)來進行資料寫入。According to some embodiments, the size of the buffer area 116A in the buffer memory 116 may be greater than or equal to the amount of data written into the non-volatile memory 120 at one time. When the main device 50 writes the aforementioned continuous data (such as the video data, the data length can be very long) into the memory device 100, the memory controller 110 can use a series of sub-blocks that are not mapped to any parent block ( Such as sub-block 223) to store and receive the multiple small pieces of data to avoid extra work, such as garbage collection operations. When needed (for example, the main device writes data that does not fill a page and needs to fill in the beginning or end), the memory controller 110 can use a cache block (such as any one of the cache blocks 230) to perform data Write.

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 non-volatile memory 120, there are a variety of technologies available, such as: 2D/Planar NAND Flash (2D/Planar NAND Flash) technology in which memory cells are arranged in a single layer; and memory cells are arranged in multiple vertical stacks. Three-dimensional NAND flash (3D NAND Flash) technology. According to some embodiments, the non-volatile memory 120 can be implemented as a planar NAND flash structure with memory cells arranged in a single layer. According to some embodiments, the non-volatile memory 120 can be implemented as a three-dimensional NAND flash structure with multiple memory cells stacked vertically. For example, based on certain design concepts, the non-volatile memory 120 can be designed such that when the multi-level cell writing mode is used to write information, two pages of data must be written at a time, such as even pages plus odd pages (even pages). page plus odd page); this means that the size of buffer 116A has doubled the original requirement. Assuming sufficient hardware resources (for example, the total storage capacity of the buffer memory 116 is large enough), the allowable size of the buffer 116A is more than two pages. In this situation, when the main device 50 writes the above-mentioned continuous data (such as the video data, whose data length can be very long) into the memory device 100, the microprocessor 112 can dynamically monitor the data in the buffer 116A , Such as the data of one or more of the plurality of small fragments, to accurately determine whether the data of the one or more small fragments should be written into a cache block or a sub-block. For example, when the data of the one or more small segments is subsequent data of the data of the previous small segment, the microprocessor 112 can accurately determine that the data of the one or more small segments should be written to the sub-block. Therefore, the memory controller 110 can use the series of sub-blocks (such as the sub-block 223) to store and receive the plurality of small fragments of data, and the memory device 100 can have excellent writing performance.

假設硬體資源不足(例如緩衝記憶體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 buffer memory 116 is limited) makes the size of the buffer 116A equal to the size of one page. In this situation, when the main device 50 writes the aforementioned continuous data (such as the recorded data) into the memory device 100, the microprocessor 112 may not have enough information to accurately determine the one or more small pieces of data Whether it should be written to a cache block or a sub-block, which may invalidate the above-mentioned mechanism of using the series of sub-blocks to store and receive the multiple small fragments of data (for example, the memory controller 110 may not be able to avoid Extra work, such as garbage collection operations), in which write performance may be reduced. Figure 3 is a schematic diagram of a method for writing management in a memory device according to an embodiment of the present invention, where the method can be applied to the memory device 100 and can be applied to the controller such as a memory controller 110. The main device 50 can be implemented as any one of a video recorder, a driving recorder, etc., but the present invention is not limited thereto. Due to the limited buffer space of video recorders, driving recorders, etc., the above-mentioned continuous data (such as the video data) can be cut, especially into many small pieces of data mentioned above. For example: the size of the recorded data reaches 1 MB (megabyte; megabytes) or more, and the size of each small fragment of these small fragments of data can be equal to 8 KB, and any one of the series of sub-blocks The size of each page in a sub-block (such as block 223) may be equal to 16 KB.

依據本實施例,當偶頁的資料收滿時,透過一結尾程序(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 memory controller 110 can make the data enter a double page of a sub-block, and use dummy data or Other data is added or filled into an odd page of the sub-block, such as the next page of the even page, to complete the double-page writing of the sub-block, but the invention is not limited to this. The data from a small fragment under the main device 50 originally needed to enter the odd page of the sub-block, but now it can only be written into a cache block, because the odd page of the sub-block has just passed through The ending program is used. Therefore, the aforementioned mechanism of using the series of sub-blocks to store and receive the data of the multiple small fragments fails. In the case of long-term recording, the memory controller 110 may not be able to avoid additional tasks, such as garbage collection operations, in which the writing performance may be reduced.

為了便於理解,資料{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 buffer 116A), and the data {1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)} respectively represent the data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} are written versions in non-volatile memory 120, where the symbol "X" can stand for "Don't Care". The main device 50 sequentially executes steps {S01, S02, S03, S04} to write data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} to the memory device 100 respectively. For example, the memory controller 110 may receive a series of data such as data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} from the host device 50 to obtain data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} take out a part as even page data, and take out another part from the data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} as odd page data, but the present invention does not take this as limit. Assuming that the data {1st-8K, 2nd-8K} and the data {3rd-8K, 4th-8K} are expected to be written into an even page and an odd page of a block in the non-volatile memory 120 respectively ( For example, the data on page 0 and the data on page 1); this means that the data {1st-8K, 2nd-8K} and the data {3rd-8K, 4th-8K} can be regarded as even page data and odd page data, respectively. {1st-8K(1), 2nd-8K(1)} and data {3rd-8K(1), 4th-8K(1)} can be regarded as even page data and odd page data respectively, and data {1st-8K (2), 2nd-8K(2)} and data {3rd-8K(2), 4th-8K(2)} can be regarded as even page data and odd page data respectively (labeled as "even page" and "odd page" respectively Page" for brevity).

因應主裝置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 host device 50, the data 1st-8K can be stored in the first part of the buffer 116A as the data 1st-8K(1), and can be written to a page of block 231 belonging to the cache block 230 As the data 1st-8K(2), the size of the first part is equal to 8 KB. For example, through the ending process, the memory controller 110 can combine the data 1st-8K(1) with 8 KB of dummy data (or other data), and write the combined data to the page of the block 231. In response to step S02 of the host device 50, the data 2nd-8K can be stored in the second part of the buffer 116A as the data 2nd-8K(1) for being written to the non-volatile memory 120 as the data 2nd-8K( 2), where the size of the second part is equal to 8 KB. In this situation, the memory controller 110 has received even page data in the buffer 116A, such as data {1st-8K(1), 2nd-8K(1)}. The memory controller 110 may have detected that the main device 50 has suspended or stopped data transmission (for example: after receiving data 2nd-8K(1) from the main device 50, the memory controller 110 may have received a stop from the main device 50 Command), and at this moment, it is impossible to determine whether the next data and data {1st-8K(1), 2nd-8K(1)} belong to the same series of data, of which data {1st-8K(1), 2nd-8K( 1)} The buffer zone 116A is full. The memory controller 110 can combine the data 1st-8K(2) (obtained from the page of block 231) and the data 2nd-8K(1) (obtained from the buffer 116A) to use the combined data as It is expected to write data {1st-8K(2), 2nd-8K(2)} of an even page (for example, page 0) belonging to the block 223 of the sub-block 220. For example: through this ending procedure, the memory controller 110 can combine data {1st-8K(2), 2nd-8K(2)} and 16 KB fake data (or other data) to combine data {1st-8K (2), 2nd-8K(2)} and the above-mentioned 16 KB fake data are written into the even page of block 223 (for example, page 0) and the next page, such as an odd page of block 223 (for example, Page 1) to complete a double-page write operation for this sub-block. In response to step S03 of the host device 50, the first part of the data 3rd-8K can be stored in the buffer 116A as the data 3rd-8K(1), and can be written to another page of the block 231 as the data 3rd-8K (2). For example, through the ending process, the memory controller 110 can combine data 3rd-8K(1) with 8 KB of dummy data (or other data), and write the combined data to the other part of block 231 page. In response to step S04 of the host device 50, the data 4th-8K can be stored in the second part of the buffer 116A as the data 4th-8K(1) for writing to the non-volatile memory 120 as the data 4th-8K (2). In this situation, the memory controller 110 has received odd pages of data in the buffer 116A, such as data {3rd-8K(1), 4th-8K(1)}. Since the odd page (such as page 1) of block 223 has been used to store the 16 KB fake data (or other data), the data {3rd-8K(2), 4th-8K(2)} is It is stored in block 231 instead of block 223. For example, the memory controller 110 can combine data 3rd-8K(2) (obtained from the other page of block 231) and data 4th-8K(1) (obtained from buffer 116A) to combine all The combined data is written into another page of the block 231 as data {3rd-8K(2), 4th-8K(2)}. After the above operation, because valid even page data (such as data {1st-8K(2), 2nd-8K(2)}) is located in block 223 belonging to sub-block 220, and valid odd page data (such as The data {3rd-8K(2), 4th-8K(2)}) is located in the block 231 belonging to the cache block 230, so the memory controller 110 may not be able to avoid extra work, such as garbage collection operations, but the present invention does not Limited to this.

依據某些實施例,在緩衝記憶體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 buffer memory 116 is limited (for example, the size of the buffer 116A is equal to the size of a page), the memory controller 110 can adjust (for example, suspend, cancel, and/or modify ) Part of the operating instructions for the non-volatile memory 120 to avoid 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)}) are distributed in different types of blocks; and the memory controller 110 can obtain enough information to accurately determine whether the data of the one or more small fragments It should be written to a cache block or a sub-block to ensure that the above-mentioned mechanism of using the series of sub-blocks to store and receive the multiple small fragments of data is effective. For example, in the case that the manufacturer of the non-volatile memory 120 does not provide an operation command for controlling an internal buffer 121 in the non-volatile memory 120, the memory controller 110 can use the command Adjust to properly utilize the internal buffer 121 in the non-volatile memory 120, especially the data can be transferred to the non-volatile memory 120 first to temporarily store the data in the internal buffer 121. As long as the memory controller 110 does not send a confirmation command to the non-volatile memory 120, the non-volatile memory 120 will not execute programming. Therefore, before sending the confirmation command to the non-volatile memory 120, the memory controller 110 The target writing position of one of the data can be changed, for example, it can be dynamically determined whether to change the target writing position from the block 223 belonging to the sub-block 220 to the block 231 belonging to the cache block 230. In addition, in order to avoid the problem of unreadable data (such as the problem that the randomized version of the data cannot be correctly derandomized) caused by changing the target writing position, the memory controller 110 can temporarily change the buffer memory The purpose of at least a part of the small remaining storage space in the body 116 (for example, part or all of the remaining storage space) is used to arrange a data exchange area 116B (which may only have 2 KB size or smaller), and the random seed can be modified through data exchange between the data exchange area 116B and the internal buffer 121, especially for the data to perform multiple random data out operations Operate with multiple random data in to correct the random seed. Assuming that the target writing location was originally a first location in a first block (for example, block 223), and before the data is transferred to the non-volatile memory 120, the memory controller 110 has already performed a A random seed randomizes the data to convert it into a first set of randomized data as a randomized version of the data, wherein the first random seed corresponds to the first block (for example, block 223) The first position. When it is determined to change the target writing location to a second location in a second block (for example, block 231), the multiple random data output operations and the multiple random data input operations are performed in turn, and memory control The device 110 may de-randomize the first set of randomized data according to the first random seed to retrieve the data, and may randomize the data according to a second random seed to convert it into a second set of randomized data. As another randomized version of the data, the second random seed corresponds to the second position in the second block (for example, block 231). Thus, in the internal buffer 121, the first set of randomized data becomes the second set of randomized data. In this situation, the memory controller 110 can send the confirmation command to the non-volatile memory 120 to trigger the non-volatile memory 120 to program the second set of randomized data to the second position in the block 231. Similarly, when necessary, the first block and the second block can be changed. For example, the first block and the second block can represent the block 231 and the block 223 respectively. Therefore, the memory controller 110 can arbitrarily change the target writing position before sending the confirmation command to the non-volatile memory 120 without the aforementioned data unreadable problem.

由於記憶體控制器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 memory controller 110 can arbitrarily change the target writing position without the aforementioned data unreadable problem, the memory controller 110 can avoid the embodiment shown in Figure 3 by changing the target writing position The problem. Figure 4 is a schematic diagram of a method for writing management in a memory device according to another embodiment of the present invention, where the method can be applied to the memory device 100 and can be applied to the controller such as memory control器110. In response to step S01 of the host device 50, the first part of the data 1st-8K can be stored in the buffer 116A as the data 1st-8K(1), and can be written to a block 231 belonging to the cache block 230 Page as data 1st-8K(2). For example, through the ending process, the memory controller 110 can combine the data 1st-8K(1) with 8 KB of dummy data (or other data), and write the combined data to the page of the block 231. In response to step S02 of the host device 50, the data 2nd-8K can be stored in the second part of the buffer 116A as the data 2nd-8K(1) for being written to the non-volatile memory 120 as the data 2nd-8K (2). For example: through a header process, the memory controller 110 can combine the data 1st-8K(2) (obtained from the page of block 231) and the data 2nd-8K (obtained from the buffer 116A) (1) At least one data write command is issued to indicate that the memory controller 110 intends to write the combined data to an even page of the block 223 of the sub-block 220 in the non-volatile memory 120 as data {1st-8K(2), 2nd-8K(2)}, but avoid sending the confirmation command to the non-volatile memory 120 immediately, where the confirmation command can trigger the non-volatile memory 120 to perform at least one data write instruction. The memory controller 110 may have detected that the main device 50 has suspended or stopped data transmission (for example: after receiving data 2nd-8K(1) from the main device 50, the memory controller 110 may have received a stop from the main device 50 Command), and at this moment, it is impossible to determine whether the next data and data {1st-8K(1), 2nd-8K(1)} belong to the same series of data, of which data {1st-8K(1), 2nd-8K( 1)} The buffer zone 116A is full. The memory controller 110 may first transfer the data {1st-8K(2), 2nd-8K(2)} (especially, the data {1st-8K(2), 2nd-8K(2)} to the corresponding multiple The randomized version before the random data output operation and the corresponding multiple random data input operations; this randomized version can be used as an example of the first set of randomized data) is transferred to the non-volatile memory 120 and temporarily stored in The internal buffer 121 can perform the corresponding multiple random data output operations and the corresponding multiple random data input operations in turn, so as to avoid the aforementioned data unreadable problem when changing the target writing position. For example: after changing the target writing position, the memory controller 110 can send the confirmation command to the non-volatile memory 120 to trigger the non-volatile memory 120 to store data {1st-8K(2), 2nd-8K (2)} (especially, the randomized version of the data {1st-8K(2), 2nd-8K(2)} after the corresponding multiple random data output operations and the corresponding multiple random data input operations ; This randomized version can be used as an example of the second set of randomized data) to be programmed into block 231. In this way, when the data of the next page (such as data {3rd-8K(1), 4th-8K(1)}) has been completely received in the buffer 116A, the memory controller 110 can store the data belonging to the same series In block 223, the problem of irrelevant data (such as the above-mentioned fake data of 16 KB or other data) occupying block 223 will not be encountered.

另外,因應主裝置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 host device 50, the first part of the data 3rd-8K can be stored in the buffer 116A as the data 3rd-8K(1), and can be written to another page of the block 231 as the data 3rd -8K(2). For example, through the ending process, the memory controller 110 can combine data 3rd-8K(1) with 8 KB of dummy data (or other data), and write the combined data to the other part of block 231 page. In response to step S04 of the host device 50, the data 4th-8K can be stored in the second part of the buffer 116A as the data 4th-8K(1) for writing to the non-volatile memory 120 as the data 4th-8K (2). For example: through the initial procedure, the memory controller 110 can try to combine the data 3rd-8K(2) (obtained from the page of block 231) and the data 4th-8K(1) (obtained from the buffer 116A) , And the detected data {1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)} belongs to the same series of data, and the confirmation command has not been issued to non-volatile The memory 120, and the data {3rd-8K(1), 4th-8K(1)} has filled up the buffer 116A. For example: for even page data, such as data {1st-8K(2), 2nd-8K(2)} in block 231, the memory controller 110 can perform multiple random data output operations and multiple random data input operations , To adjust the random seed of the randomized version of the data {1st-8K(2), 2nd-8K(2)} to an even page corresponding to block 223 (for example, page 0), so that it stays in the internal buffer器121中. Thus, the memory controller 110 can write data {1st-8K(2), 2nd-8K(2), 3rd-8K(2), 4th-8K(2)} in the double page of block 223, where The data {1st-8K(2), 2nd-8K(2)} is written into the even page (such as page 0) of block 223, and the data {3rd-8K(2), 4th-8K(2)} It is written to the next page (for example, page 1) of the even page, but the present invention is not limited to this.

在上列運作之後,由於屬於同一系列資料的小片段的資料被連續地儲存於子區塊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 block 223 of the sub-block 220 (for example: 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)}) located in two consecutive pages in block 223 of sub-block 220), so memory The volume controller 110 can avoid extra tasks, such as garbage collection operations, and the memory device 100 can have excellent writing performance.

依據某些實施例,小片段的資料的大小、一頁的大小、緩衝區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 buffer zone 116A, and/or the size of the data exchange area 116B can be changed. For ease of understanding, the above-mentioned at least one data writing instruction may include a first group of instructions such as {0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)}, and the The confirmation command can include the command {0x10}, which can be regarded as a confirmation write command, where 0x80 can represent the write command in the multi-level cell write mode, and can be regarded as a pre-announce data write A preview write command, Child_Addr(0) can represent the physical address of the even page of block 223 in plane 0, and DATA(0) can represent the data to be written (such as data 1st-8K(2)), 0x11 can represent a plane switching command, Child_Addr(1) can represent the physical address of the even page of block 223 in plane 1, and DATA(1) can represent the data to be written (such as data 2nd-8K(1)), But the present invention is not limited to this. Before the confirmation command (such as command {0x10}) is issued, the data {DATA(0), DATA(1)} (especially its randomized version) can stay in the internal buffer, and the memory controller 110 The target write location can be changed by changing the address so that the data {DATA(0), DATA(1)} is written to block 231 (not block 223) to avoid irrelevant data (such as 16 above) KB size fake data or other data) occupy block 223. For example: a second set of commands corresponding to a single-stage cell write operation, such as commands {0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}, can be included in the above at least one data write command, where 0xDA can represent switching to the single-level cell write mode, 0x85 can represent the write command in the single-level cell write mode, and can be regarded as a preview write command used to predict data writing, Cache_Addr(0) It can represent the physical address of a page in block 231 on plane 0, and Cache_Addr(1) can represent the physical address of this page in block 231 on plane 1. The memory controller 110 can issue the first set of commands such as commands {0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)}, the second set of commands such as commands { 0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}, and the confirmation command (such as the command {0x10}) to change/update the address in the single-stage cell write mode (by changing the bit Address {Child_Addr(0), Child_Addr(1)} is changed/updated to address {Cache_Addr(0), Cache_Addr(1)}) to write data {DATA(0), DATA(1)} to block 231, But the present invention is not limited to this. According to some embodiments, the memory controller 110 can set the first set of commands such as commands {0x80, Child_Addr(0), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)} and the first set of commands Insert at least one set of additional instructions between two sets of instructions such as instructions {0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}, such as instructions {0x00, 0x05, 0xE0} and {0x85} to pass the above At least one set of additional commands adjust the random seed to ensure the correctness and/or readability of the data written in the non-volatile memory 120, especially to avoid randomizing/de-randomizing operations The mechanism is affected by the change/update of the address, but the invention is not limited to this. For example, the memory controller 110 can execute the commands {0x00, 0x05, 0xE0} and {0x85} one or more times for even pages to perform copy-back reading and randomized data writing to change the internal The random seed that the randomized data in the buffer 121 should use. Among the above at least one set of additional commands, the commands {0x00, 0x05, 0xE0} and {0x85} can be regarded as random data output commands and random data input commands, respectively, for performing a random data output operation and a random data input operation. Thus, the memory controller 110 can execute the commands {0x00, 0x05, 0xE0} and {0x85} multiple times to modify the random seed by alternately performing multiple random data output operations and multiple random data input operations. For example: when the data exchange area has a size of 2 KB, the memory controller 110 can execute the commands {0x00, 0x05, 0xE0} and {0x85} four times for the randomized data of 8 KB size to modify its random seed.

第5圖繪示第4圖所示方法於一實施例中之工作流程300。依據本實施例,記憶體控制器110可從主裝置50接收該系列資料諸如資料{1st-8K, 2nd-8K, 3rd-8K, 4th-8K},以從該系列資料取出一部分作為偶頁資料、以及從該系列資料取出另一部分作為奇頁資料,但本發明不以此為限。FIG. 5 shows the workflow 300 of the method shown in FIG. 4 in an embodiment. According to this embodiment, the memory controller 110 can receive the series of data such as data {1st-8K, 2nd-8K, 3rd-8K, 4th-8K} from the host device 50, and take a part of the series of data as even-page data And take out another part from the series of data as odd page data, but the invention is not limited to this.

於步驟S30中,記憶體控制器110可將該偶頁資料中之第一局部(partial)資料(諸如資料1st-8K)寫入至非揮發性記憶體120(例如:屬於快取區塊230之區塊231)。In step S30, the memory controller 110 can write the first partial data (such as data 1st-8K) of the even page data to the non-volatile memory 120 (for example, belonging to the cache block 230). Block 231).

於步驟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 memory controller 110 may transmit a first group of commands without the confirmation command (such as command {0x10}) (for example, the first group of commands mentioned above, such as the command {0x80, Child_Addr(0) ), DATA(0), 0x11, 0x80, Child_Addr(1), DATA(1)}) to the non-volatile memory 120 to store the first partial data (such as data 1st-8K) and the even page data The second partial data (such as data 2nd-8K) is written into the internal buffer 121 in the non-volatile memory 120, wherein the confirmation command can be used to trigger the non-volatile memory 120 to execute at least one command, such as the aforementioned at least one data Write at least a part (such as part or all) of the command to write at least one non-volatile memory device in the non-volatile memory 120 (such as non-volatile memory devices 122-1, 122-2, ... and 122). -N at least one) to perform programming operations. For example, the first set of commands may indicate that the non-volatile memory 120 should write the first partial data and the second partial data to a sub-area of the non-volatile memory 120 through the multi-level cell writing mode A block, such as the block 223 belonging to the sub-block 220.

於步驟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 memory controller 110 may send at least one set of additional commands (for example, the aforementioned at least one set of additional commands, such as commands {0x00, 0x05, 0xE0} and {0x85}) to the non-volatile memory 120 to adjust the random seed through the at least one set of additional commands to ensure the correctness of the written data in the non-volatile memory 120 and/ Or readability. According to this embodiment, through data exchange between the data exchange area 116B and the internal buffer 121, the memory controller 110 can modify the random seed of at least a part of the data in the internal buffer 121.

於步驟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 memory controller 110 may transmit a second set of commands (for example, the above-mentioned second set of commands, such as commands {0xDA, 0x85, Cache_Addr(0), 0x11, 0x85, Cache_Addr(1)}) And the confirmation command (such as command {0x10}) to the non-volatile memory 120 to write the first partial data and the second partial data to a cache block of the non-volatile memory 120, such as The block 231 belongs to the cache block 230. For example, the second set of commands may indicate that the non-volatile memory 120 should write the first partial data and the second partial data to the cache block through the single-stage cell write mode. According to this embodiment, the at least one command may include the second set of commands, and the confirmation command triggers the non-volatile memory 120 to execute the second set of commands, wherein the second set of commands can replace at least one of the first set of commands A part (for example, a part or all), and can be regarded as an update command of the first group of commands. For example, the memory controller 110 does not need to retransmit certain data (such as DATA(0) and DATA(1)) to the non-volatile memory 120, but the invention is not limited to this. In addition, the first group of instructions and the second group of instructions respectively correspond to different target writing positions. For example: by transmitting the second set of commands, the memory controller 110 can replace a first target write location (such as the first location) specified by the first set of commands with one specified by the second set of commands The second target writing position (such as the second position). The memory controller 110 can modify the random seed of the at least part of the data in the internal buffer 121 to match the second target writing position.

於步驟S38中,記憶體控制器110可將該奇頁資料中之第三局部資料(諸如資料3rd-8K)寫入至非揮發性記憶體120(例如:屬於快取區塊230之區塊231)。In step S38, the memory controller 110 can write the third partial data (such as data 3rd-8K) in the odd page data to the non-volatile memory 120 (for example, a block belonging to the cache block 230). 231).

於步驟S40中,記憶體控制器110可檢查該奇頁資料是否已被完整地收到,尤其可檢查該第三局部資料(諸如資料3rd-8K)與該奇頁資料中之第四局部資料(諸如資料4th-8K)是否都已被收到,其中該奇頁資料是否已被完整地收到可對應於該第三局部資料(諸如資料3rd-8K)與該第四局部資料(諸如資料4th-8K)是否都已被收到。例如:記憶體控制器110可檢查該第四局部資料(諸如資料4th-8K)是否已被收到,以判斷該奇頁資料是否已被完整地收到。當該奇頁資料已被完整地收到時(例如:該第四局部資料(諸如資料4th-8K)已被收到),進入步驟S42;否則,工作流程300結束,但本發明不限於此。In step S40, the memory controller 110 can check whether the odd page data has been completely received, especially the third partial data (such as data 3rd-8K) and the fourth partial data in the odd page data (Such as data 4th-8K) have been received, and whether the odd page data has been completely received can correspond to the third partial data (such as data 3rd-8K) and the fourth partial data (such as data 4th-8K) have all been received. For example, the memory controller 110 can check whether the fourth partial data (such as data 4th-8K) has been received to determine whether the odd page data has been received completely. When the odd page data has been completely received (for example, the fourth partial data (such as data 4th-8K) has been received), go to step S42; otherwise, the workflow 300 ends, but the present invention is not limited to this .

於步驟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 memory controller 110 may send the at least one set of additional commands (such as commands {0x00, 0x05, 0xE0} and { 0x85}) to the non-volatile memory 120 to adjust the random seed through the at least one additional set of commands to ensure the correctness and/or readability of the data written in the non-volatile memory 120.

於步驟S44中,記憶體控制器110可將該第一局部資料(諸如資料1st-8K)與該第二局部資料(諸如資料2nd-8K)寫入至該子區塊(諸如區塊223)的一偶頁,且將該第三局部資料(諸如資料3rd-8K)與該第四局部資料(諸如資料4th-8K)寫入至該子區塊(諸如區塊223)的一奇頁,其中該奇頁是該偶頁的下一頁。In step S44, the memory controller 110 may write the first partial data (such as data 1st-8K) and the second partial data (such as data 2nd-8K) into the sub-block (such as block 223) And write the third partial data (such as data 3rd-8K) and the fourth partial data (such as data 4th-8K) to an odd page of the sub-block (such as block 223), The odd page is the next page of the even page.

由於有效的偶頁資料(諸如資料{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 block 223, the memory controller 110 can have excellent write performance and can avoid additional tasks (such as garbage collection operations). For the sake of brevity, the content of this embodiment similar to the foregoing embodiment will not be repeated here. The foregoing descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made in accordance with the scope of the patent application of the present invention shall fall within the scope of the present invention.

50‧‧‧主裝置 100‧‧‧記憶裝置 110‧‧‧記憶體控制器 112‧‧‧微處理器 112C‧‧‧程式碼 112M‧‧‧唯讀記憶體 114‧‧‧控制邏輯電路 116‧‧‧緩衝記憶體 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)

一種用來於一記憶裝置中進行寫入管理之方法,該記憶裝置包含一非揮發性記憶體(non-volatile memory, NV memory),該非揮發性記憶體包含一或多個非揮發性記憶體元件(NV memory element),該一或多個非揮發性記憶體元件中之任一者包含多個區塊(block),該多個區塊中之任一者包含多頁,該方法包含有: 利用該記憶裝置之一緩衝記憶體中之一緩衝區緩衝從一主裝置(host device)所接收之一系列資料,其中該系列資料中之一第一組片段與一第二組片段係分別用來作為偶頁資料與奇頁資料; 將該偶頁資料中之第一局部(partial)資料寫入至該非揮發性記憶體,其中該第一局部資料包含該第一組片段中之至少一第一片段; 傳送一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器(internal buffer),而不觸發該非揮發性記憶體對該非揮發性記憶體中之任何非揮發性記憶體元件進行任何編程(programming)運作,其中該第二局部資料包含該第一組片段中之至少一第二片段; 傳送一第二組指令與一確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該確認指令觸發該非揮發性記憶體執行該第二組指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行對應的編程運作; 將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體,其中該第三局部資料包含該第二組片段中之至少一第三片段;以及 將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁,其中該第四局部資料包含該第二組片段中之至少一第四片段。A method for writing management in a memory device, the memory device including a non-volatile memory (non-volatile memory, NV memory), the non-volatile memory including one or more non-volatile memory Element (NV memory element), any one of the one or more non-volatile memory elements includes multiple blocks, and any one of the multiple blocks includes multiple pages, the method includes : Use a buffer in a buffer memory of the memory device to buffer a series of data received from a host device, wherein a first set of fragments and a second set of fragments in the series of data are used respectively To be used as even page data and odd page data; Writing first partial (partial) data in the even page data to the non-volatile memory, wherein the first partial data includes at least one first segment in the first set of segments; Send a first set of commands to the non-volatile memory to write the first partial data and the second partial data of the even page data into an internal buffer in the non-volatile memory, and Does not trigger the non-volatile memory to perform any programming operation on any non-volatile memory element in the non-volatile memory, wherein the second partial data includes at least one second segment in the first set of segments; A second set of commands and a confirmation command are sent 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 confirmation command triggers the non-volatile memory The volatile memory executes the second set of commands to perform a corresponding programming operation on at least one non-volatile memory element in the non-volatile memory; Writing the third partial data in the odd page data to the non-volatile memory, wherein the third partial data includes at least one third segment in the second set of segments; and Write the first partial data and the second partial data to an even page of another block in the non-volatile memory, and write the third partial data and the fourth partial data of the odd page data Enter an odd page of the other block, where the fourth partial data includes at least one fourth segment in the second group of segments. 如申請專利範圍第1項所述之方法,其中於該系列資料中,該第二組片段是該第一組片段之後續片段。The method described in claim 1, wherein in the series of data, the second set of fragments are subsequent fragments of the first set of fragments. 如申請專利範圍第1項所述之方法,其中於該第一組片段中,該至少一第二片段是該至少一第一片段之至少一後續片段;以及於該第二組片段中,該至少一第四片段是該至少一第三片段之至少一後續片段。The method according to claim 1, wherein in the first set of fragments, the at least one second fragment is at least one subsequent fragment of the at least one first fragment; and in the second set of fragments, the The at least one fourth segment is at least one subsequent segment of the at least one third segment. 如申請專利範圍第1項所述之方法,其中該第一組片段與該第二組片段中之每一片段的大小不大於該緩衝區的大小之一半。According to the method described in claim 1, wherein the size of each of the first group of segments and the second group of segments is not greater than half of the size of the buffer. 如申請專利範圍第1項所述之方法,其中該區塊與該另一區塊分別屬於不同類型的區塊。The method described in item 1 of the scope of patent application, wherein the block and the other block are of different types. 如申請專利範圍第5項所述之方法,其中該區塊代表一快取(cache)區塊,且該另一區塊代表一子(child)區塊。The method described in item 5 of the scope of patent application, wherein the block represents a cache block, and the other block represents a child block. 如申請專利範圍第1項所述之方法,其中該第一組指令所指定之一目標寫入位置位於該另一區塊。In the method described in claim 1, wherein a target writing location specified by the first set of instructions is located in the other block. 如申請專利範圍第1項所述之方法,其中該記憶裝置包含位於該非揮發性記憶體以外之一控制器,且該控制器包含該緩衝記憶體,其中該緩衝記憶體中之該緩衝區的大小等於一頁的大小。The method described in claim 1, wherein the memory device includes a controller located outside the non-volatile memory, and the controller includes the buffer memory, wherein the buffer memory in the buffer memory The size is equal to the size of a page. 一種記憶裝置,包含有: 一非揮發性記憶體(non-volatile memory, NV memory),用來儲存資訊,其中該非揮發性記憶體包含一或多個非揮發性記憶體元件(NV memory element),該一或多個非揮發性記憶體元件中之任一者包含多個區塊(block),且該多個區塊中之任一者包含多頁;以及 一控制器,耦接至該非揮發性記憶體,用來控制該記憶裝置之運作,其中該控制器包含: 一緩衝記憶體,用來暫時地儲存資訊;以及 一處理電路,用來依據來自一主裝置(host device)的複數個主裝置指令(host command)控制該控制器,以容許該主裝置透過該控制器存取(access)該非揮發性記憶體,其中: 該控制器利用該緩衝記憶體中之一緩衝區緩衝從該主裝置所接收之一系列資料,其中該系列資料中之一第一組片段與一第二組片段係分別用來作為偶頁資料與奇頁資料; 該控制器將該偶頁資料中之第一局部(partial)資料寫入至該非揮發性記憶體,其中該第一局部資料包含該第一組片段中之至少一第一片段; 該控制器傳送一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器(internal buffer),而不觸發該非揮發性記憶體對該非揮發性記憶體中之任何非揮發性記憶體元件進行任何編程(programming)運作,其中該第二局部資料包含該第一組片段中之至少一第二片段; 該控制器傳送一第二組指令與一確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該確認指令觸發該非揮發性記憶體執行該第二組指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行對應的編程運作; 該控制器將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體,其中該第三局部資料包含該第二組片段中之至少一第三片段;以及 該控制器將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁,其中該第四局部資料包含該第二組片段中之至少一第四片段。A memory device including: A non-volatile memory (NV memory) is used to store information, where the non-volatile memory includes one or more non-volatile memory elements (NV memory element), and the one or more non-volatile memory elements Any one of the volatile memory elements 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, wherein the controller includes: A buffer memory for temporarily storing information; and A processing circuit for controlling the controller according to a plurality of host commands from a host device to allow the host device to access the non-volatile memory through the controller, among them: The controller uses a buffer in the buffer memory to buffer a series of data received from the host device, wherein a first set of fragments and a second set of fragments in the series of data are respectively used as even page data And odd page information; The controller writes first partial (partial) data in the even page data to the non-volatile memory, wherein the first partial data includes at least one first segment in the first set of segments; The controller sends a first set of commands to the non-volatile memory to write the first partial data and the second partial data in the even page data into an internal buffer in the non-volatile memory. ) Without triggering the non-volatile memory to perform any programming operation on any non-volatile memory element in the non-volatile memory, wherein the second partial data includes at least one of the first set of segments Two fragments The controller sends a second set of commands and a 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 confirmation The instruction triggers the non-volatile memory to execute the second set of instructions to perform a corresponding programming operation on at least one non-volatile memory element in the non-volatile memory; The controller writes the third partial data in the odd page data to the non-volatile memory, wherein the third partial data includes at least one third segment in the second set of segments; and The controller writes the first partial data and the second partial data to an even page of another block in the non-volatile memory, and the third partial data and the fourth of the odd page data The partial data is written to an odd page of the other block, wherein the fourth partial data includes at least one fourth segment in the second group of segments. 一種記憶裝置之控制器,該記憶裝置包含該控制器與一非揮發性記憶體(non-volatile memory, NV memory),該非揮發性記憶體包含一或多個非揮發性記憶體元件(NV memory element),該一或多個非揮發性記憶體元件中之任一者包含多個區塊(block),該多個區塊中之任一者包含多頁,該控制器包含有: 一緩衝記憶體,用來暫時地儲存資訊;以及 一處理電路,用來依據來自一主裝置(host device)的複數個主裝置指令(host command)控制該控制器,以容許該主裝置透過該控制器存取(access)該非揮發性記憶體,其中: 該控制器利用該緩衝記憶體中之一緩衝區緩衝從該主裝置所接收之一系列資料,其中該系列資料中之一第一組片段與一第二組片段係分別用來作為偶頁資料與奇頁資料; 該控制器將該偶頁資料中之第一局部(partial)資料寫入至該非揮發性記憶體,其中該第一局部資料包含該第一組片段中之至少一第一片段; 該控制器傳送一第一組指令至該非揮發性記憶體,以將該第一局部資料以及該偶頁資料中之第二局部資料寫入該非揮發性記憶體中之一內部緩衝器(internal buffer),而不觸發該非揮發性記憶體對該非揮發性記憶體中之任何非揮發性記憶體元件進行任何編程(programming)運作,其中該第二局部資料包含該第一組片段中之至少一第二片段; 該控制器傳送一第二組指令與一確認指令至該非揮發性記憶體,以將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之一區塊,其中該確認指令觸發該非揮發性記憶體執行該第二組指令以對該非揮發性記憶體中之至少一非揮發性記憶體元件進行對應的編程運作; 該控制器將該奇頁資料中之第三局部資料寫入至該非揮發性記憶體,其中該第三局部資料包含該第二組片段中之至少一第三片段;以及 該控制器將該第一局部資料與該第二局部資料寫入至該非揮發性記憶體中之另一區塊的一偶頁,且將該第三局部資料與該奇頁資料中之第四局部資料寫入至該另一區塊的一奇頁,其中該第四局部資料包含該第二組片段中之至少一第四片段。A controller for a memory device. The memory device includes the controller and a non-volatile memory (NV memory). The non-volatile memory includes one or more non-volatile memory devices (NV memory). element), any one of the one or more non-volatile memory elements includes multiple blocks, any one of the multiple blocks includes multiple pages, and the controller includes: A buffer memory for temporarily storing information; and A processing circuit for controlling the controller according to a plurality of host commands from a host device to allow the host device to access the non-volatile memory through the controller, among them: The controller uses a buffer in the buffer memory to buffer a series of data received from the host device, wherein a first set of fragments and a second set of fragments in the series of data are respectively used as even page data And odd page information; The controller writes first partial (partial) data in the even page data to the non-volatile memory, wherein the first partial data includes at least one first segment in the first set of segments; The controller sends a first set of commands to the non-volatile memory to write the first partial data and the second partial data in the even page data into an internal buffer in the non-volatile memory. ) Without triggering the non-volatile memory to perform any programming operation on any non-volatile memory element in the non-volatile memory, wherein the second partial data includes at least one of the first set of segments Two fragments The controller sends a second set of commands and a 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 confirmation The instruction triggers the non-volatile memory to execute the second set of instructions to perform a corresponding programming operation on at least one non-volatile memory element in the non-volatile memory; The controller writes the third partial data in the odd page data to the non-volatile memory, wherein the third partial data includes at least one third segment in the second set of segments; and The controller writes the first partial data and the second partial data to an even page of another block in the non-volatile memory, and the third partial data and the fourth of the odd page data The partial data is written to an odd page of the other block, wherein the fourth partial data includes at least one fourth segment in the second group of segments.
TW108111650A 2018-01-26 2018-01-26 Method for performing writing management in a memory device, and associated memory device and controller thereof TWI709855B (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (11)

* Cited by examiner, † Cited by third party
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