[go: up one dir, main page]

TWI760094B - Memory device, flash memory controller and associated access method - Google Patents

Memory device, flash memory controller and associated access method Download PDF

Info

Publication number
TWI760094B
TWI760094B TW110104324A TW110104324A TWI760094B TW I760094 B TWI760094 B TW I760094B TW 110104324 A TW110104324 A TW 110104324A TW 110104324 A TW110104324 A TW 110104324A TW I760094 B TWI760094 B TW I760094B
Authority
TW
Taiwan
Prior art keywords
block
flash memory
time
memory module
data
Prior art date
Application number
TW110104324A
Other languages
Chinese (zh)
Other versions
TW202205290A (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 TW110104324A priority Critical patent/TWI760094B/en
Publication of TW202205290A publication Critical patent/TW202205290A/en
Application granted granted Critical
Publication of TWI760094B publication Critical patent/TWI760094B/en

Links

Images

Landscapes

  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a control method applied to a flash memory controller, which includes the following steps: creating a write time table, wherein the write time table records block numbers of blocks having data stored therein and corresponding first time and second time; referring to the write time table to determine whether there is at least one first block in the flash memory module whose first time is earlier than a first threshold, and if so, recording the at least one first block into an expired block table; referring to the write time table to determine whether there is at least one second block in the flash memory module whose second time is earlier than a second threshold, and if so, recording the at least one second block into the expired block table; and referring to the expired block table to perform an expired block recycling operation.

Description

記憶裝置、快閃記憶體控制器及其存取方法Memory device, flash memory controller and access method thereof

本發明係有關於快閃記憶體控制器及相關的控制方法。The present invention relates to a flash memory controller and a related control method.

隨著立體快閃記憶體技術的發展,快閃記憶體晶片內堆疊的層數越來越多,再加上目前的快閃記憶體模組內會包含許多採用三層式儲存(Triple-Level Cell,TLC)或是四層式儲存(Quad-Level Cell,QLC)的區塊,因此,快閃記憶體內所儲存之資料的品質越來越差,甚至在資料寫入後數週後便品質快速下滑而造成後續解碼上的困難或甚至無法讀取。為了解決此一問題,快閃記憶體控制器可以利用空閒的時間讀取快閃記憶體模組內每一個區塊的部分內容,以判斷出每一個區塊的品質,然而,上述方法會耗費大量的時間,且若是快閃記憶體控制器常常處於忙碌狀態時會無法兼顧存取效率與區塊品質。With the development of three-dimensional flash memory technology, more and more layers are stacked in the flash memory chip. In addition, the current flash memory module will contain many triple-level storage (Triple-Level Cell, TLC) or Quad-Level Cell (QLC) blocks, therefore, the quality of the data stored in the flash memory is getting worse and worse, even after a few weeks after the data is written. The rapid slide down makes subsequent decoding difficult or even impossible to read. In order to solve this problem, the flash memory controller can use the idle time to read part of the content of each block in the flash memory module to determine the quality of each block. However, the above method will consume A lot of time, and if the flash memory controller is always busy, the access efficiency and block quality cannot be taken into account.

因此,本發明的目的之一在於提出一種快閃記憶體控制器與相關的控制方法,其可以有效率地對快閃記憶體模組內品質可能有問題的區塊預先做處理,以解決先前技術中所述的問題。Therefore, one of the objectives of the present invention is to provide a flash memory controller and a related control method, which can efficiently pre-process the blocks in the flash memory module that may have problems in quality, so as to solve the problem of previous problems. Issues described in the technique.

在本發明的一個實施例中,揭露了一種應用於一快閃記憶體控制器的控制方法,其中該快閃記憶體控制器用以存取一快閃記憶體模組,該快閃記憶體模組包含了多個區塊,且每一個區塊包含了多個資料頁,以及該控制方法包含有:當資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間;當資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間;當資料寫入至該快閃記憶體模組之任一區塊的一最後資料頁時,在該最後資料頁記錄該第一時間與該第二時間;建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間;參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊;參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。In one embodiment of the present invention, a control method applied to a flash memory controller is disclosed, wherein the flash memory controller is used to access a flash memory module, the flash memory module The group includes a plurality of blocks, and each block includes a plurality of data pages, and the control method includes: when data is written into any block of the flash memory module, a first data page, record a first time in the first data page; when data is written to at least one intermediate data page of any block of the flash memory module, record a first time in the at least one intermediate data page second time; when data is written to a last data page of any block of the flash memory module, record the first time and the second time in the last data page; create a write time record Table, wherein the write time record table records the block number of the block in which data is written in the flash memory module and the corresponding first time, or records the block number in the flash memory module The block number of the block in which data is written and the corresponding first time and the second time; refer to the write time record table to determine whether there is the first time of the block in the flash memory module Earlier than a first threshold, if the first time of at least one first block in the flash memory module is earlier than the first threshold, recording the at least one first time in an expired block table a block; refer to the write time record table to determine whether the second time of a block in the flash memory module is earlier than a second threshold, if there is at least one block in the flash memory module The second time of the second block is earlier than the second threshold, the at least one second block is recorded in the expired block table; and the at least one first area recorded in the expired block table An expired block recovery operation is performed on the block and the at least one second block, so as to sequentially move the valid data in the at least one first block and the at least one second block to at least one blank block.

在本發明的另一個實施例中,揭露了一種快閃記憶體控制器,其中該快閃記憶體控制器係用來存取一快閃記憶體模組,且該快閃記憶體控制器包含有一唯讀記憶體、一微處理器以及一緩衝記憶體。當該微處理器將資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間;當該微處理器將資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間;當該微處理器將資料寫入至該快閃記憶體模組之任一區塊的一最後資料頁時,在該最後資料頁記錄該第一時間與該第二時間;該微處理器另建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間。此外,該微處理器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊;該微處理器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。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 controller includes There is a ROM, a microprocessor and a buffer memory. When the microprocessor writes data to a first data page of any block of the flash memory module, a first time is recorded in the first data page; when the microprocessor writes When data is written to at least one intermediate data page of any block of the flash memory module, a second time is recorded in the at least one intermediate data page; when the microprocessor writes data to the flash memory In the last data page of any block of the memory module, the first time and the second time are recorded in the last data page; the microprocessor also establishes a writing time record table, wherein the writing time The record table records the block number of the block in which data is written in the flash memory module and the corresponding first time, or records the block in which data is written in the flash memory module and the corresponding first time and the second time. In addition, the microprocessor refers to the writing time record table to determine whether the first time of a block in the flash memory module is earlier than a first threshold value, if there is a block in the flash memory module If the first time of at least one first block is earlier than the first threshold value, the at least one first block is recorded in an expired block table; the microprocessor refers to the writing time record table to determine the Whether the second time of a block in the flash memory module is earlier than a second threshold, if the second time of at least one second block in the flash memory module is earlier than the second time threshold value, record the at least one second block in the expired block table; and perform expired block recovery according to the at least one first block and the at least one second block recorded in the expired block table The operation is to sequentially move the valid data in the at least one first block and the at least one second block to at least one blank block.

在本發明的另一個實施例中,揭露了一種記憶裝置,其包含有一快閃記憶體模組及一快閃記憶體控制器。當該快閃記憶體控制器將資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間;當該快閃記憶體控制器將資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間;當該快閃記憶體控制器將資料寫入至該快閃記憶體模組之任一區塊的一最後資料頁時,在該最後資料頁記錄該第一時間與該第二時間;該快閃記憶體控制器另建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間;此外,該快閃記憶體控制器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊;該快閃記憶體控制器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。In another embodiment of the present invention, a memory device is disclosed, which includes a flash memory module and a flash memory controller. When the flash memory controller writes data to a first data page of any block of the flash memory module, a first time is recorded in the first data page; When the flash memory controller writes data to at least one intermediate data page of any block of the flash memory module, a second time is recorded in the at least one intermediate data page; when the flash memory control When the device writes data to a last data page of any block of the flash memory module, the first time and the second time are recorded in the last data page; the flash memory controller creates another a write time record table, wherein the write time record table records the block number of the block in which data is written in the flash memory module and the corresponding first time, or records the flash memory module The memory module has the block number of the block in which data is written and the corresponding first time and the second time; in addition, the flash memory controller refers to the write time record table to determine the flash memory Whether the first time of a block in the memory module is earlier than a first threshold, if the first time of at least one first block in the flash memory module is earlier than the first threshold , the at least one first block is recorded in an expired block table; the flash memory controller refers to the write time record table to determine whether there is the second block of the block in the flash memory module The time is earlier than a second threshold. If the second time of at least one second block in the flash memory module is earlier than the second threshold, the at least one block is recorded in the expired block table. the second block; and performing an expired block recovery operation according to the at least one first block and the at least one second block recorded in the expired block table, so as to order the at least one first block and the at least one second block in sequence. Valid data in at least one second block is moved to at least one blank block.

第1圖為依據本發明一實施例之一種記憶裝置100的示意圖。電子裝置100包含有一快閃記憶體(Flash Memory)模組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所讀出的資料進行解碼。FIG. 1 is a schematic diagram of a memory device 100 according to an embodiment of the present invention. The electronic device 100 includes a flash memory module 120 and a flash memory controller 110 , and the flash memory controller 110 is used for accessing the flash memory module 120 . According to this 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 ROM 112M is used to store a code 112C, and the microprocessor 112 is used to execute the code 112C to control access to the flash memory module 120 . The control logic 114 includes an encoder 132 and a decoder 134, wherein the encoder 132 is used to encode the data written into the flash memory module 120 to generate a corresponding check code (or error correction code). code (Error Correction Code, ECC), and the decoder 134 is used for decoding the data read from the flash memory module 120 .

於典型狀況下,快閃記憶體模組120包含了多個快閃記憶體晶片,而每一個快閃記憶體晶片包含複數個區塊(block),而快閃記憶體控制器110對快閃記憶體模組120進行抹除資料運作係以區塊為單位來進行。另外,一區塊可記錄特定數量的資料頁(page),其中快閃記憶體控制器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 flash memory chip includes a plurality of blocks, and the flash memory controller 110 controls the flash memory. The operation of erasing data by the memory module 120 is performed in units of blocks. In addition, a block can record a specific number of data pages, wherein the operation of the flash memory controller 110 to write data to the flash memory module 120 is performed in units of data pages. In this embodiment, the flash memory module 120 is a three-dimensional NAND-type flash memory (3D NAND-type flash) module.

實作上,透過微處理器112執行程式碼112C之快閃記憶體控制器110可利用其本身內部之元件來進行諸多控制運作,例如:利用控制邏輯114來控制快閃記憶體模組120之存取運作(尤其是對至少一區塊或至少一資料頁之存取運作)、利用緩衝記憶體116進行所需之緩衝處理、以及利用介面邏輯118來與一主裝置(Host Device)130溝通。緩衝記憶體116係以隨機存取記憶體(Random Access Memory,RAM)來實施。例如,緩衝記憶體116可以是靜態隨機存取記憶體(Static RAM,SRAM),但本發明不限於此。此外,快閃記憶體控制器110耦接於一動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)。In practice, the flash memory controller 110 that executes the code 112C through the microprocessor 112 can use its own internal components to perform various control operations. For example, the control logic 114 is used to control the flash memory module 120. Access operations (especially access operations to at least one block or at least one data page), use the buffer memory 116 to perform required buffering, and use the interface logic 118 to communicate with a Host Device 130 . The buffer memory 116 is implemented by random access memory (Random Access Memory, RAM). For example, the buffer memory 116 may be a static random access memory (Static RAM, SRAM), but the invention is not limited thereto. In addition, the flash memory controller 110 is coupled to a dynamic random access memory (Dynamic Random Access Memory, DRAM).

在一實施例中,記憶裝置100可以是可攜式記憶裝置(例如:符合SD/MMC、CF、MS、XD標準之記憶卡),且主裝置130為一可與記憶裝置100連接的電子裝置,例如手機、筆記型電腦、桌上型電腦…等等。而在另一實施例中,記憶裝置100可以是固態硬碟或符合通用快閃記憶體儲存(Universal Flash Storage,UFS)或嵌入式多媒體記憶卡(Embedded Multi Media Card,EMMC)規格之嵌入式儲存裝置,且可以設置在手機、筆記型電腦、桌上型電腦之中,而此時主裝置130可以是手機、筆記型電腦、桌上型電腦的一處理器。In one embodiment, the memory device 100 may be a portable memory device (eg, a memory card conforming to SD/MMC, CF, MS, XD standards), and the host device 130 is an electronic device that can be connected to the memory device 100 , such as mobile phones, laptops, desktops...etc. In another embodiment, the memory device 100 may be a solid state drive or an embedded storage conforming to Universal Flash Storage (UFS) or Embedded Multi Media Card (EMMC) specifications The main device 130 can be a processor of the mobile phone, notebook computer, and desktop computer.

第2圖為依據本發明一實施例之快閃記憶體模組120中一區塊200的示意圖,其中快閃記憶體模組120為立體NAND型快閃記憶體。如第2圖所示,區塊200包含了多個記憶單元(例如圖示的浮閘電晶體202或是其他的電荷捕捉(charge trap)元件),其透過多條位元線(圖示僅繪示了BL1~BL3)及多條字元線(例如圖示WL0~WL2、WL4~WL6)來構成立體NAND型快閃記憶體架構。在第2圖中,以最上面的一個平面為例,字元線WL0上的所有浮閘電晶體構成了至少一資料頁,字元線WL1上的所有浮閘電晶體構成了另至少一資料頁,而字元線WL2的所有浮閘電晶體構成了再另至少一資料頁…以此類堆。此外,根據快閃記憶體寫入方式的不同,字元線WL0與資料頁(邏輯資料頁)之間的定義也會有所不同,詳細來說,當使用單層式儲存(Single-Level Cell,SLC)的方式寫入時,字元線WL0上的所有浮閘電晶體僅對應到單一邏輯資料頁;當使用雙層式儲存(Multi-Level Cell,MLC)的方式寫入時,字元線WL0上的所有浮閘電晶體對應到兩個邏輯資料頁;當使用三層式儲存(TLC)的方式寫入時,字元線WL0上的所有浮閘電晶體對應到三個邏輯資料頁;以及當使用四層式儲存(QLC)的方式寫入時,字元線WL0上的所有浮閘電晶體對應到四個邏輯資料頁。由於本技術領域中具有通常知識者應能了解立體NAND型快閃記憶體的結構以及字元線及資料頁之間的關係,故相關的細節在此不予贅述。FIG. 2 is a schematic diagram of a block 200 in the flash memory module 120 according to an embodiment of the present invention, wherein the flash memory module 120 is a three-dimensional NAND type flash memory. As shown in FIG. 2, the block 200 includes a plurality of memory cells (such as the floating thyristor 202 shown in the figure or other charge trap devices), which pass through a plurality of bit lines (the figure only BL1-BL3) and a plurality of word lines (eg, WL0-WL2, WL4-WL6 are shown) are shown to form a three-dimensional NAND-type flash memory structure. In Figure 2, taking the uppermost plane as an example, all the floating thyristors on the word line WL0 constitute at least one data page, and all the floating thyristors on the word line WL1 constitute at least another data page page, and all the floating thyristors of word line WL2 constitute at least one other data page . . . and so on. In addition, the definition between the word line WL0 and the data page (logical data page) is also different according to the different writing methods of the flash memory. , SLC), all floating thyristors on the word line WL0 only correspond to a single logical data page; when using the Multi-Level Cell (MLC) method, the word All floating thyristors on line WL0 correspond to two logical data pages; when using triple-level storage (TLC) to write, all floating thyristors on word line WL0 correspond to three logical data pages ; and when using the quad-level storage (QLC) method to write, all floating gate transistors on the word line WL0 correspond to four logical data pages. Since those skilled in the art should be able to understand the structure of the 3D NAND flash memory and the relationship between word lines and data pages, the relevant details are omitted here.

第3圖所示為根據本發明一實施例之建立一寫入時間記錄表的流程圖。在步驟300,流程開始,快閃記憶體控制器110上電並完成了初始化操作。在步驟302,快閃記憶體控制器110自快閃記憶體模組120的多個空白區塊中選擇一區塊,準備將來自主裝置130的資料寫入至該區塊之中。在步驟304,快閃記憶體控制器110將資料由該區塊的第一資料頁開始寫入,並在資料寫入第一資料頁以及中間資料頁時一併將當時的時間資訊寫入至備用區域中。具體來說,參考第4圖所示之快閃記憶體模組120的示意圖,假設區塊B1包含了多個資料頁P1~P256,快閃記憶體控制器110將資料自區塊B1的第一個資料頁P1開始依序寫入來自主裝置130的資料,其中當快閃記憶體控制器110準備將資料寫入到資料頁P1時,快閃記憶體控制器110會同時擷取目前的時間資訊T1_1,例如可以由內建的計時器或是來自主裝置130的絕對時間(例如,2020年5月11日下午2點)來產生對應的時間資訊,並將來自主裝置的資料與相關的時間資訊T1_1一併寫入到資料頁P1中,其中時間資訊T1_1可以寫入至位於資料頁P1後端的備用區域中。接著,快閃記憶體控制器110依序將資料寫入到資料頁P2、P3、…、直到當快閃記憶體控制器110準備將資料寫入到中間資料頁P128時,快閃記憶體控制器110會同時擷取目前的時間資訊T1_M並將來自主裝置的資料與相關的時間資訊T1_M一併寫入到資料頁P128中,其中時間資訊T1_M可以寫入至位於資料頁P128後端的備用區域中。需注意的是,第一個資料頁P1與中間資料頁P128之間的資料頁P2~P127可以不需要寫入任何的時間資訊,以降低快閃記憶體控制器110的負擔。需注意的是,上述之資料頁的備用區域也可稱為管理區域,亦即用來儲存一些管理資料,例如邏輯位址…等等。FIG. 3 is a flow chart of establishing a writing time record table according to an embodiment of the present invention. At step 300, the process starts, the flash memory controller 110 is powered on and the initialization operation is completed. In step 302, the flash memory controller 110 selects a block from a plurality of blank blocks of the flash memory module 120, and prepares to write the data from the master device 130 into the block. In step 304, the flash memory controller 110 starts writing data from the first data page of the block, and writes the current time information to the first data page and the middle data page when the data is written into the first data page and the middle data page. in the spare area. Specifically, referring to the schematic diagram of the flash memory module 120 shown in FIG. 4, assuming that the block B1 includes a plurality of data pages P1-P256, the flash memory controller 110 transfers the data from the first page of the block B1 A data page P1 starts to write data from the host device 130 in sequence, wherein when the flash memory controller 110 is ready to write data to the data page P1, the flash memory controller 110 will simultaneously retrieve the current data The time information T1_1, for example, can be generated by the built-in timer or the absolute time from the host device 130 (for example, 2:00 pm on May 11, 2020) to generate the corresponding time information, and the data from the host device can be correlated with the relevant time information. The time information T1_1 is also written into the data page P1, wherein the time information T1_1 can be written into the spare area located at the rear end of the data page P1. Next, the flash memory controller 110 writes data to the data pages P2, P3, . . . in sequence until the flash memory controller 110 prepares to write data to the intermediate data page P128, The device 110 will simultaneously retrieve the current time information T1_M and write the data from the host device together with the related time information T1_M into the data page P128, wherein the time information T1_M can be written to the spare area at the back end of the data page P128 . It should be noted that, the data pages P2 to P127 between the first data page P1 and the intermediate data page P128 do not need to write any time information, so as to reduce the burden on the flash memory controller 110 . It should be noted that the above-mentioned spare area of the data page can also be called a management area, that is, used to store some management data, such as logical addresses, etc.

需注意的是,在第4圖的實施例中,係以資料頁P128來作為中間資料頁,但此僅是範例說明而非是本發明的限制。在其他的實施例中,也可以使用資料頁P127來作為中間資料頁、或是同時使用資料頁P127、P128來做為中間資料頁。此外,在另一實施例中,中間資料頁的數量可以是多個資料頁,例如,資料頁P126、P127、P128、P129這四個資料頁都作為本實施例中所述的多個中間資料頁,亦即資料頁P126、P127、P128、P129的備用區域都儲存了對應的時間資訊。It should be noted that, in the embodiment of FIG. 4 , the data page P128 is used as the intermediate data page, but this is only an example rather than a limitation of the present invention. In other embodiments, the data page P127 may also be used as the intermediate data page, or the data pages P127 and P128 may be simultaneously used as the intermediate data pages. In addition, in another embodiment, the number of intermediate data pages may be multiple data pages. For example, four data pages P126, P127, P128, and P129 are all used as the multiple intermediate data pages described in this embodiment. Pages, that is, the spare areas of data pages P126, P127, P128, and P129 all store corresponding time information.

接著,快閃記憶體控制器110依序將資料寫入到資料頁P129、P130、…、直到當快閃記憶體控制器110準備將資料寫入到最後資料頁(即,資料頁P256)時,快閃記憶體控制器110會將先前資料頁P1的時間資訊T1_1以及資料頁P128的時間資訊T1_M連同來自主裝置130的資料一併寫入到資料頁P256中,其中時間資訊T1_M可以寫入至位於資料頁P256後端的備用區域中。Next, the flash memory controller 110 sequentially writes data to data pages P129, P130, . . . until when the flash memory controller 110 is ready to write data to the last data page (ie, data page P256) , the flash memory controller 110 writes the time information T1_1 of the previous data page P1 and the time information T1_M of the data page P128 together with the data from the host device 130 into the data page P256, wherein the time information T1_M can be written to the spare area located at the back end of data page P256.

在步驟306中,在區塊B1進行資料寫入的過程中,快閃記憶體控制器110會同步在DRAM 140中建立如第5圖所示的寫入時間記錄表500,亦即,寫入時間記錄表500會記錄區塊編號B1及對應的時間資訊T1_1、T1_M。需注意的是,寫入時間記錄表500所記錄的是第一個資料頁P1的時間資訊T1_1以及中間資料頁(例如,資料頁P128)的時間資訊T1_M,而若是如先前段落中所述每一個區塊有設定多個中間資料頁時,例如資料頁P126、P127、P128、P129這四個資料頁同時作為中間資料頁時,則寫入時間記錄表500可以根據資料頁P126、P127、P128、P129所記錄的多個時間資訊來產生中間資料頁的單一個時間資訊,例如將資料頁P126、P127、P128、P129所記錄的多個時間資訊做平均或是取中間值,來得到中間資料頁所對應的單一個時間資訊。In step 306, during the process of data writing in block B1, the flash memory controller 110 will synchronously create the writing time record table 500 in the DRAM 140 as shown in FIG. The time record table 500 records the block number B1 and the corresponding time information T1_1 and T1_M. It should be noted that the writing time record table 500 records the time information T1_1 of the first data page P1 and the time information T1_M of the intermediate data page (eg, the data page P128 ), and if it is described in the previous paragraph, each time When multiple intermediate data pages are set in a block, for example, when four data pages P126, P127, P128, and P129 are used as intermediate data pages at the same time, the writing time record table 500 can be written according to the data pages P126, P127, P128. , Multiple time information recorded by P129 to generate a single time information of the intermediate data page, for example, the multiple time information recorded in the data pages P126, P127, P128, P129 are averaged or the intermediate value is taken to obtain the intermediate data The single time information corresponding to the page.

需注意的是,針對某些不具有DRAM 140的記憶裝置,上述的寫入時間記錄表500也可以被儲存在緩衝記憶體116中。It should be noted that, for some memory devices that do not have the DRAM 140 , the above-mentioned writing time record table 500 can also be stored in the buffer memory 116 .

在步驟308,微處理器112判斷目前區塊B1的所有資料頁是否已都寫滿資料,若否,流程回到步驟304以繼續將資料寫入到區塊B1的剩餘資料頁;若是,流程回到步驟302以選擇下一個空白區塊,例如第4圖所示的區塊B2,接著,類似快閃記憶體控制器110對區塊B1的資料寫入流程,當快閃記憶體控制器110準備將資料寫入到區塊B2的資料頁P1時,快閃記憶體控制器110會同時擷取目前的時間資訊T2_1,並將來自主裝置的資料與相關的時間資訊T2_1一併寫入到區塊B2的資料頁P1中;當快閃記憶體控制器110準備將資料寫入到區塊B2的資料頁P128時,快閃記憶體控制器110會同時擷取目前的時間資訊T2_M,並將來自主裝置的資料與相關的時間資訊T2_M一併寫入到區塊B2的資料頁P128中;以及當快閃記憶體控制器110準備將資料寫入到資料頁P256時,快閃記憶體控制器110會將先前資料頁P1的時間資訊T2_1以及資料頁P128的時間資訊T2_M連同來自主裝置130的資料一併寫入到資料頁P256中。此外,微處理器112會更新寫入時間記錄表500以記錄區塊編號B2及對應的時間資訊T2_1、T2_M。In step 308, the microprocessor 112 determines whether all the data pages of the current block B1 are filled with data, if not, the process returns to step 304 to continue writing data to the remaining data pages of the block B1; if so, the process Return to step 302 to select the next blank block, such as the block B2 shown in FIG. 4, and then, similar to the data writing process of the flash memory controller 110 to the block B1, when the flash memory controller When 110 is ready to write data to the data page P1 of the block B2, the flash memory controller 110 will simultaneously retrieve the current time information T2_1, and write the data from the host device together with the relevant time information T2_1 into In the data page P1 of the block B2; when the flash memory controller 110 prepares to write data into the data page P128 of the block B2, the flash memory controller 110 will simultaneously retrieve the current time information T2_M, and Write the data from the master device together with the related time information T2_M into the data page P128 of the block B2; and when the flash memory controller 110 is ready to write data to the data page P256, the flash memory control The server 110 writes the time information T2_1 of the previous data page P1 and the time information T2_M of the data page P128 into the data page P256 together with the data from the host device 130 . In addition, the microprocessor 112 updates the writing time record table 500 to record the block number B2 and the corresponding time information T2_1 and T2_M.

每當快閃記憶體模組120內有空白區塊開始進行資料寫入時,微處理器112都會更新寫入時間記錄表500,亦即寫入時間記錄表500記錄了快閃記憶體模組120中每一個區塊之第一個資料頁P1的時間資訊以及中間資料頁(例如資料頁P128)的時間資訊。Whenever there is a blank block in the flash memory module 120 for data writing, the microprocessor 112 will update the write time record table 500, that is, the write time record table 500 records the flash memory module The time information of the first data page P1 of each block in 120 and the time information of the intermediate data pages (eg, data page P128 ).

此外,寫入時間記錄表500會常駐在DRAM 140,以方便後續進行過期區塊判斷與垃圾收集(garbage collection)操作時使用,而當記憶裝置100需要關閉電源時,微處理器112會先將寫入時間記錄表500寫入至快閃記憶體模組120中,並等待記憶裝置100上電後重新讀取快閃記憶體模組120中的寫入時間記錄表500,並載入DRAM 140以供後續使用。In addition, the write time record table 500 will be resident in the DRAM 140 to facilitate the subsequent use of expired block determination and garbage collection operations. When the memory device 100 needs to be powered off, the microprocessor 112 will first The write time record table 500 is written into the flash memory module 120 , and after the memory device 100 is powered on, the write time record table 500 in the flash memory module 120 is read again and loaded into the DRAM 140 for subsequent use.

然而,記憶裝置100可能會因為各種不同的原因而造成突發性斷電(suddenly power off),而造成儲存在DRAM 140中的寫入時間記錄表500遺失。因此,在記憶裝置100重新上電之後,則需要重新在DRAM 140中建立出寫入時間記錄表500。具體來說,參考第6圖所示之根據本發明一實施例之記憶裝置上電後在DRAM 140中建立出寫入時間記錄表500的流程圖。在步驟600,流程開始,且記憶裝置100上電並開始初始化操作。在步驟602,微處理器112判斷記憶裝置100在上電之前的斷電是否是不正常斷電(突發性斷電),若否,流程進入步驟604以自快閃記憶體模組120讀取寫入時間記錄表500並暫存在DRAM 140中;若是,流程進入步驟606。舉例來說,當記憶裝置100在正常關機/斷電的情形下,快閃記憶體控制器110會將儲存在緩衝記憶體116中的多個暫存表格及資料儲存到快閃記憶體模組120中,且其中包含了一個用來標示記憶裝置100是否正常關機的標籤(flag),因此,快閃記憶體控制器110在上電後可以透過讀取儲存在快閃記憶體模組120中的上述標籤來判斷記憶裝置100之前是否有遭遇到不正常斷電的情形,例如,當上述標籤並未被正確設定時便判斷先前有遭遇到不正常斷電。在步驟606,微處理器112依序讀取快閃記憶體模組120中每一個有資料寫入的區塊的最後一個資料頁(例如,第4圖所示的資料頁P256),以取得每一個區塊之第一個資料頁的時間資訊以及中間資料頁的時間資訊。舉例來說,同時參考第4圖,微處理器112可以直接讀取區塊B1的最後一個資料頁P256來取得第一個資料頁P1的時間資訊T1_1以及中間資料頁P128的時間資訊T1_M,且也可以直接讀取區塊B2的最後一個資料頁P256來取得第一個資料頁P1的時間資訊T2_1以及中間資料頁P128的時間資訊T2_M。此外,在某些特別狀況下,例如區塊之最後一個資料頁P256的資料毀損,或是區塊的最後一個資料頁P256尚未有資料寫入,則此時微處理器112可以直接讀取上述區塊的第一個資料頁及中間資料頁的時間資訊。However, the memory device 100 may be suddenly powered off due to various reasons, resulting in the loss of the write time record table 500 stored in the DRAM 140 . Therefore, after the memory device 100 is powered on again, the writing time record table 500 needs to be re-created in the DRAM 140 . Specifically, referring to FIG. 6 is a flowchart of creating a write time record table 500 in the DRAM 140 after the memory device according to an embodiment of the present invention is powered on. At step 600, the flow begins, and the memory device 100 is powered on and begins an initialization operation. In step 602 , the microprocessor 112 determines whether the power outage of the memory device 100 before the power-on is abnormal (sudden power outage), if not, the process proceeds to step 604 to read data from the flash memory module 120 The writing time record table 500 is retrieved and temporarily stored in the DRAM 140 ; if yes, the flow goes to step 606 . For example, when the memory device 100 is normally shut down/powered off, the flash memory controller 110 will store a plurality of temporary tables and data stored in the buffer memory 116 to the flash memory module 120 includes a flag used to indicate whether the memory device 100 is shut down normally, so the flash memory controller 110 can read and store the memory in the flash memory module 120 after power-on to determine whether the memory device 100 has encountered an abnormal power outage before, for example, when the above-mentioned tag is not correctly set, it is determined that an abnormal power outage has been encountered previously. In step 606 , the microprocessor 112 sequentially reads the last data page (eg, the data page P256 shown in FIG. 4 ) of each block in which data is written in the flash memory module 120 to obtain The time information of the first data page of each block and the time information of the intermediate data pages. For example, referring to FIG. 4 at the same time, the microprocessor 112 can directly read the last data page P256 of the block B1 to obtain the time information T1_1 of the first data page P1 and the time information T1_M of the intermediate data page P128, and It is also possible to directly read the last data page P256 of the block B2 to obtain the time information T2_1 of the first data page P1 and the time information T2_M of the intermediate data page P128. In addition, in some special cases, for example, the data of the last data page P256 of the block is damaged, or the last data page P256 of the block has not yet been written with data, then the microprocessor 112 can directly read the above Time information for the first data page and intermediate data pages of the block.

由於記憶裝置100的初始化時間有一定的限制,例如1~2秒,再加上在初始化操作的期間內快閃記憶體控制器110會需要重建許多其他的對照表/映射表,因此,由於本實施例可以在僅讀取區塊的最後一個資料頁便可以得到第一個資料頁的時間資訊與中間資料頁的時間資訊,因此讓重建的寫入時間記錄表500變得很快速,以避免初始化操作的時間逾時。Since the initialization time of the memory device 100 is limited, for example, 1-2 seconds, and the flash memory controller 110 will need to rebuild many other comparison tables/mapping tables during the initialization operation, therefore, due to this The embodiment can obtain the time information of the first data page and the time information of the intermediate data pages only by reading the last data page of the block, so that the reconstructed writing time record table 500 becomes very fast, so as to avoid Timeout for initialization operation.

在取得每一個有資料寫入之區塊的第一個資料頁的時間資訊以及中間資料頁的時間資訊後,便可以在DRAM 140中重新建立寫入時間記錄表500,此時流程便進入608以結束操作。After obtaining the time information of the first data page and the time information of the intermediate data pages of each block in which data is written, the write time record table 500 can be re-established in the DRAM 140 , and the flow then proceeds to 608 to end the operation.

第7圖為根據本發明一實施例之進行過期區塊回收操作的流程圖。在步驟700,流程開始,且記憶裝置100已完成初始化操作。在步驟702,微處理器112根據寫入時間記錄表500,以判斷快閃記憶體模組120中是否有任何區塊之第一個資料頁P1的時間資訊早於一第一門檻值,若有,則流程進入步驟704;若否,流程進入步驟708。第一門檻值可以是根據目前時間所決定的時間,舉例來說,假設目前時間是2020年5月21日下午8點,則第一門檻值可以是12天前,亦即第一門檻值可以是2020年5月9日下午8點。FIG. 7 is a flowchart of an expired block recovery operation according to an embodiment of the present invention. At step 700, the process starts and the memory device 100 has completed the initialization operation. In step 702 , the microprocessor 112 determines whether the time information of the first data page P1 of any block in the flash memory module 120 is earlier than a first threshold value according to the writing time record table 500 . If yes, the flow goes to step 704 ; if not, the flow goes to step 708 . The first threshold value can be a time determined according to the current time. For example, if the current time is 8:00 pm on May 21, 2020, the first threshold value can be 12 days ago, that is, the first threshold value can be It is May 9, 2020 at 8:00 pm.

在步驟704中,微處理器112將第一個資料頁P1的時間資訊早於一第一門檻值的區塊加入至一過期區塊表中(例如,在過期區塊表中記錄這些區塊的區塊編號),並將這些區塊標註為待處理區塊。在本實施例中,過期區塊表係用來記錄過期區塊回收操作的優先順序,其具有固定的大小(即,可以記錄的區塊數量具有一上限值),因此,若是步驟702中所決定出的區塊數量太多,則優先選擇第一個資料頁P1之時間資訊較早的區塊加入至過期區塊表。In step 704, the microprocessor 112 adds blocks whose time information of the first data page P1 is earlier than a first threshold value to an expired block table (eg, records these blocks in the expired block table) block number), and mark these blocks as pending blocks. In this embodiment, the expired block table is used to record the priority order of the expired block recycling operation, and it has a fixed size (that is, the number of blocks that can be recorded has an upper limit). Therefore, if in step 702 If the number of determined blocks is too large, the block with earlier time information of the first data page P1 is preferentially selected to be added to the expired block table.

在步驟706,微處理器112判斷過期區塊表所記錄的區塊是否已到達上限值,若是,流程進入步驟712;若否,流程進入步驟708。In step 706 , the microprocessor 112 determines whether the block recorded in the expired block table has reached the upper limit value, if yes, the flow goes to step 712 ; if not, the flow goes to step 708 .

在步驟708,微處理器112根據寫入時間記錄表500,以判斷快閃記憶體模組120中是否有任何區塊之中間資料頁(例如,第4圖的資料頁P128)的時間資訊早於一第二門檻值,若有,則流程進入步驟710;若否,流程進入步驟712。第二門檻值可以是根據目前時間所決定的時間,且第二門檻值晚於第一門檻值。舉例來說,假設目前時間是2020年5月21日下午8點,則第二門檻值可以是11天前,亦即第一門檻值可以是2020年5月10日下午8點。In step 708 , the microprocessor 112 determines whether there is any intermediate data page (eg, data page P128 in FIG. 4 ) in the flash memory module 120 with earlier time information according to the writing time record table 500 . If there is a second threshold value, the process goes to step 710 ; if not, the process goes to step 712 . The second threshold value may be a time determined according to the current time, and the second threshold value is later than the first threshold value. For example, assuming that the current time is 8:00 pm on May 21, 2020, the second threshold value may be 11 days ago, that is, the first threshold value may be 8:00 pm on May 10, 2020.

在步驟710中,微處理器112將中間資料頁的時間資訊早於一第二門檻值的區塊加入至一過期區塊表中,並將這些區塊標註為待處理區塊。此外,若是步驟708中所決定出的區塊數量太多,則優先選擇中間資料頁之時間資訊較早的區塊加入至過期區塊表。In step 710, the microprocessor 112 adds blocks whose time information of the intermediate data page is earlier than a second threshold value to an expired block table, and marks these blocks as pending blocks. In addition, if the number of blocks determined in step 708 is too large, the block with earlier time information of the intermediate data page is preferentially selected to be added to the expired block table.

關於上述步驟708、710中,由於在步驟704中已經將第一個資料頁P1的時間資訊早於第一門檻值的區塊加入至過期區塊表中,因此,步驟708、710中實質上可視為將中間資料頁的時間資訊介於第二門檻值與第一門檻值之間的區塊加入至過期區塊表。Regarding the above steps 708 and 710, since the blocks whose time information of the first data page P1 is earlier than the first threshold value have been added to the expired block table in step 704, the steps 708 and 710 are substantially It can be regarded as adding the blocks whose time information of the intermediate data page is between the second threshold value and the first threshold value to the expired block table.

需注意的是,上述過期區塊表所記錄之區塊並不全部都是根據步驟702、708中的方法所決定出的,亦即,過期區塊表中所記錄的區塊有部分可能是根據區塊品質或其他機制所決定的。It should be noted that not all the blocks recorded in the above expired block table are determined according to the methods in steps 702 and 708, that is, some of the blocks recorded in the expired block table may be Determined by block quality or other mechanisms.

在步驟712,微處理器112根據上述過期區塊表中所記錄的區塊,來依序進行過期區塊回收操作。具體來說,微處理器112可以將過期區塊表中所記錄之區塊內的有效資料搬移到一個空白資料頁中,並在區塊的有效資料完全搬移之後,將區塊標記為無效或是進行抹除。需注意的是,步驟712所述的過期區塊回收操作可以在背景執行,亦即當快閃記憶體控制器110處於閒置狀態時(例如,不需要處理來自主裝置130的存取指令),則微處理器112可以開始執行過期區塊回收操作,直到快閃記憶體控制器110接收到來自主裝置130的存取指令而需要開始忙碌為止。In step 712, the microprocessor 112 sequentially performs the expired block recovery operation according to the blocks recorded in the expired block table. Specifically, the microprocessor 112 can move the valid data in the block recorded in the expired block table to a blank data page, and mark the block as invalid or after the valid data of the block is completely moved. is to erase. It should be noted that the expired block recovery operation described in step 712 can be performed in the background, that is, when the flash memory controller 110 is in an idle state (eg, does not need to process an access command from the host device 130 ), Then the microprocessor 112 can start to perform the expired block recovery operation until the flash memory controller 110 receives the access command from the host device 130 and needs to start busy.

由於立體NAND型快閃記憶體不斷增加的記憶體容量的單位密度而致使記憶體性能不斷劣化,新型的立體NAND型快閃記憶體在資料寫入後,其記憶體細胞之閘極所儲存的電荷將不斷流失,在一段時間之後,某些記憶體細胞之閘極所儲存的電荷已經不能反應其原本所欲儲存的資料之電荷量,而導致讀取時經常發生錯誤。而這些錯誤通常會讓快閃記憶體控制器啟動改變讀取電壓以及硬解碼、軟解碼的糾正機制,才能從這些過期的區塊上讀取到正確的資料,這些糾正機制通常非常耗時、耗電,也可能根本無法把錯誤糾正,導致記憶體控制器讀不到正確資料。因此,需要對區塊的寫入時間進行記錄,避免上述問題。需注意的是,以上實施例所述的過期區塊回收操作並不同於垃圾收集操作,且本實施例之過期區塊表也不同於垃圾收集操作所需的垃圾收集序列。詳細來說,在記憶裝置100的操作中,快閃記憶體控制器110會持續判斷目前快閃記憶體模組120中每一個區塊之有效資料頁的數量,以決定出哪一些區塊需要進行垃圾收集操作,舉例來說,當一區塊的有效資料頁的數量低於一臨界值時,該區塊會被排入至垃圾收集序列中,以在後續進行垃圾收集操作。然而,本實施例所述之過期區塊表所記錄的則是寫入時間過長的區塊,亦即這些區塊有或許有部分的區塊並未達到垃圾收集操作的標準,例如這些區塊的有效資料頁的數量遠高於該臨界值。此外,由於過期區塊表所記錄之區塊的資料即將快速劣化,因此過期區塊表的優先順序高於垃圾收集序列,亦即若是過期區塊表中有紀錄任何的區塊編號,則在垃圾收集操作允許中斷的情形下,快閃記憶體控制器110會優先停止垃圾收集操作而開始進行過期區塊回收操作。換句話說,快閃記憶體控制器110會立刻對過期區塊表所記錄之區塊進行過期區塊回收操作。Due to the increasing unit density of the memory capacity of the 3D NAND type flash memory, the memory performance is deteriorating continuously. The charge will continue to be lost. After a period of time, the charge stored in the gate of some memory cells can no longer reflect the charge of the data originally intended to be stored, resulting in frequent reading errors. These errors usually cause the flash memory controller to start the correction mechanism of changing the read voltage and hard decoding and soft decoding, so that correct data can be read from these expired blocks. These correction mechanisms are usually very time-consuming, Power consumption may also fail to correct errors at all, causing the memory controller to not read the correct data. Therefore, it is necessary to record the writing time of the block to avoid the above problems. It should be noted that the expired block recycling operation described in the above embodiment is not different from the garbage collection operation, and the expired block table in this embodiment is also different from the garbage collection sequence required for the garbage collection operation. Specifically, during the operation of the memory device 100, the flash memory controller 110 will continue to determine the number of valid data pages of each block in the current flash memory module 120, so as to determine which blocks need to be A garbage collection operation is performed. For example, when the number of valid data pages of a block is lower than a threshold, the block will be queued into a garbage collection sequence for subsequent garbage collection operations. However, the expired block table described in this embodiment records the blocks whose writing time is too long, that is, some blocks of these blocks may not meet the standard of garbage collection operation, such as these blocks The number of valid data pages for a block is well above this threshold. In addition, since the data of the blocks recorded in the expired block table is about to deteriorate rapidly, the priority order of the expired block table is higher than the garbage collection sequence, that is, if any block number is recorded in the expired block table, then in the In the case that the garbage collection operation is allowed to be interrupted, the flash memory controller 110 will preferentially stop the garbage collection operation and start the expired block recovery operation. In other words, the flash memory controller 110 immediately performs the expired block recovery operation on the blocks recorded in the expired block table.

在步驟714,由於步驟712在進行過期區塊回收操作時有進行區塊的寫入以及抹除,因此,微處理器112根據上述區塊的寫入以及抹除來更新寫入時間記錄表500。舉例來說,若是區塊B1被標記為無效或是抹除,則微處理器112可以刪除寫入時間記錄表500中有關於區塊B1的時間資訊。In step 714, since block writing and erasing are performed when the expired block recovery operation is performed in step 712, the microprocessor 112 updates the writing time record table 500 according to the writing and erasing of the above-mentioned blocks. . For example, if the block B1 is marked as invalid or erased, the microprocessor 112 can delete the time information about the block B1 in the writing time record table 500 .

以上步驟708、710中根據第二門檻值來決定出加入至過期區塊表之區塊的原因在於中間資料頁的時間資訊較能反映出區塊整體的寫入時間,且透過將第二門檻值設定為晚於第一門檻值,並將中間資料頁的時間資訊介於第二門檻值與第一門檻值間的區塊加入到過期區塊表,可以讓過期區塊表可以一次性地加入足夠數量的區塊以供進行後續的過期區塊回收操作,而不需要很頻繁地重複進行第7圖的流程或是其他機制來挑選出需要進行過期區塊回收操作的區塊。此外,由於在立體快閃記憶體中,儲存在區塊中的資料會隨著時間變長而快速劣化,但若是區塊有被進行讀取或寫入操作(寫資料至剩餘資料頁)的情形下可以讓區塊的整體資料品質會稍有改善,因此上述使用第二門檻值與第一門檻值來做為判斷機制可以讓品質較差的區塊優先加入到過期區塊表。此外,由於區塊之資料寫入的時間可能會相差很大,亦即區塊的第一個資料頁的時間資訊與中間資料頁的時間資訊可能會有很大的差距,因此,透過另外使用較為可以反映出區塊的整體寫入時間之中間資料頁的時間資訊,可以讓區塊過期的判斷更為準確。The reason why the blocks to be added to the expired block table are determined according to the second threshold value in the above steps 708 and 710 is that the time information of the intermediate data page can better reflect the writing time of the entire block, and by adding the second threshold value The value is set to be later than the first threshold value, and the time information of the intermediate data page is added to the expired block table for the time information of the intermediate data page between the second threshold value and the first threshold value, so that the expired block table can be used at one time. A sufficient number of blocks are added for subsequent expired block recycling operations, without the need to repeat the process in Figure 7 or other mechanisms to pick out blocks that require expired block recycling operations. In addition, in the stereoscopic flash memory, the data stored in the block will deteriorate rapidly over time, but if the block is read or written (writing data to the remaining data pages) In this case, the overall data quality of the block can be slightly improved. Therefore, the above-mentioned use of the second threshold value and the first threshold value as the judgment mechanism allows the blocks with poor quality to be preferentially added to the expired block table. In addition, since the data writing time of the block may vary greatly, that is, the time information of the first data page of the block and the time information of the middle data page may have a large gap. Therefore, by using another The time information of the intermediate data page can better reflect the overall writing time of the block, which can make the judgment of block expiration more accurate.

參考以上第3~7圖的實施例所述,透過建立出寫入時間記錄表500來記錄每一個區塊之第一個資料頁與中間資料頁的時間資訊,再加上使用第一門檻值與第二門檻值來挑選出需要進行過期區塊回收操作的區塊,整體來說可以在挑選出需要進行過期區塊回收操作的區塊更為迅速有效率。Referring to the above embodiments in FIGS. 3 to 7, the time information of the first data page and the intermediate data page of each block is recorded by creating a writing time record table 500, and the first threshold value is used. With the second threshold value to select the blocks that need to be reclaimed for expired blocks, on the whole, it can be more efficient and efficient to select the blocks that need to be reclaimed for expired blocks.

過期區塊回收操作需要配合邏輯資料頁與實體資料頁鏈結表,以找出區塊所有的有效資料頁,並將有效資料頁從過期區塊中搬移到新的區塊中,由於搬移的行為導致有效資料頁裡的資料重新寫入至新的區塊,也因此重置了這些資料的有效期限,並且將該過期區塊抹除備用。在搬移有效資料後,微處理器112需更新邏輯資料頁與實體資料頁鏈結表以及建立新的區塊的有效資料頁的資料數目表。為求謹慎,亦可將過期區塊中的無效資料搬移到另一個新區塊中,並相對應的建立無效資料之邏輯資料頁與實體資料頁鏈結表,以避免主機誤刪除資料時仍可拯救資料。請注意到,有些過期區塊當中,可能所有的資料頁都是有效的資料頁,那就得將所有的資料都搬移到新的資料當中,重置所有的資料的有效期限。The expired block recycling operation needs to cooperate with the logical data page and the physical data page link table to find out all the valid data pages of the block, and move the valid data pages from the expired block to the new block. This behavior causes the data in the valid data page to be rewritten to a new block, which resets the validity period of these data and erases the expired block for use. After moving the valid data, the microprocessor 112 needs to update the link table of the logical data page and the physical data page and the data number table of the valid data page for creating a new block. In order to be cautious, the invalid data in the expired block can also be moved to another new block, and the logical data page and the physical data page link table of the invalid data can be created correspondingly, so as to prevent the host from deleting the data by mistake. rescue data. Please note that in some expired blocks, all data pages may be valid data pages, then all data must be moved to new data to reset the validity period of all data.

此外,在某些應用中,快閃記憶體模組120會具有數千個區塊、再加上頻繁的寫入,因此,寫入時間記錄表500會需要記錄許多區塊編號與相關的時間資訊,因而嚴重消耗DRAM 140的儲存空間。此外,若是記憶裝置100不具有DRAM 140而使得寫入時間記錄表500需要儲存在緩衝記憶體116中,則此時由於緩衝記憶體116通常使用較貴的SRAM來實作且容量不會太大,因此更會造成緩衝記憶體116在記憶體配置上的麻煩。如上所述,在以下的實施例中另外出了一種寫入時間記錄表500的壓縮方法,其可以將寫入時間記錄表500的大部分內容寫入至快閃記憶體模組120的區塊中,以降低儲存在DRAM 140或緩衝記憶體116之寫入時間記錄表500的大小。In addition, in some applications, the flash memory module 120 may have thousands of blocks and frequent writes. Therefore, the write time record table 500 needs to record many block numbers and associated times. information, thus seriously consuming the storage space of the DRAM 140 . In addition, if the memory device 100 does not have the DRAM 140 and the writing time record table 500 needs to be stored in the buffer memory 116 , then the buffer memory 116 is usually implemented with an expensive SRAM and the capacity is not too large. , thus causing more trouble in the memory configuration of the buffer memory 116 . As mentioned above, in the following embodiment, another compression method of the write time record table 500 is provided, which can write most of the content of the write time record table 500 to the block of the flash memory module 120 in order to reduce the size of the write time record table 500 stored in the DRAM 140 or the buffer memory 116 .

舉例來說,參考第8圖所示之壓縮後寫入時間記錄表800的示意圖,其中壓縮後寫入時間記錄表800可以透過將寫入時間記錄表500進行簡化壓縮而來。在第8圖中,壓縮後寫入時間記錄表800包含了多個時間範圍及對應的至少一資料頁位址,其中多個時間範圍可以是任意適合的時間範圍,而在本實施例中時間範圍是以一天為單位。在第8圖的實施例中,微處理器112會依序或週期性地將寫入時間記錄表500中的區塊編號及對應的時間資訊寫入到快閃記憶體模組120的區塊中,以第8圖之時間範圍是今日的狀況來說明,當快閃記憶體控制器110將資料寫入至快閃記憶體模組120的多個區塊,並同步建立寫入時間記錄表500後,微處理器112會將寫入時間記錄表500中所記錄的區塊編號及對應的時間資訊寫入到區塊B200的資料頁P25中,而壓縮後寫入時間記錄表800便記錄區塊B200之資料頁P25的資料頁位址“PPA98765”;此外,由於區塊B200的資料頁P25以記錄了寫入時間記錄表500的內容,故微處理器112便可以將寫入時間記錄表500中的相關資料刪除,以釋放出記憶體空間。同理,第8圖所示之時間範圍為“昨日”所記錄之資料頁位址“PPA33333”對應到區塊B201之資料頁P46,且區塊B201之資料頁P46記錄了昨日寫入的區塊及對應的時間資訊;同理,第8圖所示之時間範圍為“前天”所記錄之資料頁位址“PPA33445”對應到區塊B202之資料頁P37,且區塊B202之資料頁P37記錄了前天寫入的區塊及對應的時間資訊。因此,由於第5圖所示之寫入時間記錄表500中的內容可以儲存在快閃記憶體模組120中,且壓縮後寫入時間記錄表800僅需要記錄快閃記憶體模組120中的一些資料頁位址,因此可以有效地降低寫入時間記錄表500對於記憶體空間的負擔。For example, referring to the schematic diagram of the write time record table 800 after compression shown in FIG. 8 , the write time record table 800 after compression can be obtained by simplifying the compression of the write time record table 500 . In FIG. 8, the compressed write time record table 800 includes multiple time ranges and at least one corresponding data page address, wherein the multiple time ranges can be any suitable time ranges, and in this embodiment, the time ranges The range is in one day. In the embodiment of FIG. 8 , the microprocessor 112 sequentially or periodically writes the block numbers and the corresponding time information in the writing time record table 500 to the blocks of the flash memory module 120 , the time range in FIG. 8 is today's situation to illustrate, when the flash memory controller 110 writes data to multiple blocks of the flash memory module 120, and creates a write time record table synchronously After 500, the microprocessor 112 will write the block number and the corresponding time information recorded in the write time record table 500 into the data page P25 of the block B200, and the compressed write time record table 800 will record The data page address "PPA98765" of the data page P25 of the block B200; in addition, since the data page P25 of the block B200 records the content of the writing time record table 500, the microprocessor 112 can record the writing time The relevant data in the table 500 is deleted to free up memory space. Similarly, the time range shown in Figure 8 is that the data page address "PPA33333" recorded in "yesterday" corresponds to the data page P46 of block B201, and the data page P46 of block B201 records the area written yesterday. block and the corresponding time information; similarly, the time range shown in Figure 8 is that the data page address "PPA33445" recorded in "the day before yesterday" corresponds to the data page P37 of the block B202, and the data page P37 of the block B202 The block written the day before yesterday and the corresponding time information are recorded. Therefore, since the content in the write time record table 500 shown in FIG. 5 can be stored in the flash memory module 120 , and the compressed write time record table 800 only needs to be recorded in the flash memory module 120 Therefore, the load on the memory space of the writing time record table 500 can be effectively reduced.

此外,由於快閃記憶體模組120中的區塊有可能被抹除而變為空白區塊,因此,當微處理器112得知有區塊被抹除時,便會更新快閃記憶體模組120與壓縮後寫入時間記錄表800的內容。舉例來說,假設昨日所寫入的區塊B1在今日被抹除了,則微處理器112讀取區塊B201之資料頁P46的內容,並將區塊B1及相關之時間資訊刪除後,重新寫入到另一個資料頁,例如區塊B201之資料頁P47;此外,將壓縮後寫入時間記錄表800中關於區塊B201之資料頁P46的資料頁位址替換為區塊B201之資料頁P47的資料頁位址。In addition, since the blocks in the flash memory module 120 may be erased and become blank blocks, the microprocessor 112 will update the flash memory when the microprocessor 112 knows that a block has been erased The module 120 and the contents of the compressed time record table 800 are written. For example, assuming that the block B1 written yesterday is erased today, the microprocessor 112 reads the content of the data page P46 of the block B201, deletes the block B1 and the related time information, and rewrites it. Write to another data page, such as data page P47 of block B201; in addition, replace the data page address of data page P46 of block B201 in the compressed write time record table 800 with the data page of block B201 The address of the data page for P47.

此外,為了方便區塊及資料頁的管理,壓縮後寫入時間記錄表800中的每一個時間範圍對應到一個專屬的區塊,例如前天進行資料寫入之所有區塊的區塊編號與時間資訊都被寫入到區塊B202、昨日進行資料寫入之所有區塊的區塊編號與時間資訊都被寫入到區塊B201、今日進行資料寫入之所有區塊的區塊編號與時間資訊都被寫入到區塊B200、…以此類推。此外,上述專屬區塊不會被拿來儲存其他資料。In addition, in order to facilitate the management of blocks and data pages, each time range in the compressed write time record table 800 corresponds to a dedicated block, such as the block numbers and times of all blocks in which data was written the day before yesterday. The information is written into block B202, the block number and time information of all blocks where data was written yesterday are written into block B201, and the block number and time of all blocks where data is written today Information is written to block B200, ... and so on. In addition, the above-mentioned exclusive blocks will not be used to store other data.

簡要歸納本發明,在本發明之應用於一快閃記憶體控制器的控制方法中,係透過建立出寫入時間記錄表來記錄每一個區塊之第一個資料頁與中間資料頁的時間資訊,再加上使用第一門檻值與第二門檻值來挑選出需要進行過期區塊回收操作的區塊,以效率地完成過期區塊回收操作。此外,透過將寫入時間記錄表進行壓縮可以降低寫入時間記錄表對於記憶體空間的負擔。 以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。 Summarizing the present invention briefly, in the control method of the present invention applied to a flash memory controller, the time of the first data page and the intermediate data page of each block is recorded by creating a writing time record table In addition, the first threshold value and the second threshold value are used to select the blocks that need to perform the expired block recycling operation, so as to efficiently complete the expired block recycling operation. In addition, by compressing the write time record table, the burden on the memory space of the write time record table can be reduced. The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of the present invention.

100:記憶裝置 110:快閃記憶體控制器 112:微處理器 112C:程式碼 112M:唯讀記憶體 114:控制邏輯 116:緩衝記憶體 118:介面邏輯 120:快閃記憶體模組 130:主裝置 132:編碼器 134:解碼器 140:動態隨機存取記憶體 300~308:步驟 500:寫入時間記錄表 600~608:步驟 700~714:步驟 800:壓縮後寫入時間記錄表 B1, B2, B200, B201, B202:區塊 BL1, BL2, BL3:位元線 P1~P256:資料頁 T1_1, T1_M, T2_1, T2_M:時間資訊 WL0~WL2, WL4~WL6:字元線 100: Memory Device 110: Flash memory controller 112: Microprocessor 112C: Code 112M: read-only memory 114: Control logic 116: Buffer memory 118: Interface logic 120: Flash memory module 130: Main unit 132: Encoder 134: decoder 140: Dynamic random access memory 300~308: Steps 500: Write time record table 600~608: Steps 700~714: Steps 800: Write time record table after compression B1, B2, B200, B201, B202: Blocks BL1, BL2, BL3: bit lines P1~P256: Information page T1_1, T1_M, T2_1, T2_M: Time information WL0~WL2, WL4~WL6: word lines

第1圖為依據本發明一實施例之一種記憶裝置的示意圖。 第2圖為依據本發明一實施例之快閃記憶體模組中一區塊的示意圖。 第3圖所示為根據本發明一實施例之建立一寫入時間記錄表的流程圖。 第4圖所示之在區塊中寫入時間資訊的示意圖。 第5圖為根據本發明一實施例之寫入時間記錄表的示意圖。 第6圖所示之根據本發明一實施例之記憶裝置上電後在DRAM中建立出寫入時間記錄表的流程圖。 第7圖為根據本發明一實施例之進行過期區塊回收操作的流程圖。 第8圖所示之壓縮後寫入時間記錄表的示意圖。 FIG. 1 is a schematic diagram of a memory device according to an embodiment of the present invention. FIG. 2 is a schematic diagram of a block in a flash memory module according to an embodiment of the present invention. FIG. 3 is a flow chart of establishing a writing time record table according to an embodiment of the present invention. FIG. 4 shows a schematic diagram of writing time information in a block. FIG. 5 is a schematic diagram of a writing time record table according to an embodiment of the present invention. FIG. 6 shows a flow chart of creating a writing time record table in the DRAM after the memory device according to an embodiment of the present invention is powered on. FIG. 7 is a flowchart of an expired block recovery operation according to an embodiment of the present invention. Figure 8 is a schematic diagram of the post-compression write time record table.

100:記憶裝置 110:快閃記憶體控制器 112:微處理器 112C:程式碼 112M:唯讀記憶體 114:控制邏輯 116:緩衝記憶體 118:介面邏輯 120:快閃記憶體模組 130:主裝置 132:編碼器 134:解碼器 140:動態隨機存取記憶體 100: Memory Device 110: Flash memory controller 112: Microprocessor 112C: Code 112M: read-only memory 114: Control logic 116: Buffer memory 118: Interface logic 120: Flash memory module 130: Main unit 132: Encoder 134: decoder 140: Dynamic random access memory

Claims (9)

一種應用於一快閃記憶體控制器的控制方法,其中該快閃記憶體控制器用以存取一快閃記憶體模組,該快閃記憶體模組係為一立體快閃記憶體(3D NAND-type flash)模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含了多個區塊,每一個區塊包含了多個資料頁;每一個區塊包含了分別位於多個不同平面之多條字元線以及位元線來控制的多個浮閘電晶體,且每一條字元線上的浮閘電晶體構成了該多個資料頁中的至少一資料頁;以及該控制方法包含有: 當資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間; 當資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間; 建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間; 參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊; 參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及 根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。 A control method applied to a flash memory controller, wherein the flash memory controller is used to access a flash memory module, and the flash memory module is a three-dimensional flash memory (3D NAND-type flash) module, the flash memory module includes a plurality of flash memory chips, each flash memory chip includes a plurality of blocks, and each block includes a plurality of data pages; Each block includes a plurality of word lines located on a plurality of different planes and a plurality of floating gate transistors controlled by the bit lines, and the floating gate transistors on each word line constitute the plurality of data pages at least one data page in ; and the control method includes: When data is written to a first data page of any block of the flash memory module, recording a first time in the first data page; When data is written to at least one intermediate data page of any block of the flash memory module, recording a second time in the at least one intermediate data page; Create a write time record table, wherein the write time record table records the block number of the block in which data is written in the flash memory module and the corresponding first time, or records the flash memory module. The block number of the block in which data is written in the flash memory module and the corresponding first time and the second time; Referring to the write time record table to determine whether the first time of a block in the flash memory module is earlier than a first threshold, if there is at least one first block in the flash memory module If the first time is earlier than the first threshold, the at least one first block is recorded in an expired block table; Referencing the write time record table to determine whether the second time of the block in the flash memory module is earlier than a second threshold value, if there is at least one second block in the flash memory module If the second time is earlier than the second threshold, the at least one second block is recorded in the expired block table; and Perform an expired block recovery operation according to the at least one first block and the at least one second block recorded in the expired block table, so as to sequentially order the at least one first block and the at least one second block The valid data within is moved to at least one blank block. 如申請專利範圍第1項所述之控制方法,其中該第二門檻值所表示的時間晚於該第一門檻值所表示的時間。The control method as described in item 1 of the claimed scope, wherein the time indicated by the second threshold value is later than the time indicated by the first threshold value. 如申請專利範圍第1或2項所述之控制方法,其中該第一門檻值係根據該控制方法在執行當下的時間所決定。The control method as described in claim 1 or 2 of the claimed scope, wherein the first threshold value is determined according to the current time when the control method is executed. 一種快閃記憶體控制器,其中該快閃記憶體控制器係用來存取一快閃記憶體模組,該快閃記憶體模組係為一立體快閃記憶體(3D NAND-type flash)模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含了多個區塊,每一個區塊包含了多個資料頁;每一個區塊包含了分別位於多個不同平面之多條字元線以及位元線來控制的多個浮閘電晶體,且每一條字元線上的浮閘電晶體構成了該多個資料頁中的至少一資料頁;且該快閃記憶體控制器包含有: 一唯讀記憶體,用來儲存一程式碼; 一微處理器,用來執行該程式碼以控制對該快閃記憶體模組之存取;以及 一緩衝記憶體; 其中當該微處理器將資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間;當該微處理器將資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間;該微處理器另建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間; 其中該微處理器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊;該微處理器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。 A flash memory controller, wherein the flash memory controller is used to access a flash memory module, the flash memory module is a three-dimensional flash memory (3D NAND-type flash memory) ) module, the flash memory module includes a plurality of flash memory chips, each flash memory chip includes a plurality of blocks, and each block includes a plurality of data pages; each block It includes a plurality of floating gate transistors controlled by a plurality of word lines and bit lines respectively located on a plurality of different planes, and the floating gate transistor on each word line constitutes at least one of the plurality of data pages. data page; and the flash controller contains: a ROM, used to store a code; a microprocessor for executing the code to control access to the flash memory module; and a buffer memory; When the microprocessor writes data into a first data page of any block of the flash memory module, a first time is recorded in the first data page; when the microprocessor When writing data into at least one intermediate data page of any block of the flash memory module, a second time is recorded in the at least one intermediate data page; the microprocessor also establishes a writing time record table , wherein the write time record table records the block number of the block in which the data is written in the flash memory module and the corresponding first time, or records that the flash memory module has The block number of the block in which the data is written and the corresponding first time and the second time; Wherein the microprocessor refers to the writing time record table to determine whether the first time of the block in the flash memory module is earlier than a first threshold value, if there is at least one block in the flash memory module When the first time of a first block is earlier than the first threshold, the at least one first block is recorded in an expired block table; the microprocessor refers to the writing time record table to determine the fast block Whether the second time of a block in the flash memory module is earlier than a second threshold, if the second time of at least one second block in the flash memory module is earlier than the second threshold value, record the at least one second block in the expired block table; and perform an expired block recycling operation according to the at least one first block and the at least one second block recorded in the expired block table , so as to sequentially move the valid data in the at least one first block and the at least one second block to at least one blank block. 如申請專利範圍第4項所述之快閃記憶體控制器,其中該第二門檻值所表示的時間晚於該第一門檻值所表示的時間。The flash memory controller as described in claim 4, wherein the time indicated by the second threshold value is later than the time indicated by the first threshold value. 如申請專利範圍第4或5項所述之快閃記憶體控制器,其中該第一門檻值係根據該控制方法在執行當下的時間所決定。The flash memory controller as described in claim 4 or 5, wherein the first threshold value is determined according to the current time when the control method is executed. 一種記憶裝置,包含有: 一快閃記憶體模組,其中該快閃記憶體模組係為一立體快閃記憶體(3D NAND-type flash)模組,該快閃記憶體模組包含了多個快閃記憶體晶片,每一個快閃記憶體晶片包含了多個區塊,每一個區塊包含了多個資料頁;每一個區塊包含了分別位於多個不同平面之多條字元線以及位元線來控制的多個浮閘電晶體,且每一條字元線上的浮閘電晶體構成了該多個資料頁中的至少一資料頁;以及 一快閃記憶體控制器,用以存取該快閃記憶體模組; 其中當該快閃記憶體控制器將資料寫入至該快閃記憶體模組之任一區塊的一第一個資料頁時,在該第一個資料頁記錄一第一時間;當該快閃記憶體控制器將資料寫入至該快閃記憶體模組之任一區塊的至少一中間資料頁時,在該至少一中間資料頁記錄一第二時間;該快閃記憶體控制器另建立一寫入時間記錄表,其中該寫入時間記錄表記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間、或是記錄了該快閃記憶體模組中有資料寫入之區塊的區塊編號及對應的該第一時間與該第二時間; 其中該快閃記憶體控制器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第一時間早於一第一門檻值,若是該快閃記憶體模組中有至少一第一區塊的該第一時間早於該第一門檻值,則在一過期區塊表中記錄該至少一第一區塊;該快閃記憶體控制器參考該寫入時間記錄表以判斷該快閃記憶體模組中是否有區塊的該第二時間早於一第二門檻值,若是該快閃記憶體模組中有至少一第二區塊的該第二時間早於該第二門檻值,則在該過期區塊表中記錄該至少一第二區塊;以及根據該過期區塊表所記錄的該至少一第一區塊與該至少一第二區塊進行過期區塊回收操作,以依序將該至少一第一區塊與該至少一第二區塊內的有效資料搬移至至少一空白區塊中。 A memory device comprising: A flash memory module, wherein the flash memory module is a three-dimensional flash memory (3D NAND-type flash) module, and the flash memory module includes a plurality of flash memory chips , each flash memory chip contains multiple blocks, each block contains multiple data pages; each block contains multiple word lines and bit lines located in multiple different planes to control a plurality of floating gate transistors, and the floating gate transistors on each word line constitute at least one data page of the plurality of data pages; and a flash memory controller for accessing the flash memory module; Wherein, when the flash memory controller writes data into a first data page of any block of the flash memory module, a first time is recorded in the first data page; when the When the flash memory controller writes data to at least one intermediate data page of any block of the flash memory module, a second time is recorded in the at least one intermediate data page; the flash memory control The device also establishes a write time record table, wherein the write time record table records the block number of the block in which data is written in the flash memory module and the corresponding first time, or records The flash memory module has the block number of the block in which the data is written and the corresponding first time and the second time; Wherein the flash memory controller refers to the write time record table to determine whether the first time of the block in the flash memory module is earlier than a first threshold value, if the flash memory module is the first time If the first time of at least one first block is earlier than the first threshold value, the at least one first block is recorded in an expired block table; the flash memory controller refers to the writing time a record table to determine whether the second time of the block in the flash memory module is earlier than a second threshold, if the second time of the at least one second block in the flash memory module is earlier than the second threshold, record the at least one second block in the expired block table; and record the at least one first block and the at least one second block according to the expired block table An expired block recovery operation is performed to sequentially move the valid data in the at least one first block and the at least one second block to at least one blank block. 如申請專利範圍第7項所述之記憶裝置,其中該第二門檻值所表示的時間晚於該第一門檻值所表示的時間。The memory device as described in claim 7, wherein the time indicated by the second threshold value is later than the time indicated by the first threshold value. 如申請專利範圍第7或8項所述之記憶裝置,其中該第一門檻值係根據該控制方法在執行當下的時間所決定。The memory device as described in claim 7 or 8, wherein the first threshold value is determined according to the current time when the control method is executed.
TW110104324A 2020-07-06 2020-07-06 Memory device, flash memory controller and associated access method TWI760094B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110104324A TWI760094B (en) 2020-07-06 2020-07-06 Memory device, flash memory controller and associated access method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110104324A TWI760094B (en) 2020-07-06 2020-07-06 Memory device, flash memory controller and associated access method

Publications (2)

Publication Number Publication Date
TW202205290A TW202205290A (en) 2022-02-01
TWI760094B true TWI760094B (en) 2022-04-01

Family

ID=81323711

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110104324A TWI760094B (en) 2020-07-06 2020-07-06 Memory device, flash memory controller and associated access method

Country Status (1)

Country Link
TW (1) TWI760094B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US12436882B1 (en) * 2024-06-25 2025-10-07 Silicon Motion, Inc. Control method of flash memory controller

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069474B2 (en) * 2013-08-20 2015-06-30 Seagate Technology Llc Retention based defecting in a hybrid memory system
US20170123700A1 (en) * 2015-11-03 2017-05-04 Samsung Electronics Co., Ltd. Io redirection methods with cost estimation
US10102118B2 (en) * 2014-10-30 2018-10-16 Toshiba Memory Corporation Memory system and non-transitory computer readable recording medium
TW201947402A (en) * 2018-05-14 2019-12-16 深圳大心電子科技有限公司 Memory management method and storage controller
US20200117361A1 (en) * 2016-08-12 2020-04-16 Pure Storage, Inc. Data stability in data storage system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9069474B2 (en) * 2013-08-20 2015-06-30 Seagate Technology Llc Retention based defecting in a hybrid memory system
US10102118B2 (en) * 2014-10-30 2018-10-16 Toshiba Memory Corporation Memory system and non-transitory computer readable recording medium
US20170123700A1 (en) * 2015-11-03 2017-05-04 Samsung Electronics Co., Ltd. Io redirection methods with cost estimation
US20200117361A1 (en) * 2016-08-12 2020-04-16 Pure Storage, Inc. Data stability in data storage system
TW201947402A (en) * 2018-05-14 2019-12-16 深圳大心電子科技有限公司 Memory management method and storage controller

Also Published As

Publication number Publication date
TW202205290A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN111475425B (en) Method for managing flash memory module and related flash memory controller and electronic device
TWI733568B (en) Memory device, flash memory controller and associated access method
US11487475B2 (en) Control method for referring to expired block table to perform expired block recycling operation and associated flash memory controller and memory device
US20190065361A1 (en) Method for writing data into flash memory module and associated flash memory controller and electronic device
TWI811130B (en) Method for accessing flash memory module, flash memory controller, and electronic device
US11194502B1 (en) Electronic device, flash memory controller and method for performing garbage collection operation on flash memory module
US11487655B2 (en) Method for managing flash memory module and associated flash memory controller and electronic device based on timing of dummy read operations
TWI760094B (en) Memory device, flash memory controller and associated access method
TWI759580B (en) Method for managing flash memory module and associated flash memory controller and electronic device
US11249676B2 (en) Electronic device, flash memory controller and associated control method
US11809748B2 (en) Control method of flash memory controller and associated flash memory controller and electronic device
TWI768336B (en) Method for managing flash memory module and associated flash memory controller and electronic device
TWI781886B (en) Method for managing flash memory module and associated flash memory controller and electronic device
TWI852008B (en) Flash memory controller and electronic device