TWI657339B - Method for managing flash memory module and associated flash memory controller - Google Patents

Method for managing flash memory module and associated flash memory controller Download PDF

Info

Publication number
TWI657339B
TWI657339B TW107100021A TW107100021A TWI657339B TW I657339 B TWI657339 B TW I657339B TW 107100021 A TW107100021 A TW 107100021A TW 107100021 A TW107100021 A TW 107100021A TW I657339 B TWI657339 B TW I657339B
Authority
TW
Taiwan
Prior art keywords
temporary storage
storage block
data
flash memory
block
Prior art date
Application number
TW107100021A
Other languages
Chinese (zh)
Other versions
TW201905701A (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 CN201810444354.3A priority Critical patent/CN109117383B/en
Priority to US16/009,174 priority patent/US10866751B2/en
Publication of TW201905701A publication Critical patent/TW201905701A/en
Application granted granted Critical
Publication of TWI657339B publication Critical patent/TWI657339B/en

Links

Abstract

本發明揭露一種管理一快閃記憶體模組的方法,其中該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,以及該方法包含有:將一資料寫入至該多個第二暫存區塊中的一第二暫存區塊中;當該快閃記憶體模組的存取符合一特定條件時,將儲存於該第二暫存區塊中的該資料搬移至該多個第一暫存區塊中的一第一暫存區塊,並在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 The invention discloses a method for managing a flash memory module, wherein the flash memory module comprises a plurality of flash memory chips, each of the flash memory chips comprises a plurality of first temporary storage blocks and a plurality of second temporary storage blocks, each of the first temporary storage block and the second temporary storage block includes a plurality of data pages, and the method includes: writing a data to the plurality of second temporary storage blocks a second temporary storage block in the block; when the access of the flash memory module meets a specific condition, the data stored in the second temporary storage block is moved to the plurality of A first temporary storage block in the temporary storage block, and the information of the first blank data page of the second temporary storage block is recorded in the first temporary storage block.

Description

管理快閃記憶體模組的方法及相關的快閃記憶體控制器 Method for managing flash memory module and related flash memory controller

本發明係有關於快閃記憶體,尤指一種管理快閃記憶體模組的方法及相關的快閃記憶體控制器。 The present invention relates to flash memory, and more particularly to a method of managing a flash memory module and related flash memory controller.

在採用立體NAND型快閃記憶體(3D NAND-type flash)的架構中,當快閃記憶體控制器需要將資料寫入至快閃記憶體模組中的多層式儲存(Multiple-Level Cell,MLC)區塊或是三層式儲存(Triple-Level Cell,TLC)區塊時,一次寫入的資料量必須要很大,例如64千位元組(KB)或是128KB,然而,若是快閃記憶體控制器需要寫入的資料具有很小資料量(例如,4KB)的隨機資料時,則快閃記憶體控制器需要加入60KB或是124KB的虛擬無效資料(dummy data)至4KB的隨機資料中,以使得一次寫入的資料量為64KB或是128KB。在這種情況下,若是具有很小資料量的隨機資料量很多的時候,每一個區塊的大部分內容都會是無效資料,因此會使得快閃記憶體模組的空間會很快地不足,進而需要頻繁地進行垃圾資料回收(garbage collection)操作,影響到系統效能。 In a three-dimensional NAND-type flash architecture, when the flash memory controller needs to write data to the multi-layer memory (Multiple-Level Cell) in the flash memory module, When the MLC) block or the Triple-Level Cell (TLC) block, the amount of data written at one time must be large, such as 64 kilobytes (KB) or 128 KB. However, if it is fast When the flash memory controller needs to write data with a small amount of data (for example, 4KB) of random data, the flash memory controller needs to add 60KB or 124KB of dummy data to 4KB of random data. In the data, the amount of data that is written once is 64 KB or 128 KB. In this case, if there is a large amount of random data with a small amount of data, most of the contents of each block will be invalid data, so the space of the flash memory module will be quickly insufficient. In turn, frequent garbage collection operations are required, which affects system performance.

為了避免上述情況,可以在快閃記憶體模組中另外設置一暫存區塊,其用來收集這些具有很小資料量的隨機資料,等到收集到足夠資料量的時 候再從該暫存區塊寫回到上述的多層式儲存區塊或是三層式儲存區塊。然而,若是在這種資料寫入的過程中發生斷電後回復(power off recovery,POR)或是突發斷電後回復(sudden power off recovery,SPOR)狀況時,則會無法判斷暫存區塊與多層式儲存區塊或是三層式儲存區塊中的資料的新舊,進而造成後續重新建立位址映射表上的問題。 In order to avoid the above situation, a temporary storage block may be additionally set in the flash memory module, which is used to collect random data with a small amount of data, and wait until a sufficient amount of data is collected. Then write back from the temporary storage block to the above-mentioned multi-layer storage block or three-layer storage block. However, if there is a power off recovery (POR) or a sudden power off recovery (SPOR) condition during the data write process, the temporary storage area cannot be determined. The block and the multi-layer storage block or the new and old data in the three-tier storage block, thereby causing problems in the subsequent re-establishment of the address mapping table.

因此,本發明的目的之一在於提供一種管理快閃記憶體模組的方法,其可以在發生斷電後回復或是突發斷電後回復狀況時,仍然可以正確地判斷出暫存區塊與多層式儲存區塊或是三層式儲存區塊中的資料的新舊,以順利地重新建立位址映射表,以解決先前技術中的問題。 Therefore, one of the objects of the present invention is to provide a method for managing a flash memory module, which can correctly determine a temporary storage block when a power failure occurs after a power failure or a power failure recovery condition occurs. And the old and new data in the multi-layer storage block or the three-tier storage block to smoothly re-establish the address mapping table to solve the problems in the prior art.

在本發明的一個實施例中,揭露了一種管理一快閃記憶體模組的方法,其中該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,以及該方法包含有:將一第一資料寫入至該多個第二暫存區塊中的一第二暫存區塊中;當該快閃記憶體模組的存取符合一特定條件時,將儲存於該第二暫存區塊中的該第一資料搬移至該多個第一暫存區塊中的一第一暫存區塊,並在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 In one embodiment of the present invention, a method for managing a flash memory module is disclosed, wherein the flash memory module includes a plurality of flash memory chips, each of which includes a plurality of flash memory chips. a first temporary storage block and a plurality of second temporary storage blocks, each of the first temporary storage block and the second temporary storage block comprising a plurality of data pages, and the method comprises: placing a first data Writing to a second temporary storage block of the plurality of second temporary storage blocks; when the access of the flash memory module meets a specific condition, storing the second temporary storage block The first data in the first data is moved to a first temporary storage block of the plurality of first temporary storage blocks, and the first one of the second temporary storage blocks is currently recorded in the first temporary storage block Blank information page information.

在本發明的另一個實施例中,揭露了一種管理一快閃記憶體模組的方法,其中該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第 二暫存區塊包含了多個資料頁,以及該方法包含有:當發生斷電後回復狀況時,讀取一第一暫存區塊中一資料頁的備用區域的內容,並決定出一資料頁序號;判斷一第二暫存區塊中位於該資料頁序號之前的所有資料頁為無效資料頁;以及判斷該第二暫存區塊中包含該資料頁序號及之後的所有資料頁為有效資料頁。 In another embodiment of the present invention, a method of managing a flash memory module is disclosed, wherein the flash memory module includes a plurality of flash memory chips, each of which includes a flash memory chip. a plurality of first temporary storage blocks and a plurality of second temporary storage blocks, each of the first temporary storage blocks and the first The second temporary storage block includes a plurality of data pages, and the method includes: when replying to the situation after the power failure, reading the content of the spare area of a data page in the first temporary storage block, and determining a a data page number; determining that all data pages in the second temporary storage block that are located before the data page number are invalid data pages; and determining that the second temporary storage block includes the data page number and all subsequent data pages are Valid profile page.

在本發明的另一個實施例中,揭露了一種快閃記憶體控制器,其中該快閃記憶體控制器係用來存取一快閃記憶體模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,且該快閃記憶體控制器包含有一唯讀記憶體以及一微處理器,其中該唯讀記憶體用來儲存一程式碼,且該微處理器用來執行該程式碼以控制對該快閃記憶體模組之存取;其中該微處理器將一第一資料寫入至該多個第二暫存區塊中的一第二暫存區塊中;以及當該快閃記憶體模組的存取符合一特定條件時,該微處理器將儲存於該第二暫存區塊中的該第一資料搬移至該多個第一暫存區塊中的一第一暫存區塊,並在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 In another embodiment of the present invention, a flash memory controller is disclosed, wherein the flash memory controller is used to access a flash memory module, and the flash memory module includes a plurality of flash memory chips, each of the flash memory chips includes a plurality of first temporary storage blocks and a plurality of second temporary storage blocks, each of the first temporary storage blocks and the second temporary storage block includes a plurality of data pages, and the flash memory controller includes a read-only memory and a microprocessor, wherein the read-only memory is used to store a code, and the microprocessor is configured to execute the code Controlling access to the flash memory module; wherein the microprocessor writes a first data into a second temporary storage block of the plurality of second temporary storage blocks; and when the fast When the access of the flash memory module meets a specific condition, the microprocessor moves the first data stored in the second temporary storage block to a first one of the plurality of first temporary storage blocks Temporarily storing the block, and recording the first empty space of the second temporary storage block in the first temporary storage block Information profile page.

在本發明的另一個實施例中,揭露了一種快閃記憶體控制器,其中該快閃記憶體控制器係用來存取一快閃記憶體模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,且該快閃記憶體控制器包含有一唯讀記憶體以及一微處理器,其中該唯讀記憶體用來儲存一程式碼,且該微處理器用來執行該程式碼以控制對該快閃記憶體模組 之存取;其中當發生斷電後回復狀況時,該微處理器讀取一第一暫存區塊中一資料頁的備用區域的內容,並決定出一資料頁序號;以及該微處理器判斷一第二暫存區塊中位於該資料頁序號之前的所有資料頁為無效資料頁,且判斷該第二暫存區塊中包含該資料頁序號及之後的所有資料頁為有效資料頁。 In another embodiment of the present invention, a flash memory controller is disclosed, wherein the flash memory controller is used to access a flash memory module, and the flash memory module includes a plurality of flash memory chips, each of the flash memory chips includes a plurality of first temporary storage blocks and a plurality of second temporary storage blocks, each of the first temporary storage blocks and the second temporary storage block includes a plurality of data pages, and the flash memory controller includes a read-only memory and a microprocessor, wherein the read-only memory is used to store a code, and the microprocessor is configured to execute the code Controlling the flash memory module Accessing; wherein when a power failure occurs after a power failure, the microprocessor reads the content of the spare area of a data page in the first temporary storage block, and determines a data page serial number; and the microprocessor Determining that all the data pages in the second temporary storage block that are located before the serial number of the data page are invalid data pages, and determining that the second temporary storage block includes the data page serial number and all subsequent data pages as valid data pages.

100‧‧‧記憶裝置 100‧‧‧ memory device

110‧‧‧快閃記憶體控制器 110‧‧‧Flash Memory Controller

112‧‧‧微處理器 112‧‧‧Microprocessor

112C‧‧‧程式碼 112C‧‧‧ Code

112M‧‧‧唯讀記憶體 112M‧‧‧Reading memory

114‧‧‧控制邏輯 114‧‧‧Control logic

116‧‧‧緩衝記憶體 116‧‧‧Buffered memory

118‧‧‧介面邏輯 118‧‧‧Interface logic

120‧‧‧快閃記憶體模組 120‧‧‧Flash Memory Module

130‧‧‧主裝置 130‧‧‧Main device

132‧‧‧編碼器 132‧‧‧Encoder

134‧‧‧解碼器 134‧‧‧Decoder

200~208、500~506‧‧‧步驟 200~208, 500~506‧‧‧ steps

310、320‧‧‧快閃記憶體晶片 310, 320‧‧‧ flash memory chip

352、534、536‧‧‧超級區塊 352, 534, 536‧‧‧ Super Blocks

DB_0~DB_M‧‧‧資料區塊 DB_0~DB_M‧‧‧data block

TB_MLC_0~TB_MLC_K‧‧‧第一暫存區塊 TB_MLC_0~TB_MLC_K‧‧‧First temporary storage block

TB_SIC0~TB_SLC_N‧‧‧第二暫存區塊 TB_SIC0~TB_SLC_N‧‧‧Second temporary storage block

P0~P34‧‧‧資料頁 P0~P34‧‧‧Information Page

LBA_001、LBA_XXX‧‧‧邏輯位址 LBA_001, LBA_XXX‧‧‧ logical address

第1圖為依據本發明一實施例之一記憶裝置的示意圖。 1 is a schematic diagram of a memory device in accordance with an embodiment of the present invention.

第2圖為根據本發明一實施例之管理快閃記憶體模組的流程圖。 2 is a flow chart of managing a flash memory module in accordance with an embodiment of the present invention.

第3A圖為管理快閃記憶體模組的示意圖。 Figure 3A is a schematic diagram of managing a flash memory module.

第3B圖為根據本發明一實施例之超級區塊的示意圖。 Figure 3B is a schematic illustration of a superblock in accordance with an embodiment of the present invention.

第4圖為根據本發明一實施例之將資料寫入至暫存區塊以及資料區塊的示意圖。 FIG. 4 is a schematic diagram of writing data to a temporary storage block and a data block according to an embodiment of the invention.

第5圖為根據本發明另一實施例之管理快閃記憶體模組的流程圖。 FIG. 5 is a flow chart of managing a flash memory module according to another embodiment of the present invention.

第6圖為根據本發明一實施例之重新建立暫存區塊以及資料區塊的位址映射表的示意圖。 FIG. 6 is a schematic diagram of an address mapping table for re-establishing a temporary storage block and a data block according to an embodiment of the present invention.

參考第1圖,第1圖為依據本發明一實施例之一記憶裝置100的示意圖。記憶裝置100包含有一快閃記憶體模組120以及一快閃記憶體控制器110,且快閃記憶體控制器110用來存取快閃記憶體模組120。依據本實施例,快閃記憶體控制器110包含一微處理器112、一唯讀記憶體(Read Only Memory,ROM)112M、一控制邏輯114、一緩衝記憶體116、與一介面邏輯118。唯讀記憶體112M係用來儲存一程式碼112C,而微處理器112則用來執行程式碼112C以控制對快閃 記憶體模組120之存取(Access)。控制邏輯114包含了一編碼器132以及一解碼器134,其中編碼器132用來對寫入到快閃記憶體模組120中的資料進行編碼以產生對應的校驗碼(或稱,錯誤更正碼(Error Correction Code),ECC),而解碼器134用來將從快閃記憶體模組120所讀出的資料進行解碼。 Referring to FIG. 1, FIG. 1 is a schematic diagram of a memory device 100 in accordance with an embodiment of the present invention. The memory device 100 includes a flash memory module 120 and a flash memory controller 110, and the flash memory controller 110 is used to access the flash memory module 120. According to the embodiment, the flash memory controller 110 includes a microprocessor 112, a read only memory (ROM) 112M, a control logic 114, a buffer memory 116, and an interface logic 118. The read-only memory 112M is used to store a code 112C, and the microprocessor 112 is used to execute the code 112C to control the flash. Access to the memory module 120. The control logic 114 includes an encoder 132 and a decoder 134, wherein the encoder 132 is configured to encode the data written into the flash memory module 120 to generate a corresponding check code (or, error correction) The code (Error Correction Code), ECC), and the decoder 134 is used to decode the data read from the flash memory module 120.

於典型狀況下,快閃記憶體模組120包含了多個快閃記憶體晶片,而每一個快閃記憶體晶片包含複數個區塊(Block),而該控制器(例如:透過微處理器112執行程式碼112C之快閃記憶體控制器110)對快閃記憶體模組120進行抹除資料運作係以區塊為單位來進行。另外,一區塊可記錄特定數量的資料頁(Page),其中該控制器(例如:透過微處理器112執行程式碼112C之記憶體控制器110)對快閃記憶體模組120進行寫入資料之運作係以資料頁為單位來進行寫入。在本實施例中,快閃記憶體模組120為一立體NAND型快閃記憶體(3D NAND-type flash)。 In a typical situation, the flash memory module 120 includes a plurality of flash memory chips, and each of the flash memory chips includes a plurality of blocks (eg, through a microprocessor). The flash memory controller 110 of the execution code 112C executes the erase data operation on the flash memory module 120 in units of blocks. In addition, a block can record a specific number of pages, wherein the controller (eg, the memory controller 110 executing the code 112C through the microprocessor 112) writes to the flash memory module 120. The operation of the data is written in units of data pages. In this embodiment, the flash memory module 120 is a stereo NAND-type flash (3D NAND-type flash).

實作上,透過微處理器112執行程式碼112C之快閃記憶體控制器110可利用其本身內部之元件來進行諸多控制運作,例如:利用控制邏輯114來控制快閃記憶體模組120之存取運作(尤其是對至少一區塊或至少一資料頁之存取運作)、利用緩衝記憶體116進行所需之緩衝處理、以及利用介面邏輯118來與一主裝置(Host Device)130溝通。 In practice, the flash memory controller 110 executing the code 112C through the microprocessor 112 can perform various control operations by using its own internal components, for example, using the control logic 114 to control the flash memory module 120. Access operations (especially for at least one block or at least one data page), buffer memory 116 for buffering, and interface logic 118 for communication with a host device 130 .

在一實施例中,記憶裝置100可以是可攜式記憶裝置(例如:符合SD/MMC、CF、MS、XD標準之記憶卡),且主裝置130為一可與記憶裝置連接的電子裝置,例如手機、筆記型電腦、桌上型電腦...等等。而在另一實施例中,記憶裝置100可以設置在一電子裝置中,例如設置在手機、筆記型電腦、桌上型 電腦之中,而此時主裝置130可以是該電子裝置的一處理器。 In an embodiment, the memory device 100 can be a portable memory device (for example, a memory card conforming to the SD/MMC, CF, MS, and XD standards), and the main device 130 is an electronic device connectable to the memory device. For example, mobile phones, notebook computers, desktop computers, etc. In another embodiment, the memory device 100 can be disposed in an electronic device, such as a mobile phone, a notebook computer, or a desktop device. In the computer, the main device 130 can be a processor of the electronic device.

參考第2圖,其為根據本發明一實施例之管理快閃記憶體模組120的流程圖。在步驟200中,流程開始。在步驟202中,快閃記憶體控制器110接收來自主裝置130的一寫入命令,以將一資料寫入至快閃記憶體模組120的一區塊中。在本實施例中,參考第3A圖,快閃記憶體模組120包含了多個快閃記憶體晶片310、320,每一個快閃記憶體晶片包含了多個資料區塊DB_0~DB_M、多個第二暫存區塊TB_SLC_0~TB_SLC_N及多個第一暫存區塊TB_MLC_0~TB_MLC_K,而每一個區塊均包含了多個資料頁。在本實施例中,第二暫存區塊TB_SLC_0~TB_SLC_N為單層式儲存(Single-Level Cell,SLC)區塊,且資料區塊DB_0~DB_M以及第一暫存區塊TB_MLC_0~TB_MLC_K為多層式儲存(MLC)區塊,但不以此為限,於其他實施例中資料區塊DB0~DB_M及/或第一暫存區塊TB_MLC_0~TB_MLC_K可為三層式儲存(TLC)區塊。在一實施例中,第二暫存區塊TB_SLC_0~TB_SLC_N亦可使用多層式儲存區塊來做為單層式儲存區塊來使用。在快閃記憶體模組120的實際操作中,可以“超級區塊”來作為資料寫入的模式,具體來說,參考第3B圖,其為根據本發明一實施例之超級區塊的示意圖。如第3B圖所示,假設每一個快閃記憶體晶片310、320中的區塊均分為兩個平面(plane),且快閃記憶體模組120僅包含兩個快閃記憶體晶片310、320,故快閃記憶體晶片310、320中位於不同平面的四個區塊便可以構成一超級區塊。在第3B圖中,快閃記憶體晶片310、320中的資料區塊DB_0、DB_1構成一超級區塊352、快閃記憶體晶片310、320中的第二暫存區塊TB_SLC_0、TB_SLC_1構成一超級區塊354、且快閃記憶體晶片310、320中的第一暫存區塊TB_MLC_0、TB_MLC_1構成一超級區塊356...以此類推。當資料需要寫入到快閃記憶體模組120時,每一次都需要寫入到超級區塊中的每一個資料頁、亦即四 個區塊的一個資料頁中,舉例來說,假設一區塊中的一個資料頁的大小為16KB,則快閃記憶體控制器110一次需要寫入64KB的資料至一超級區塊356的一個資料頁,亦即將這64KB的資料依序寫入到快閃記憶體晶片310中第一暫存區塊TB_MLC_0的一個資料頁、快閃記憶體晶片310中第一暫存區塊TB_MLC_1的一個資料頁、快閃記憶體晶片320中第一暫存區塊TB_MLC_0的一個資料頁、以及快閃記憶體晶片320中第一暫存區塊TB_MLC_1的一個資料頁。於其他實施例中,快閃記憶體控制器110一次需要寫入128KB的資料至一超級區塊356的二個資料頁,亦即將這128KB的資料寫入到快閃記憶體晶片310中第一暫存區塊TB_MLC_0的二個資料頁、快閃記憶體晶片310中第一暫存區塊TB_MLC_1的二個資料頁、快閃記憶體晶片320中第一暫存區塊TB_MLC_0的二個資料頁、以及快閃記憶體晶片320中第一暫存區塊TB_MLC_1的二個資料頁。 Referring to FIG. 2, a flow diagram of managing a flash memory module 120 in accordance with an embodiment of the present invention. In step 200, the process begins. In step 202, the flash memory controller 110 receives a write command from the host device 130 to write a file into a block of the flash memory module 120. In this embodiment, referring to FIG. 3A, the flash memory module 120 includes a plurality of flash memory chips 310 and 320. Each of the flash memory chips includes a plurality of data blocks DB_0~DB_M. The second temporary storage block TB_SLC_0~TB_SLC_N and the plurality of first temporary storage blocks TB_MLC_0~TB_MLC_K, and each of the blocks includes a plurality of data pages. In this embodiment, the second temporary storage block TB_SLC_0~TB_SLC_N is a single-level cell (SLC) block, and the data block DB_0~DB_M and the first temporary storage block TB_MLC_0~TB_MLC_K are multiple layers. The storage (MLC) block, but not limited thereto, in other embodiments, the data block DB0~DB_M and/or the first temporary storage block TB_MLC_0~TB_MLC_K may be a three-tier storage (TLC) block. In an embodiment, the second temporary storage block TB_SLC_0~TB_SLC_N may also be used as a single-layer storage block using a multi-layer storage block. In the actual operation of the flash memory module 120, a "super block" may be used as a mode of data writing. Specifically, referring to FIG. 3B, which is a schematic diagram of a super block according to an embodiment of the present invention. . As shown in FIG. 3B, it is assumed that the blocks in each of the flash memory chips 310, 320 are divided into two planes, and the flash memory module 120 includes only two flash memory chips 310. 320, so four blocks located in different planes of the flash memory chips 310, 320 can form a super block. In FIG. 3B, the data blocks DB_0, DB_1 in the flash memory chips 310, 320 constitute a super block 352, and the second temporary storage blocks TB_SLC_0 and TB_SLC_1 in the flash memory chips 310, 320 constitute a The super block 354, and the first temporary storage blocks TB_MLC_0, TB_MLC_1 of the flash memory chips 310, 320 constitute a super block 356... and so on. When data needs to be written to the flash memory module 120, each time it needs to be written to each data page in the super block, that is, four In a data page of a block, for example, assuming that the size of one data page in a block is 16 KB, the flash memory controller 110 needs to write 64 KB of data to one of the super blocks 356 at a time. The data page also sequentially writes the 64 KB data to a data page of the first temporary storage block TB_MLC_0 in the flash memory chip 310, and a data of the first temporary storage block TB_MLC_1 in the flash memory chip 310. A page of the first temporary storage block TB_MLC_0 in the page, the flash memory chip 320, and a data page of the first temporary storage block TB_MLC_1 in the flash memory chip 320. In other embodiments, the flash memory controller 110 needs to write 128 KB of data to two data pages of a super block 356 at a time, that is, the 128 KB of data is written into the flash memory chip 310. Two data pages of the temporary block TB_MLC_0, two data pages of the first temporary storage block TB_MLC_1 in the flash memory chip 310, and two data pages of the first temporary storage block TB_MLC_0 in the flash memory chip 320 And two data pages of the first temporary storage block TB_MLC_1 in the flash memory chip 320.

在本實施例中,當資料需要寫入至快閃記憶體模組120時,快閃記憶體控制器110會由第一暫存區塊TB_MLC_0~TB_MLC_K中選擇一個來進行儲存,而由於快閃記憶體控制器110對於第一暫存區塊TB_MLC_0~TB_MLC_K一次寫入的資料量需要大於一臨界值(例如,上述的64KB),因此,在步驟204中,快閃記憶體控制器110判斷快閃記憶體模組120的存取是否符合一特定條件,若否,流程進入步驟206;若是,則流程進入至步驟208。具體來說,該特定條件指的是步驟202中所述之寫入命令所對應的資料以及目前儲存在第二暫存區塊中且尚未搬移至第一暫存區塊之資料的資料量總和是否到達該臨界值。 In this embodiment, when data needs to be written to the flash memory module 120, the flash memory controller 110 selects one of the first temporary storage blocks TB_MLC_0~TB_MLC_K for storage, and flashes due to flashing. The amount of data written by the memory controller 110 for the first temporary storage block TB_MLC_0~TB_MLC_K needs to be greater than a critical value (for example, 64 KB described above). Therefore, in step 204, the flash memory controller 110 judges fast. Whether the access of the flash memory module 120 meets a specific condition, if not, the flow proceeds to step 206; if so, the flow proceeds to step 208. Specifically, the specific condition refers to the sum of the data corresponding to the write command described in step 202 and the data currently stored in the second temporary storage block and not yet moved to the first temporary storage block. Whether to reach the threshold.

在步驟206中,快閃記憶體控制器110將步驟202中所述之寫入命令所對應的資料寫入至該第二暫存區塊中。在步驟208中,快閃記憶體控制器110將步驟202中所述之寫入命令所對應的資料,連同目前儲存在該第二暫存區塊中且 尚未搬移至該第一暫存區塊之資料,一併寫入至該第一暫存區塊中,此外,在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。接著,流程回到步驟202。 In step 206, the flash memory controller 110 writes the data corresponding to the write command described in step 202 into the second temporary storage block. In step 208, the flash memory controller 110 stores the data corresponding to the write command described in step 202, together with the data currently stored in the second temporary storage block. The data that has not been moved to the first temporary storage block is also written into the first temporary storage block, and the first temporary storage block is recorded in the first temporary storage block. Information on a blank data page. Then, the flow returns to step 202.

以下透過第4圖來舉一例子來詳細說明第2圖所示之流程圖,需注意的是,為了方便理解,第4圖係以第二暫存區塊TB_SLC_0以及第一暫存區塊TB_MLC_0來做為說明,但本領域技術人員應能了解上述暫存區塊在實作上可以是第3B圖所示的超級區塊。首先,快閃記憶體控制器110自主裝置130接收到一第一寫入命令,假設該第一寫入命令所對應之資料為隨機資料(例如4KB)且資料量不到該臨界值,則快閃記憶體控制器110將該第一寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的第一個資料頁P0中;接著,快閃記憶體控制器110自主裝置130依序接收到一第二寫入命令及一第三寫入命令,假設該第二、第三寫入命令所對應之資料亦為隨機資料(例如4KB),則快閃記憶體控制器110會依序將該第二、第三寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的資料頁P1、P2中。接著,快閃記憶體控制器110自主裝置130接收到一第四寫入命令,而假設該第四寫入命令所對應之資料為連續資料,且該資料的資料量為大於該臨界值的548KB,則由於待寫入至第一暫存區塊TB_MLC_0的資料量大於該臨界值,則快閃記憶體控制器110此時會先將第二暫存區塊TB_SLC_0之資料頁P0~P2的的有效資料(共12KB)連同該第四寫入命令所對應之資料(548KB)一起寫入至第一暫存區塊TB_MLC_0的資料頁P0~P34中。在本實施例中,快閃記憶體控制器110在將資料寫入到第一暫存區塊TB_MLC_0的過程中,會在每一個資料頁P0~P34的一備用區域中記錄目前第二暫存區塊TB_SLC_0的第一個空白資料頁的資訊(亦即資料頁P3)。在本實施例中,該備用區域的大小通常是64B或是128B,且一般是用來儲存檔案系統的管理資訊。 The flow chart shown in FIG. 2 will be described in detail below by taking an example of FIG. 4. It should be noted that, for convenience of understanding, FIG. 4 is a second temporary storage block TB_SLC_0 and a first temporary storage block TB_MLC_0. As an illustration, those skilled in the art should be able to understand that the above-mentioned temporary storage block can be implemented as a super block shown in FIG. 3B. First, the flash memory controller 110 autonomous device 130 receives a first write command, and assumes that the data corresponding to the first write command is random data (for example, 4 KB) and the data amount is less than the critical value. The flash memory controller 110 writes the data corresponding to the first write command to the first data page P0 of the second temporary storage block TB_SLC_0; then, the flash memory controller 110 autonomous device 130 sequentially Receiving a second write command and a third write command, assuming that the data corresponding to the second and third write commands is also random data (for example, 4 KB), the flash memory controller 110 sequentially The data corresponding to the second and third write commands are written into the data pages P1 and P2 of the second temporary storage block TB_SLC_0. Next, the flash memory controller 110 autonomous device 130 receives a fourth write command, and assumes that the data corresponding to the fourth write command is continuous data, and the data amount of the data is 548 KB greater than the critical value. If the amount of data to be written to the first temporary storage block TB_MLC_0 is greater than the critical value, the flash memory controller 110 firstly sets the data pages P0~P2 of the second temporary storage block TB_SLC_0. The valid data (12 KB in total) is written to the data pages P0 to P34 of the first temporary storage block TB_MLC_0 together with the data (548 KB) corresponding to the fourth write command. In this embodiment, the flash memory controller 110 records the current second temporary storage in a spare area of each of the data pages P0 to P34 in the process of writing the data to the first temporary storage block TB_MLC_0. The information of the first blank data page of the block TB_SLC_0 (ie, the data page P3). In this embodiment, the size of the spare area is usually 64B or 128B, and is generally used to store management information of the file system.

一般而言,當快閃記憶體控制器110接收到該第一、第二、第三寫入命令所對應之資料時,係先將該第一、第二、第三寫入命令所對應之資料暫存於緩衝記憶體116中,而當快閃記憶體控制器110將該第一、第二、第三寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的資料頁P0、P1、P2後,將刪除緩衝記憶體116中暫存的對應資料。於此實施例中,當快閃記憶體控制器110將該第一、第二、第三寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的資料頁P0、P1、P2後,係不刪除暫存於緩衝記憶體116中之該第一、第二、第三寫入命令所對應之資料。當收到該第四寫入命令時,快閃記憶體控制器110將該第四寫入命令所對應之資料暫存於緩衝記憶體116後,直接從緩衝記憶體116中讀取該第一至第四寫入命令所對應之資料,將其一併寫入至第一暫存區塊TB_MLC_0的資料頁P0~P34中,接著再刪除緩衝記憶體116中暫存之該第一至第四寫入命令所對應之資料。於其他實施例中,當快閃記憶體控制器110將該第一、第二、第三寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的資料頁P0、P1、P2後,係刪除暫存於緩衝記憶體116中之該第一、第二、第三寫入命令所對應之資料。當收到該第四寫入命令時,快閃記憶體控制器110將該第四寫入命令所對應之資料暫存於緩衝記憶體116後,從第二暫存區塊TB_SLC_0的資料頁P0、P1、P2讀取資料至緩衝記憶體116之後,再從緩衝記憶體116中讀取該第一至第四寫入命令所對應之資料,將其一併寫入至第一暫存區塊TB_MLC_0的資料頁P0~P34中。 Generally, when the flash memory controller 110 receives the data corresponding to the first, second, and third write commands, the first, second, and third write commands are first The data is temporarily stored in the buffer memory 116, and when the flash memory controller 110 writes the data corresponding to the first, second, and third write commands to the data page P0 of the second temporary storage block TB_SLC_0 After P1 and P2, the corresponding data temporarily stored in the buffer memory 116 is deleted. In this embodiment, after the flash memory controller 110 writes the data corresponding to the first, second, and third write commands to the data pages P0, P1, and P2 of the second temporary storage block TB_SLC_0. The data corresponding to the first, second, and third write commands temporarily stored in the buffer memory 116 are not deleted. When the fourth write command is received, the flash memory controller 110 temporarily stores the data corresponding to the fourth write command in the buffer memory 116, and directly reads the first data from the buffer memory 116. The data corresponding to the fourth write command is collectively written into the data pages P0 to P34 of the first temporary storage block TB_MLC_0, and then the first to fourth temporarily stored in the buffer memory 116 are deleted. Write the data corresponding to the command. In other embodiments, after the flash memory controller 110 writes the data corresponding to the first, second, and third write commands to the data pages P0, P1, and P2 of the second temporary storage block TB_SLC_0. The data corresponding to the first, second, and third write commands temporarily stored in the buffer memory 116 is deleted. When receiving the fourth write command, the flash memory controller 110 temporarily stores the data corresponding to the fourth write command in the buffer memory 116, and from the data page P0 of the second temporary storage block TB_SLC_0. After P1 and P2 read the data to the buffer memory 116, the data corresponding to the first to fourth write commands are read from the buffer memory 116, and are collectively written to the first temporary storage block. TB_MLC_0 data page P0~P34.

需注意的是,在上述的實施例中,第一暫存區塊TB_MLC_0中所記錄之第二暫存區塊TB_SLC_0的第一個空白資料頁的資訊是資料頁P3,但本發明並不以此為限,在其他實施例中,所謂“第二暫存區塊TB_SLC_0的第一個空白 資料頁的資訊”可以是任何可以關聯到並據以決定出資料頁P3的內容,例如第二暫存區塊TB_SLC_0之最後一個有資料寫入之資料頁的序號,這些設計上的變化應隸屬於本發明的範疇。 It should be noted that, in the foregoing embodiment, the information of the first blank data page of the second temporary storage block TB_SLC_0 recorded in the first temporary storage block TB_MLC_0 is the data page P3, but the present invention does not To be limited thereto, in other embodiments, the first blank of the second temporary storage block TB_SLC_0 is called. The information of the data page may be any content that can be associated with and determined by the data page P3, for example, the serial number of the last data page written by the second temporary storage block TB_SLC_0, and these design changes shall be attached to Within the scope of the invention.

接著,快閃記憶體控制器110自主裝置130接收到一第五寫入命令及一第六寫入命令,假設該第五、第六寫入命令所對應之資料為隨機資料,則快閃記憶體控制器110會依序將該第五、第六寫入命令所對應之資料寫入至第二暫存區塊TB_SLC_0的資料頁P3、P4中。在本實施例中,係假設第二暫存區塊TB_SLC_0的資料頁P4所儲存的資料是用來更新第二暫存區塊TB_SLC_0的資料頁P1所儲存的資料,亦即第二暫存區塊TB_SLC_0的資料頁P1、P4與第一暫存區塊TB_MLC_0的資料頁P1對應到相同的邏輯位址。 Then, the flash memory controller 110 autonomous device 130 receives a fifth write command and a sixth write command, and assumes that the data corresponding to the fifth and sixth write commands is random data, then flash memory The body controller 110 sequentially writes the data corresponding to the fifth and sixth write commands to the data pages P3 and P4 of the second temporary storage block TB_SLC_0. In this embodiment, it is assumed that the data stored in the data page P4 of the second temporary storage block TB_SLC_0 is used to update the data stored in the data page P1 of the second temporary storage block TB_SLC_0, that is, the second temporary storage area. The data pages P1, P4 of the block TB_SLC_0 and the data page P1 of the first temporary storage block TB_MLC_0 correspond to the same logical address.

在第2~4圖的實施例中,在第一暫存區塊TB_MLC_0中的資料頁P0~P34的備用區域中記錄在其資料寫入過程中第二暫存區塊TB_SLC_0的第一個空白資料頁的資訊的目的是為了避免後續發生斷電後回復(POR)或是突發斷電後回復(SPOR)狀況時無法判斷第一暫存區塊TB_MLC0與第二暫存區塊TB_SLC_0中的資料新舊問題,而造成錯誤。以下第5、6圖所示的實施例將說明如何利用第一暫存區塊TB_MLC_0所記錄之第二暫存區塊TB_SLC_0的第一個空白資料頁的資訊來正確地判斷第一暫存區塊TB_MLC_0與第二暫存區塊TB_SLC_0中的資料新舊。 In the embodiment of the second to fourth embodiments, the first blank of the second temporary storage block TB_SLC_0 is recorded in the spare area of the data pages P0 to P34 in the first temporary storage block TB_MLC_0 in the data writing process. The purpose of the information on the data page is to avoid the subsequent occurrence of a power failure (POR) or a SPOR condition, and it is impossible to determine the first temporary storage block TB_MLC0 and the second temporary storage block TB_SLC_0. Information is old and new, causing errors. The following embodiments shown in FIGS. 5 and 6 will explain how to correctly determine the first temporary storage area by using the information of the first blank data page of the second temporary storage block TB_SLC_0 recorded by the first temporary storage block TB_MLC_0. The data in the block TB_MLC_0 and the second temporary storage block TB_SLC_0 is new and old.

參考第5圖,其為根據本發明一實施例之管理快閃記憶體模組120的方法的流程圖。在步驟500中,記憶裝置100遭遇到斷電後回復(POR)或是突發斷電後回復(SPOR)的狀況,因此,原本儲存在緩衝記憶體116中的位址映射表均已 遺失。在步驟502中,快閃記憶體控制器110讀取第一暫存區塊的最後一個有資料寫入的資料頁的備用區域的內容,以決定出第二暫存區塊的一資料頁序號。在步驟504中,快閃記憶體控制器110判斷第二暫存區塊中從該資料頁序號開始的資料是最新的資料,而該資料頁序號之前的都是舊資料(無效資料)。在步驟506中,快閃記憶體控制器110根據步驟504的判斷結果來重新建立位址映射表。 Referring to FIG. 5, a flowchart of a method of managing a flash memory module 120 in accordance with an embodiment of the present invention. In step 500, the memory device 100 encounters a state after a power failure (POR) or a power failure (SPOR). Therefore, the address mapping table originally stored in the buffer memory 116 has been Lost. In step 502, the flash memory controller 110 reads the content of the spare area of the last data page of the first temporary storage block to determine a data page number of the second temporary storage block. . In step 504, the flash memory controller 110 determines that the data in the second temporary storage block starting from the data page number is the latest data, and the data page number is the old data (invalid data). In step 506, the flash memory controller 110 re-establishes the address mapping table according to the determination result of step 504.

具體來說,接續著第4圖所示的實施例,並同時參考第6圖,當記憶裝置100遭遇到斷電後回復(POR)或是突發斷電後回復(SPOR)的狀況後,快閃記憶體控制器110會需要重新建立分別對應到第二暫存區塊TB_SLC_0以及第一暫存區塊TB_MLC_0的位址映射表。此時,快閃記憶體控制器110會直接至第一暫存區塊TB_MLC_0的最後一個有資料寫入的資料頁(亦即,P34)的備用區域讀取內容,並得到一個資料頁序號(亦即,P3),而在建立第二暫存區塊TB_SLC_0之位址映射表的過程中,快閃記憶體控制器110會直接判斷第二暫存區塊TB_SLC_0從資料頁P3開始以後的資料才是新的資料,而資料頁P3之前的資料都是舊的資料,因此,第二暫存區塊TB_SLC_0的位址映射表只會記錄有關於資料頁P3、P4的實體位址及對應的邏輯位址,而並不會記錄有關於資料頁P0~P2的位址資訊。 Specifically, following the embodiment shown in FIG. 4, and referring to FIG. 6, when the memory device 100 encounters a power failure (POR) or a sudden power failure (SPOR) condition, The flash memory controller 110 may need to re-establish an address mapping table corresponding to the second temporary storage block TB_SLC_0 and the first temporary storage block TB_MLC_0, respectively. At this time, the flash memory controller 110 directly reads the content to the spare area of the last data page (ie, P34) of the first temporary storage block TB_MLC_0, and obtains a data page number ( That is, P3), in the process of establishing the address mapping table of the second temporary storage block TB_SLC_0, the flash memory controller 110 directly determines the data of the second temporary storage block TB_SLC_0 starting from the data page P3. It is the new data, and the data before the data page P3 is the old data. Therefore, the address mapping table of the second temporary storage block TB_SLC_0 will only record the physical addresses of the data pages P3 and P4 and the corresponding The logical address does not record the address information about the data pages P0~P2.

此外,關於第一暫存區塊TB_MLC_0的位址映射表,快閃記憶體控制器110則會循序地讀取第一暫存區塊TB_MLC_0中每一個資料頁的資訊以重新建立出第一暫存區塊TB_MLC_0中每一個資料頁P0~P34的實體位址及對應的邏輯位址。 In addition, regarding the address mapping table of the first temporary storage block TB_MLC_0, the flash memory controller 110 sequentially reads the information of each of the first temporary storage blocks TB_MLC_0 to re-establish the first temporary The physical address of each data page P0~P34 in the block TB_MLC_0 and the corresponding logical address.

在以上的實施例中,由於在斷電後回復或是突發斷電後回復的狀況 後所重新建立之第二暫存區塊TB_SLC_0的位址映射表僅會包含最新的資訊,因此若是第二暫存區塊TB_SLC_0與第一暫存區塊TB_MLC_0的位址映射表具有一相同的邏輯位址,例如第6圖所示之第二暫存區塊TB_SLC_0之資料頁P4與第一暫存區塊TB_MLC_0之資料頁P1具有相同的邏輯位址(LBA_001),則可以直接地判斷第二暫存區塊TB_SLC_0之資料頁P4是最新的資料,亦即第二暫存區塊TB_SLC_0之資料頁P4的資料是用來更新第一暫存區塊TB_MLC_0之資料頁P1的內容。在一實施例中,若是此時快閃記憶體控制器110接收到一要求讀取邏輯位址LBA_001的讀取命令,則快閃記憶體控制器110會直接先從第二暫存區塊TB_SLC_0的位址映射表來取得對應的實體位址,並自第二暫存區塊TB_SLC_0之資料頁P4來讀取資料,而並不需要去讀取第一暫存區塊TB_MLC_0之位址映射表的內容。 In the above embodiments, the status of the reply after the power is restored after the power is turned off or the power is suddenly turned off. The address mapping table of the second temporary storage block TB_SLC_0 newly re-established will only contain the latest information, so if the second temporary storage block TB_SLC_0 has the same address mapping table as the first temporary storage block TB_MLC_0 The logical address, for example, the data page P4 of the second temporary storage block TB_SLC_0 shown in FIG. 6 has the same logical address (LBA_001) as the data page P1 of the first temporary storage block TB_MLC_0, and the content can be directly judged. The data page P4 of the second temporary storage block TB_SLC_0 is the latest data, that is, the data of the data page P4 of the second temporary storage block TB_SLC_0 is used to update the content of the data page P1 of the first temporary storage block TB_MLC_0. In an embodiment, if the flash memory controller 110 receives a read command requesting the read logical address LBA_001, the flash memory controller 110 directly starts from the second temporary storage block TB_SLC_0. The address mapping table obtains the corresponding physical address, and reads the data from the data page P4 of the second temporary storage block TB_SLC_0, and does not need to read the address mapping table of the first temporary storage block TB_MLC_0 Content.

在一實施例中,當多個第一暫存區塊完成資料寫入之後,可以對該些第一暫存區塊進行垃圾收集(garbage collection)操作,以將其中的有效資料搬移至至少一資料區塊(例如,DB_0)中,而該些第一暫存區塊之後則便可以被釋放出來以繼續供資料寫入之用。 In an embodiment, after the plurality of first temporary storage blocks complete the data writing, the first temporary storage blocks may be subjected to a garbage collection operation to move the valid data to at least one of the first temporary storage blocks. The data blocks (for example, DB_0) can be released after the first temporary storage blocks to continue for data writing.

簡要歸納本發明,在本發明之管理快閃記憶體模組的方法中,係使用兩個暫存區塊(第一暫存區塊以及第二暫存區塊)來儲存寫入至快閃記憶體模組中的資料,其中第一暫存區塊主要是用來儲存資料量大於一臨界值(例如,64KB)的資料,而第二暫存區塊則是用來儲存資料量小於該臨界值的隨機資料。另外,透過在第一暫存區塊中記錄目前第二暫存區塊的最後一個空白資料頁的資訊,可以在發生斷電後回復或是突發斷電後回復的狀況後能夠準確地判斷出第二暫存區塊與第一暫存區塊中的資料新舊,特別是當第一暫存區塊與第二暫 存區塊中有資料頁具有相同邏輯位址的情況,以確實解決先前技術的問題。 Briefly summarized in the present invention, in the method for managing a flash memory module of the present invention, two temporary storage blocks (a first temporary storage block and a second temporary storage block) are used to store and write to the flash. The data in the memory module, wherein the first temporary storage block is mainly used for storing data whose data amount is greater than a critical value (for example, 64 KB), and the second temporary storage block is used for storing data amount smaller than the Random data for the critical value. In addition, by recording the information of the last blank data page of the current second temporary storage block in the first temporary storage block, the information can be accurately determined after the power failure after the power failure or the power failure after the sudden power failure. The information in the second temporary storage block and the first temporary storage block is new and old, especially when the first temporary storage block and the second temporary storage block There are cases where the data pages have the same logical address in the memory block to solve the problem of the prior art.

以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。 The above are only the preferred embodiments of the present invention, and all changes and modifications made to the scope of the present invention should be within the scope of the present invention.

Claims (10)

一種管理一快閃記憶體模組的方法,其中該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,以及該方法包含有:將一第一資料寫入至該多個第二暫存區塊中的一第二暫存區塊中;當該快閃記憶體模組的存取符合一特定條件時,將儲存於該第二暫存區塊中的該第一資料搬移至該多個第一暫存區塊中的一第一暫存區塊,並在該第一資料搬移至該第一暫存區塊時一併在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 A method for managing a flash memory module, wherein the flash memory module comprises a plurality of flash memory chips, each of the flash memory chips comprising a plurality of first temporary memory blocks and a plurality of The second temporary storage block, each of the first temporary storage block and the second temporary storage block includes a plurality of data pages, and the method includes: writing a first data to the plurality of second temporary storage areas a second temporary storage block in the block; when the access of the flash memory module meets a specific condition, moving the first data stored in the second temporary storage block to the plurality of a first temporary storage block in the first temporary storage block, and recording the current second temporary storage in the first temporary storage block when the first data is moved to the first temporary storage block Information on the first blank data page of the block. 如申請專利範圍第1項所述之方法,其中該第二暫存區塊為一單層式儲存(Single-Level Cell,SLC)區塊,且該第一暫存區塊為多層式儲存(Multiple-Level Cell,MLC)區塊或是三層式儲存(Triple-Level Cell,TLC)區塊。 The method of claim 1, wherein the second temporary storage block is a single-level cell (SLC) block, and the first temporary storage block is a multi-layer storage ( Multiple-Level Cell (MLC) block or Triple-Level Cell (TLC) block. 如申請專利範圍第1項所述之方法,其中該第二暫存區塊之第一個空白資料頁的資訊為該第二暫存區塊之第一個空白資料頁的序號,或是該第二暫存區塊之最後一個有資料寫入之資料頁的序號。 The method of claim 1, wherein the information of the first blank data page of the second temporary storage block is the serial number of the first blank data page of the second temporary storage block, or The last one of the second temporary storage block has the serial number of the data page to which the data is written. 如申請專利範圍第1項所述之方法,其中將儲存於該第二暫存區塊中的該第一資料搬移至該第一暫存區塊,並在該第一暫存區塊中記錄該第二暫存區塊中有關於第一個空白資料頁之序號的資訊的步驟包含有:將儲存於該第二暫存區塊中的該第一資料搬移至該第一暫存區塊的多個資 料頁中,並在該多個資料頁中每一個資料頁的一備用區域中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 The method of claim 1, wherein the first data stored in the second temporary storage block is moved to the first temporary storage block, and recorded in the first temporary storage block. The step of the information about the serial number of the first blank data page in the second temporary storage block includes: moving the first data stored in the second temporary storage block to the first temporary storage block Multiple funds In the material page, the information of the first blank data page of the second temporary storage block is recorded in a spare area of each of the plurality of data pages. 如申請專利範圍第4項所述之方法,另包含有:將一第二資料寫入至該第二暫存區塊中;當該第二資料寫入的過程中發生斷電後回復(power off recovery,POR)狀況時,自該第一暫存區塊中最後一個有資料寫入之資料頁的備用區域中讀取該第二暫存區塊之第一個空白資料頁的資訊,並根據該資訊來判斷該第二暫存區塊中那些資料頁是無效資料頁,以及那些資料頁的內容尚未搬移到該第一暫存區塊中,以供建立邏輯實體位址映射表。 The method of claim 4, further comprising: writing a second data into the second temporary storage block; and recovering after power failure occurs during the writing of the second data (power) In the off recovery (POR) state, the information of the first blank data page of the second temporary storage block is read from the spare area of the last data page in which the data is written in the first temporary storage block, and Based on the information, it is determined that the data pages in the second temporary storage block are invalid data pages, and the contents of those data pages have not been moved into the first temporary storage block for establishing a logical entity address mapping table. 如申請專利範圍第5項所述之方法,其中該第二暫存區塊之第一個空白資料頁的資訊係為一資料頁序號,以及根據該資訊來判斷該第二暫存區塊中那些資料頁是無效資料頁,以及那些資料頁的內容尚未搬移到該第一暫存區塊中的步驟包含有:判斷該第二暫存區塊中位於該資料頁序號之前的所有資料頁為無效資料頁;以及判斷該第二暫存區塊中包含該資料頁序號及之後的所有資料頁為有效資料頁,且該些有效資料頁的內容為該快閃記憶體模組中最新的資料。 The method of claim 5, wherein the information of the first blank data page of the second temporary storage block is a data page number, and the second temporary storage block is determined according to the information. The data pages are invalid data pages, and the steps of the data pages have not been moved to the first temporary storage block. The method includes: determining that all the data pages in the second temporary storage block that are located before the data page number are Invalid data page; and determining that the data page number and all subsequent data pages in the second temporary storage block are valid data pages, and the contents of the valid data pages are the latest data in the flash memory module . 一種快閃記憶體控制器,其中該快閃記憶體控制器係用來存取一快閃記憶體模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含多個第一暫存區塊以及多個第二暫存區塊,每一個第一暫存區塊及第二暫存區塊包含了多個資料頁,且該快閃記憶體控制器包含 有:一唯讀記憶體,用來儲存一程式碼;以及一微處理器,用來執行該程式碼以控制對該快閃記憶體模組之存取;其中該微處理器將一第一資料寫入至該多個第二暫存區塊中的一第二暫存區塊中;以及當該快閃記憶體模組的存取符合一特定條件時,該微處理器將儲存於該第二暫存區塊中的該第一資料搬移至該多個第一暫存區塊中的一第一暫存區塊,並在該第一資料搬移至該第一暫存區塊時一併在該第一暫存區塊中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 A flash memory controller, wherein the flash memory controller is used to access a flash memory module, the flash memory module includes a plurality of flash memory chips, each flashing The memory chip includes a plurality of first temporary storage blocks and a plurality of second temporary storage blocks, each of the first temporary storage block and the second temporary storage block includes a plurality of data pages, and the flash memory Controller contains There is: a read-only memory for storing a code; and a microprocessor for executing the code to control access to the flash memory module; wherein the microprocessor will be a first Data is written into a second temporary storage block of the plurality of second temporary storage blocks; and when the access of the flash memory module meets a specific condition, the microprocessor is stored in the The first data in the second temporary storage block is moved to a first temporary storage block of the plurality of first temporary storage blocks, and when the first data is moved to the first temporary storage block And storing information of the first blank data page of the second temporary storage block in the first temporary storage block. 如申請專利範圍第7項所述之快閃記憶體控制器,其中該第二暫存區塊為一單層式儲存(Single-Level Cell,SLC)區塊,且該第一暫存區塊為多層式儲存(Multiple-Level Cell,MLC)區塊或是三層式儲存(Triple-Level Cell,TLC)區塊。 The flash memory controller of claim 7, wherein the second temporary storage block is a single-level cell (SLC) block, and the first temporary storage block It is a Multiple-Level Cell (MLC) block or a Triple-Level Cell (TLC) block. 如申請專利範圍第7項所述之快閃記憶體控制器,其中該第二暫存區塊之第一個空白資料頁的資訊為該第二暫存區塊之第一個空白資料頁的序號,或是該第二暫存區塊之最後一個有資料寫入之資料頁的序號。 The flash memory controller of claim 7, wherein the information of the first blank data page of the second temporary storage block is the first blank data page of the second temporary storage block. The serial number or the serial number of the data page to which the last data of the second temporary storage block is written. 如申請專利範圍第7項所述之快閃記憶體控制器,其中該微處理器將儲存於該第二暫存區塊中的該第一資料搬移至該第一暫存區塊的多個資料頁中,並在該多個資料頁中每一個資料頁的一備用區域中記錄目前該第二暫存區塊之第一個空白資料頁的資訊。 The flash memory controller of claim 7, wherein the microprocessor moves the first data stored in the second temporary storage block to the plurality of first temporary storage blocks. In the data page, the information of the first blank data page of the second temporary storage block is recorded in a spare area of each of the plurality of data pages.
TW107100021A 2017-06-25 2018-01-02 Method for managing flash memory module and associated flash memory controller TWI657339B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810444354.3A CN109117383B (en) 2017-06-25 2018-05-10 Method for managing flash memory module and flash memory controller
US16/009,174 US10866751B2 (en) 2017-06-25 2018-06-14 Method for managing flash memory module and associated flash memory controller

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US201762524602P 2017-06-25 2017-06-25
US62/524,602 2017-06-25

Publications (2)

Publication Number Publication Date
TW201905701A TW201905701A (en) 2019-02-01
TWI657339B true TWI657339B (en) 2019-04-21

Family

ID=66213345

Family Applications (1)

Application Number Title Priority Date Filing Date
TW107100021A TWI657339B (en) 2017-06-25 2018-01-02 Method for managing flash memory module and associated flash memory controller

Country Status (1)

Country Link
TW (1) TWI657339B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6767532B2 (en) * 2019-03-11 2020-10-14 ウィンボンド エレクトロニクス コーポレーション Semiconductor storage device
TWI697778B (en) * 2019-06-17 2020-07-01 慧榮科技股份有限公司 A data storage device and a data processing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248965A1 (en) * 2008-03-25 2009-10-01 Asmedia Technology Inc. Hybrid flash memory device and method of controlling the same
TW200947455A (en) * 2008-05-06 2009-11-16 Apacer Technology Inc Method of managing storage unit and storage medium therefor
TW201351417A (en) * 2012-06-04 2013-12-16 Silicon Motion Inc Flash memory apparatus and data accessing method for flash memory
TW201519251A (en) * 2013-11-05 2015-05-16 Via Tech Inc Non-volatile memory device and operation method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090248965A1 (en) * 2008-03-25 2009-10-01 Asmedia Technology Inc. Hybrid flash memory device and method of controlling the same
TW200947455A (en) * 2008-05-06 2009-11-16 Apacer Technology Inc Method of managing storage unit and storage medium therefor
TW201351417A (en) * 2012-06-04 2013-12-16 Silicon Motion Inc Flash memory apparatus and data accessing method for flash memory
TW201519251A (en) * 2013-11-05 2015-05-16 Via Tech Inc Non-volatile memory device and operation method thereof

Also Published As

Publication number Publication date
TW201905701A (en) 2019-02-01

Similar Documents

Publication Publication Date Title
TWI692690B (en) Method for accessing flash memory module and associated flash memory controller and electronic device
TWI650644B (en) Method for managing flash memory module and related flash memory controller and electronic device
TWI720588B (en) Method for performing access management in a memory device, associated memory device and controller thereof, and associated electronic device
CN109117383B (en) Method for managing flash memory module and flash memory controller
US10372619B2 (en) Data backup method, data recovery method and storage controller
CN110908925B (en) High-efficiency garbage collection method, data storage device and controller thereof
US9582416B2 (en) Data erasing method, memory control circuit unit and memory storage apparatus
US8984219B2 (en) Data storage device and method of writing data in the same
CN110058795B (en) Method for managing flash memory module, related flash memory controller and electronic device
US20090307413A1 (en) Data writing method for flash memory and storage system and controller using the same
TWI659304B (en) Method for accessing flash memory module and associated flash memory controller and electronic device
US20140372668A1 (en) Data writing method, memory controller and memory storage apparatus
US11733895B2 (en) Control method of flash memory controller and associated flash memory controller and storage device
TWI574274B (en) Methods for accessing data in a circular block mode and apparatuses using the same
CN107590080B (en) Mapping table updating method, memory control circuit unit and memory storage device
US9037781B2 (en) Method for managing buffer memory, memory controllor, and memory storage device
US11809328B2 (en) Control method of flash memory controller and associated flash memory controller and storage device
CN113885808B (en) Mapping information recording method, memory control circuit unit and memory device
TWI657339B (en) Method for managing flash memory module and associated flash memory controller
TW202015057A (en) Flash memory controller, control method of flash memory controller and associated electronic device
TWI749279B (en) A data storage device and a data processing method
CN112051971A (en) Data merging method, memory storage device and memory control circuit unit
TW201643722A (en) Memory management method, memory control circuit unit and memory storage device
TW201337553A (en) Data writing method, memory controller and memory storage apparatus
TWI670598B (en) Method for managing flash memory module and associated flash memory controller and electronic device