TWI606458B - Operation method of non-volatile memory device - Google Patents

Operation method of non-volatile memory device Download PDF

Info

Publication number
TWI606458B
TWI606458B TW104138238A TW104138238A TWI606458B TW I606458 B TWI606458 B TW I606458B TW 104138238 A TW104138238 A TW 104138238A TW 104138238 A TW104138238 A TW 104138238A TW I606458 B TWI606458 B TW I606458B
Authority
TW
Taiwan
Prior art keywords
data
volatile memory
physical
physical block
memory cell
Prior art date
Application number
TW104138238A
Other languages
Chinese (zh)
Other versions
TW201611035A (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 TW104138238A priority Critical patent/TWI606458B/en
Publication of TW201611035A publication Critical patent/TW201611035A/en
Application granted granted Critical
Publication of TWI606458B publication Critical patent/TWI606458B/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Description

非揮發性記憶體裝置的操作方法 Non-volatile memory device operation method

本發明是有關於一種操作方法,且特別是有關於一種非揮發性記憶體裝置的操作方法。 This invention relates to an operational method and, more particularly, to a method of operation of a non-volatile memory device.

一般使用反及快閃(NAND flash)記憶體做為資料儲存媒介的硬碟,例如固態硬碟(solid state disk,SSD)、嵌入式快閃記憶卡(Embedded MultiMediaCard,eMMC)或行動硬碟等,通常包括多個實體塊(block),且每一個實體塊會包括多個頁面(page)。由於一個被寫滿的實體塊在被抹除之前無法重複地再被寫入資料,因此當一個主機要更新實體塊中的資料時,則會先將新資料寫入至另一個未被寫滿的實體塊(暫存區塊)。此另一個實體塊會儲存有效資料,而原先的實體塊中儲存的待更新的資料(原始資料)則會被無效化並留存於原本的實體塊中。因此,當暫存區塊的空間已不夠用時,這反及快閃記憶體便需要對原始資料與新資料進行重整。 Generally, a NAND flash memory is used as a data storage medium, such as a solid state disk (SSD), an embedded multi-media card (eMMC), or a mobile hard disk. It usually includes multiple physical blocks, and each physical block will include multiple pages. Since a filled physical block cannot be repeatedly written to the data before being erased, when a host wants to update the data in the physical block, it will first write the new data to another one that is not full. Physical block (temporary block). This other entity block will store the valid data, and the data (original data) to be updated stored in the original entity block will be invalidated and retained in the original physical block. Therefore, when the space of the temporary storage block is not enough, the reverse flash memory needs to be reconstructed from the original data and the new data.

重整是將一個或是多個實體塊上的有效資料搬移或複製 至一個備用的實體塊,藉以讓一個被寫滿有效及無效資料的實體塊可以被抹除並於之後用以儲存其他資料。所述重整操作為本領域之技術人員所熟知,故不再贅述。然而,當這些實體塊被重整時,倘若有斷電事件發生,則這備用的實體塊中可能會有已被寫入重整資料卻尚未完成重整操作的頁面,而這些頁面可能因此斷電事件而造成資料損毀或錯誤。因此若實體塊被重整時有斷電事件發生,則硬碟可能會損失部份的資料。 Reorganization is the process of moving or copying valid data on one or more physical blocks. To an alternate physical block, so that a physical block filled with valid and invalid data can be erased and used to store other data. The reforming operation is well known to those skilled in the art and will not be described again. However, when these physical blocks are reorganized, if there is a power outage event, there may be pages in the spare physical block that have been written to the reorganization data but have not completed the reorganization operation, and these pages may be broken. Data corruption or error caused by electrical events. Therefore, if there is a power outage event when the physical block is reformed, the hard disk may lose some of the data.

另一方面,一般來說,硬碟(如:固態硬碟、eMMC等)在使用時,需要使用信息表來記錄邏輯位址至實體位址的映射關係。而在不斷執行主機的眾多資料存取指令或者重整指令的過程中,由於邏輯位址與實體位址之對應關係可被對應地改變,因此信息表的內容可被不斷地更新。然而,隨著固態硬碟所寫入的資料增多,信息表所記錄的內容也會隨著增加。因此,傳統固態硬碟需要使用非常大的儲存空間來放置此信息表。 On the other hand, in general, hard disks (such as solid state drives, eMMC, etc.) need to use an information table to record the mapping relationship between logical addresses and physical addresses. In the process of continuously executing a plurality of data access instructions or reorganization instructions of the host, since the correspondence between the logical address and the physical address can be correspondingly changed, the content of the information table can be continuously updated. However, as the amount of data written by the SSD increases, so does the content recorded on the information sheet. Therefore, traditional solid state drives require very large storage space to place this information sheet.

此外,上述的硬碟可能具有單層記憶胞(Single Level Cell,SLC)NAND型快閃記憶體、多層記憶胞(Multi Level Cell,MLC)NAND型快閃記憶體、三層記憶胞(Triple Level Cell,TLC)NAND型快閃記憶體或其他型快閃記憶體。其中,三層記憶胞快閃記憶體具有較高的位元錯誤率。 In addition, the above-mentioned hard disk may have a single level cell (SLC) NAND type flash memory, a multi-level cell (MLC) NAND type flash memory, and a three-layer memory cell (Triple Level). Cell, TLC) NAND flash memory or other type of flash memory. Among them, the three-layer memory cell flash memory has a higher bit error rate.

本發明提供一種非揮發性記憶體裝置的操作方法,其可 兼顧資料寫入的正確性以及資料寫入速度。 The invention provides a method for operating a non-volatile memory device, which can Take into account the correctness of data writing and data writing speed.

本發明實施例另提出一種非揮發性記憶體裝置的操作方法,其中非揮發性記憶體裝置的非揮發性記憶體模組包括多個操作於單層記憶胞模式的實體塊以及多個操作於三層記憶胞模式的實體塊。此操作方法包括:將資料寫入所述操作於單層記憶胞模式的實體塊其中之一;當在非揮發性記憶體模組內所述操作於單層記憶胞模式的實體塊之中的三個實體塊的所有頁面均被使用時,依據一條件而決定對所述三個實體塊進行內部重整或是外部重整,以將所述三個實體塊的資料重整至操作於三層記憶胞模式的該些實體塊中的擇定實體塊。 The embodiment of the present invention further provides a method for operating a non-volatile memory device, wherein the non-volatile memory module of the non-volatile memory device includes a plurality of physical blocks operating in a single-layer memory cell mode and a plurality of operations. A solid block of three-layer memory cell mode. The method includes: writing data to one of the physical blocks operating in the single-layer memory cell mode; and operating the physical block in the single-layer memory cell mode in the non-volatile memory module When all the pages of the three physical blocks are used, it is decided to perform internal or external re-construction on the three physical blocks according to a condition to reform the data of the three physical blocks to operate in three A selected physical block of the plurality of physical blocks of the layer memory cell mode.

基於上述,非揮發性記憶體模組可選擇透過外部的記憶體控制器來對寫入操作於三層記憶胞模式的實體塊的資料進行糾錯,或者選擇直接透過非揮發性記憶體模組內部的控制電路將資料進行重整,藉以兼顧資料寫入的正確性以及資料寫入速度。 Based on the above, the non-volatile memory module can select an external memory controller to correct the data of the physical block written in the three-layer memory mode, or directly through the non-volatile memory module. The internal control circuit reorganizes the data to take into account the correctness of data writing and the speed of data writing.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.

100‧‧‧非揮發性記憶體裝置 100‧‧‧Non-volatile memory device

10‧‧‧主機 10‧‧‧Host

110‧‧‧記憶體控制器 110‧‧‧ memory controller

120‧‧‧非揮發性記憶體模組 120‧‧‧Non-volatile memory module

122、124‧‧‧實體塊 122, 124‧‧‧ physical blocks

122p、124p‧‧‧頁面 122p, 124p‧‧‧ page

202‧‧‧微處理單元 202‧‧‧Microprocessing unit

204‧‧‧主機介面 204‧‧‧Host interface

206‧‧‧記憶體介面 206‧‧‧ memory interface

208‧‧‧緩衝記憶體 208‧‧‧buffer memory

210‧‧‧錯誤檢查與校正單元 210‧‧‧Error checking and correction unit

D0‧‧‧第一重整資料 D0‧‧‧First reorganization data

D1‧‧‧重整資料 D1‧‧‧Reorganization data

D2‧‧‧第二重整資料 D2‧‧‧Second reorganization

P1-0~P1-(x+1)、P2-0~P2-y‧‧‧頁面 P1-0~P1-(x+1), P2-0~P2-y‧‧‧ page

n1、n1+1~n1+4、n1、n2、n3、n4、n5‧‧‧邏輯頁位址 N1, n1+1~n1+4, n1, n2, n3, n4, n5‧‧‧ logical page address

m1、m2、m3、m4、m5‧‧‧實體塊位址 M1, m2, m3, m4, m5‧‧‧ physical block addresses

k1、k1+1~k1+4、k2、k3、k4、k5‧‧‧實體頁位址 K1, k1+1~k1+4, k2, k3, k4, k5‧‧‧ physical page address

S302~S308‧‧‧非揮發性記憶體裝置的操作方法各步驟 S302~S308‧‧‧ Non-volatile memory device operation method steps

S602~S608、S801~S806‧‧‧操作方法各步驟 S602~S608, S801~S806‧‧‧ steps of operation method

圖1是依照本發明之一實施例所繪示的非揮發性記憶體裝置的方塊示意圖。 1 is a block diagram of a non-volatile memory device in accordance with an embodiment of the invention.

圖2是依照本發明之一實施例所繪示圖1的記憶體控制器的 方塊示意圖。 2 is a diagram of the memory controller of FIG. 1 according to an embodiment of the invention. Block diagram.

圖3是依照本發明一實施例所繪示的非揮發性記憶體裝置的操作方法流程示意圖。 FIG. 3 is a flow chart showing an operation method of a non-volatile memory device according to an embodiment of the invention.

圖4與5A至圖5D為說明非揮發性記憶體裝置進行重整的示意圖。 4 and 5A to 5D are schematic views illustrating the reforming of the non-volatile memory device.

圖6是依照本發明一實施例所繪示的非揮發性記憶體裝置的操作方法流程示意圖。 FIG. 6 is a flow chart showing an operation method of a non-volatile memory device according to an embodiment of the invention.

圖7A是依照本發明一實施例所繪示的第一重整資料的邏輯位址資訊與實體位址資訊的示意圖。 FIG. 7A is a schematic diagram of logical address information and physical address information of a first reformed data according to an embodiment of the invention.

圖7B是依照本發明一實施例所繪示的執行長度映射表的示意圖。 FIG. 7B is a schematic diagram of an execution length mapping table according to an embodiment of the invention.

圖7C是依照本發明一實施例所繪示的頁映射表的示意圖。 FIG. 7C is a schematic diagram of a page mapping table according to an embodiment of the invention.

圖8是依照本發明一實施例所繪示的操作方法流程示意圖。 FIG. 8 is a schematic flow chart of an operation method according to an embodiment of the invention.

圖1是依照本發明之一實施例所繪示的非揮發性記憶體裝置的方塊示意圖。請參照圖1,非揮發性記憶體裝置100例如是以快閃記憶體(flash memory)作為儲存媒介的快閃記憶體儲存裝置,例如固態硬碟(Solid State Disk,SSD)、嵌入式快閃記憶卡(Embedded MultiMediaCard,eMMC)或行動硬碟等硬碟。在一些應用情境中,非揮發性記憶體裝置100可做為儲存放置各種快取資料(cache data)的快取空間(cache space)。在另一些應用情 境中,非揮發性記憶體裝置100可做為大容量儲存設備(mass storage device)。此外,本實施例的非揮發性記憶體裝置100可耦接於主機10,以供主機10存取資料,其中主機10可以是個人電腦、筆記型電腦、平板電腦、智慧型手機或是其他計算平台/裝置。非揮發性記憶體裝置100可設置於主機10的內部,並與主機10電性連接。或者,非揮發性記憶體裝置100也可以利用外接的方式與主機10電性連接,例如,透過通用序列匯流排(Universal Serial Bus,USB)等各式匯流排與主機10電性連接等等,本實施例不對其加以限制。 1 is a block diagram of a non-volatile memory device in accordance with an embodiment of the invention. Referring to FIG. 1, the non-volatile memory device 100 is, for example, a flash memory storage device using a flash memory as a storage medium, such as a solid state disk (SSD), embedded flash. A hard disk such as an Embedded MultiMediaCard (eMMC) or a mobile hard disk. In some application scenarios, the non-volatile memory device 100 can be used as a cache space for storing various cache data. In other applications In the meantime, the non-volatile memory device 100 can be used as a mass storage device. In addition, the non-volatile memory device 100 of the embodiment can be coupled to the host 10 for accessing data by the host 10. The host 10 can be a personal computer, a notebook computer, a tablet computer, a smart phone, or other computing device. Platform/device. The non-volatile memory device 100 can be disposed inside the host 10 and electrically connected to the host 10. Alternatively, the non-volatile memory device 100 can be electrically connected to the host 10 by means of an external connection, for example, electrically connected to the host 10 through various bus bars such as a universal serial bus (USB). This embodiment does not limit it.

非揮發性記憶體裝置100包括一個記憶體控制器110以及一或多個非揮發性記憶體模組120,其中記憶體控制器110耦接於非揮發性記憶體模組120。本實施例並不限制非揮發性記憶體模組120的數量。記憶體控制器110可以用硬體型式或韌體型式實作之。例如,記憶體控制器110可能包括多個邏輯閘。記憶體控制器110可根據主機10所下達的指令在非揮發性記憶體模組120中進行資料的寫入、讀取、抹除、重整與/或其他運作。 The non-volatile memory device 100 includes a memory controller 110 and one or more non-volatile memory modules 120. The memory controller 110 is coupled to the non-volatile memory module 120. This embodiment does not limit the number of non-volatile memory modules 120. The memory controller 110 can be implemented in a hard type or a firmware type. For example, memory controller 110 may include multiple logic gates. The memory controller 110 can perform data writing, reading, erasing, reforming, and/or other operations in the non-volatile memory module 120 according to instructions issued by the host 10.

非揮發性記憶體模組120具有至少一實體塊以儲存主機10所寫入的資料。為了方便說明,在此以非揮發性記憶體模組120所包括的第一實體塊122與第二實體塊124為例,但本實施例並不限制實體塊的數量。詳細而言,第一實體塊122具有至少一頁面122p。第二實體塊124具有至少一頁面124p,其中屬於同一個實體塊的不同頁面可被獨立地寫入,且屬於同一個實體塊的所有 頁面可以被同時地抹除。舉例而言,每一實體塊可由128個頁面所組成,但不限於此。在其他實施例中,每一實體塊也可由64個頁面、256個頁面或其他任意個頁面所組成。在本實施例中,非揮發性記憶體模組120例如是單層記憶胞(Single Level Cell,SLC)NAND型快閃記憶體、多層記憶胞(Multi Level Cell,MLC)NAND型快閃記憶體、三層記憶胞(Triple Level Cell,TLC)NAND型快閃記憶體或其他類型快閃記憶體。其中,SLC NAND型快閃記憶體的每個記憶胞可儲存1個位元的資料,MLC NAND型快閃記憶體的每個記憶胞可儲存2個位元的資料,而TLC NAND型快閃記憶體的每個記憶胞可儲存3個位元的資料。 The non-volatile memory module 120 has at least one physical block to store data written by the host 10. For convenience of description, the first physical block 122 and the second physical block 124 included in the non-volatile memory module 120 are taken as an example, but the embodiment does not limit the number of physical blocks. In detail, the first physical block 122 has at least one page 122p. The second entity block 124 has at least one page 124p, wherein different pages belonging to the same entity block can be written independently and belong to all of the same physical block Pages can be erased at the same time. For example, each physical block may be composed of 128 pages, but is not limited thereto. In other embodiments, each physical block may also consist of 64 pages, 256 pages, or any other page. In this embodiment, the non-volatile memory module 120 is, for example, a single-level memory cell (SLC) NAND flash memory or a multi-level cell (MLC) NAND flash memory. , Triple-level memory (TLC) NAND flash memory or other types of flash memory. Among them, each memory cell of the SLC NAND type flash memory can store 1 bit of data, and each memory cell of the MLC NAND type flash memory can store 2 bits of data, while the TLC NAND type flashes. Each memory cell of the memory can store 3 bits of data.

圖2是依照本發明之一實施例所繪示圖1的記憶體控制器110的方塊示意圖。請同時參照圖1與圖2,記憶體控制器110包括微處理單元202、主機介面204、記憶體介面206、緩衝記憶體208以及錯誤檢查與校正單元210。 FIG. 2 is a block diagram of the memory controller 110 of FIG. 1 according to an embodiment of the invention. Referring to FIG. 1 and FIG. 2 simultaneously, the memory controller 110 includes a micro processing unit 202, a host interface 204, a memory interface 206, a buffer memory 208, and an error checking and correcting unit 210.

微處理單元202用以控制記憶體控制器110的整體運作。例如,微處理單元202可以控制記憶體控制器110以執行本實施例的操作方法(容後詳述),來對非揮發性記憶體裝置100中的非揮發性記憶體模組120進行重整,或者將資料寫入非揮發性記憶體模組120中。此外,記憶體控制器110會維護一個或多個邏輯轉實體位址(logical to physical address)的信息表(或稱為位址映射表),以記錄資料在主機10的邏輯位址與在非揮發性記憶體模組120中實體位址的映射關係。藉此,當主機10欲存取某 一邏輯位址時,微處理單元202便可根據所述信息表取得對應的實體位址,並於非揮發性記憶體模組120中的所述實體位址上存取資料。 The micro processing unit 202 is used to control the overall operation of the memory controller 110. For example, the micro processing unit 202 can control the memory controller 110 to perform the operation method of the embodiment (described in detail later) to reform the non-volatile memory module 120 in the non-volatile memory device 100. Or write the data into the non-volatile memory module 120. In addition, the memory controller 110 maintains one or more logical to physical address information tables (or address mapping tables) to record the logical address and presence of the data on the host 10. The mapping relationship of physical addresses in the volatile memory module 120. Thereby, when the host 10 wants to access a certain When a logical address is obtained, the micro processing unit 202 can obtain a corresponding physical address according to the information table, and access the data on the physical address in the non-volatile memory module 120.

主機介面204是耦接於微處理單元202,並且用以接收主機10所傳送的指令與資料。也就是說,主機10所傳送的指令與資料會透過主機介面204來傳送至微處理單元202。在本實施例中,主機介面204例如是相容於序列先進附件(Serial Advanced Technology Attachment,SATA)標準的介面電路。然而,必須瞭解的是本發明不限於此。例如在其他實施例中,主機介面204亦可以是相容於並列先進附件(Parellel Advanced Technology Attachment,PATA)標準、電氣和電子工程師協會(Institute of Electrical and Electronic Engineers,IEEE)1394標準、高速周邊零件連接介面(Peripheral Component Interconnect Express,PCI Express)標準、通用序列匯流排(Universal Serial Bus,USB)標準、超高速一代(Ultra High Speed-I,UHS-I)介面標準、超高速二代(Ultra High Speed-II,UHS-II)介面標準、安全數位(Secure Digital,SD)介面標準、記憶棒(Memory Stick,MS)介面標準、多媒體儲存卡(Multi Media Card,MMC)介面標準、小型快閃(Compact Flash,CF)介面標準、整合式驅動電子介面(Integrated Device Electronics,IDE)標準或其他適合的資料傳輸標準的介面電路。 The host interface 204 is coupled to the micro processing unit 202 and is configured to receive instructions and data transmitted by the host 10. That is to say, the instructions and data transmitted by the host 10 are transmitted to the micro processing unit 202 through the host interface 204. In this embodiment, the host interface 204 is, for example, an interface circuit compatible with the Serial Advanced Technology Attachment (SATA) standard. However, it must be understood that the invention is not limited thereto. For example, in other embodiments, the host interface 204 may also be compatible with the Parallel Advanced Technology Attachment (PATA) standard, the Institute of Electrical and Electronic Engineers (IEEE) 1394 standard, and high-speed peripheral components. Peripheral Component Interconnect Express (PCI Express) standard, Universal Serial Bus (USB) standard, Ultra High Speed-I (UHS-I) interface standard, Ultra High II (Ultra High) Speed-II, UHS-II) interface standard, Secure Digital (SD) interface standard, Memory Stick (MS) interface standard, Multi Media Card (MMC) interface standard, small flash ( Compact Flash, CF) interface standard, integrated device electronics (IDE) standard or other suitable data transmission standard interface circuit.

記憶體介面206耦接於微處理單元202並且用以存取非 揮發性記憶體模組120。記憶體介面206可以將資料信號轉換為非揮發性記憶體模組120所能接受的格式。也就是說,微處理單元202可以將欲寫入至非揮發性記憶體模組120的資料經由記憶體介面206儲存至非揮發性記憶體模組120中。 The memory interface 206 is coupled to the micro processing unit 202 and used to access the non- Volatile memory module 120. The memory interface 206 can convert the data signals into a format acceptable to the non-volatile memory module 120. That is, the micro processing unit 202 can store the data to be written to the non-volatile memory module 120 to the non-volatile memory module 120 via the memory interface 206.

緩衝記憶體208耦接於微處理單元202並且用以暫存來自於主機10的資料與指令,或是儲存微處理單元202對非揮發性記憶體模組120的管理訊息(例如上述的信息表),或是暫存來自於非揮發性記憶體模組120的資料等。在此,緩衝記憶體208例如是動態隨機存取記憶體(dynamic random access memory,DRAM)、靜態隨機存取記憶體(static random access memory,SRAM)或是其他揮發性記憶體(volatile memory)等。 The buffer memory 208 is coupled to the micro processing unit 202 and used to temporarily store data and instructions from the host 10 or to store management information of the non-volatile memory module 120 by the micro processing unit 202 (for example, the above information table). ), or temporarily storing data from the non-volatile memory module 120. Here, the buffer memory 208 is, for example, a dynamic random access memory (DRAM), a static random access memory (SRAM), or other volatile memory. .

錯誤檢查與校正單元210耦接於微處理單元202並且用以執行錯誤檢查與校正程序以確保資料的正確性。具體來說,當微處理單元202從主機10中接收到寫入指令時,錯誤檢查與校正單元210會為對應此寫入指令的資料產生對應的錯誤檢查與校正碼(Error Checking and Correcting Code,ECC Code),並且微處理單元202會將對應此寫入指令的資料與對應的錯誤檢查與校正碼寫入至非揮發性記憶體模組120中。之後,微處理單元202從非揮發性記憶體模組120中讀取資料時會同時讀取此資料對應的錯誤檢查與校正碼,而錯誤檢查與校正單元210會依據此錯誤檢查與校正碼對所讀取的資料執行錯誤檢查與校正程序。 The error checking and correction unit 210 is coupled to the micro processing unit 202 and is configured to perform error checking and correction procedures to ensure the correctness of the data. Specifically, when the micro processing unit 202 receives a write command from the host 10, the error check and correction unit 210 generates a corresponding error check and correction code (Error Checking and Correcting Code) for the data corresponding to the write command. ECC Code), and the micro processing unit 202 writes the data corresponding to the write command and the corresponding error check and correction code into the non-volatile memory module 120. After that, when the micro processing unit 202 reads the data from the non-volatile memory module 120, the error check and the correction code corresponding to the data are simultaneously read, and the error check and correction unit 210 performs the error check and the correction code pair according to the error check and correction code. The read data performs error checking and calibration procedures.

底下即搭配上述非揮發性記憶體裝置100來說明本實施 例的操作方法各步驟。圖3是依照本發明一實施例所繪示的記憶體裝置100的操作方法流程圖。圖4以及圖5A至圖5D為說明非揮發性記憶體裝置100進行重整的示意圖。請參照圖1、圖3與圖4,於步驟S302,當記憶體控制器110對非揮發性記憶體裝置100進行重整時,記憶體控制器110將已完成重整的第一重整資料寫入第一實體塊122的至少一個頁面122p。例如在圖4中,以標示為P1-0~P1-1的所述頁面122p來存放已完成重整的重整資料D0,而以標示為P1-2~P1-x的所述頁面122p來存放已完成重整的重整資料D1。重整資料D0與D1依序被寫入的所述至少一個頁面122p,其中x為正整數。值得注意的是,對於多層記憶胞(Multi Level Cell,MLC)及三層記憶胞(Triple Level Cell,TLC)NAND型快閃記憶體而言,其具有成對頁面(Pair Page)與多頁面於同一個記憶胞的特性,即一個記憶胞中具有對應的兩個頁面或三個頁面的位元資料。另外,對於同一實體塊而言,這些成對頁面可能是連續或是不連續,其端視不同的設計而定。例如在圖4中,假設標示為P1-x及P1-(x-1)的所述頁面122p對應同一個記憶胞,則此為連續的成對頁面,而假設標示為P1-x及P1-(x-2)的所述頁面122p對應同一個記憶胞,則此為不連續的成對頁面。 The present embodiment is described below with the non-volatile memory device 100 described above. Example of the method of operation. FIG. 3 is a flow chart of an operation method of the memory device 100 according to an embodiment of the invention. 4 and 5A to 5D are schematic views illustrating the reforming of the non-volatile memory device 100. Referring to FIG. 1 , FIG. 3 and FIG. 4 , in step S302 , when the memory controller 110 performs the reforming of the non-volatile memory device 100 , the memory controller 110 converts the first reformed data that has been reconstructed. At least one page 122p of the first physical block 122 is written. For example, in FIG. 4, the reformed data D0 that has been reformed is stored by the page 122p labeled P1-0~P1-1, and the page 122p labeled P1-2~P1-x is used. Stores the reformed data D1 that has been reformed. The at least one page 122p in which the reform data D0 and D1 are sequentially written, where x is a positive integer. It is worth noting that for multi-level cell (MLC) and triple-level memory (TLC) NAND-type flash memory, it has a pair of pages (Pair Page) and multiple pages. The characteristics of the same memory cell, that is, the bit data of a corresponding two pages or three pages in one memory cell. In addition, for the same physical block, these pairs of pages may be continuous or discontinuous, depending on the design. For example, in FIG. 4, it is assumed that the pages 122p labeled P1-x and P1-(x-1) correspond to the same memory cell, and this is a continuous pair of pages, and the hypotheses are labeled P1-x and P1- The page 122p of (x-2) corresponds to the same memory cell, and this is a discontinuous pair of pages.

此外,在本實施例中,若沒有發生斷電事件,則在將重整資料D1寫入圖4中標示為P1-2至P1-x的這些頁面122p之後,記憶體控制器110可從重整資料D1的最後一個頁面122p所接續的頁面,即自標示為P1-(x+1)的這個頁面122p開始,繼續儲存下 一筆重整資料。假設在將所述下一筆重整資料寫入第一實體塊122的過程中發生斷電事件,使得所述下一筆重整資料未能完整寫入第一實體塊122。重新上電後,記憶體控制器110可再一次將所述下一筆重整資料寫入第一實體塊122,以及進行後續資料重整操作。然而,在沒有應用本實施例所述技術的情況下,重新上電後在將所述下一筆重整資料再一次寫入第一實體塊122的過程中,所述下一筆重整資料可能會發生錯誤/逸失。例如所述下一筆重整資料未完整地寫入標示為P1-(x+1)的這個頁面122p便發生斷電事件,則重新上電後記憶體控制器110可根據標示為P1-0至P1-x的這個頁面122p中的對應資訊而判斷出重整資料D1已完整地寫入到標示為P1-x的這個頁面122p。在沒有應用本實施例所述技術的情況下,重新上電後標示為P1-(x+1)的這個頁面122p本身與它的成對頁面(Pair Page)的資料會發生錯誤/逸失。 In addition, in the present embodiment, if the power-off event does not occur, the memory controller 110 may be heavy after writing the reforming data D1 to the pages 122p labeled P1-2 to P1-x in FIG. The page connected to the last page 122p of the entire data D1, that is, starting from the page 122p labeled P1-(x+1), continue to store A reorganization of the information. It is assumed that a power down event occurs during the writing of the next round of reforming data to the first physical block 122, such that the next round of reforming data is not completely written to the first physical block 122. After power-on, the memory controller 110 can once again write the next round of reforming data to the first physical block 122, and perform subsequent data reforming operations. However, in the case that the technology described in this embodiment is not applied, in the process of writing the next piece of reformed data to the first entity block 122 again after power-on, the next piece of reforming data may be An error/loss occurred. For example, if the next reforming data is not completely written to the page 122p labeled P1-(x+1), a power-off event occurs, and after the power is turned back on, the memory controller 110 can be labeled as P1-0. The corresponding information in this page 122p of P1-x determines that the reforming data D1 has been completely written to this page 122p labeled P1-x. In the case where the technique described in this embodiment is not applied, the information of the page 122p itself and its paired page (Pair Page), which is marked as P1-(x+1) after power-on, may be erroneous/escaped.

值得一提的是,記憶體控制器110可提供一個信息表來記錄對應於第一重整資料D0的至少一實體位址信息,其中實體位址信息分別指出第一實體塊122中標示為P1-0~P1-1的所述頁面122p的實體位址。因此,當主機10欲存取第一實體塊122中的重整資料D0時,記憶體控制器110可根據信息表而在第一實體塊122中對重整資料D0進行存取。此外,當記憶體控制器110將已完成重整的重整資料D0寫入第一實體塊122的其中一個頁面122p時,記憶體控制器110可利用一個指標,來記錄目前已寫入已完成重整的重整資料D0的後一個頁面122p的實體位址。其中,指 標例如是被儲存在記憶體控制器110的緩衝記憶體208(繪示於圖2)中,且可根據記憶體控制器110所寫入的實體塊的頁面進行更新,以記錄相同或不同的實體塊中頁面的實體位址。 It is worth mentioning that the memory controller 110 can provide an information table to record at least one physical address information corresponding to the first reformed material D0, wherein the physical address information indicates that the first physical block 122 is labeled as P1. The physical address of the page 122p of -0~P1-1. Therefore, when the host 10 wants to access the reforming material D0 in the first entity block 122, the memory controller 110 can access the reforming material D0 in the first entity block 122 according to the information table. In addition, when the memory controller 110 writes the reformed data D0 that has been reformed into one of the pages 122p of the first physical block 122, the memory controller 110 can use an indicator to record that the current write has been completed. The physical address of the next page 122p of the reorganized data D0. Which refers to For example, the label is stored in the buffer memory 208 (shown in FIG. 2) of the memory controller 110, and can be updated according to the page of the physical block written by the memory controller 110 to record the same or different. The physical address of the page in the entity block.

假設在未進行本發明之步驟S304~S308的情況下,當在斷電事件後再一次供電給非揮發性記憶體裝置100時,非揮發性記憶體裝置100可能會發生重整資料D1錯誤/逸失的問題。所述在未進行步驟S304~S308的情況下發生重整資料D1錯誤/逸失的原因說明如下。 It is assumed that, in the case where the steps S304 to S308 of the present invention are not performed, when the power is supplied to the non-volatile memory device 100 again after the power-off event, the non-volatile memory device 100 may undergo a reform data D1 error/ The problem of loss. The reason why the reforming data D1 error/escape occurs in the case where the steps S304 to S308 are not performed is explained as follows.

舉例來說,如圖4所示,倘若記憶體控制器110將重整資料D1寫入第一實體塊122中標示為P1-x的頁面122p時有一斷電事件發生,使得記憶體控制器110已執行的寫入動作被中斷時,則除了正在寫入的頁面P1-x可能受損之外,也可能會連帶影響同一記憶胞中的其他成對頁面(Pair Page,例如標示為P1-(x-1)或P1-(x-2)的所述頁面122p),而導致一個或多個頁面資料錯誤。換言之,若重整過程中發生斷電事件,則對於MLC NAND型快閃記憶體而言,可能會產生連續或不連續成對頁面的資料錯誤。或者,對於TLC NAND型快閃記憶體而言,則可能會產生連續或不連續的三個頁面的資料錯誤。本發明實施例的步驟S304~S308可以有效防止在斷電與重新上電的過程中重整資料發生錯誤/逸失,以下即搭配圖5A至圖5D來進行說明。 For example, as shown in FIG. 4, if the memory controller 110 writes the reformation data D1 to the page 122p indicated as P1-x in the first physical block 122, a power-off event occurs, so that the memory controller 110 is caused. When the executed write operation is interrupted, in addition to the possible damage to the page P1-x being written, it may also affect other pairs of pages in the same memory cell (Pair Page, for example, labeled P1-( The page 122p) of x-1) or P1-(x-2) results in one or more page material errors. In other words, if a power outage event occurs during the reforming process, data errors of consecutive or discontinuous pairs of pages may occur for MLC NAND type flash memory. Or, for TLC NAND type flash memory, data errors of three consecutive or discontinuous pages may occur. Steps S304 to S308 of the embodiment of the present invention can effectively prevent error/loss of the data in the process of power-off and power-on, and the following description will be made with reference to FIG. 5A to FIG. 5D.

請參照圖5A,記憶體控制器110將資料D0寫入第一實體塊122中標示為P1-0或P1-1的頁面122p,其中資料D0例如為 已完成重整的重整資料。在將資料D0寫入第一實體塊122之後,記憶體控制器110可繼續儲存下一筆重整資料至第一實體塊122。在此將假設在將所述下一筆重整資料寫入第一實體塊122的過程中發生斷電事件,使得所述下一筆重整資料未能完整寫入第一實體塊122。在於斷電事件後再一次供電給非揮發性記憶體裝置100時,如圖5B所示,記憶體控制器110可以進行步驟S304,以從多個自由實體塊選擇一個實體塊(例如第二實體塊124),並對第二實體塊124進行抹除程序。在此,記憶體控制器110例如是抹除第二實體塊124中所儲存的資料。例如,圖5B所繪示的第二實體塊124,表示於斷電事件後再一次供電給非揮發性記憶體裝置100時,第二實體塊124中所儲存的資料已被抹除。 Referring to FIG. 5A, the memory controller 110 writes the material D0 to the page 122p indicated as P1-0 or P1-1 in the first physical block 122, where the data D0 is, for example, The reformed data that has been reorganized has been completed. After the data D0 is written to the first physical block 122, the memory controller 110 can continue to store the next round of reorganization data to the first physical block 122. It will be assumed here that a power down event occurs during the writing of the next round of reforming data to the first physical block 122 such that the next round of reforming data is not completely written to the first physical block 122. When power is supplied to the non-volatile memory device 100 again after the power-off event, as shown in FIG. 5B, the memory controller 110 may proceed to step S304 to select one physical block from the plurality of free-body blocks (for example, the second entity). Block 124), and the second physical block 124 is erased. Here, the memory controller 110 erases the data stored in the second physical block 124, for example. For example, the second physical block 124 illustrated in FIG. 5B indicates that the data stored in the second physical block 124 has been erased when power is again supplied to the non-volatile memory device 100 after the power-off event.

於步驟S306,在上述抹除程序完成後,記憶體控制器110會搜尋在斷電事件之前所完整寫入第一實體塊122的有效資料。例如,在重新上電後,記憶體控制器110可根據頁面122p中的對應資訊,而判斷出這些重整資料D0在斷電事件之前已完整地寫入到第一實體塊122。因此,記憶體控制器110在步驟S306中將第一實體塊122在斷電事件之前所完整寫入的重整資料D0複製到第二實體塊124的至少一個頁面124p上,其中所述至少一個頁面124p對應於所述至少一個頁面122p。例如於圖5C,在第二實體塊124中標示為P2-0~P2-1的所述頁面124p來存放從第一實體塊122複製而來的重整資料D0。 In step S306, after the erasing process is completed, the memory controller 110 searches for the valid data completely written to the first physical block 122 before the power-off event. For example, after re-powering, the memory controller 110 can determine, based on the corresponding information in the page 122p, that the reform data D0 has been completely written to the first physical block 122 before the power-off event. Therefore, the memory controller 110 copies the reformed material D0 completely written by the first physical block 122 before the power-off event to at least one page 124p of the second physical block 124 in step S306, wherein the at least one The page 124p corresponds to the at least one page 122p. For example, in FIG. 5C, the page 124p labeled P2-0~P2-1 in the second entity block 124 stores the reformation data D0 copied from the first physical block 122.

於步驟S308,記憶體控制器110會繼續對非揮發性記憶 體裝置100進行重整,並將再一次供電給非揮發性記憶體裝置100之後所繼續重整的第二重整資料寫入第二實體塊124,而不寫入第一實體塊122。例如在圖5D中,在完成重整資料D0複製至第二實體塊124之後,記憶體控制器110可以繼續對非揮發性記憶體裝置100進行重整而獲得第二重整資料D2,並將第二重整資料D2存放在第二實體塊124中標示為P2-2~P2-y的所述頁面124p上,其中y為正整數。在一實施例中,等到第二實體塊124完成資料重整作業後,記憶體控制器110還可選擇性地對第一實體塊122進行抹除程序,來釋放第一實體塊122的儲存空間。 In step S308, the memory controller 110 continues to operate on non-volatile memory. The body device 100 performs reforming, and writes the second reforming material that is continuously reformed after the power is supplied to the non-volatile memory device 100 to the second physical block 124 without writing to the first physical block 122. For example, in FIG. 5D, after the completion of the reforming data D0 is copied to the second physical block 124, the memory controller 110 may continue to reform the non-volatile memory device 100 to obtain the second reforming data D2, and The second reformation data D2 is stored on the page 124p labeled P2-2~P2-y in the second physical block 124, where y is a positive integer. In an embodiment, after the second physical block 124 completes the data reconstruction operation, the memory controller 110 can also selectively erase the first physical block 122 to release the storage space of the first physical block 122. .

此外,記憶體控制器110還可更新信息表的實體位址信息。其中,實體位址信息分別指出對應於第二實體塊124中標示為P2-0~P2-y的頁面124p的實體位址。如此一來,記憶體控制器110便可根據信息表而存取非揮發性記憶體裝置100中經重整的資料(包括斷電事件前所重整的第一重整資料D0,以及斷電事件後再一次供電給非揮發性記憶體裝置100所重整的第二重整資料D2)。 In addition, the memory controller 110 can also update the physical address information of the information table. The physical address information respectively indicates the physical address of the page 124p corresponding to the P2-0~P2-y in the second entity block 124. In this way, the memory controller 110 can access the reformed data in the non-volatile memory device 100 according to the information table (including the first reformed data D0 that is reformed before the power-off event, and the power-off After the event, power is again supplied to the second reforming data D2) reformed by the non-volatile memory device 100.

在此說明的是,倘若記憶體控制器110在將第二重整資料D2存入至第二實體塊124的過程中,又有另一斷電事件發生而使記憶體控制器110正在進行的重整動作再一次中斷時,則記憶體控制器110會再一次執行與上述步驟S304~S306。亦即,在於斷電事件後再一次供電給記憶體裝置100時,記憶體控制器110會對另一個實體塊進行初始化程序,以及在上述初始化程序完成 後,記憶體控制器110會再一次將第一實體塊122在斷電事件之前所寫入的第一重整資料D0複製到所述另一個實體塊對應的頁面上。並且,記憶體控制器110會繼續對記憶體裝置100進行重整而獲得第二重整資料D2,並將所述而獲得第二重整資料D2寫入所述另一個實體塊。 It is explained here that if the memory controller 110 stores the second reforming data D2 into the second physical block 124, another power-off event occurs to cause the memory controller 110 to be in progress. When the reforming operation is once again interrupted, the memory controller 110 executes the above steps S304 to S306 again. That is, when power is supplied to the memory device 100 again after the power-off event, the memory controller 110 initializes another physical block and completes the initialization process. After that, the memory controller 110 copies the first reformed material D0 written by the first physical block 122 before the power-off event to the page corresponding to the other physical block. Moreover, the memory controller 110 continues to reform the memory device 100 to obtain the second reforming data D2, and writes the obtained second reforming data D2 into the other physical block.

基於上述,由於在於斷電事件後再一次供電給非揮發性記憶體裝置100時,記憶體控制器110會將已完成重整的第一重整資料D0從原先的第一實體塊122複製到已經過抹除程序的第二實體塊124。並且,記憶體控制器110可將電源恢復供應後所重整的第二重整資料D2(即接續第一重整資料D0後的重整資料)寫入第二實體塊124,而不寫入第一實體塊122。如此一來,當記憶體控制器110對非揮發性記憶體裝置100進行重整時,若有斷電事件又再次恢復供電的情況,則由於斷電事件之前的第一重整資料D0被安全的保留於第一實體塊122,因此記憶體控制器110可避免於第一實體塊122因斷電被破壞所造成的錯誤,藉以提高重整資料的正確性。 Based on the above, since the power is again supplied to the non-volatile memory device 100 after the power-off event, the memory controller 110 copies the first reformed data D0 that has been reformed from the original first physical block 122 to The second physical block 124 of the erased program has been erased. Moreover, the memory controller 110 can write the second reforming data D2 (ie, the reforming data after the first reforming data D0) that is reformed after the power supply is restored, to the second physical block 124 without writing. The first physical block 122. In this way, when the memory controller 110 performs the reforming of the non-volatile memory device 100, if the power-off event resumes the power supply again, the first reforming data D0 before the power-off event is safe. The remaining in the first physical block 122, the memory controller 110 can avoid the error caused by the power failure of the first physical block 122, thereby improving the correctness of the reformed data.

值得一提的是,上述記憶體控制器110在將已完成重整的重整資料寫入實體塊(例如實體塊122、124或其他實體塊)中的至少一頁面時,還可透過執行長度映射表(run-length mapping table),來記錄具有連續邏輯位址且位在同一個實體塊的多個連續頁面中的重整資料,以減少用來儲存重整資料的邏輯位址資訊以及實體位址資訊的空間。為了方便說明,底下以記憶體控制器110 將已完成重整的重整資料寫入非揮發性記憶體模組120的至少一實體塊時的步驟為例,來說明將重整資料寫入實體塊中的操作方法。 It is worth mentioning that the memory controller 110 can also execute the length when writing the reformed data that has been re-formed into at least one of the physical blocks (for example, the physical blocks 122, 124 or other physical blocks). A run-length mapping table that records re-formed data with consecutive logical addresses and bits in multiple consecutive pages of the same physical block to reduce logical address information and entities used to store the reconstructed data. The space of the address information. For convenience of explanation, the memory controller 110 is underneath. The step of writing the reformed data that has been reformed into at least one physical block of the non-volatile memory module 120 is taken as an example to explain the operation method of writing the reformed data into the physical block.

圖6是依照本發明一實施例所繪示的非揮發性記憶體裝置的操作方法流程示意圖。請同時參照圖1與圖6,於步驟S602,記憶體控制器110將重整資料寫入非揮發性記憶體模組120的至少一實體塊,例如是第一實體塊122或第二實體塊124。於步驟S604,記憶體控制器110會判斷第一條件是否成立,其中第一條件包括所述重整資料的多個邏輯位址為連續且所述重整資料位在同一個實體塊的多個連續頁面中。舉例來說,若記憶體控制器110將具有多個連續邏輯位址的重整資料寫入非揮發性記憶體模組120的第一實體塊122的多個連續頁面中,則第一條件成立。然而,若記憶體控制器110將重整資料寫入非揮發性記憶體模組120的第一實體塊122的非連續頁面,則第一條件不成立。 FIG. 6 is a flow chart showing an operation method of a non-volatile memory device according to an embodiment of the invention. Referring to FIG. 1 and FIG. 6 simultaneously, in step S602, the memory controller 110 writes the reformed data into at least one physical block of the non-volatile memory module 120, such as the first physical block 122 or the second physical block. 124. In step S604, the memory controller 110 determines whether the first condition is met, wherein the first condition includes that the plurality of logical addresses of the reformed material are consecutive and the reformed data bits are in the same physical block. In a continuous page. For example, if the memory controller 110 writes the reformed data having the plurality of consecutive logical addresses into the plurality of consecutive pages of the first physical block 122 of the non-volatile memory module 120, the first condition is established. . However, if the memory controller 110 writes the reformed data to the non-contiguous page of the first physical block 122 of the non-volatile memory module 120, the first condition does not hold.

當第一條件成立時,則如步驟S606所示,記憶體控制器110會將重整資料的起始邏輯位址、重整資料的起始實體位址與重整資料的資料長度分別記錄在執行長度映射表中的邏輯位址欄位、實體位址欄位以及長度欄位,其中記憶體控制器110可根據重整資料的起始實體位址與終止實體位址而得知重整資料的資料長度。 When the first condition is met, the memory controller 110 records the start logical address of the reformed data, the starting physical address of the reformed data, and the data length of the reformed data, respectively, as shown in step S606. The logical address field, the physical address field, and the length field in the length mapping table are executed, wherein the memory controller 110 can learn the reorganization data according to the starting physical address and the ending physical address of the reorganization data. The length of the data.

圖7A是依照本發明一實施例所繪示被寫入非揮發性記憶體模組120的重整資料的邏輯位址資訊與實體位址資訊的關係 示意圖。圖7B是依照本發明一實施例所繪示的執行長度映射表的示意圖。在圖7B所示實施例中,執行長度映射表的邏輯位址欄位為邏輯頁位址(logical page address)欄位,而執行長度映射表中的實體位址欄位包括實體塊位址(physical block address)欄位以及實體頁位址(physical page address)欄位。從圖7A的邏輯位址資訊可知重整資料的邏輯頁位址為連續,例如邏輯位址為n1~n1+4。並且,根據圖7A的實體位址資訊可知重整資料是位在同一個實體塊的多個連續頁面中,例如實體塊位址皆是為m1,而實體頁位址為k1~k1+4。記憶體控制器110可根據此重整資料的起始實體頁位址k1與終止實體頁位址k1+4而得知此重整資料的資料長度為5。 FIG. 7A illustrates the relationship between logical address information and physical address information of the reformed data written to the non-volatile memory module 120 according to an embodiment of the invention. schematic diagram. FIG. 7B is a schematic diagram of an execution length mapping table according to an embodiment of the invention. In the embodiment shown in FIG. 7B, the logical address field of the execution length mapping table is a logical page address field, and the physical address field in the execution length mapping table includes a physical block address ( Physical block address) field and physical page address field. It can be seen from the logical address information of FIG. 7A that the logical page address of the reformed data is continuous, for example, the logical address is n1~n1+4. Moreover, according to the physical address information of FIG. 7A, the reorganization data is located in multiple consecutive pages of the same physical block, for example, the physical block address is m1, and the physical page address is k1~k1+4. The memory controller 110 can know that the data length of the reformed material is 5 according to the starting physical page address k1 and the ending physical page address k1+4 of the reformed data.

因此,記憶體控制器110在步驟S604會判斷圖7A所例舉的重整資料符合第一條件,所以記憶體控制器110在步驟S606將此重整資料的位址映射關係記錄在執行長度映射表中。例如圖7B所示,記憶體控制器110會將此重整資料的起始邏輯頁位址(在此例為n1)、實體塊位址(在此例為m1)、起始實體頁位址(在此例為k1)與資料長度(在此例為5)分別記錄在執行長度映射表中的邏輯頁位址欄位、實體塊位址欄位、實體頁位址欄位以及長度欄位。 Therefore, the memory controller 110 determines in step S604 that the reforming data exemplified in FIG. 7A conforms to the first condition, so the memory controller 110 records the address mapping relationship of the reformed data in the execution length mapping in step S606. In the table. For example, as shown in FIG. 7B, the memory controller 110 will start the logical page address (in this case, n1), the physical block address (in this case, m1), and the starting physical page address of the data. (in this case, k1) and the data length (in this case, 5) record the logical page address field, the physical block address field, the physical page address field, and the length field in the execution length mapping table, respectively. .

另一方面,當圖6的步驟S604判斷第一條件不成立時,則記憶體控制器110會進行步驟S608。如步驟S608所示,記憶體控制器110會將重整資料的所述多個邏輯位址與多個實體位址分 別記錄在頁映射表(page mapping table)中的邏輯位址欄位與實體位址欄位。例如,圖7C是依照本發明一實施例所繪示的頁映射表的示意圖。在圖7C的頁映射表中,重整資料位在不同實體塊的非連續頁面中,其中邏輯位址欄位的邏輯頁位址欄位記錄了重整資料的邏輯頁位址為n1、n2、n3、n4與n5,實體位址欄位的實體塊位址欄位記錄了重整資料的實體塊位址為m1、m2、m3、m4與m5,而實體位址欄位的實體頁位址欄位記錄了重整資料的實體頁位址為k1、k2、k3、k4與k5。 On the other hand, when it is judged in step S604 of Fig. 6 that the first condition is not satisfied, the memory controller 110 proceeds to step S608. As shown in step S608, the memory controller 110 divides the plurality of logical addresses of the reformed material and the plurality of physical addresses. Do not record the logical address field and entity address field in the page mapping table. For example, FIG. 7C is a schematic diagram of a page mapping table according to an embodiment of the invention. In the page mapping table of FIG. 7C, the reorganization data bits are in non-contiguous pages of different physical blocks, wherein the logical page address field of the logical address field records the logical page address of the reorganization data as n1, n2 , n3, n4 and n5, the physical block address field of the physical address field records the physical block address of the reorganization data as m1, m2, m3, m4 and m5, and the physical page position of the physical address field The address field records the physical page addresses of the reorganization data as k1, k2, k3, k4, and k5.

另需說明的是,上述圖6的操作方法,不限定應用於重整資料的寫入操作。例如,當記憶體控制器110從主機10接收一資料寫入指令而對應地將一筆資料寫入非揮發性記憶體模組120後,記憶體控制器110也可根據上述圖6所示第一條件來進行判斷,以選擇利用執行長度映射表或者頁映射表來記錄資料的邏輯位址與實體位址的映射關係資訊。亦即,當記憶體控制器110將一筆資料寫入非揮發性記憶體模組120的至少一實體塊後,若圖6的步驟S604判斷第一條件成立,則記憶體控制器110會選擇利用執行長度映射表來記錄資料的邏輯位址與實體位址的映射關係資訊。然而,若圖6的步驟S604判斷第一條件不成立時,則記憶體控制器110會選擇利用頁映射表來記錄資料的邏輯位址與實體位址的映射關係資訊。 It should be noted that the above operation method of FIG. 6 does not limit the write operation applied to the reformed data. For example, after the memory controller 110 receives a data write command from the host 10 and correspondingly writes a piece of data into the non-volatile memory module 120, the memory controller 110 can also be first according to FIG. 6 described above. The condition is used to determine whether to use the execution length mapping table or the page mapping table to record the mapping relationship between the logical address of the data and the physical address. That is, after the memory controller 110 writes a piece of data into at least one physical block of the non-volatile memory module 120, if the first condition is satisfied in step S604 of FIG. 6, the memory controller 110 selects to use The length mapping table is executed to record the mapping relationship between the logical address of the data and the physical address. However, if the step S604 of FIG. 6 determines that the first condition is not satisfied, the memory controller 110 selects to use the page mapping table to record the mapping relationship between the logical address of the material and the physical address.

基於上述,本實施例的記憶體控制器110在將資料寫入非揮發性記憶體模組120的至少一實體塊時,可透過執行長度映 射表,來記錄具有連續邏輯位址且位在同一個實體塊的多個連續頁面中的重整資料,以有效儲存對應於重整資料的邏輯位址資訊以及實體位址資訊。藉此,映射表的資料量可以大幅減少。 Based on the above, the memory controller 110 of the embodiment can perform the length mapping when the data is written into at least one physical block of the non-volatile memory module 120. A table is used to record the reformed data having consecutive logical addresses and being located in a plurality of consecutive pages of the same physical block to effectively store logical address information and physical address information corresponding to the reformed data. Thereby, the amount of data in the mapping table can be greatly reduced.

值得一提的是,本實施例的非揮發性記憶體模組120可具有操作於單層記憶胞(Single Level Cell,SLC)模式的多個實體塊以及操作於三層記憶胞(Trinary Level Cell,TLC)模式的多個實體塊。在將資料寫入TLC模式實體塊的操作過程中,所述資料會被暫存於SLC模式的實體塊中,而不會直接寫入TLC模式實體塊。當在非揮發性記憶體模組120內操作於SLC實體塊之中的三個實體塊的所有頁面均被使用時,也就是所述三個SLC實體塊的暫存空間均被用盡時,所述三個SLC實體塊會進行重整,以將所述三個SLC實體塊的資料重整/搬移至非揮發性記憶體模組120內操作於TLC模式的實體塊中。在此,假設第一實體塊122與第二實體塊124是操作於TLC模式,則當非揮發性記憶體模組120內操作於SLC模式的實體塊之中的三個實體塊的所有頁面均被使用時,記憶體控制器110還可對所述三個SLC實體塊進行重整,以將所述三個SLC實體塊的資料重整至非揮發性記憶體模組120內操作於TLC模式的第一實體塊122或第二實體塊124中。底下再舉一實施例來進行說明。 It should be noted that the non-volatile memory module 120 of the embodiment may have multiple physical blocks operating in a single level cell (SLC) mode and operate on a three-layer memory cell (Trinary Level Cell). , TLC) mode of multiple physical blocks. During the operation of writing data into the TLC mode entity block, the data is temporarily stored in the entity block of the SLC mode, and is not directly written into the TLC mode entity block. When all the pages of the three physical blocks operating in the SLC physical block in the non-volatile memory module 120 are used, that is, when the temporary storage space of the three SLC physical blocks is used up, The three SLC physical blocks are subjected to reforming to reform/move the data of the three SLC physical blocks into a physical block operating in the TLC mode in the non-volatile memory module 120. Here, assuming that the first physical block 122 and the second physical block 124 are operating in the TLC mode, all pages of the three physical blocks operating in the SLC mode physical block in the non-volatile memory module 120 are all When used, the memory controller 110 may also perform reorganization on the three SLC physical blocks to reform the data of the three SLC physical blocks into the non-volatile memory module 120 to operate in the TLC mode. In the first physical block 122 or the second physical block 124. An embodiment will be described below for explanation.

圖8是依照本發明一實施例所繪示的操作方法流程圖。底下即搭配上述非揮發性記憶體裝置100來說明本實施例的操作方法各步驟。請參照圖1與圖8,記憶體控制器110在步驟S801 中將資料寫入操作於SLC模式的實體塊其中之一。於步驟S802,記憶體控制器110判斷是否需要將SLC實體塊的資料搬移至TLC實體塊。當在非揮發性記憶體模組120內操作於SLC模式的多個實體塊之中的三個實體塊的所有頁面均被使用時,也就是步驟S802的判斷結果為「SLC實體塊的資料需要搬移至TLC實體塊」,記憶體控制器110會接著進行步驟S806。在步驟S806中,記憶體控制器110依據一第二條件而決定對所述三個SLC實體塊進行「內部重整」或是「外部重整」,以將所述三個SLC實體塊的資料重整至非揮發性記憶體模組120內操作於TLC模式的實體塊中的一個擇定實體塊。反之,當所述三個SLC實體塊尚有頁面未被使用時,也就是步驟S802的判斷結果為「SLC實體塊的資料尚不需搬移至TLC實體塊」,記憶體控制器110會返回至步驟S801,以等待下一筆資料。 FIG. 8 is a flow chart of an operation method according to an embodiment of the invention. The steps of the operation method of the present embodiment will be described below in conjunction with the above-described non-volatile memory device 100. Referring to FIG. 1 and FIG. 8, the memory controller 110 is in step S801. The intermediate data is written to one of the physical blocks operating in the SLC mode. In step S802, the memory controller 110 determines whether it is necessary to move the data of the SLC physical block to the TLC physical block. When all the pages of the three physical blocks operating in the SLC mode in the non-volatile memory module 120 are used, that is, the result of the determination in step S802 is "the data requirement of the SLC physical block. Moving to the TLC physical block", the memory controller 110 proceeds to step S806. In step S806, the memory controller 110 determines, according to a second condition, "internal reforming" or "external reforming" on the three SLC physical blocks to store the data of the three SLC physical blocks. Reconstructed to a selected physical block in a non-volatile memory module 120 operating in a TLC mode entity block. On the other hand, when the three SLC physical blocks still have pages that are not used, that is, the result of the determination in step S802 is "the data of the SLC physical block does not need to be moved to the TLC physical block", the memory controller 110 returns to Step S801, to wait for the next data.

於圖8所示實施例中,步驟S806包含子步驟S804、S803與S805。於步驟S804,記憶體控制器110會判斷所述第二條件是否成立。此第二條件包括:非揮發性記憶體模組120內操作於TLC模式的實體塊中任一者的抹除(erasing)次數已達第一門檻值,或是非揮發性記憶體模組120內操作於TLC模式的實體塊中任一者的位元錯誤率已達第二門檻值。例如,非揮發性記憶體模組120可以記錄操作於TLC模式的實體塊的抹除次數。並且/或者,記憶體控制器110可以記錄這些TLC實體塊各自的位元錯誤率。例如,當記憶體控制器110從TLC模式的實體塊中讀取資料時,可透過 錯誤檢查與校正電路210對從TLC實體塊讀出的資料進行錯誤檢查與校正(請參照於圖2的相關說明),藉以獲得所述操作於TLC模式的實體塊的位元錯誤率。 In the embodiment shown in FIG. 8, step S806 includes sub-steps S804, S803, and S805. In step S804, the memory controller 110 determines whether the second condition is true. The second condition includes: the number of erasing of any one of the physical blocks operating in the TLC mode in the non-volatile memory module 120 has reached a first threshold, or is within the non-volatile memory module 120. The bit error rate of any of the entity blocks operating in the TLC mode has reached a second threshold. For example, the non-volatile memory module 120 can record the number of erases of a physical block operating in the TLC mode. And/or, the memory controller 110 can record the bit error rate of each of the TLC entity blocks. For example, when the memory controller 110 reads data from a physical block of the TLC mode, it is transparent. The error checking and correction circuit 210 performs error checking and correction on the data read from the TLC entity block (please refer to the related description of FIG. 2) to obtain the bit error rate of the physical block operating in the TLC mode.

當步驟S804判斷所述第二條件成立時,則非揮發性記憶體裝置100進行所述外部重整,以將操作於SLC模式的所述三個實體塊的資料重整至操作於TLC模式的所述擇定實體塊。所述外部重整如步驟S805所示。於步驟S805中,非揮發性記憶體模組120內的所述三個SLC實體塊的資料會被讀取至非揮發性記憶體模組120外部的記憶體控制器110,並由所述記憶體控制器110對所述三個SLC實體塊的資料進行糾錯(例如進行錯誤檢查與校正),以及將糾錯後的資料從所述記憶體控制器110寫入操作於TLC模式的所述擇定實體塊中(例如寫入第一實體塊122或第二實體塊124中)。具體而言,記憶體控制器110中的錯誤檢查與校正電路210(繪示於圖2)可對所述三個SLC實體塊的資料進行糾錯,並且經糾錯的資料寫入操作於TLC模式的第一實體塊122或第二實體塊124,以降低TLC實體塊中資料的位元錯誤率。在完成所述外部重整後,所述三個SLC實體塊中的資料會被抹除以釋放記憶體空間。 When the step S804 determines that the second condition is met, the non-volatile memory device 100 performs the external reforming to reform the data of the three physical blocks operating in the SLC mode to operate in the TLC mode. The selected physical block. The external reforming is as shown in step S805. In step S805, the data of the three SLC physical blocks in the non-volatile memory module 120 are read to the memory controller 110 outside the non-volatile memory module 120, and the memory is read by the memory. The body controller 110 performs error correction (for example, error checking and correction) on the data of the three SLC physical blocks, and writes the error-corrected data from the memory controller 110 to the operation in the TLC mode. The physical block is selected (eg, written in the first physical block 122 or the second physical block 124). Specifically, the error checking and correction circuit 210 (shown in FIG. 2) in the memory controller 110 can correct the data of the three SLC physical blocks, and the error-corrected data write operation is performed on the TLC. The first physical block 122 or the second physical block 124 of the mode is to reduce the bit error rate of the data in the TLC physical block. After the external reforming is completed, the data in the three SLC physical blocks is erased to release the memory space.

另一方面,當步驟S804判斷所述第二條件不成立時,則非揮發性記憶體裝置100進行所述內部重整,以將操作於SLC模式的所述三個實體塊的資料重整至操作於TLC模式的所述擇定實體塊。與所述外部重整的差別在於,所述內部重整在將所述三個 SLC實體塊的資料搬移至TLC實體塊的過程中並不會進行糾錯作業。所述內部重整如步驟S803所示。於步驟S803中,由非揮發性記憶體模組120內部的控制電路將所述三個SLC實體塊的資料重整至操作於TLC模式的的所述擇定實體塊中(例如寫入第一實體塊122或第二實體塊124中)。具體來說,非揮發性記憶體模組120內部的此控制電路可執行以硬體型式或韌體型式實作的多個邏輯閘或控制指令,以控制所述三個SLC實體塊中的資料重整所分別寫入的操作於TLC模式的第一實體塊122或第二實體塊124。也就是說,控制電路可根據預先設定的指令,以自動將資料重整寫入對應的操作於TLC模式的實體塊。藉此,當進行資料重整以將所述三個SLC實體塊中的資料寫入TLC模式的實體塊時,所述內部重整可具有較高的資料寫入速度。在完成所述內部重整後,所述三個SLC實體塊中的資料會被抹除以釋放記憶體空間。 On the other hand, when it is determined in step S804 that the second condition is not satisfied, the non-volatile memory device 100 performs the internal reforming to reform the data of the three physical blocks operating in the SLC mode to the operation. The selected physical block in the TLC mode. The difference from the external reforming is that the internal reforming is in the three The process of moving the data of the SLC entity block to the TLC entity block does not perform error correction operations. The internal reforming is as shown in step S803. In step S803, the data of the three SLC physical blocks is reformed by the control circuit inside the non-volatile memory module 120 to the selected physical block operating in the TLC mode (for example, writing the first In the entity block 122 or the second entity block 124). Specifically, the control circuit inside the non-volatile memory module 120 can execute a plurality of logic gates or control commands implemented in a hard type or a firmware type to control data in the three SLC entity blocks. The first entity block 122 or the second entity block 124 operating in the TLC mode is separately rewritten. That is to say, the control circuit can automatically reformate the data into the corresponding physical block operating in the TLC mode according to a preset instruction. Thereby, when data reforming is performed to write the data in the three SLC entity blocks into the physical block of the TLC mode, the internal reforming may have a higher data writing speed. After the internal reforming is completed, the data in the three SLC physical blocks is erased to release the memory space.

基於上述,非揮發性記憶體裝置100在步驟S804中可根據第二條件的成立與否,判斷是否透過非揮發性記憶體模組120外部的記憶體控制器110來對非揮發性記憶體模組120進行資料重整作業,例如將所述三個SLC實體塊中的資料搬移至TLC模式的實體塊。在資料重整作業中,記憶體控制器110在步驟S805中可以對寫入於TLC實體塊的資料進行糾錯,以降低TLC實體塊中資料的位元錯誤率。或者,非揮發性記憶體裝置100在步驟S803中透過非揮發性記憶體模組120內部的控制電路將資料直接從原本的實體塊搬移至TLC實體塊而不進行糾錯,以獲得較高的資料 重整速度。藉此,本實施例可同時兼顧資料寫入的正確性以及資料寫入速度。 Based on the above, the non-volatile memory device 100 determines whether the non-volatile memory model is transmitted through the memory controller 110 outside the non-volatile memory module 120 according to whether the second condition is established or not. Group 120 performs a data reorganization operation, such as moving the data in the three SLC entity blocks to a physical block in the TLC mode. In the data reorganization operation, the memory controller 110 may perform error correction on the data written in the TLC physical block in step S805 to reduce the bit error rate of the data in the TLC physical block. Alternatively, the non-volatile memory device 100 moves the data directly from the original physical block to the TLC physical block through the control circuit inside the non-volatile memory module 120 in step S803 without error correction to obtain a higher data Reorganization speed. Thereby, the embodiment can simultaneously consider the correctness of data writing and the data writing speed.

綜上所述,在本實施例的非揮發性記憶體裝置與其操作方法中,當在於斷電事件後再一次供電給非揮發性記憶體裝置時,記憶體控制器110會將已完成重整的第一重整資料從第一實體塊複製到已經過抹除程序的第二實體塊,並且將電源恢復供應後所重整的第二重整資料接續第一重整資料寫入第二實體塊。如此一來,若有斷電事件又再次恢復供電的情況,則記憶體控制器110可避免於同一實體頁重複寫入重整資料所造成的錯誤,藉以提高重整資料的正確性。此外,在本實施例的操作方法中,記憶體控制器110在將資料寫入非揮發性記憶體模組120的至少一實體塊時,可透過執行長度映射表,來記錄具有連續邏輯位址且位在同一個實體塊的多個連續頁面中的資料,以減少映射表的資料量。在本實施例另一操作方法可判斷是否透過非揮發性記憶體模組120外部的記憶體控制器110來對寫入非揮發性記憶體模組120內TLC實體塊的資料進行糾錯,或者透過非揮發性記憶體模組120內部的控制電路將資料直接從原本的實體塊搬移至TLC實體塊而不進行糾錯。藉此,本實施例可同時兼顧資料寫入的正確性以及資料寫入速度。 In summary, in the non-volatile memory device of the embodiment and the method of operating the same, when the power is supplied to the non-volatile memory device again after the power-off event, the memory controller 110 will complete the reforming. The first reforming data is copied from the first physical block to the second physical block that has been erased, and the second reformed data reconstructed after the power supply is restored is connected to the first reformed data to be written into the second entity. Piece. In this way, if there is a power-off event and the power supply is restored again, the memory controller 110 can avoid the error caused by repeatedly writing the reformed data on the same physical page, thereby improving the correctness of the reformed data. In addition, in the operation method of the embodiment, the memory controller 110 can record the continuous logical address by executing the length mapping table when the data is written into at least one physical block of the non-volatile memory module 120. And data in multiple consecutive pages of the same physical block to reduce the amount of data in the mapping table. In another method of the present embodiment, it can be determined whether the data written in the TLC physical block in the non-volatile memory module 120 is corrected by the memory controller 110 outside the non-volatile memory module 120, or The data is directly transferred from the original physical block to the TLC physical block through the control circuit inside the non-volatile memory module 120 without error correction. Thereby, the embodiment can simultaneously consider the correctness of data writing and the data writing speed.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍 當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of protection of the present invention It is subject to the definition of the scope of the patent application attached.

S801~S806‧‧‧操作方法各步驟 S801~S806‧‧‧Methods of each step

Claims (4)

一種非揮發性記憶體裝置的操作方法,其中該非揮發性記憶體裝置的一非揮發性記憶體模組包括多個操作於單層記憶胞模式的實體塊以及多個操作於三層記憶胞模式的實體塊,該操作方法包括:將一資料寫入該些操作於單層記憶胞模式的實體塊其中之一;以及每當在該非揮發性記憶體模組內該些操作於單層記憶胞模式的實體塊之中的三個實體塊的所有頁面均被使用時,依據一條件而決定對所述三個實體塊進行一內部重整或是一外部重整,以直接將所述三個實體塊的資料重整至該非揮發性記憶體模組內操作於三層記憶胞模式的該些實體塊中的一擇定實體塊。 A method for operating a non-volatile memory device, wherein a non-volatile memory module of the non-volatile memory device includes a plurality of physical blocks operating in a single-layer memory cell mode and a plurality of operating modes in a three-layer memory cell mode The physical block includes: writing a data to one of the physical blocks operating in the single-layer memory cell mode; and operating the single-layer memory cell in the non-volatile memory module each time When all the pages of the three physical blocks in the physical block of the mode are used, it is decided to perform an internal reorganization or an external reorganization on the three physical blocks according to a condition to directly directly The data of the physical block is reformed to a selected one of the physical blocks operating in the three-layer memory cell mode in the non-volatile memory module. 如申請專利範圍第1項所述的操作方法,其中該條件包括該非揮發性記憶體模組內該些操作於三層記憶胞模式的實體塊中任一者的抹除次數已達一第一門檻值,或是該非揮發性記憶體模組內該些操作於三層記憶胞模式的實體塊中任一者的位元錯誤率已達一第二門檻值。 The method of claim 1, wherein the condition includes that the number of erasures of the one of the solid blocks operating in the three-layer memory cell mode in the non-volatile memory module has reached a first The threshold value, or the bit error rate of any of the non-volatile memory modules operating in the three-layer memory cell mode, has reached a second threshold. 如申請專利範圍第1項所述的操作方法,其中當該條件成立時,進行所述外部重整以直接將操作於單層記憶胞模式的所述三個實體塊的資料重整至操作於三層記憶胞模式的所述擇定實體塊;以及所述外部重整包括:讀取操作於單層記憶胞模式的所述三個實體塊的資料至該非 揮發性記憶體模組外部的一記憶體控制器;透過該記憶體控制器對操作於單層記憶胞模式的所述三個實體塊的資料進行糾錯;以及將糾錯後的所述資料從該記憶體控制器直接寫入操作於三層記憶胞模式的所述擇定實體塊中。 The method of operation of claim 1, wherein when the condition is met, the external reforming is performed to directly reform data of the three physical blocks operating in a single-layer memory cell mode to operate The selected physical block of the three-layer memory cell mode; and the external reforming includes: reading data of the three physical blocks operating in the single-layer memory cell mode to the non- a memory controller external to the volatile memory module; correcting data of the three physical blocks operating in the single-layer memory cell mode through the memory controller; and correcting the data The selected physical block operating in the three-layer memory cell mode is directly written from the memory controller. 如申請專利範圍第1項所述的操作方法,其中當該條件不成立時,進行所述內部重整以直接將操作於單層記憶胞模式的所述三個實體塊的資料重整至操作於三層記憶胞模式的所述擇定實體塊;以及所述內部重整包括:由該非揮發性記憶體模組內部的一控制電路將操作於單層記憶胞模式的所述三個實體塊的資料直接寫入至操作於三層記憶胞模式的所述擇定實體塊中。 The operation method of claim 1, wherein when the condition is not satisfied, the internal reforming is performed to directly reform data of the three physical blocks operating in a single-layer memory cell mode to operate The selected physical block of the three-layer memory cell mode; and the internal reforming includes: operating, by a control circuit inside the non-volatile memory module, the three physical blocks operating in a single-layer memory cell mode The data is written directly into the selected physical block operating in the three-layer memory cell mode.
TW104138238A 2013-11-05 2013-11-05 Operation method of non-volatile memory device TWI606458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW104138238A TWI606458B (en) 2013-11-05 2013-11-05 Operation method of non-volatile memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW104138238A TWI606458B (en) 2013-11-05 2013-11-05 Operation method of non-volatile memory device

Publications (2)

Publication Number Publication Date
TW201611035A TW201611035A (en) 2016-03-16
TWI606458B true TWI606458B (en) 2017-11-21

Family

ID=56085239

Family Applications (1)

Application Number Title Priority Date Filing Date
TW104138238A TWI606458B (en) 2013-11-05 2013-11-05 Operation method of non-volatile memory device

Country Status (1)

Country Link
TW (1) TWI606458B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI652577B (en) 2017-06-19 2019-03-01 慧榮科技股份有限公司 Data storage device and method for operating non-volatile memory
TWI653538B (en) 2017-11-13 2019-03-11 慧榮科技股份有限公司 Data storage device and data processing method of memory device
TWI664527B (en) * 2018-03-20 2019-07-01 慧榮科技股份有限公司 Method for performing initialization in a memory device, associated memory device and controller thereof, and associated electronic device

Also Published As

Publication number Publication date
TW201611035A (en) 2016-03-16

Similar Documents

Publication Publication Date Title
TWI520153B (en) Non-volatile memory device and operation method thereof
TWI585778B (en) Operation method of non-volatile memory device
US8230161B2 (en) Data backup method for a flash memory and controller and storage system using the same
US9009399B2 (en) Flash memory storage system and controller and data writing method thereof
US9122498B2 (en) Firmware code loading method, memory controller and memory storage apparatus
US9177656B2 (en) Data writing method, memory storage device and memory controlling circuit unit
TWI490871B (en) Method for preventing read-disturb, memory control circuit unit and memory storage apparatus
TWI476590B (en) Memory management method, and memory controller and memory storage device using the same
TWI584189B (en) Memory controller, memory storage device, and method for writing data
US9383929B2 (en) Data storing method and memory controller and memory storage device using the same
TWI540428B (en) Data writing method, memory controller and memory storage apparatus
TWI501244B (en) Data writing method, memory control circuit unit and memory storage apparatus
TWI606458B (en) Operation method of non-volatile memory device
TWI516934B (en) Data storing method, memory control circuit unit and memory stoarge apparatus
US20130067141A1 (en) Data writing method, and memory controller and memory storage apparatus using the same
TWI564901B (en) Data writing method, memory control circuit unit and memory storage apparatus
TWI622044B (en) Memory managing method, memory control circuit unit and memory storage apparatus
TWI814501B (en) Mapping table re-building method, memory storage device and memory control circuit unit
CN112527184A (en) Data management method, memory control circuit unit and memory storage device