TW201917583A - Memory device and data management method thereof - Google Patents

Memory device and data management method thereof Download PDF

Info

Publication number
TW201917583A
TW201917583A TW106136746A TW106136746A TW201917583A TW 201917583 A TW201917583 A TW 201917583A TW 106136746 A TW106136746 A TW 106136746A TW 106136746 A TW106136746 A TW 106136746A TW 201917583 A TW201917583 A TW 201917583A
Authority
TW
Taiwan
Prior art keywords
data
sub
cluster
controller
region
Prior art date
Application number
TW106136746A
Other languages
Chinese (zh)
Other versions
TWI629592B (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 TW106136746A priority Critical patent/TWI629592B/en
Application granted granted Critical
Publication of TWI629592B publication Critical patent/TWI629592B/en
Publication of TW201917583A publication Critical patent/TW201917583A/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

A memory device and a data management method thereof are provided. The memory device includes a memory array and a controller. The memory array includes a first storage region and a second storage region. The first storage region includes a plurality of first sub-region clusters being arranged in I1 columns and J1 rows. Each of the first sub-region clusters includes a plurality of sub-regions, which are arranged in O1 columns and P1 rows. The second storage region includes a plurality of second sub-region clusters being arranged in I2 columns and J2 rows. Each of the second sub-region clusters includes a plurality of sub-regions, which are arranged in O2 columns and P2 rows. The controller access a first data through one of a first first sub-region cluster among the plurality of first sub-region clusters and a first second sub-region cluster among the plurality of second sub-region clusters.

Description

記憶體裝置及應用於其上之資料管理方法Memory device and data management method applied thereto

本發明是有關於一種記憶體裝置及應用於其上之資料管理方法,且特別是有關於一種針對機密性資料的存放之記憶體裝置及應用於其上之資料管理方法。The present invention relates to a memory device and a data management method applied thereto, and more particularly to a memory device for storing confidential data and a data management method applied thereto.

隨著影音技術的發展,為能存取大量的影音資料,平板電腦、手機、數位相機等電子產品均提供記憶體裝置。With the development of audio-visual technology, in order to access a large number of audio and video materials, electronic devices such as tablets, mobile phones, and digital cameras provide memory devices.

請參見第1圖,其係記憶體裝置之示意圖。主控裝置10可透過匯流排或傳輸線等方式而電連接於記憶體裝置11的控制器111。控制器111因應主控裝置10發出的指令而存取記憶體陣列115。其中,記憶體陣列115可為不同類型的儲存元件。例如,快閃記憶體陣列。Please refer to FIG. 1 , which is a schematic diagram of a memory device. The main control device 10 can be electrically connected to the controller 111 of the memory device 11 via a bus bar or a transmission line or the like. The controller 111 accesses the memory array 115 in response to an instruction issued by the master device 10. The memory array 115 can be different types of storage elements. For example, a flash memory array.

記憶體陣列115採用實體位址(physical address)定址的方式紀錄資料的位置,但是主控裝置10使用的檔案系統,卻是以邏輯位址(logical address)定址的方式存取資料。其中,控制器111內部設有一快閃轉譯層(Flash translation layer,簡稱為FTL),用於提供位址映射的功能,將主控裝置10傳出的邏輯位址轉換為實體位址,反之亦然。也就是說,快閃轉譯層能協助主控裝置10存取記憶體陣列115的資料。另,基於快閃記憶體存取時的限制,習用技術的記憶體裝置係以異地更新方式儲存資料。The memory array 115 records the location of the data by means of physical address addressing, but the file system used by the master device 10 accesses the data in a logical address addressing manner. The controller 111 is internally provided with a Flash translation layer (FTL) for providing address mapping function, and converting the logical address transmitted by the main control device 10 into a physical address, and vice versa. Of course. That is, the flash translation layer can assist the host device 10 to access the data of the memory array 115. In addition, based on the limitation of flash memory access, the conventional memory device stores data in an off-site update manner.

請參見第2A~2C圖,其係習用技術的記憶體裝置,以異地更新(Out-of-place update)方式儲存資料之示意圖。為便於說明,本文以空白方格表示未存放資料的資料分頁;以點狀網底表示已經寫入資料的資料分頁(例如,第2A圖的資料分頁115a)。Please refer to FIG. 2A~2C, which is a schematic diagram of a memory device of a conventional technology for storing data in an out-of-place update manner. For the sake of explanation, in this paper, a blank square indicates the data paging of the unstored data; a dot-shaped network bottom indicates the data paging of the data that has been written (for example, the data page 115a of Figure 2A).

在第2A圖中,控制器111從主控裝置10接收一筆新的寫入資料A。本文以英文字母搭配數字的方式表示資料內容與其對應的版本。即,相同的英文字母代表同一筆資料(例如同一個檔案),而數字則代表版本的新舊。因為寫入資料A為第一次寫入的緣故,此處表示為資料A1。在第2A圖中,快閃轉譯層111a將資料A1寫入資料分頁115a中。In FIG. 2A, the controller 111 receives a new write data A from the master device 10. This article uses English letters and numbers to indicate the content of the data and its corresponding version. That is, the same English letters represent the same material (for example, the same file), while the numbers represent the old and new versions. Since the written data A is the first write, it is represented here as the material A1. In FIG. 2A, the flash translation layer 111a writes the material A1 into the material page 115a.

在第2B圖中,控制器111從主控裝置10接收更新資料A的指令。即,主控裝置10擬以資料A2更新原本存放在記憶體裝置11的資料A1。此時,快閃轉譯層111a並不會以資料A1更新存放在資料分頁115a的內容。事實上,快閃轉譯層111a會將資料A2寫入資料分頁115b中,並更改內部的位址映射表(Mapping Table)。此外,快閃轉譯層111a還會將資料分頁115a標示為無效。在本文中,以交叉的網底表示資料分頁被標示為無效(例如,第2B圖的資料分頁115a)。其後,若主控裝置10想要讀取資料A時,快閃轉譯層111a會從資料分頁115b讀取資料A2。In FIG. 2B, the controller 111 receives an instruction to update the material A from the master device 10. That is, the main control device 10 intends to update the material A1 originally stored in the memory device 11 with the data A2. At this time, the flash translation layer 111a does not update the content stored in the material page 115a with the material A1. In fact, the flash translation layer 111a writes the material A2 into the data page 115b and changes the internal mapping table. In addition, the flash translation layer 111a also marks the data page 115a as invalid. In this context, data pagination is indicated as being invalidated by intersecting nets (eg, sub-page 115a of Figure 2B). Thereafter, if the master device 10 wants to read the material A, the flash translation layer 111a reads the material A2 from the material page 115b.

在第2C圖中,控制器111再度從主控裝置10接收更新資料A的指令。即,主控裝置10擬以資料A3更新原本存放在記憶體裝置11的資料A2。同樣地,快閃轉譯層111a並不會更新資料分頁115b的內容,而是將資料A3寫入資料分頁115c中,並更改內部的位址映射表。此外,快閃轉譯層111a還會將資料分頁115b標示為無效。In FIG. 2C, the controller 111 receives the instruction to update the material A again from the master device 10. That is, the main control device 10 intends to update the data A2 originally stored in the memory device 11 with the data A3. Similarly, the flash translation layer 111a does not update the contents of the material page 115b, but writes the material A3 into the material page 115c and changes the internal address mapping table. In addition, the flash translation layer 111a also marks the data page 115b as invalid.

根據第2A~2C圖的說明可以得知,控制器111在接收更新資料時,原本用於存放過時資料(stale data)的資料分頁(例如,資料分頁115a、115b)雖然被快閃轉譯層111a標示為無效,但在該些資料分頁存放的資料內容實際上仍然存在。此種存放著過時資料的資料分頁,仍有機會因為被駭而讀出。換言之,對於機密性較高的資料(例如,銀行資料、公司內部資料等)而言,過時資料仍存在於原本的資料分頁中,隨時可能被讀取,進而影響資料的安全性。也就是說,快閃記憶體異地更新的特性,並不適合機密性較高的資料。As can be seen from the description of FIGS. 2A-2C, when the controller 111 receives the update data, the data page (for example, the material pages 115a, 115b) originally used to store the stale data is flashed through the layer 111a. Marked as invalid, but the content of the data stored in the pages of the data actually still exists. This kind of information paging that stores outdated information still has the opportunity to be read out because of being detained. In other words, for documents with high confidentiality (for example, bank data, company internal data, etc.), outdated data still exists in the original data page, which may be read at any time, thereby affecting the security of the data. In other words, the characteristics of flash memory remote update are not suitable for data with high confidentiality.

本發明係有關於一種記憶體裝置及應用於其上之資料管理方法。The present invention relates to a memory device and a data management method applied thereto.

根據本發明之第一方面,提出一種包含記憶體陣列與控制器的記憶體裝置。記憶體陣列包含第一儲存區域與第二儲存區域。第一儲存區域對應於第一資料層級,第二儲存區域對應於第二資料層級。其中,第一儲存區域包含排列為I1行與J1列的複數個第一子區域叢集,且各該第一子區域叢集係包含排列為一O1行與一P1列的複數個資料分頁。第二儲存區域包含排列為I2行與J2列的複數個第二子區域叢集,且各該第二子區域叢集係包含排列為一O2行與一P2列的複數個資料分頁。其中I1、J1、O1與P1與該第一資料層級相關,而I2、J2、O2與P2與該第二資料層級相關。控制器電連接於記憶體陣列。其中,控制器利用該等第一子區域叢集中的一第一第一子區域叢集以及該等第二子區域叢集中的一第一第二子區域叢集之其中一者存取一第一資料。此外,控制器利用該等第一子區域叢集中的一第二第一子區域叢集以及該等第二子區域叢集中的一第二第二子區域叢集之其中一者存取一第二資料。其中控制器隨著第一資料的更新頻率而將第一資料存放於第一第一子區域叢集與第二第一子區域叢集之一者。其中, I1與O1的乘積等於I2與O2的乘積,且J1與P1的乘積等於J2與P2的乘積。According to a first aspect of the invention, a memory device comprising a memory array and a controller is presented. The memory array includes a first storage area and a second storage area. The first storage area corresponds to the first data level, and the second storage area corresponds to the second data level. The first storage area includes a plurality of first sub-area clusters arranged in the I1 row and the J1 column, and each of the first sub-region clusters includes a plurality of data pages arranged in an O1 row and a P1 column. The second storage area comprises a plurality of second sub-region clusters arranged in I2 rows and J2 columns, and each of the second sub-region clusters comprises a plurality of data pages arranged in an O2 row and a P2 column. Wherein I1, J1, O1 and P1 are related to the first data level, and I2, J2, O2 and P2 are related to the second data level. The controller is electrically connected to the memory array. The controller accesses a first data by using one of the first first sub-region clusters of the first sub-region clusters and one of the first and second sub-region clusters of the second sub-region clusters . In addition, the controller accesses a second data by using one of the second first sub-region clusters of the first sub-region clusters and one of the second and second sub-region clusters of the second sub-region clusters . The controller stores the first data in one of the first first sub-region cluster and the second first sub-region cluster according to the update frequency of the first data. Wherein, the product of I1 and O1 is equal to the product of I2 and O2, and the product of J1 and P1 is equal to the product of J2 and P2.

根據本發明之第二方面,提出一種應用於記憶體裝置上之資料管理方法。此資料管理方法可被應用於包含第一儲存區域與第二儲存區域的記憶體陣列。其中,第一儲存區域與第二儲存區域分別對應於第一資料層級與第二資料層級。第一儲存區域包含排列為I1行與J1列的複數個第一子區域叢集,且各該第一子區域叢集包含排列為O1行與P1列的複數個資料分頁。第二儲存區域包含排列為I2行與J2列的複數個第二子區域叢集,且各該第二子區域叢集係包含排列為O2行與P2列的複數個資料分頁。其中,該等第一子區域叢集的數量大於該等第二子區域叢集的數量。資料管理方法包含以下步驟。利用該等第一子區域叢集中的一第一第一子區域叢集以及該等第二子區域叢集中的一第一第二子區域叢集之其中一者存取一第一資料。利用該等第一子區域叢集中的一第二第一子區域叢集以及該等第二子區域叢集中的一第二第二子區域叢集之其中一者存取一第二資料。隨著該第一資料的更新頻率而將該第一資料存放於該第一第一子區域叢集與該第二第一子區域叢集之一者。其中I1、J1、O1與P1與該第一資料層級相關,而I2、J2、O2與P2與該第二資料層級相關。其中, I1與O1的乘積等於I2與O2的乘積,且J1與P1的乘積等於J2與P2的乘積。According to a second aspect of the present invention, a data management method applied to a memory device is proposed. This data management method can be applied to a memory array including a first storage area and a second storage area. The first storage area and the second storage area respectively correspond to the first data level and the second data level. The first storage area includes a plurality of first sub-region clusters arranged in the I1 row and the J1 column, and each of the first sub-region clusters comprises a plurality of data pages arranged in the O1 row and the P1 column. The second storage area includes a plurality of second sub-region clusters arranged in the I2 row and the J2 column, and each of the second sub-region clusters includes a plurality of data pages arranged in the O2 row and the P2 column. The number of clusters of the first sub-regions is greater than the number of clusters of the second sub-regions. The data management method includes the following steps. One of the first first sub-region clusters in the first sub-region clusters and one of the first and second sub-region clusters in the second sub-region clusters access a first data. Using a second first sub-region cluster of the first sub-region clusters and one of the second second sub-region clusters of the second sub-region clusters accesses a second material. The first data is stored in the first first sub-region cluster and the second first sub-region cluster according to the update frequency of the first data. Wherein I1, J1, O1 and P1 are related to the first data level, and I2, J2, O2 and P2 are related to the second data level. Wherein, the product of I1 and O1 is equal to the product of I2 and O2, and the product of J1 and P1 is equal to the product of J2 and P2.

為了對本發明之上述及其他方面有更佳的瞭解,下文特舉實施例,並配合所附圖式詳細說明如下:In order to better understand the above and other aspects of the present invention, the following detailed description of the embodiments and the accompanying drawings

基於資料保密的考量,記憶體裝置的控制器需要將記憶體陣列儲存的過時資料加以清除(Sanitize)。一種進行資料清除的作法是,在控制器執行垃圾回收(garbage collection)後,以抹除(erase)操作的方式清除資料。然而,記憶體裝置進行抹除操作時,需要以較大的儲存區域(例如:資料區塊)作為基本單位,且抹除操作需要花費較長的時間。Based on the consideration of data confidentiality, the controller of the memory device needs to clear out the obsolete data stored in the memory array (Sanitize). One method of data clearing is to erase the data by an erase operation after the controller performs garbage collection. However, when the memory device performs the erase operation, it is necessary to use a large storage area (for example, a data block) as a basic unit, and the erase operation takes a long time.

此外,透過抹除操作而清除儲存區域的資料的做法,會影響記憶體裝置的存取速度以及增加壽命。特別像是,在儲存區域內,僅有小部分的過時資料具有機密性而需要清除,卻因此而必須清除整個儲存區域的內容。或者,資料經常被更新,導致控制器經常性地以抹除操作清除過時資料等情況。為此,基於避免因為清除儲存區去的過時資料而衍生之降低存取速度的情形,本揭露提出以較小的子區域(例如:資料分頁)作為清除過時資料的基本單位的做法,詳如下述。In addition, the removal of data in the storage area by the erase operation affects the access speed of the memory device and increases the lifetime. In particular, in the storage area, only a small portion of the outdated data is confidential and needs to be cleared, but the content of the entire storage area must be cleared. Or, the data is often updated, causing the controller to frequently erase outdated data with an erase operation. For this reason, based on the case of avoiding the reduction of the access speed due to the obsolescence of the storage area, the present disclosure proposes to use a smaller sub-area (for example, data paging) as a basic unit for erasing obsolete data, as follows. Said.

為便於說明,以下舉例係以單階記憶胞(Single-Level Cell,簡稱為SLC)為例,但本發明亦可應用於多階記憶胞(Multi-Level Cell,簡稱為MLC)、三階記憶胞(Triple-Level Cell,簡稱為TLC)之應用。此外,只要記憶體裝置採用的是異地更新方式的情況,均可能存在類似的機密資料管理問題。因此,該些記憶體裝置也可搭配本揭露的資料管理方法使用,並不限於快閃記憶體。再者,本文的實施例雖假設儲存區域為資料區塊(block)、子區域為資料分頁(page),但實際應用時,資料區塊與資料分頁的單位與大小並不以此為限。For convenience of description, the following examples are exemplified by a single-level cell (SLC), but the present invention can also be applied to a multi-level cell (MLC), third-order memory. Application of Triple-Level Cell (TLC). In addition, similar confidential data management issues may exist as long as the memory device is in an off-site update mode. Therefore, the memory devices can also be used in conjunction with the data management method disclosed herein, and are not limited to flash memory. Furthermore, although the embodiment of the present invention assumes that the storage area is a data block (block) and the sub-area is a data page (page), in practice, the unit and size of the data block and the data page are not limited thereto.

請參見第3A圖,其係資料分頁的記憶胞存有資料之示意圖。資料分頁215包含多個記憶胞215a、215b,其中部分的記憶胞215a存放的資料位元為”0”,部分的記憶胞215b存放的資料位元為”1”。因此,在第3A圖下方的記憶胞分布圖中,部分的記憶胞215a的臨界電壓Vth高於參考電壓Vref,代表記憶胞215b所儲存的資料位元為”0”;部分的記憶胞215b的臨界電壓Vth低於參考電壓Vref,代表記憶胞215b所儲存的資料位元為”1”。Please refer to Figure 3A, which is a schematic diagram of the data stored in the memory cells of the data page. The data page 215 includes a plurality of memory cells 215a, 215b, wherein some of the memory cells 215a store data bits of "0", and some of the memory cells 215b store data bits of "1". Therefore, in the memory cell distribution diagram below FIG. 3A, the threshold voltage Vth of part of the memory cell 215a is higher than the reference voltage Vref, and the data bit stored in the memory cell 215b is "0"; part of the memory cell 215b The threshold voltage Vth is lower than the reference voltage Vref, and represents that the data bit stored in the memory cell 215b is "1".

根據本揭露的構想,可特定的針對資料分頁215中,資料位元為”1”的記憶胞進行再程式化(re-programming)。當這些原本存放資料位元”1”的記憶胞215b經過再程式化後,該些記憶胞215b儲存的資料位元更新為”0”。據此,整個資料分頁215的記憶胞分布情形就類似完全未寫入資料前的分布情形。According to the concept of the present disclosure, a memory cell having a data bit of "1" in the data page 215 can be specifically re-programmed. When the memory cells 215b originally storing the data bit "1" are reprogrammed, the data bits stored in the memory cells 215b are updated to "0". Accordingly, the memory cell distribution of the entire data page 215 is similar to the distribution before the data is completely written.

請參見第3B圖,其係針對原本存放資料位元”1”的記憶胞,改以資料位元”0”進行再程式化之示意圖。即,針對資料分頁215中,所有存放有資料位元”1”的記憶胞215b進行程式化,以資料位元”0”取代原本儲存在記憶胞215b的資料位元”1”。據此,資料分頁215的內容將全部為資料位元”0”。此時,所有記憶胞215a、215b的臨界電壓Vth都高於參考電壓Vref。Please refer to FIG. 3B, which is a schematic diagram of reprogramming the data cell “0” for the memory cell originally storing the data bit “1”. That is, for the data page 215, all the memory cells 215b storing the data bit "1" are programmed, and the data bit "1" stored in the memory cell 215b is replaced with the data bit "0". Accordingly, the contents of the data page 215 will all be the data bit "0". At this time, the threshold voltage Vth of all the memory cells 215a, 215b is higher than the reference voltage Vref.

在第3B圖中,即使資料分頁215再度被讀取,控制器僅能讀到全部為”0”的內容。因此,經過再程式化後,控制器無法從資料分頁215讀取任何資料,代表過時資料已經被清除。此種針對特定的資料分頁的內容,以資料位元”0”進行再程式化,進而達到清除效果的方式稱為擦除操作。In Fig. 3B, even if the material page 215 is read again, the controller can only read all the contents of "0". Therefore, after reprogramming, the controller cannot read any data from the data page 215, indicating that the outdated data has been cleared. Such a content for a specific data page is reprogrammed by the data bit "0", and the way to achieve the clearing effect is called an erase operation.

承上,基於資料安全性的考量而清除過時資料時,可選擇以資料區塊為單位進行抹除操作,或如第3B圖所示,以資料分頁為單位進行擦除操作。為此,針對清除(clean)過時資料的需求,本揭露的記憶體裝置可提供抹除指令(erase commad)以及擦除指令(scrub command)。其中,當控制器發出擦除指令時,可同時包含對多個資料分頁進行擦除操作的過程。In the case of erasing obsolete data based on data security considerations, it is optional to perform erasing operations in units of data blocks or, as shown in FIG. 3B, to perform erasing operations in units of data pages. To this end, the memory device of the present disclosure can provide an erase commad and a scrub command for the need to clean outdated data. Wherein, when the controller issues an erase command, it may simultaneously include a process of performing an erase operation on a plurality of data pages.

簡言之,控制器可評估執行抹除指令和執行擦除指令所需的執行時間後,選擇其中所需時間較短者。此外,為使擦除指令的執行時間縮短本揭露對記憶體裝置提出整體性的規劃管理機制。亦即,本揭露能基於清除過時資料的目的下,在資料寫入階段、資料更新階段以及垃圾回收等階段,針對資料的特性個別針對其存放位置進行管理。連帶地,待控制器執行擦除指令時,就可以用較有效率的方式執行擦除操作。In short, the controller can evaluate the time required to execute the erase command and the execution of the erase command, and select the one in which the time is shorter. In addition, in order to shorten the execution time of the erase command, the present disclosure proposes a holistic planning management mechanism for the memory device. That is to say, the disclosure can manage the storage location individually according to the characteristics of the data in the data writing phase, the data updating phase, and the garbage collection phase based on the purpose of erasing obsolete data. Incidentally, when the controller executes an erase command, the erase operation can be performed in a more efficient manner.

請參見第4圖,其係依據本揭露構想的實施例,於控制器設置操作管理程式與擦除功能之示意圖。在此實施例中,記憶體裝置33包含控制器331、快取記憶體335與記憶體陣列333。其中,控制器331電連接於快取記憶體335與記憶體陣列333。Please refer to FIG. 4, which is a schematic diagram of setting an operation management program and an erasing function in a controller according to an embodiment of the present disclosure. In this embodiment, the memory device 33 includes a controller 331, a cache memory 335, and a memory array 333. The controller 331 is electrically connected to the cache memory 335 and the memory array 333.

控制器331包含快閃轉譯層3311與控制韌體層3313。其中,快閃轉譯層3311進一步包含:位址轉譯器3311a、資料區塊分配器3311b、垃圾回收器3311c、耗損平均器3311d,以及擦除管理程式3311e。根據本揭露的構想,擦除管理程式3311e可搭配快閃轉譯層3311的各個程式,利用控制韌體層3313的各個功能進行相關操作。The controller 331 includes a flash translation layer 3311 and a control firmware layer 3313. The flash translation layer 3311 further includes: an address translator 3311a, a data block allocator 3311b, a garbage collector 3311c, a wear leveling unit 3311d, and an erasure management program 3311e. According to the concept of the present disclosure, the erasure management program 3311e can cooperate with each program of the flash translation layer 3311 to perform related operations by controlling various functions of the firmware layer 3313.

例如:當有一筆具有機密性的資料需要存入記憶體陣列333時,擦除管理程式3311e需搭配位址轉譯器3311a、資料區塊分配器3311b,自記憶體陣列333中,找出該筆資料應寫入的資料區塊以及在該資料區塊內的哪一個資料分頁。此外,在記憶體陣列333已經使用一段期間後,擦除管理程式3311e可搭配垃圾回收器3311c與耗損平均器3311d對記憶體陣列333的儲存空間加以調整。此外,在擦除管理程式3311e搭配垃圾回收器3311c與耗損平均器3311d對記憶體陣列333的儲存空間行調整的同時,也須搭配位址轉譯器3311a與3311b使用。For example, when a confidential data needs to be stored in the memory array 333, the erasure management program 3311e needs to be matched with the address translator 3311a and the data block distributor 3311b, and the memory array 333 is found in the memory array 333. The data block to which the data should be written and which data in the data block is paged. In addition, after the memory array 333 has been used for a period of time, the erase management program 3311e can adjust the storage space of the memory array 333 in conjunction with the garbage collector 3311c and the wear leveling device 3311d. In addition, the erasure management program 3311e is used in conjunction with the garbage collector 3311c and the wear leveling unit 3311d to adjust the storage space of the memory array 333, and is also used in conjunction with the address translators 3311a and 3311b.

控制韌體層3313進一步包含:讀取功能3313a、程式化功能3313b、抹除功能3313c,以及擦除功能3313d。其中,讀取功能3313a可用於讀取資料分頁的內容;程式化功能3313b可以資料分頁為單位寫入資料(例如,將記憶胞的內容程式化為”0”或”1”);抹除功能3313c可以資料區塊為單位清除資料;且擦除功能3313d可以資料分頁為單為清除資料。依據本揭露的實施例,針對資料清除的目的,擦除管理程式3311e可根據需被清除的範圍大小,選擇以抹除功能3313c清除資料區塊的內容,或是以擦除功能3313d清除資料分頁的內容。實際應用時,控制器331所提供的功能與程式並不以此處的例子為限。The control firmware layer 3313 further includes a read function 3313a, a stylization function 3313b, an erase function 3313c, and an erase function 3313d. The read function 3313a can be used to read the content of the data page; the stylization function 3313b can write the data in units of data pages (for example, program the contents of the memory cell to "0" or "1"); erase function 3313c can clear the data in units of data blocks; and the erasing function 3313d can sort the data into single data for clearing data. According to the embodiment of the present disclosure, for the purpose of data clearing, the erasure management program 3311e may select to erase the content of the data block by the erasing function 3313c according to the size of the range to be cleared, or clear the data page by the erasing function 3313d. Content. In practical applications, the functions and programs provided by the controller 331 are not limited to the examples herein.

接著以一個包含16個資料分頁的資料區塊為例,說明擦除資料分頁的過程。其中可以看出,當控制器331對一個選定的資料分頁進行再程式化時,對與該選定的資料分頁相鄰的資料分頁,也同時造成影響。此處假設資料區塊內的資料分頁排列為4行與4列。Then, a data block containing 16 data pages is taken as an example to illustrate the process of erasing data paging. It can be seen that when the controller 331 reprograms a selected data page, the data paging adjacent to the selected data page also affects at the same time. It is assumed here that the data in the data block is arranged in columns of 4 rows and 4 columns.

請參見第5A-5D,其係對一個選定的資料分頁進行再程式化時,對與該選定的資料分頁相鄰的資料分頁造成影響之示意圖。此處假設資料區塊內的三個資料分頁P1、P2、P3存有過時資料而須進行再程式化,且這三個資料分頁在資料區塊中,排列為L型。為便於說明,以下係以清除操作代表對一個資料分頁的內容進行再程式化。See Figures 5A-5D, which are diagrams that affect the data pagination adjacent to the selected data pagination when reprogramming a selected material pagination. It is assumed here that the three data pages P1, P2, and P3 in the data block have obsolete data and need to be reprogrammed, and the three data pages are arranged in the data block and arranged in an L shape. For ease of explanation, the following is a re-programming of the contents of a data page by a clear operation.

在第5A圖中,點狀網底代表資料區塊40內的資料分頁均已經寫入資料。其中,假設以粗黑線框起的資料分頁P1、P2、P3存有過時資料,因此被控制器331當作需要進行擦除操作的資料分頁。如第5A圖下方所示,在控制器331還未對資料分頁P1、P2、P3進行清除操作前,儲存在資料分頁P1、P2、P3內的記憶胞,其臨界電壓Vth均分別散佈在參考電壓Vref的兩側。In Figure 5A, the dot-like mesh representation represents that the data pages in the data block 40 have been written. Here, it is assumed that the data pages P1, P2, and P3 framed by the thick black lines have obsolete data, and thus are regarded as the data page to be erased by the controller 331. As shown in the lower part of FIG. 5A, before the controller 331 has performed the clearing operation on the data pages P1, P2, and P3, the memory cells stored in the data pages P1, P2, and P3 are respectively dispersed in the reference voltage Vth. Both sides of the voltage Vref.

第5B圖所示為,控制器331對資料分頁P1進行擦除操作後的情形。第5B圖上方以白色表示資料分頁P1的資料已經因為擦除操作而被清除。此外,在第5B圖下方,與資料分頁P1對應的記憶胞分布中,記憶胞的資料位元全部轉變為”0”。也就是藉由擦除操作,讓資料分頁P1內的所有記憶胞的臨界電壓Vth均高於參考電壓Vref。Fig. 5B shows the situation after the controller 331 performs an erase operation on the material page P1. The data indicating that the page P1 is indicated by white in the upper part of Fig. 5B has been erased due to the erasing operation. Further, in the memory cell distribution corresponding to the material page P1 in the lower part of FIG. 5B, the data bits of the memory cell are all converted to "0". That is, by the erasing operation, the threshold voltage Vth of all the memory cells in the data page P1 is higher than the reference voltage Vref.

在第5B圖中,資料分頁P2因為未直接與資料分頁P1相鄰的緣故,資料分頁P2在第5B圖的記憶胞分佈仍然維持與第5A圖相同。另一方面,對資料分頁P3而言,因為資料分頁P3的位置在資料分頁P1的正下方。因此,擦除資料分頁P1的同時,因為資料分頁P3與其位置相當靠近地緣故,導致的資料分頁P3的記憶胞分佈,將連帶產生變化。由第5B圖可以看出,在資料分頁P3中,資料位元為1的記憶胞的臨界電壓Vth,開始呈現向參考電壓Vref方向(右側)移動的趨勢。此種記憶胞的臨界電壓Vth改變的現象,代表資料分P3儲存的內容受到干擾(Disturb)。In Fig. 5B, the data page P2 is not directly adjacent to the material page P1, and the memory cell distribution of the data page P2 in Fig. 5B remains the same as in Fig. 5A. On the other hand, for the material page P3, since the position of the material page P3 is directly below the material page P1. Therefore, while the data page P1 is erased, since the data page P3 is relatively close to its position, the memory cell distribution of the data page P3 will change. As can be seen from Fig. 5B, in the data page P3, the threshold voltage Vth of the memory cell having the data bit of 1 starts to exhibit a tendency to move toward the reference voltage Vref (right side). The phenomenon that the threshold voltage Vth of such a memory cell changes changes, and the content stored in the data sub-P3 is disturbed (Disturb).

在本文中,以左上右下方向的網底,代表一個資料分頁因為其相鄰的資料分頁進行擦除操作後,所導致之資料分頁的儲存內容受到干擾的情況。如第5B圖所示,除了資料分頁P3具有左上右下方向的網底外,在資料分頁P1的上方、左側以及右側的資料分頁,同樣以左上右下方向的網底表示。這是因為在資料分頁P1的上方、左側以及右側的資料分頁,也都受到對資料分頁P1進行擦除操作影響的緣故。承上,對一個資料分頁進行擦除操作時,與該選定的資料分頁相鄰的其他資料分頁所儲存的資料,會連帶受到干擾。In this paper, the bottom of the network in the upper left and lower right directions represents a situation in which the data content of the data page is disturbed after the data page is erased by its adjacent data page. As shown in FIG. 5B, except that the material page P3 has a bottom left and a right bottom, the data page above, the left side, and the right side of the data page P1 is also represented by the bottom of the left upper right direction. This is because the data pages above, on the left side, and on the right side of the data page P1 are also affected by the erase operation of the data page P1. In the case of erasing a data page, the data stored in the other data pages adjacent to the selected data page may be interfered.

在第5B圖後,控制器331也對資料分頁P2進行擦除操作。如第5C圖上方所示,因為資料分頁P2的資料被清除的緣故,資料分頁P2以白色方框表示空。由資料分頁P2的記憶胞分布可以看出中,資料分頁P2的記憶胞的臨界電壓Vth全部高於參考電壓Vref。亦即,資料分頁P2內的資料位元全部變為”0”。附帶一的是,因為資料分頁P1先前已經被擦除,在第5C圖中,資料分頁P1的資料分布仍維持與第5B圖相同。After FIG. 5B, the controller 331 also performs an erase operation on the material page P2. As shown at the top of Figure 5C, because the data of the data page P2 is cleared, the data page P2 is indicated by a white square. It can be seen from the memory cell distribution of the data page P2 that the threshold voltage Vth of the memory cells of the data page P2 is all higher than the reference voltage Vref. That is, all the data bits in the data page P2 become "0". Incidentally, since the data page P1 has been previously erased, in the 5C chart, the data distribution of the data page P1 remains the same as in the 5B picture.

在第5C圖中,因為資料分頁P3位於進行擦除操作的資料分頁P2的右側。因此,資料分頁P3的記憶胞分佈,將受到資料分頁P2的擦除操作而影響。由第5C圖可以看出,在資料分頁P3中,資料位元為1的記憶胞,再度呈現向參考電壓方向(右側)移動的趨勢。甚至,在資料分頁P3中,有部分的記憶胞的臨界電壓Vth已經超過參考電壓Vref。另, 在本文中,以方格狀的網底代表此種因為相鄰的資料分頁進行擦除操作後,導致資料分頁的內容兩度受到干擾的情況。同樣的,除了資料分頁P3外,位於 資料分頁P1左側的資料分頁,也與資料分頁P3一樣,受兩度受到干擾。因此,此處亦以方格狀的網底繪式位於 資料分頁P1左側的資料分頁。In Fig. 5C, since the material page P3 is located on the right side of the material page P2 where the erasing operation is performed. Therefore, the memory cell distribution of the data page P3 will be affected by the erase operation of the data page P2. As can be seen from Fig. 5C, in the data page P3, the memory cell with the data bit of 1 again shows a tendency to move toward the reference voltage direction (right side). Even in the data page P3, the threshold voltage Vth of a part of the memory cells has exceeded the reference voltage Vref. In addition, in the present text, the square-shaped mesh bottom represents the case where the content of the data page is disturbed twice because the adjacent data page is erased. Similarly, except for the data page P3, the data page located on the left side of the data page P1 is also subject to the same interference as the data page P3. Therefore, here, the grid-like grid is located on the left side of the data page P1.

最後,第5D圖所示為,在第5C圖後,再對資料分頁P3進行擦除操作的結果。在第5D圖上方,因為資料分頁P3的資料已經被清除的緣故,資料分頁P3也以白色表示。此外,在資料分頁P3的記憶胞分布中,的記憶胞的資料位元全部變為”0”。也就是藉由擦除操作,讓資料分頁P3內的所有記憶胞的臨界電壓Vth均高於參考電壓Vref。同樣的,因為資料分頁P1、P2先前均已經過擦除操作,在第5D圖中,資料分頁P1、P2的資料分布仍維持與第5C圖相同。Finally, Fig. 5D shows the result of the erase operation on the material page P3 after the 5C picture. Above the 5D picture, because the data of the data page P3 has been cleared, the data page P3 is also indicated in white. Further, in the memory cell distribution of the data page P3, the data bits of the memory cells all become "0". That is, by the erasing operation, the threshold voltage Vth of all the memory cells in the data page P3 is higher than the reference voltage Vref. Similarly, since the data pages P1 and P2 have all been erased before, in the 5D picture, the data distribution of the data pages P1 and P2 remains the same as the 5C picture.

在第5C圖中,控制器331雖然還未實際對資料分頁P3進行擦除操作,但是在第5C圖的資料分頁P3內,已經有部分的記憶胞的資料位元由”1”變成”0”。即,已經有部分的記憶胞不需要被再程式化,即已呈現被清除的效果。據此,當控制器331在對資料分頁P3進行擦除操作而變成第5D圖的過程中,實際需要被再程式化的記憶胞數量相對較少。連帶地,控制器331對資料分頁P3進行擦除操作所需要的時間,會較對資料分頁P1、P2進行擦除操作所需的時間少。換言之,資料分頁P3受到干擾的現象,可以節省控制器331對資料分頁P3進行擦除操作所需的時間。In Fig. 5C, although the controller 331 has not actually erased the data page P3, in the data page P3 of the 5C chart, the data bits of some of the memory cells have changed from "1" to "0. ". That is, some of the memory cells do not need to be reprogrammed, that is, the effect of being cleared has been presented. Accordingly, when the controller 331 becomes the 5D picture in the erasing operation on the material page P3, the number of memory cells actually needing to be reprogrammed is relatively small. Incidentally, the time required for the controller 331 to perform the erase operation on the data page P3 is less than the time required for the data page P1, P2 to perform the erase operation. In other words, the phenomenon that the data page P3 is disturbed can save the time required for the controller 331 to erase the data page P3.

如前所述,控制器331擦除一個資料分頁所需的時間,會隨著該資料分頁是否曾經被干擾而異。若以單位擦除時間Tsu代表對未經過干擾的一個資料分頁進行擦除所需的時間,則,對一個被干擾過一次的資料分頁執行擦除操作時,控制器331需要的擦除時間約為Tsu*60%;對一個已經被干擾過兩次的資料分頁執行擦除操作時,控制器331需要的擦除時間約為Tsu*40%;對一個已經被干擾過三次的資料分頁執行擦除操作時,控制器331需要的擦除時間約為Tsu*35%;以及,對一個已經被干擾過四次的資料分頁進行擦除操作時,控制器331需要的擦除時間約為Tsu*30%。由此可以看出,隨著被干擾次數的增加,控制器331擦除資料分頁所需的時間雖然逐步減少,但減少的幅度亦隨著干擾次數的增加而趨緩。As previously mentioned, the time required for the controller 331 to erase a data page will vary depending on whether the data page has been interfered with. If the unit erasure time Tsu represents the time required for erasing a data page that has not been disturbed, the erasure time required by the controller 331 is approximately performed when an erase operation is performed on a data page that has been interfered once. It is Tsu*60%; when an erase operation is performed on a data page that has been interfered twice, the controller 331 needs an erase time of about Tsu*40%; performing a wipe on a data page that has been interfered three times. In addition to the operation, the controller 331 requires an erase time of approximately Tsu*35%; and, when an erase operation is performed on a data page that has been interfered four times, the controller 331 requires an erase time of approximately Tsu*. 30%. It can be seen that as the number of times of interference increases, the time required for the controller 331 to erase the data page is gradually reduced, but the magnitude of the decrease is also slowed down as the number of interferences increases.

進一步的,本揭露的實施例進一步規劃資料寫入至資料分頁的順序,藉以發揮此種因為相鄰的資料分頁(例如,資料分頁P1、P2)先進行擦除操作,所導致之後續需要進行擦除操作的資料分頁(例如,資料分頁P3)因為受到干擾而能縮短擦除操作所需時間的效果。Further, the embodiment of the present disclosure further plans the order in which data is written to the data page, so that the subsequent data paging (for example, data paging P1, P2) is performed first, and the subsequent operations are required. The data page of the erase operation (for example, data page P3) can reduce the time required for the erase operation because of interference.

請參見第 6A-6E圖,其係擬進行擦除操作的資料分頁的位置所影響之其他資料分頁的個數,且在進行擦除操作前,需先將其他受影響之有效分頁複製至其他空白頁面之示意圖。為便於說明,以下假設資料區塊BLK包含的資料分頁排列為M行與N列,並假設對資料分頁P(m, n)進行擦除操作。其中,m代表資料分頁在資料區塊內的行數;n代表資料分頁在資料區塊內的列數。其中,M、N、m、n均為正整數。Please refer to Figure 6A-6E, which is the number of other data pages affected by the location of the data page to be erased, and the other affected valid pages must be copied to other pages before the erase operation. A schematic of a blank page. For convenience of explanation, it is assumed that the data blocks included in the data block BLK are arranged in M rows and N columns, and it is assumed that the data paging P(m, n) is erased. Where m represents the number of rows of data pages in the data block; n represents the number of columns of data pages in the data block. Where M, N, m, and n are all positive integers.

第6A~6E圖所示為一個包含16個資料分頁的資料區塊20。在第6A圖中,假設全部的資料分頁均存有資料,且資料分頁均以P(m, n)、m=1~4、n=1~4標註在資料區塊20內的位置。Figures 6A-6E show a data block 20 containing 16 data pages. In Fig. 6A, it is assumed that all data pages have data stored, and the data pages are marked in the data block 20 by P(m, n), m=1~4, n=1~4.

在第6B~6E圖中,以粗黑實線框選的資料分頁代表需進行擦除操作的資料分頁。另外,以粗黑虛線框選的資料分頁,代表與待執行擦除操作的資料分頁相鄰的受干擾的資料分頁。若在該些受干擾的資料分頁中,確實存有資料,且所儲存的資料內容仍然有效(即,非過時資料)時,控制器331需要將這些受干擾的資料分頁所儲存的有效資料,複製到其他的資料區塊。隨著待執行擦除操作的資料分頁P(m, n)在資料區塊20內的位置改變,在資料區塊20內受到干擾的資料分頁的數量也不盡相同。In Figures 6B to 6E, the data page selected by the thick black solid line represents the data page to be erased. In addition, the data page selected by the bold black dotted line represents the disturbed data page adjacent to the data page to be erased. If the data is actually stored in the interfered data pages, and the stored data content is still valid (ie, non-obsolete data), the controller 331 needs to page the damaged data to store the valid data. Copy to other data blocks. As the position of the data page P(m, n) to be erased is changed within the data block 20, the number of data pages disturbed in the data block 20 is also different.

在第6B圖中,若控制器331對資料分頁P(1, 1)執行擦除操作時,資料分頁P(2, 1)、P(1, 2)會受到干擾。據此,若控制器331對資料分頁P(1, 1)、P(M, 1)、P(1, N)、P(M, N)(即,資料分頁位於資料區塊20的四個角落) 執行擦除操作時,將使兩個與資料分頁P(m, n)相鄰的資料分頁受到干擾。In Fig. 6B, if the controller 331 performs an erase operation on the material page P(1, 1), the data pages P(2, 1), P(1, 2) are disturbed. Accordingly, if the controller 331 pages the data P(1, 1), P(M, 1), P(1, N), P(M, N) (ie, the data page is located in the data block 20) Corner) When an erase operation is performed, two data pages adjacent to the data page P(m, n) are disturbed.

在第6C圖中,若控制器331對資料分頁P(1, 2)執行擦除操作時,資料分頁 P(1, 1)、P(1, 3)、P(2, 2)會受到干擾。據此,若控制器331對資料分頁P(1, n)、P(M, n),其中n≠1且n≠N (即,資料分頁位於資料區塊的第一行或最後一行)執行擦除操作時,將使三個與資料分頁P(m, n)相鄰的資料分頁受到干擾。In Fig. 6C, if the controller 331 performs an erase operation on the data page P(1, 2), the data pages P(1, 1), P(1, 3), P(2, 2) are interfered. . Accordingly, if the controller 331 pages the data P(1, n), P(M, n), where n≠1 and n≠N (ie, the data page is located in the first row or the last row of the data block) When the erase operation is performed, three data pages adjacent to the data page P(m, n) will be interfered.

在第6D圖中,若控制器331對資料分頁P(2,1)執行擦除操作時,資料分頁P(1, 1)、P(3, 1)、P(2, 2)會受到干擾。據此,若控制器331對資料分頁P(m, 1)、P(m, N),其中m≠1且m≠M (即,資料分頁位於於資料區塊的第一列或最後一列)執行擦除操作時,將使三個與資料分頁P(m, n)相鄰的資料分頁受到干擾。In Fig. 6D, if the controller 331 performs an erase operation on the data page P(2, 1), the data pages P(1, 1), P(3, 1), P(2, 2) are interfered. . Accordingly, if the controller 331 pages the data P(m, 1), P(m, N), where m ≠ 1 and m ≠ M (ie, the data page is located in the first column or the last column of the data block) When the erase operation is performed, the three data pages adjacent to the data page P(m, n) are disturbed.

在第6E圖中,若控制器331對資料分頁P(2, 3)執行擦除操作時,資料分頁P(1, 3)、P(2, 2)、P(3, 3)、P(2, 4)會受到干擾。據此,若控制器331對資料分頁P(m, n),其中m≠1、m≠M、n≠1且n≠N(相當於資料區塊的中間)執行擦除操作時,資料分頁P((m-1), n)、 P((m+1), n)、P(m, (n-1))、P (m, (n+1)),將使四個與資料分頁P(m, n)相鄰的資料分頁受到干擾。In Fig. 6E, if the controller 331 performs an erase operation on the material page P(2, 3), the data page P(1, 3), P(2, 2), P(3, 3), P( 2, 4) will be disturbed. According to this, if the controller 331 performs the erasing operation on the data page P(m, n), where m≠1, m≠M, n≠1, and n≠N (corresponding to the middle of the data block), the data paging P((m-1), n), P((m+1), n), P(m, (n-1)), P (m, (n+1)), will make four data The page pagination adjacent to the page P(m, n) is disturbed.

由第6A~6E圖可以看出,隨著控制器331執行擦除操作的資料分頁P(m,n)的位置不同,受到干擾的資料分頁的數量也不相同。也因此,控制器331需備份的資料分頁資料分頁的內容也不相同。更進一步的,隨著該些受到干擾的資料分頁中,實際存放的資料為有效資料或是過時資料的不同,控制器331所需備份的資料分頁的個數也不相同。As can be seen from the 6A to 6E diagrams, as the position of the data page P(m, n) in which the controller 331 performs the erase operation is different, the number of data pages interfered with is different. Therefore, the content of the page data of the data to be backed up by the controller 331 is also different. Further, as the actual data stored in the interfered data pages is different from the valid data or the obsolete data, the number of pages to be backed up by the controller 331 is also different.

請參見第7A、7B、7C圖,其係說明隨著待擦除的資料分頁在資料區塊的位置不同,受干擾的資料分頁的數量也隨著改變之示意圖。在第7A、7B、7C圖中,以數字代表在待執行擦除操作的資料分頁中,同樣需要執行擦除操作並彼此相鄰的資料分頁的個數。Please refer to FIGS. 7A, 7B, and 7C, which illustrate a schematic diagram of the number of interfered data pages as the data page to be erased is different in the location of the data block. In the 7A, 7B, and 7C diagrams, the number represents the number of data pages that are subjected to the erasing operation and adjacent to each other in the data page in which the erasing operation is to be performed.

第7A圖假設在資料區塊451內,待擦除的四個資料分頁451a、451b、451c、451d完全不相鄰。因此,待擦除的資料分頁451a、451b、451c、451d均標示為0(0表示待擦除相鄰分頁的個數)。此種情況下,控制器331對各該待擦除的資料分頁451a、451b、451c、451d執行擦除操作時,都需要100%的單位擦除時間Tsu。在第7A圖中,不須被擦除的資料分頁可進一步區分為:15個與資料分頁451a、451b、451c、451d相鄰的受干擾的資料分頁451e,以及13個不會受到干擾的資料分頁451f。Figure 7A assumes that within data block 451, the four data pages 451a, 451b, 451c, 451d to be erased are completely non-adjacent. Therefore, the data pages 451a, 451b, 451c, and 451d to be erased are all indicated as 0 (0 indicates the number of adjacent pages to be erased). In this case, when the controller 331 performs an erase operation on each of the material pages 451a, 451b, 451c, and 451d to be erased, a unit erasure time Tsu of 100% is required. In Figure 7A, data pages that do not need to be erased can be further distinguished as: 15 interfered data pages 451e adjacent to data pages 451a, 451b, 451c, 451d, and 13 undisturbed data. Page 451f.

第7B圖假設在資料區塊452內,待擦除的四個資料分頁452a、452b、452c、452d排列為一行,因此,位在頭尾兩端的待擦除的資料分頁452a、452d均標示為1;位在中間的待擦除的資料分頁452b、452c均標示為2(2表示待擦除相鄰頁面的個數)。此種情況下,可利用待擦除的資料分頁彼此鄰接的關係,縮短控制器331執行擦除操作所需的時間。在第7B圖中,共有10個與資料分頁452a、452b、452c、452d相鄰的受干擾的資料分頁451a,以及18個不會受到干擾的資料分頁452f。Figure 7B assumes that in the data block 452, the four data pages 452a, 452b, 452c, and 452d to be erased are arranged in a row. Therefore, the data pages 452a and 452d to be erased at both ends of the head and tail are marked as 1; The data pages 452b, 452c to be erased in the middle are all marked as 2 (2 indicates the number of adjacent pages to be erased). In this case, the relationship in which the data to be erased pages are adjacent to each other can be utilized to shorten the time required for the controller 331 to perform the erasing operation. In Figure 7B, there are a total of 10 disturbed data pages 451a adjacent to data pages 452a, 452b, 452c, 452d, and 18 data pages 452f that are not subject to interference.

第7C圖假設在資料區塊453內,待擦除的四個資料分頁453a、453b、453c、453d排列為田字型。因此,待擦除的資料分頁453a、453b、453c、453兩兩相鄰,故皆標示為2(2表示待擦除相鄰頁面的個數)。此種情況下,可利用待擦除的資料分頁453a、453b、453c、453d彼此鄰接的關係,減少控制器331執行擦除操作所需的時間。在7C圖中,共有8個與資料分頁453a、453b、453c、453d相鄰的受干擾的資料分頁453e,以及20個不會受到干擾的資料分頁453f。Figure 7C assumes that in data block 453, the four data pages 453a, 453b, 453c, and 453d to be erased are arranged in a field type. Therefore, the data pages 453a, 453b, 453c, and 453 to be erased are adjacent to each other, so they are all marked as 2 (2 indicates the number of adjacent pages to be erased). In this case, the relationship between the data sheets 453a, 453b, 453c, and 453d to be erased adjacent to each other can be utilized to reduce the time required for the controller 331 to perform the erasing operation. In Figure 7C, there are 8 disturbed data pages 453e adjacent to data pages 453a, 453b, 453c, 453d, and 20 data pages 453f that are not subject to interference.

比較第7A、7B、7C圖可以看出,待擦除之資料分頁在資料區塊內的排列方式,將影響受干擾的資料分頁的數量。當控制器331對資料區塊451、452、453內的資料分頁進行擦除操作時,也需要受干擾的資料分頁所儲存的資料進行備份。因此,當受干擾的資料分頁的數量較多時,控制器331也相對需要花費較多的時間備份該些資料分頁的內容。Comparing the 7A, 7B, and 7C graphs, it can be seen that the arrangement of the data pages to be erased in the data block will affect the number of data pages that are interfered. When the controller 331 performs an erase operation on the data pages in the data blocks 451, 452, and 453, the data stored in the interfered data pages is also required to be backed up. Therefore, when the number of interfered data pages is large, the controller 331 also needs to spend more time to back up the contents of the data pages.

除了排列方式的差異可能影響控制器331執行擦除操作所需時間外,控制器331執行擦除操作的順序,也會對整體執行擦除指令所須的時間產生影響。關於擦除操作的順序如何影響控制器331執行擦除指令所需時間,將於第8A、8B說明。In addition to the difference in arrangement that may affect the time required for the controller 331 to perform an erase operation, the order in which the controller 331 performs the erase operation also affects the time required for the overall execution of the erase command. How the order of the erase operation affects the time required for the controller 331 to execute the erase command will be explained in Figs. 8A and 8B.

第8A、8B圖延續第7B圖的舉例,以一個包含4*8個資料分頁的資料區塊為例,說明在執行擦除指令時,若採用不同的擦除順序,擦除指令的執行時間也不同。此處假設在控制器331已預先將受干擾的資料分頁的內容複製至其他分頁,也已經將該些受干擾的資料分頁標示為無效。第8A、8B圖各自包含四個須擦除的資料分頁,且擦除指令可包含四個以箭頭圖案表示的擦除階段。控制器331在每個階段擦除其中一個資料分頁。8A, 8B continues the example of Figure 7B, taking a data block containing 4*8 data pages as an example to illustrate the execution time of the erase command if different erase sequences are used when executing the erase command. It is also different. It is assumed here that the controller 331 has previously copied the contents of the interfered material page to other pages, and the disturbed data pages have also been marked as invalid. The 8A, 8B maps each contain four data pages to be erased, and the erase command may include four erase stages in an arrow pattern. The controller 331 erases one of the data pages at each stage.

請參見第8A圖,其係依照待擦除資料分頁的排列順序,對資料分頁進行擦除操作之示意圖。首先,第一個箭頭圖案ST1代表,對儲存過時資料A的資料分頁P(2, 4)進行擦除。因為資料分頁P(2,4)為第一個被擦除的資料分頁,在擦除資料分頁P(2,4)前,過時資料A並未受到任何干擾。所以擦除資料分頁P(2,4)時,需要100%的單位擦除時間Tsu。Please refer to FIG. 8A, which is a schematic diagram of erasing data pages according to the order of the pages to be erased. First, the first arrow pattern ST1 represents erasing the data page P(2, 4) storing the stale data A. Since the data page P(2, 4) is the first erased data page, the obsolete data A is not subject to any interference until the data page P(2, 4) is erased. Therefore, when erasing the data page P(2, 4), 100% unit erasure time Tsu is required.

經過擦除操作後,資料分頁P(2,4)包含的過時資料A已經被清除。因此,在第一個箭頭圖案ST1右側的資料分頁P(2,4)以空白方格表示。在控制器331清除過時資料A的同時,資料分頁P(2, 5)因為與資料分頁(2, 4)相鄰的緣故,存放在資料分頁P(2, 5)的過時資料B將受到一次干擾。After the erase operation, the obsolete data A contained in the data page P(2, 4) has been cleared. Therefore, the material page P(2, 4) on the right side of the first arrow pattern ST1 is indicated by a blank square. While the controller 331 clears the obsolete data A, the data page P(2, 5) is adjacent to the data page (2, 4), and the obsolete data B stored in the data page P(2, 5) will be received once. interference.

接著對包含過時資料B的資料分頁P(2, 5)進行擦除操作。因為資料分頁P(2, 5)先前已經被干擾過,控制器331擦除資料分頁P(2, 5)時,僅需要花費60%的單位擦除時間Tsu(Tsu*60%)。經過擦除操作後,資料分頁P(2, 5)包含的過時資料B已經被清除。因此,在第二個箭頭圖案ST2右側的資料分頁P(2, 5)以空白方格表示。在控制器331清除過時資料B的同時,資料分頁P(2, 6)因為與資料分頁(2, 5)相鄰的緣故,存放在資料分頁P(2, 6)的過時資料C將受到一次干擾。Then, the data page P(2, 5) containing the obsolete material B is erased. Since the data page P(2, 5) has been previously disturbed, the controller 331 erases the data page P(2, 5), and only takes 60% of the unit erasure time Tsu (Tsu*60%). After the erase operation, the obsolete data B contained in the data page P(2, 5) has been cleared. Therefore, the material page P(2, 5) on the right side of the second arrow pattern ST2 is indicated by a blank square. While the controller 331 clears the obsolete data B, the data page P(2, 6) is adjacent to the data page (2, 5), and the obsolete data C stored in the data page P(2, 6) will be subjected to once. interference.

接著對包含過時資料C的資料分頁P(2, 6)進行擦除操作。因為資料分頁P(2, 6)先前已經被干擾過,控制器331擦除資料分頁P(2, 6)時,僅需要花費60%的單位擦除時間Tsu(Tsu*60%)。經過擦除操作後,資料分頁P(2, 6)包含的過時資料C已經被清除。因此,在第三個箭頭圖案ST3右側的資料分頁P(2, 6)以空白方格表示。在控制器331清除過時資料C的同時,資料分頁P(2, 7)因為與資料分頁(2, 6)相鄰的緣故,存放在資料分頁P(2, 7)的過時資料D將受到一次干擾。The data page P (2, 6) containing the obsolete data C is then erased. Since the data page P(2, 6) has been previously disturbed, the controller 331 only needs to spend 60% of the unit erase time Tsu (Tsu*60%) when erasing the material page P(2, 6). After the erase operation, the obsolete data C contained in the data page P(2, 6) has been cleared. Therefore, the material page P(2, 6) on the right side of the third arrow pattern ST3 is indicated by a blank square. While the controller 331 clears the obsolete data C, the data page P(2, 7) is adjacent to the data page (2, 6), and the obsolete data D stored in the data page P(2, 7) will be subjected to once. interference.

最後,對包含過時資料D的資料分頁P(2, 7)進行擦除操作。因為資料分頁P(2, 7)先前已經被干擾過,控制器331擦除資料分頁P(2, 7)時,僅需要花費60%的單位擦除時間Tsu(Tsu*60%)。經過擦除操作後,資料分頁P(2, 7)包含的過時資料D已經被清除。因此,在第四個箭頭圖案ST4右側的資料分頁P(2, 7)以空白方格表示。Finally, the data page P(2, 7) containing the obsolete material D is erased. Since the data page P(2, 7) has been previously disturbed, the controller 331 erases the data page P(2, 7), and only takes 60% of the unit erasure time Tsu (Tsu*60%). After the erase operation, the obsolete data D contained in the data page P(2, 7) has been cleared. Therefore, the material page P(2, 7) on the right side of the fourth arrow pattern ST4 is indicated by a blank square.

承上所述,依據資料分頁的排列順序,針對包含過時資料A、B、C、D的資料分頁P(2, 4)、P(2, 5)、P(2, 6)、P(2, 7)依序進行擦除操作的作法,所需的擦除時間分別為:Tsu*100%、Tsu*60%、Tsu*60%、Tsu*60%。因此,在第8A圖中,累計這四次的擦除操作總共需要Tsu*280%的時間。According to the above, according to the order of the data pages, the data pages P(2, 4), P(2, 5), P(2, 6), P(2) for the obsolete data A, B, C, and D are included. 7) The erase operation is performed in sequence, and the required erasure times are: Tsu*100%, Tsu*60%, Tsu*60%, and Tsu*60%. Therefore, in Fig. 8A, the total of these four erasing operations requires a total of Tsu*280% of the time.

請參見第8B圖,其係未依照待擦除資料分頁的排列順序,對資料分頁進行擦除操作之示意圖。首先,第一個箭頭圖案ST1代表,對儲存過時資料A的資料分頁P(2, 4)進行擦除。因為資料分頁P(2,4)為第一個被擦除的資料分頁,在擦除資料分頁P(2,4)前,過時資料A並未受到任何干擾。所以擦除資料分頁P(2,4)時,需要100%的單位擦除時間Tsu*100%。Please refer to FIG. 8B, which is a schematic diagram of the erasing operation of the data paging according to the order of the pages to be erased. First, the first arrow pattern ST1 represents erasing the data page P(2, 4) storing the stale data A. Since the data page P(2, 4) is the first erased data page, the obsolete data A is not subject to any interference until the data page P(2, 4) is erased. Therefore, when erasing the data page P(2, 4), 100% unit erasure time Tsu*100% is required.

經過擦除操作後,資料分頁P(2,4)包含的過時資料A已經被清除。因此,在第一個箭頭圖案ST1右側的資料分頁P(2,4)以空白方格表示。在控制器331清除過時資料A的同時,資料分頁P(2, 5)因為與資料分頁(2, 4)相鄰的緣故,存放在資料分頁P(2, 5)的過時資料B將受到一次干擾。After the erase operation, the obsolete data A contained in the data page P(2, 4) has been cleared. Therefore, the material page P(2, 4) on the right side of the first arrow pattern ST1 is indicated by a blank square. While the controller 331 clears the obsolete data A, the data page P(2, 5) is adjacent to the data page (2, 4), and the obsolete data B stored in the data page P(2, 5) will be received once. interference.

接著對包含過時資料C的資料分頁P(2, 6)進行擦除操作。因為資料分頁P(2, 6)先前未曾被干擾,控制器331擦除資料分頁P(2, 6)時,需要花費100%的單位擦除時間Tsu(Tsu*100%)。經過擦除操作後,資料分頁P(2, 6)包含的過時資料C已經被清除。因此,在第二個箭頭圖案ST2右側的資料分頁P(2, 6)以空白方格表示。在控制器331清除過時資料C的同時,資料分頁P(2, 7)因為與資料分頁(2, 6)相鄰的緣故,存放在資料分頁P(2, 7)的過時資料D將受到一次干擾。此外,在控制器331清除過時資料C的同時,資料分頁P(2, 5)因為與資料分頁(2, 6)相鄰的緣故,存放在資料分頁P(2, 5)的過時資料B將第二度受到干擾。The data page P (2, 6) containing the obsolete data C is then erased. Since the data page P(2, 6) has not been previously disturbed, the controller 331 needs to spend 100% of the unit erase time Tsu (Tsu*100%) when erasing the material page P(2, 6). After the erase operation, the obsolete data C contained in the data page P(2, 6) has been cleared. Therefore, the material page P(2, 6) on the right side of the second arrow pattern ST2 is indicated by a blank square. While the controller 331 clears the obsolete data C, the data page P(2, 7) is adjacent to the data page (2, 6), and the obsolete data D stored in the data page P(2, 7) will be subjected to once. interference. In addition, while the controller 331 clears the obsolete data C, the data page P(2, 5) is adjacent to the data page (2, 6), and the obsolete data B stored in the data page P(2, 5) will be The second time was disturbed.

接著對包含過時資料B的資料分頁P(2, 5)進行擦除操作。因為資料分頁P(2, 5)先前已經被干擾過兩次,控制器331擦除資料分頁P(2, 5)時,僅需要花費40%的單位擦除時間Tsu(Tsu*40%)。經過擦除操作後,資料分頁P(2, 5)包含的過時資料B已經被清除。因此,在第三個箭頭圖案ST3右側的資料分頁P(2, 5)以空白方格表示。在控制器331清除過時資料B的同時,資料分頁P(2, 4)、P(2, 6)並未存有資料,故不受影響。Then, the data page P(2, 5) containing the obsolete material B is erased. Since the data page P(2, 5) has been previously disturbed twice, the controller 331 erases the data page P(2, 5), and only takes 40% of the unit erasure time Tsu (Tsu*40%). After the erase operation, the obsolete data B contained in the data page P(2, 5) has been cleared. Therefore, the material page P(2, 5) on the right side of the third arrow pattern ST3 is indicated by a blank square. When the controller 331 clears the obsolete data B, the data pages P(2, 4), P(2, 6) do not have data, so they are not affected.

最後,對包含過時資料D的資料分頁P(2, 7)進行擦除操作。因為資料分頁P(2, 7)先前已經被干擾過,控制器331擦除資料分頁P(2, 7)時,僅需要花費60%的單位擦除時間Tsu(Tsu*60%)。經過擦除操作後,資料分頁P(2, 7)包含的過時資料D已經被清除。因此,在第四個箭頭圖案ST4右側的資料分頁P(2, 7)以空白方格表示。Finally, the data page P(2, 7) containing the obsolete material D is erased. Since the data page P(2, 7) has been previously disturbed, the controller 331 erases the data page P(2, 7), and only takes 60% of the unit erasure time Tsu (Tsu*60%). After the erase operation, the obsolete data D contained in the data page P(2, 7) has been cleared. Therefore, the material page P(2, 7) on the right side of the fourth arrow pattern ST4 is indicated by a blank square.

承上所述,在第8B圖中,未依據資料分頁的排列順序,針對過時資料A、B、C、D進行擦除操作時,控制器331擦除資料分頁P(2, 4)、P(2, 6)、P(2, 5)、P(2, 7)需要的時間分別為:Tsu*100%、Tsu*100%、Tsu*40%、Tsu*60%。因此,在第8B圖中,累計這四次的擦除操作總共需要Tsu*300%的時間。As described above, in FIG. 8B, when the erasing operation is performed for the obsolete data A, B, C, and D according to the order of the data paging, the controller 331 erases the data paging P(2, 4), P. The time required for (2, 6), P(2, 5), and P(2, 7) are: Tsu*100%, Tsu*100%, Tsu*40%, and Tsu*60%. Therefore, in Fig. 8B, the total of these four erasing operations requires a total of Tsu*300% of the time.

比較第8A圖與第8B圖可以看出,依照資料分頁本身的排列順序而對資料分頁P(2, 4)、P(2, 5)、P(2, 6)、P(2, 7)進行擦除操作時,執行擦除操作所需要的時間較短。因此,針對需擦除的資料分頁為彼此相鄰的情況,本揭露的實施例將依照待擦除的資料分頁的排列位置,依循著由左而右、由上而下的順序,對各個資料分頁進行擦除操作。Comparing pictures 8A and 8B, it can be seen that the data pages P(2, 4), P(2, 5), P(2, 6), P(2, 7) according to the order of the data pages themselves. When an erase operation is performed, the time required to perform the erase operation is short. Therefore, in the case that the data pages to be erased are adjacent to each other, the embodiment of the present disclosure follows the arrangement position of the data pages to be erased, following the left-to-right, top-down order. The page is erased.

請參見第9圖,其係對資料區塊中,排列為九宮格狀的資料分頁進行擦除操作之示意圖。此處假設資料區塊23包含的資料分頁排列為4行與8列。Please refer to Fig. 9, which is a schematic diagram of the erasing operation of the data pages arranged in a nine-square grid in the data block. It is assumed here that the data block 23 contains data pages arranged in 4 rows and 8 columns.

如第9圖左上方所示,假設在資料區塊23中,資料分頁P(1, 4)、P(2, 4)、P(3, 4)、P(1, 5)、P(2, 5)、P(3, 5)、P(1, 6)、P(2, 6)、P(3, 6)含有過時資料需要被清除。此處以粗黑線框選這些需要擦除的資料分頁。As shown in the upper left of Figure 9, it is assumed that in the data block 23, the data pages P(1, 4), P(2, 4), P(3, 4), P(1, 5), P(2) , 5), P(3, 5), P(1, 6), P(2, 6), P(3, 6) contain obsolete data that needs to be cleared. Here, select the data pages that need to be erased with a thick black line.

此外,如第9圖右上方所示,共有9個受干擾的資料分頁P(1, 3)、P(2, 3)、P(3, 3)、P(4, 4)、P(4, 5)、P(4, 6)、P(1, 7)、P(2, 7)、P(3, 7)的內容需要在備份至其他空白分頁後,再將該些受干擾的資料分頁P(1, 3)、P(2, 3)、P(3, 3)、P(4, 4)、P(4, 5)、P(4, 6)、P(1, 7)、P(2, 7)、P(3, 7)標示為無效。In addition, as shown in the upper right of Figure 9, there are 9 disturbed data pages P(1, 3), P(2, 3), P(3, 3), P(4, 4), P(4). , 5), P(4, 6), P(1, 7), P(2, 7), P(3, 7) contents need to be backed up to other blank pages, and then the interfered data P1, 3, 3, 3, 3, 3, P, 4, 5, P, 4, 5, P, 1, (7) P(2, 7), P(3, 7) are marked as invalid.

接著,為善加利用前述關於資料分頁相鄰時,清除資料分頁所導致之干擾現象進而加速其擦除速度,控制器331可針對需要清除的資料分頁,採用由左而右由上而下的順序進行擦除。Then, in order to make good use of the foregoing information about paging adjacent, the interference phenomenon caused by the data paging is cleared to accelerate the erasing speed, and the controller 331 can use the top-down from left to right for the data paging to be cleared. Erase in sequence.

第9圖的左下方以箭頭方向代表控制器331執行擦除操作的順序。其中,並以不同的網底代表對各個資料分頁實際進行擦除操作前,各該資料分頁所處的狀態。該些狀態也對應於對資料分頁進行擦除操作所需的擦除時間。第9圖的右下方所示為,資料分頁P(1, 4)、P(2, 4)、P(3, 4)、P(1, 5)、P(2, 5)、P(3, 5)、P(1, 6)、P(2, 6)、P(3, 6)的過時資料均被清除後的情形。以下說明按照資料分頁在各列的順序,由左而右說明擦除操作的執行順序。The lower left side of Fig. 9 represents the order in which the controller 331 performs the erasing operation in the direction of the arrow. Wherein, and the different network bottoms represent the state in which the data is paged before the actual data is erased. These states also correspond to the erase time required to erase the data page. The bottom right of Figure 9 shows the data pages P(1, 4), P(2, 4), P(3, 4), P(1, 5), P(2, 5), P(3). , 5), P (1, 6), P (2, 6), P (3, 6) obsolete data are cleared. The following describes the order in which the erase operations are performed from left to right in the order in which the data is paged in the columns.

首先,控制器331擦除資料分頁P(1, 4)時,必須花費100%的單位擦除時間Tsu。對資料分頁P(2, 4)執行擦除操作時,因為資料分頁P(2, 4)內的過時資料曾受到控制器331先前對資料分頁(1, 4)執行擦除操作所干擾。因此,控制器331僅需花費60%的單位擦除時間Tsu即可擦除資料分頁P(2, 4)。同理,控制器331擦除資料分頁P(3, 4)時,因為資料分頁P(3, 4)內的過時資料已經受到控制器331先前對資料分頁(2, 4)執行擦除操作所干擾,因此,控制器331僅需花費60%的單位擦除時間Tsu即可擦除資料分頁(3, 4)。First, when the controller 331 erases the material page P(1, 4), it must spend 100% of the unit erasure time Tsu. When the erase operation is performed on the material page P(2, 4), since the stale data in the data page P(2, 4) has been interfered by the controller 331 previously performing the erase operation on the material page (1, 4). Therefore, the controller 331 can erase the data page P (2, 4) by only spending 60% of the unit erase time Tsu. Similarly, when the controller 331 erases the data page P(3, 4), since the stale data in the data page P(3, 4) has been subjected to the erase operation by the controller 331 previously for the data page (2, 4). Interference, therefore, the controller 331 can erase the data page (3, 4) by only spending 60% of the unit erase time Tsu.

其次,控制器331擦除資料分頁P(1, 5)時,因為資料分頁P(1, 5)內的過時資料曾受到先前對資料分頁(1, 4)執行擦除操作的影響,僅需花費60%的單位擦除時間Tsu。另一方面,控制器331擦除資料分頁P(2, 5)時,因為受到控制器331先前擦除資料分頁P(2, 4)、P(1, 5)的影響,儲存在資料分頁P(2, 5)的過時資料已經兩度受到干擾。因此,控制器331擦除資料分頁P(2, 5)時,僅需花費40%的單位擦除時間Tsu。同樣的,控制器331擦除資料分頁P(3, 5)時,因為受到控制器331先前擦除資料分頁P(3, 4)、P(2, 5)所干擾,儲存在資料分頁P(3, 5)的過時資料已經兩度受到干擾。因此,控制器331擦除資料分頁P(3, 5)時,僅需花費40%的單位擦除時間Tsu。Secondly, when the controller 331 erases the data page P(1, 5), since the outdated data in the data page P(1, 5) has been affected by the previous erasing operation on the data page (1, 4), only It takes 60% of the unit to erase the time Tsu. On the other hand, when the controller 331 erases the data page P(2, 5), it is stored in the data page P because it is previously affected by the controller 331 to erase the data page P(2, 4), P(1, 5). The obsolete data of (2, 5) has been disturbed twice. Therefore, when the controller 331 erases the material page P(2, 5), it only takes 40% of the unit erasure time Tsu. Similarly, when the controller 331 erases the data page P(3, 5), it is stored in the data page P because it is interfered by the controller 331 to erase the data page P(3, 4), P(2, 5). 3, 5) obsolete data has been disturbed twice. Therefore, when the controller 331 erases the material page P(3, 5), it only takes 40% of the unit erasure time Tsu.

控制器331擦除資料分頁P(1, 6)時,因為受到控制器331先前擦除資料分頁(1, 5)的干擾,僅需花費60%的單位擦除時間Tsu。另一方面,控制器331擦除資料分頁P(2, 6)時,因為受到控制器331先前擦除資料分頁P(2, 5)、P(1, 6)的干擾,資料分頁P(2, 6)內的過時資料已經兩度受到干擾。因此,控制器331擦除資料分頁P(2, 6)時,僅需花費40%的單位擦除時間Tsu。同樣的,控制器331擦除資料分頁P(3, 6)時,因為受到控制器331先前擦除資料分頁P(3, 5)、P(2, 6)的干擾,資料分頁P(3, 6)內的過時資料已經兩度受到干擾。因此,控制器331擦除資料分頁P(3, 6)時,僅需花費40%的單位擦除時間Tsu。When the controller 331 erases the material page P(1, 6), it only takes 60% of the unit erase time Tsu because it is interfered by the controller 331 to erase the data page (1, 5). On the other hand, when the controller 331 erases the data page P(2, 6), because the controller 331 previously erases the data page P(2, 5), P(1, 6) interference, the data page P(2) The obsolete data in 6) has been disturbed twice. Therefore, when the controller 331 erases the material page P(2, 6), it only takes 40% of the unit erasure time Tsu. Similarly, when the controller 331 erases the data page P(3, 6), because the controller 331 previously erases the data page P(3, 5), P(2, 6) interference, the data page P(3, The outdated data within 6) has been disturbed twice. Therefore, when the controller 331 erases the material page P (3, 6), it only takes 40% of the unit erasure time Tsu.

由第9圖的左下角還可以看出,採用由左而右的順序以及由上而下的順序清除過時資料的方式,可以讓彼此相鄰且排列為田字型的四個資料分頁中,位於右上角的資料分頁受到至少一次因為其他資料分頁被擦除操所引起的干擾、位於左下角的資料分頁受到至少一次因為其他資料分頁被擦除所引起的干擾,且位於右下角的資料分頁受到兩次因為其他資料分頁被擦除操作所引起的干擾。It can also be seen from the lower left corner of Fig. 9 that in the left-to-right order and the top-down order, the obsolete data can be erased, so that four data pages adjacent to each other and arranged in a field type can be arranged. The data page in the upper right corner is subject to interference caused by at least one page erase operation, and the data page at the lower left corner is interfered at least once because other data pages are erased, and the data page is located in the lower right corner. Two times the interference caused by the erase operation of other data pages.

承上所述,除了在擦除資料分頁P(1, 4)時,無法利用干擾現象所減少擦除操作所需時間外,控制器331在擦除其餘的每一個資料分頁時,都不需要用到100%的單位擦除時間Tsu。因此,第9圖所示的擦除順序,確實可以降低擦除指令所需時間的效果。As described above, in addition to the time required to reduce the erasing operation by the interference phenomenon when erasing the data page P(1, 4), the controller 331 does not need to erase each of the remaining data pages. Use 100% unit erase time Tsu. Therefore, the erase sequence shown in Fig. 9 can really reduce the effect of the time required to erase the command.

更進一步分析依照此種順序而進行擦除操作所需的時間可以看出,控制器331擦除資料分頁P(1, 4)需要的時間為Tsu*100%;控制器331擦除資料分頁P(2, 4)、P(3, 4)、P(1, 5)、P(1, 6)需要的時間為Tsu*60%;控制器331擦除資料分頁P(2, 5)、P(3, 5)、P(2, 6)、P(3, 6)需要的時間為Tsu*40%。因此,若需要由控制器331擦除的資料分頁排列為九宮格,且控制器331依照由左而右、由上而下的順序擦除該些資料分頁時,控制器331總共需要的擦除時間為Tsu*100%+4*Tsu*60%+4*Tsu*40%=Tsu*500%。據此,控制器331擦除這九個資料分頁的過程,僅需要五個單位擦除時間Tsu*500%。Further analyzing the time required for the erase operation in accordance with this order, it can be seen that the time required for the controller 331 to erase the data page P(1, 4) is Tsu*100%; the controller 331 erases the data page P. The time required for (2, 4), P(3, 4), P(1, 5), P(1, 6) is Tsu*60%; controller 331 erases data page P(2, 5), P The time required for (3, 5), P(2, 6), P(3, 6) is Tsu*40%. Therefore, if it is required that the data pages erased by the controller 331 are arranged in a nine-square grid, and the controller 331 erases the data pages in a left-to-right, top-down order, the controller 331 requires a total erasure time. It is Tsu*100%+4*Tsu*60%+4*Tsu*40%=Tsu*500%. Accordingly, the controller 331 erases the nine data paging processes, requiring only five unit erase times Tsu*500%.

如前所述,當待擦除的資料分頁彼此相鄰時,相較於個別對九個彼此完全不相鄰的資料分頁進行擦除操作的情況,可以減少需要複製至其他資料區塊之資料分頁的數量。進一步的,若控制器331針對擦除資料分頁的順序加以設計,依照由左而右、由上而下的順序進行擦除操作時,還可利用相鄰資料分頁間的干擾特性,大幅縮短擦除操作所需的時間。因此,採用循序方式擦除資料分頁的模式,確實可大幅縮短對資料區塊執行擦除指令所需的時間。As described above, when the data pages to be erased are adjacent to each other, the data that needs to be copied to other data blocks can be reduced as compared with the case where the individual data is erased by nine non-adjacent data pages. The number of pages. Further, if the controller 331 designs the order of erasing data pages, and performs the erasing operation in the order from left to right and from top to bottom, the interference characteristics between adjacent data pages can also be utilized to greatly shorten the erasing. In addition to the time required for the operation. Therefore, the mode of erasing data paging in a sequential manner can significantly shorten the time required to execute an erase command on a data block.

接著,以第10A、10B圖說明控制器331執行抹除操作與清除操作的做法,並說明兩種做法的差異。在10A、10B圖中,假設控制器331需要清除資料區塊41中,存放在資料分頁P(2, 4)的過時資料A、存放在資料分頁P(2, 5)的過時資料B、存放在資料分頁P(2, 6) 的過時資料C,以及存放在資料分頁P(2, 7)的過時資料D。其中,第10A圖為控制器331針對資料區塊41執行抹除指令的作法;第10B圖為控制器331針對資料區塊執行擦除指令的作法。Next, the description of the controller 331 to perform the erase operation and the clear operation will be described with reference to FIGS. 10A and 10B, and the difference between the two methods will be described. In the diagrams 10A and 10B, it is assumed that the controller 331 needs to clear the obsolete data A stored in the data section P1, the obsolete data A stored in the data page P(2, 4), the obsolete data B stored in the data page P(2, 5), and the storage. Obsolete data C in data page P(2, 6) and outdated data D stored in data page P(2, 7). 10A is a diagram of the controller 331 executing an erase command for the data block 41; and FIG. 10B is a diagram of the controller 331 executing an erase command for the data block.

如第10A圖所示,控制器331針對資料區塊41執行抹除指令時,須先將資料區塊41中,除了過時資料A、B、C、D所在位置以外的其他資料分頁所包含的資料,複製至另一個資料區塊42中。因資料區塊41包含32個資料分頁,代表此處需要先從資料區塊41中,複製32-4=28個資料分頁所儲存的內容至資料區塊42。當控制器331將須備分的資料複製至資料區塊42後,控制器331便可對資料區塊41執行抹除操作。據此,控制器331可以在執行抹除指令前,依據需要備份的資料分頁的數量,以及執行抹除操作所需的時間,計算執行抹除指令所需的時間。As shown in FIG. 10A, when the controller 331 executes the erase command for the data block 41, it must first include the data in the data block 41 except for the location of the obsolete data A, B, C, and D. The data is copied to another data block 42. Since the data block 41 contains 32 data pages, it is necessary to copy the contents stored in the data block 41 from the data block 41 to the data block 42 by copying 32-4=28 data pages. When the controller 331 copies the material to be reserved to the data block 42, the controller 331 can perform an erase operation on the data block 41. Accordingly, the controller 331 can calculate the time required to execute the erase command according to the number of data pages to be backed up and the time required to perform the erase operation before executing the erase command.

如第10B圖所示,控制器331針對資料區塊41執行擦除指令時,須先將資料區塊41中,與過時資料A、B、C、D相鄰的資料分頁所包含的資料,複製至另一個資料區塊43中。由第10B圖可以看出,共有10個與過時資料A、B、C、D所在之資料分頁相鄰的資料分頁。因此,控制器331需要先從資料區塊41中,複製10個資料分頁的內容至資料區塊42中。將須備分的資料複製至資料區塊43後,控制器331便可擦除資料分頁P(2,4)、P(2,5)、P(2,6)、P(2, 7)。據此,控制器331可以在執行擦除指令前,依據需要備份的資料分頁的數量,以及對資料分頁P(2,4)、P(2,5)、P(2,6)、P(2, 7)進行擦除操作所需的時間,計算執行擦除指令所需的時間。As shown in FIG. 10B, when the controller 331 executes an erase command for the data block 41, the data included in the data block 41 adjacent to the obsolete data A, B, C, and D must be paged first. Copy to another data block 43. As can be seen from Figure 10B, there are a total of 10 data pages adjacent to the page where the obsolete data A, B, C, and D are located. Therefore, the controller 331 needs to copy the contents of the 10 material pages to the data block 42 from the data block 41. After copying the data to be reserved to the data block 43, the controller 331 can erase the data pages P(2, 4), P(2, 5), P(2, 6), P(2, 7). . Accordingly, the controller 331 can prioritize the execution of the erase command, according to the number of data pages to be backed up, and the data pages P(2, 4), P(2, 5), P(2, 6), P ( 2, 7) The time required for the erase operation to calculate the time required to execute the erase command.

為便於說明,此處假設資料區塊41中,屬於非待清除之資料分頁內均包含有效資料。但是,在實際應用中,並非全部的非待清除之資料分頁均包含有效資料。亦即,該些非待清除之資料分頁內,可能包含過時資料或還尚未寫入資料。因此,無論是抹除操作或擦除操作,實際需要複製之資料分頁內容可能少於第10A圖的例子。For the sake of explanation, it is assumed here that in the data block 41, the data pages that are not to be cleared contain valid data. However, in practical applications, not all of the data pages that are not to be cleared contain valid data. That is, the data pages that are not to be cleared may contain outdated data or have not yet been written. Therefore, whether it is an erase operation or an erase operation, the actual page content to be copied may be less than the example of FIG. 10A.

請參見第11圖,其係控制器對抹除操作與擦除操作評估所需時間後,選擇操作類別之流程圖。Please refer to Fig. 11, which is a flow chart for selecting the operation category after the controller evaluates the time required for the erase operation and the erase operation.

首先,控制器331分別估算執行抹除指令所需的時間(步驟S501),以及執行擦除指令所需的時間(S503)。這兩個步驟可同時或是先後進行,且其先後順序不限。First, the controller 331 estimates the time required to execute the erase command, respectively (step S501), and the time required to execute the erase command (S503). These two steps can be performed simultaneously or sequentially, and the order of them is not limited.

在步驟S501中,控制器331執行抹除指令所需的時間時,需先計算受影響之資料分頁的數量(S501a)。接著,計算將這些受影響之資料分頁中的有效資料,複製至其他資料區塊所需的時間。並且,將複製有效資料的時間,以及抹除一個資料區塊的時間加總後,以加總的結果代表控制器331執行抹除指令所需的時間(步驟S501b)。In step S501, when the controller 331 executes the time required for the erase command, it is necessary to first calculate the number of affected data pages (S501a). Next, calculate the time required to copy the valid data from the affected data pages to other data blocks. And, the time at which the valid material is copied and the time at which one of the data blocks are erased are added, and the total result represents the time required for the controller 331 to execute the erase command (step S501b).

在步驟S503中,估算執行擦除指令所需的時間時,需先計算受影響之資料分頁的數量(S503a)。接著,計算將這些受影響之資料分頁中的有效資料,複製至其他資料區塊所需的時間。並且,依據需擦除資料分頁的個數、位置與擬進行擦除的順序,計算對選定的資料分頁執行擦除操作所需的時間。並且,將複製有效資料的時間,以及對選定的資料分頁執行擦除操作所需的時間加總後,以加總的結果代表控制器331執行擦除指令所需的時間(步驟S503b)。In step S503, when the time required to execute the erase command is estimated, the number of affected data pages needs to be calculated first (S503a). Next, calculate the time required to copy the valid data from the affected data pages to other data blocks. And, according to the number of pages to be erased, the position and the order in which the data is to be erased, the time required to perform the erasing operation on the selected data page is calculated. And, the time at which the valid material is copied, and the time required to perform the erasing operation on the selected data page are summed, and the total result represents the time required for the controller 331 to execute the erase command (step S503b).

其後,控制器331判斷執行擦除指令所需時間是否大於執行抹除指令所需時間(步驟S505)。若步驟S505的判斷結果為肯定,控制器331便執行抹除指令(步驟S507,第10A圖)。反之,若步驟S505的判斷結果為否定,控制器331便執行擦除指令(步驟S509,第10B圖)。Thereafter, the controller 331 determines whether the time required to execute the erase command is greater than the time required to execute the erase command (step S505). If the result of the determination in step S505 is affirmative, the controller 331 executes an erase command (step S507, Fig. 10A). On the other hand, if the decision result in the step S505 is negative, the controller 331 executes the erase command (step S509, Fig. 10B).

在步驟S507中,控制器331先將在資料區塊中的其他資料分頁中的有效資料,複製至其他資料區塊(步驟S507b)。接著,控制器331再對整個資料區塊進行抹除(步驟S507b)。In step S507, the controller 331 first copies the valid data in the other material pages in the data block to the other data blocks (step S507b). Next, the controller 331 erases the entire data block (step S507b).

在步驟S509中,控制器331先將受干擾的資料分頁中的有效資料,複製至其他資料區塊(步驟S507b)。其後,控制器331再對該些選定的資料分頁進行擦除操作(步驟S507b)。In step S509, the controller 331 first copies the valid data in the interfered data page to other data blocks (step S507b). Thereafter, the controller 331 performs an erase operation on the selected data pages (step S507b).

另須留意的是,隨著記憶體製程的不同,控制器331針對不同類型的快閃記憶體執行抹除操作與擦除操作所需的時間差也不盡相同。連帶的,判斷要執行抹除指令或是執行擦除指令的判斷結果,也會依據記憶體技術的不同而異。例如,假設對第一種記憶體而言,對一個資料分頁進行擦除操作所需的時間約為對一個資料區塊進行抹除操作所需的時間的1/2;假設對第二種記憶體而言,對一個資料分頁進行擦除操作所需的時間約為對一個資料區塊進行抹除操作所需的時間的1/10。則,對這兩種不同類型的記憶體而言,控制器331選擇執行擦除操作或執行抹除操作的判斷結果也可能不同。It should also be noted that, as the memory system is different, the time difference required for the controller 331 to perform the erase operation and the erase operation for different types of flash memory is also different. In addition, the judgment result of judging whether to execute an erase command or an erase command will vary depending on the memory technology. For example, suppose that for the first type of memory, the time required to erase a data page is about 1/2 of the time required to erase a data block; In essence, the time required to erase a data page is about 1/10 of the time required to erase a data block. Then, for these two different types of memory, the judgment result that the controller 331 selects to perform an erase operation or perform an erase operation may also be different.

如前所述,控制器331將評估執行抹除指令與執行擦除指令所需花費的時間,並選擇進行其中需要較短時間的操作類型。因此,若控制器331能盡可能的縮短擦除操作所需的時間,並使擦除指令的執行時間短於抹除指令的執行時間,代表控制器331可以以用較有效率的方式清除過時資料,進而提升保護機密資料的效率。以下說明中,著重於如何縮短擦除操作所需的時間,其中,包含從寫入階段時,如何決定資料的存放位置與寫入順序的規劃;以及,包含在執行垃圾回收操作時,對資料區塊的管理等面向。As previously mentioned, the controller 331 will evaluate the time it takes to execute the erase command and execute the erase command and select the type of operation in which a shorter time is required. Therefore, if the controller 331 can shorten the time required for the erase operation as much as possible and the execution time of the erase command is shorter than the execution time of the erase command, the representative controller 331 can clear the obsolete in a more efficient manner. Information to improve the efficiency of protecting confidential information. In the following description, the focus is on how to shorten the time required for the erase operation, including how to determine the storage location and write order of the data from the write phase; and, when performing the garbage collection operation, the data The management of the block is oriented.

請參見第12圖,其係根據本揭露構想之記憶裝置之方塊圖。記憶體裝置30可透過匯流排與主控裝置31相連接。記憶體裝置30包含快取記憶體335、控制器331與記憶體陣列333。其中,控制器331電連接於主控裝置31、快取記憶體335與記憶體陣列333。根據本揭露的構想,可進一步將記憶體陣列區分為兩個部分,一部分用於儲存機密性資料(confidential data);另一部分用於儲存一般性資料(generic data)。Please refer to FIG. 12, which is a block diagram of a memory device in accordance with the present disclosure. The memory device 30 can be connected to the main control device 31 through the bus bar. The memory device 30 includes a cache memory 335, a controller 331 and a memory array 333. The controller 331 is electrically connected to the main control device 31, the cache memory 335, and the memory array 333. According to the concept of the present disclosure, the memory array can be further divided into two parts, one for storing confidential data and the other for storing general data.

如第12圖所示,記憶體陣列的內部可區分為兩個資料儲存區。其一為非敏感資料儲存區333b、其二為敏感資料儲存區333a。若控制器331從主控裝置31接收的將寫入資料或更新資料不具機密性質時,控制器331可使用一般的資料管理模式,並將其寫入非敏感資料儲存區333b。反之,若將寫入或更新的資料屬於機密資料,並需要存放於敏感資料儲存區333a時,控制器331將配合擦除管理程式3311e使用。As shown in Fig. 12, the inside of the memory array can be divided into two data storage areas. One is a non-sensitive data storage area 333b, and the other is a sensitive data storage area 333a. If the controller 331 receives the data to be written or updated from the master device 31 that is not confidential, the controller 331 can use the general data management mode and write it to the non-sensitive data storage area 333b. On the other hand, if the data to be written or updated belongs to the confidential data and needs to be stored in the sensitive data storage area 333a, the controller 331 will cooperate with the erasure management program 3311e.

透過擦除管理程式3311e,控制器331在寫入、更新資料至敏感資料儲存區333a的過程,將盡可能地以集中化的方式儲存該筆資料的不同版本。再者,若在敏感資料儲存區333a所存放的資料因為後續的更新而變成過時資料時,控制器331將對存放過時資料的資料分頁進行清除。其中,控制器331清除過時資料的方式可為,針對資料區塊進行抹除指令,或是針對資料分頁執行擦除操作。Through the erasure management program 3311e, the controller 331 stores the different versions of the data in a centralized manner as much as possible in the process of writing and updating the data to the sensitive data storage area 333a. Furthermore, if the data stored in the sensitive data storage area 333a becomes obsolete due to subsequent updates, the controller 331 clears the data paging for storing the stale data. The controller 331 can clear the obsolete data by performing an erase command for the data block or performing an erase operation for the data page.

根據本揭露的實施例,控制器331在規劃敏感資料儲存區333a的資料區塊時,會將資料區塊規劃為不同的資料層級DG。例如,第12圖假設將資料區塊分為3個資料層級DG。其中,對應於第一個資料層級DG1的資料區塊假設為資料區塊BLKa、BLKb、BLKc、BLKd;對應於第二個資料層級DG2的資料區塊假設為資料區塊BLKe、BLKf、BLKg、BLKh;對應於第三個資料層級DG3的資料區塊假設為資料區塊BLKi、BLKj、BLKk、BLKl。According to the embodiment of the present disclosure, the controller 331 plans the data block to be a different data level DG when planning the data block of the sensitive data storage area 333a. For example, Figure 12 assumes that the data block is divided into three data level DGs. The data block corresponding to the first data level DG1 is assumed to be the data block BLKa, BLKb, BLKc, BLKd; the data block corresponding to the second data level DG2 is assumed to be the data block BLKe, BLKf, BLKg, BLKh; the data block corresponding to the third data level DG3 is assumed to be the data blocks BLKi, BLKj, BLKk, BLKl.

隨著資料區塊BLK所對應的資料層級DG不同,本揭露以不同數量的資料分頁作為分頁叢集CL(即,子區域叢集)。隨著資料區塊BLK所對應的資料層級DG不同,在資料區塊BLK內的分頁叢集CL所包含的資料分頁的數量也不相同。As the data level DG corresponding to the data block BLK is different, the present disclosure uses a different number of data pages as the paging cluster CL (ie, sub-region cluster). As the data level DG corresponding to the data block BLK is different, the number of data pages included in the paging cluster CL in the data block BLK is also different.

以下將進一步以三個資料區塊所對應的資料層級DG為例,說明資料區塊BLK、分頁叢集CL與資料分頁的關係。附帶一提的是,此處關於資料層級DG數量、每個資料層級DG對應的分頁叢集CL數量,以及每個分頁叢集CL所對應的資料分頁的數量等,均為舉例,並非限制本揭露的應用。The following takes the data level DG corresponding to the three data blocks as an example to illustrate the relationship between the data block BLK, the paging cluster CL and the data paging. Incidentally, the number of data level DGs, the number of paging clusters corresponding to each data level DG, and the number of data pages corresponding to each paging cluster CL are examples, and are not limited to the disclosure. application.

請參見第13A、13B、13C圖,其似分別對應於三個資料層級DG的資料區塊BLK,以及該些資料區塊內的分頁叢集CL之示意圖。其中,第13A圖代表對應於第一個資料層級(G=1)的資料區塊651(例如,資料區塊BLKa、BLKb、BLKc、BLKd);第13B圖代表對應於資料層級DG2的資料區塊652(例如,資料區塊BLKe、BLKf、BLKg、BLKh);第13C圖代表對應於資料層級DG3的資料區塊653(例如,資料區塊BLKi、BLKj、BLKk、BLKl)。在這些圖式中,資料區塊均包含排列為M行(例如,M=8)與N列(例如,N=8)的多個資料分頁。隨著對應的資料層級DG不同,資料區塊BLK內劃分的分頁叢集CL的數量也不相同。Please refer to the figures 13A, 13B, and 13C, which correspond to the data blocks BLK corresponding to the three data level levels DG, respectively, and the schematic diagrams of the paging clusters CL in the data blocks. Wherein, the 13A picture represents the data block 651 corresponding to the first data level (G=1) (for example, the data blocks BLKa, BLKb, BLKc, BLKd); the 13B picture represents the data area corresponding to the data level DG2 Block 652 (eg, data blocks BLKe, BLKf, BLKg, BLKh); Figure 13C represents a data block 653 (eg, data blocks BLKi, BLKj, BLKk, BLK1) corresponding to data level DG3. In these figures, the data blocks each contain a plurality of data pages arranged in M rows (eg, M=8) and N columns (eg, N=8). The number of paging clusters CL divided in the data block BLK is also different as the corresponding data level DG is different.

在第13A圖中,資料區塊651包含64個分頁叢集CL,且每個分頁叢集包含1個資料分頁。例如,分頁叢集CL1包含資料分頁P(1,1)、分頁叢集CL2包含資料分頁P(2,1),其餘類推。因此,在第13A圖中,與資料區塊651對應的資料區塊使用表,總共列出64個叢集編號(1~64)。當資料區塊651內的分頁叢集CL1~CL64均未寫入任何資料時,與該些叢集編號(1~64)對應的資料存放位置(P#)均為” 0”。若在資料區塊651內,有任何一個分頁叢集寫入資料時,控制器331將與該分頁叢集CL對應的叢集編號(CL#)對應的資料存放位置(P#)更新為”1”。In Figure 13A, data block 651 contains 64 paged clusters CL, and each paged cluster contains 1 data page. For example, the paging cluster CL1 contains the material page P (1, 1), the paged cluster CL2 contains the data page P (2, 1), and the like. Therefore, in Fig. 13A, the data block use table corresponding to the data block 651 lists a total of 64 cluster numbers (1 to 64). When no data is written to the paging clusters CL1 to CL64 in the data block 651, the data storage locations (P#) corresponding to the cluster numbers (1 to 64) are all "0". If any of the paging clusters is written in the data block 651, the controller 331 updates the material storage location (P#) corresponding to the cluster number (CL#) corresponding to the paging cluster CL to "1".

在第13B圖中,資料區塊652包含16個分頁叢集CL,且每個分頁叢集CL包含4個資料分頁。因此,與資料區塊652對應的資料區塊使用表,總共列出16個叢集編號(1~16),分別對應於分頁叢集CL1~CL16。此外,每個叢集編號(1~16)所對應的資料存放位置(P#) 可為0~4。In Figure 13B, data block 652 contains 16 paged clusters CL, and each paged cluster CL contains 4 data pages. Therefore, the data block usage table corresponding to the data block 652 lists a total of 16 cluster numbers (1 to 16) corresponding to the paging clusters CL1 to CL16, respectively. In addition, the data storage location (P#) corresponding to each cluster number (1~16) can be 0~4.

在資料區塊652內的分頁叢集C1~CL16均未寫入任何資料時,與該些叢集編號(1~16)對應的資料存放位置(P#)均為” 0”。若在資料區塊652內的分頁叢集CL開始被寫入資料時,控制器331在與分頁叢集CL對應的叢集編號(CL#)紀錄最新的資料存放位置(P#)。When no data is written in the paging clusters C1 to CL16 in the data block 652, the data storage locations (P#) corresponding to the cluster numbers (1 to 16) are all "0". If the paging cluster CL in the data block 652 starts to be written, the controller 331 records the latest data storage location (P#) at the cluster number (CL#) corresponding to the paging cluster CL.

在第13C圖中,資料區塊652包含4個分頁叢集,且每個分頁叢集CL包含16個資料分頁。因此,與資料區塊653對應的資料區塊使用表,總共列出4個叢集編號1~4,分別對應於分頁叢集CL1~CL4。此外,每個叢集編號(1~4)所對應的資料存放位置(P#) 可為0~16。In Figure 13C, data block 652 contains 4 paged clusters, and each paged cluster CL contains 16 data pages. Therefore, the data block usage table corresponding to the data block 653 lists a total of four cluster numbers 1 to 4, which correspond to the paging clusters CL1 to CL4, respectively. In addition, the data storage location (P#) corresponding to each cluster number (1~4) can be 0~16.

當資料區塊653的分頁叢集CL1~CL4均未寫入任何資料時,與該些叢集編號(1~4)對應的資料存放位置(P#)均為” 0”。若在資料區塊653內的分頁叢集CL1~CL4開始被寫入資料時,控制器331在與分頁叢集CL對應的叢集編號(CL#)紀錄最新的資料存放位置(P#)。When no data is written to the paging clusters CL1 to CL4 of the data block 653, the data storage locations (P#) corresponding to the cluster numbers (1 to 4) are all "0". When the paging clusters CL1 to CL4 in the data block 653 start writing data, the controller 331 records the latest data storage location (P#) at the cluster number (CL#) corresponding to the paging cluster CL.

承上,控制器331將資料區塊使用表儲存於快取記憶體335。當控制器331對記憶體陣列33寫入資料或對資料區塊BLK、分頁叢集CL、資料分頁的內容有所更動時,亦同步更新。據此,控制器331可以透過資料區塊使用表,掌握每個資料區塊BLK的情況。除了資料區塊使用表外,控制器331另可於快取記憶體335中,維持一份資料區塊分級表與位址映射表,透過三者的搭配使用,管理資料區塊BLK的分配使用,以及如何將資料存放至合適的資料區塊與資料分頁。In response, the controller 331 stores the data block usage table in the cache memory 335. When the controller 331 writes data to the memory array 33 or changes the contents of the data block BLK, the paging cluster CL, and the data page, it is also updated synchronously. According to this, the controller 331 can grasp the situation of each data block BLK through the data block use table. In addition to the data block usage table, the controller 331 can maintain a data block grading table and an address mapping table in the cache memory 335, and manage the allocation of the data block BLK through the use of the three. And how to store the data in the appropriate data block and data tab.

請參見第14圖,其係快取記憶體內部之示意圖。 快取記憶體335用於儲存資料區塊分級表335a、資料區塊使用表335b,以及位址映射表335c。基本上,資料區塊分級表335a與資料區塊使用表335b可視為控制器331針對資料區塊BLK的管理與使用所需的相關資訊。另一方面,位址映射表335c相當於控制器331針對資料管理目的而提供的資訊。Please refer to Figure 14, which is a schematic diagram of the internal memory of the cache. The cache memory 335 is used to store a data block ranking table 335a, a data block usage table 335b, and an address mapping table 335c. Basically, the data block rating table 335a and the data block usage table 335b can be regarded as relevant information required by the controller 331 for management and use of the data block BLK. On the other hand, the address mapping table 335c is equivalent to the information provided by the controller 331 for data management purposes.

記憶體裝置30啟用期間,快閃轉譯層3311會即時更新快取記憶體335的內容,供控制器331存取記憶體陣列333使用。當記憶體裝置30停用時,控制器331將快取記憶體335的內容儲存於記憶體陣列333或其他的非揮發性記憶體中,待控制器331在下次開機時載入。During the activation of the memory device 30, the flash translation layer 3311 updates the contents of the cache memory 335 for the controller 331 to access the memory array 333 for use. When the memory device 30 is deactivated, the controller 331 stores the contents of the cache memory 335 in the memory array 333 or other non-volatile memory until the controller 331 is loaded at the next power-on.

資料區塊分級表335a用於儲存資料區塊BLK與其對應的資料層級DG、各個資料層級DG內的分頁叢集所包含的資料分頁數量。例如,在第12圖中,資料區塊BLKa、BLKb、BLKc、BLKd均屬於對應於資料層級DG1的資料區塊BLK;資料區塊BLKe、BLKf、BLKg、BLKh均屬於對應於資料層級DG2的資料區塊;以及,資料區塊BLKi、BLKj、BLKk、BLKl均屬於對應於資料層級DG3的資料區塊。The data block classification table 335a is used to store the number of pages of data included in the data block BLK and its corresponding data level DG and the paging clusters in each data level DG. For example, in FIG. 12, the data blocks BLKa, BLKb, BLKc, and BLKd all belong to the data block BLK corresponding to the data level DG1; the data blocks BLKe, BLKf, BLKg, and BLKh belong to the data corresponding to the data level DG2. The block; and the data blocks BLKi, BLKj, BLKk, BLKl all belong to the data block corresponding to the data level DG3.

另,資料區塊分級表335a還記錄與每個資料層級對應的每個分頁叢集CL所包含的資料分頁的數量Npg_cl。其中, Npg_cl=Og*Pg。延續第13A~13C圖的舉例,此處假設與資料層級G=1對應的資料區塊中,每個分頁叢集CL包含一個資料分頁的數量(當G=1時,Npg_cl=1);假設與資料層級G=2對應的資料區塊中,每個分頁叢集CL包含四個資料分頁的數量(當G=2時,Npg_cl=4);以及,假設與資料層級G=3對應的資料區塊中,每個分頁叢集包含十六個資料分頁的數量(當G=3時,Npg_cl=16)。In addition, the material block rating table 335a also records the number Npg_cl of data pages included in each page cluster CL corresponding to each data level. Where Npg_cl=Og*Pg. Continuing the example of Figures 13A-13C, it is assumed here that in the data block corresponding to the data level G=1, each paged cluster CL contains the number of data pages (when G=1, Npg_cl=1); In the data block corresponding to the data level G=2, each paged cluster CL contains the number of four data pages (Npg_cl=4 when G=2); and, assuming the data block corresponding to the data level G=3 In each page, the paging cluster contains the number of sixteen data pages (when G=3, Npg_cl=16).

此外,快取記憶體335進一步提供多份資料區塊使用表335b,每一份資料區塊使用表335b對應於一個資料區塊BLK。因此,針對第12圖的例子,若記憶體陣列333的敏感資料區333a包含資料區塊BLKa~BLKl,則每個資料區塊BLKa~BLKl都對於一份資料區塊使用表335b。另,隨著資料區塊BLKa~BLKl所對應的資料層級DG不同,各個資料區塊使用表335b內的叢集編號CL#與資料存放位置P#的數量也不相同。In addition, the cache memory 335 further provides a plurality of data block use tables 335b, and each of the data block use tables 335b corresponds to one data block BLK. Therefore, for the example of FIG. 12, if the sensitive data area 333a of the memory array 333 includes the data blocks BLKa~BLK1, each of the data blocks BLKa~BLK1 uses the table 335b for one data block. In addition, as the data level DG corresponding to the data block BLKa~BLK1 is different, the number of the cluster number CL# and the data storage location P# in the table 335b is different for each data block.

例如,當資料區塊BLK對應於資料層級DG1時,資料區塊使用表335b紀錄叢集編號為1~64,以及資料存放位置為0或1;當資料區塊BLK對應於資料層級DG2時,資料區塊使用表335b紀錄叢集編號為1~16,且資料存放位置可為0~4;當資料區塊BLK對應於資料層級DG3時,資料區塊使用表335b紀錄叢集編號1~4,且資料存放位置可為0~16(0表示此叢集尚未有資料寫入)。For example, when the data block BLK corresponds to the data level DG1, the data block uses the table 335b to record the cluster number 1 to 64, and the data storage position is 0 or 1; when the data block BLK corresponds to the data level DG2, the data The block usage table 335b records the cluster number as 1~16, and the data storage location can be 0~4; when the data block BLK corresponds to the data level DG3, the data block uses the table 335b to record the cluster number 1~4, and the data The storage location can be 0~16 (0 means that there is no data to be written in this cluster).

再者,位址映射表335c用於儲存每一個邏輯位址所對應的資料,以及該資料在記憶體陣列中的實體位址。依據本揭露的實施例,控制器331可以利用資料區塊BLKid與分頁叢集CLid辨別資料在記憶體陣列333的存放位置。在搭配資料區塊使用表335b後,就可得知該筆資料最新的版本的存放位置。Furthermore, the address mapping table 335c is used to store the data corresponding to each logical address and the physical address of the data in the memory array. According to the embodiment of the present disclosure, the controller 331 can distinguish the storage location of the data in the memory array 333 by using the data block BLKid and the paging cluster CLId. After using Table 335b in the matching data block, you can know the storage location of the latest version of the data.

關於控制器331如何在更新資料時,決定應該將資料寫入至哪一個資料區塊與哪一個資料分頁的具體例子,請參見第15、16、17A~17B、18圖的說明。這些圖式假設筆資料A會經過反覆的更新,並說明隨著資料A的更新,控制器331如何決定應該將不同版本的資料A存放於什麼位置。為便於說明,此處以英文字母搭配數字代表資料與其版本。例如,A1代表資料A的第一個版本;A2代表資料A的第二個版本,其餘類推。For details on how the controller 331 updates the data, which data block should be written to which data block and which data is to be paged, please refer to the descriptions of Figures 15, 16, 17A-17B, and 18. These schemas assume that the pen data A will be updated repeatedly, and that with the update of the data A, the controller 331 determines how the different versions of the data A should be stored. For the sake of explanation, the English letters and numbers are used here to represent the data and its version. For example, A1 represents the first version of Data A; A2 represents the second version of Data A, and the rest is analogous.

請參見第15圖,其係儲存資料A1時,將資料A1寫入對應於資料層級DG1的資料區塊之示意圖。第一次寫入任何資料時,控制器331均會利用與資料層級DG1對應的資料區塊651內。第15圖假設資料A1存放在分頁叢集CL1。此時,由資料區塊使用表335b可以看出,與分頁叢集CL1對應的叢集編號1,其資料存放位置P#更新為”1”。在此同時,因為其他的分頁叢集CL2~CL64並未存放任何資料。因此,叢集編號2~64所對應的資料存放位置均為”0”。Please refer to Fig. 15, which is a schematic diagram of the data A1 written to the data block corresponding to the data level DG1 when the data A1 is stored. When any data is written for the first time, the controller 331 uses the data block 651 corresponding to the data level DG1. Figure 15 assumes that the material A1 is stored in the paging cluster CL1. At this time, it can be seen from the data block use table 335b that the cluster storage number P1 corresponding to the paging cluster CL1 is updated to "1". At the same time, because the other paging clusters CL2~CL64 do not store any data. Therefore, the data storage locations corresponding to the cluster numbers 2 to 64 are all "0".

在位址映射表335c中,針對每一筆資料的存放位置(P#)加以記錄。此處假設資料A為記憶體陣列中的第一筆資料,因而對應於邏輯位址1。在位址映射表335c中,記錄儲存著資料A1的資料區塊651與分頁叢集CL1。如第12圖所示,資料區塊BLKa為對應於資料層級DG1的資料區塊BLK。因此,此處假設資料區塊651即為第12圖的資料區塊BLKa,且因資料A1位於分頁叢集CL1。是故,此處可以(BLKa, 1)對應於資料A。In the address mapping table 335c, the storage location (P#) of each piece of data is recorded. It is assumed here that the material A is the first data in the memory array and thus corresponds to the logical address 1. In the address mapping table 335c, the data block 651 storing the material A1 and the paging cluster CL1 are recorded. As shown in Fig. 12, the data block BLKa is the data block BLK corresponding to the data level DG1. Therefore, it is assumed here that the data block 651 is the data block BLKa of FIG. 12, and the data A1 is located in the paging cluster CL1. Therefore, here (BLKa, 1) corresponds to the data A.

請參見第16圖,其係儲存資料A2時,不再存入對應於資料層級DG1的資料區塊,而是將資料A2寫入至對應於資料層級DG2的資料區塊之示意圖。控制器331將資料A2存入記憶體陣列333時,因為與資料層級DG1對應的資料區塊651所分配給資料A的分頁叢集CL1已經全部被使用,此時改為使用與資料層級DG2對應的資料區塊存放資料A2。Referring to FIG. 16, when the data A2 is stored, the data block corresponding to the data level DG1 is no longer stored, but the data A2 is written to the data block corresponding to the data level DG2. When the controller 331 stores the data A2 in the memory array 333, since the paging cluster CL1 assigned to the material A by the data block 651 corresponding to the data level DG1 has all been used, the data layer DG2 corresponding to the data level is used instead. The data block stores the data A2.

如第16圖所示,在控制器331將資料A2寫入記憶體陣列333時,並不是將資料A2存入資料區塊651,而是將資料A2存入資料區塊652內的分頁叢集CL1的資料分頁P (1, 1)。此時,因為資料A已經從A1更新為A2,原本存放在資料區塊651的資料A1已經成為過時資料。因此,在與資料區塊651對應的資料區塊使用表335b中,與叢集編號1對應的資料存放位置P#被註記為無效的資料分頁。此處以叉號代表資料分頁被標示為無效。另一方面,因為資料A2被存入資料區塊652的分頁叢集CL1中的資料分頁P(1, 1)的緣故。因此,與資料區塊652對應的資料區塊使用表335b所記錄的叢集編號1所對應的資料存放位置P#更新為”1”。As shown in FIG. 16, when the controller 331 writes the material A2 into the memory array 333, the data A2 is not stored in the data block 651, but the data A2 is stored in the paging cluster CL1 in the data block 652. The data is tabbed P (1, 1). At this time, since the material A has been updated from A1 to A2, the data A1 originally stored in the data block 651 has become obsolete. Therefore, in the material block use table 335b corresponding to the data block 651, the material storage position P# corresponding to the cluster number 1 is annotated as an invalid material page. Here, the cross-referenced data tab is marked as invalid. On the other hand, since the material A2 is stored in the data page P(1, 1) in the page cluster CL1 of the data block 652. Therefore, the data block corresponding to the data block 652 is updated to "1" by the data storage location P# corresponding to the cluster number 1 recorded in the table 335b.

隨著資料的更新,控制器331需記錄資料A的存放位置的歷史紀錄。因此,在位址映射表335c中,可以利用鏈串列(linking list)的方式,記錄儲存資料A的資料區塊BLK與分頁叢集CL的位置。如第12圖所示,資料區塊BLKe、BLKf、BLKg、BLKh屬於資料層級DG2。因此,此處可假設資料區塊652即為第12圖的資料區塊BLKe,且因資料A2位於分頁叢集CL1的資料分頁P(1, 1)。是故,此處可以(BLKe, 1)更新至與資料A對應的鏈串列。As the data is updated, the controller 331 records the history of the storage location of the data A. Therefore, in the address mapping table 335c, the position of the data block BLK and the paging cluster CL storing the material A can be recorded by means of a linking list. As shown in Fig. 12, the data blocks BLKe, BLKf, BLKg, and BLKh belong to the data level DG2. Therefore, it can be assumed here that the data block 652 is the data block BLKe of FIG. 12, and the data A2 is located in the data page P(1, 1) of the paged cluster CL1. Therefore, here (BLKe, 1) can be updated to the chain string corresponding to the data A.

如前所述,同一個分頁叢集CL所包含的資料分頁P均用於存放同一筆資料的不同版本。由於本揭露的實施例假設在對應於資料層級DG2的資料區塊BLK中,每個分頁叢集CL包含四個資料分頁P。因此,在資料A2寫入資料區塊652的分頁叢集CL1的資料分頁P(1, 1)後,分頁叢集CL1仍有其他三個資料分頁P(2, 1)、P(1, 2)、P(2, 2)可用於寫入資料A的其他更新版本。As mentioned earlier, the data page P contained in the same paged cluster CL is used to store different versions of the same data. Since the embodiment of the present disclosure assumes that in the data block BLK corresponding to the data level DG2, each paged cluster CL contains four data pages P. Therefore, after the data A2 is written into the data page P(1, 1) of the paging cluster CL1 of the data block 652, the paging cluster CL1 still has three other data pages P(2, 1), P(1, 2), P(2, 2) can be used to write other updated versions of material A.

請參見第17A~17C圖,其係儲存資料A3、A4、A5時,寫入對應於資料層級DG2的資料區塊之示意圖。如前所述,資料區塊652的分頁叢集CL1中,仍有三個資料分頁可供寫入資料A的其他更新版本。因此,這三個資料分頁P可分別用於寫入資料A3、A4、A5。當控制器331將資料A3、A4、A5存入記憶體陣列333時,與資料A對應的資料區塊與分頁叢集並未變更。在此同時,位址映射表335c紀錄的鏈串列仍可維持不變。,Please refer to the figure 17A~17C, which is a schematic diagram of the data block corresponding to the data level DG2 when the data A3, A4, and A5 are stored. As previously mentioned, in the paging cluster CL1 of the data block 652, there are still three data pages available for writing to other updated versions of the material A. Therefore, the three data pages P can be used to write data A3, A4, A5, respectively. When the controller 331 stores the data A3, A4, and A5 in the memory array 333, the data block and the paging cluster corresponding to the material A are not changed. At the same time, the chain string recorded by the address mapping table 335c can remain unchanged. ,

第17A圖為,控制器331將資料A3寫入資料區塊652的分頁叢集CL1的資料分頁P(2, 1)(位於分頁叢集CL1右上角)。將資料A3寫入後,資料A2成為過時資料。因此,控制器331會將原本用於存放資料A2的資料區塊652的分頁叢集CL1的資料分頁P(1, 1),標示為無效的資料分頁。此時,因為有效資料A3被存放在資料分頁P(2, 1)的緣故,控制器331在與資料區塊652對應的資料區塊紀錄表中,將與叢集編號1對應的資料存放位置更新為”2”。In Fig. 17A, the controller 331 writes the material A3 to the data page P(2, 1) of the paging cluster CL1 of the data block 652 (located in the upper right corner of the paging cluster CL1). After the data A3 is written, the data A2 becomes obsolete. Therefore, the controller 331 will mark the data page P(1, 1) of the page cluster CL1 of the data block 652 originally used for storing the material A2 as an invalid material page. At this time, since the valid data A3 is stored in the data page P(2, 1), the controller 331 updates the data storage location corresponding to the cluster number 1 in the data block record table corresponding to the data block 652. It is "2".

第17B圖為,控制器331將資料A4寫入資料區塊652的分頁叢集CL1的資料分頁P(1, 2)(位於分頁叢集CL1左下角)。將資料A4寫入後,資料A3成為過時資料。因此,控制器331會將原本用於存放資料A3的資料區塊652的分頁叢集CL1的資料分頁P(2, 1),標示為無效的資料分頁。此時,因為有效資料A4的存放位置在資料分頁P(1, 2)的緣故,控制器331在與資料區塊652對應的資料區塊紀錄表中,將與叢集編號1對應的資料存放位置更新為”3”。In Fig. 17B, the controller 331 writes the material A4 to the data page P(1, 2) of the page cluster CL1 of the data block 652 (located in the lower left corner of the page cluster CL1). After the data A4 is written, the data A3 becomes obsolete. Therefore, the controller 331 will mark the data page P(2, 1) of the page cluster CL1 of the data block 652 originally used for storing the material A3 as an invalid material page. At this time, since the storage location of the valid data A4 is in the data page P(1, 2), the controller 331 sets the data storage location corresponding to the cluster number 1 in the data block record table corresponding to the data block 652. Updated to "3".

第17C圖為,控制器331將資料A5寫入資料區塊652的分頁叢集CL1的資料分頁P(2, 2)(位於分頁叢集CL1右下角)。將資料A5寫入後,資料A4成為過時資料。因此,控制器331會將原本用於存放資料A4的資料區塊652的分頁叢集CL1的資料分頁P(1, 1),標示為無效的資料分頁。此時,因為有效資料A5的存放位置在資料分頁P(2, 2)的緣故,控制器331在與資料區塊652對應的資料區塊紀錄表中,將與叢集編號1對應的資料存放位置更新為”4”。In Fig. 17C, the controller 331 writes the material A5 to the data page P(2, 2) of the paging cluster CL1 of the data block 652 (located in the lower right corner of the paging cluster CL1). After the data A5 is written, the data A4 becomes obsolete. Therefore, the controller 331 will mark the data page P(1, 1) of the page cluster CL1 of the data block 652 originally used for storing the material A4 as an invalid material page. At this time, since the storage location of the valid data A5 is in the data page P(2, 2), the controller 331 sets the data storage location corresponding to the cluster number 1 in the data block record table corresponding to the data block 652. Updated to "4".

請參見第18圖,其係儲存資料A的第六個版本時,不再存入對應於資料層級DG2的資料區塊,而是將資料A的第六個版本改為寫入至對應資料層級DG3的資料區塊之示意圖。Referring to Figure 18, when storing the sixth version of the data A, the data block corresponding to the data level DG2 is no longer stored, but the sixth version of the data A is written to the corresponding data level. Schematic diagram of the data block of DG3.

當控制器331寫入資料A6時,因為資料區塊652所分配與資料A對應的分頁叢集CL1已經全部被使用。據此,控制器331判斷需要使用容量更大的分頁叢集CL存放資料A的更新版本。因此,控制器331將改為使用與資料層級DG3對應的資料區塊653的分頁叢集CL存放資料A6。When the controller 331 writes the material A6, the paging cluster CL1 corresponding to the material A allocated by the data block 652 has all been used. According to this, the controller 331 judges that it is necessary to use the larger-page paging cluster CL to store the updated version of the material A. Therefore, the controller 331 will instead store the material A6 using the paging cluster CL of the data block 653 corresponding to the material level DG3.

如第18圖所示,在控制器331將資料A6存入記憶體陣列333時,並不是將資料A6存入資料區塊652,而是將資料A6存入資料區塊653。此時,因為資料A已經從A5更新為A6,原本儲存的資料A5成為過時資料。因此,用於儲存資料A5的資料區塊652的分頁叢集CL2的資料分頁P(2, 2)會被控制器331標示為無效。As shown in FIG. 18, when the controller 331 stores the data A6 in the memory array 333, the data A6 is not stored in the data block 652, but the data A6 is stored in the data block 653. At this time, since the data A has been updated from A5 to A6, the originally stored data A5 becomes obsolete. Therefore, the data page P(2, 2) of the paged cluster CL2 of the data block 652 for storing the material A5 is marked as invalid by the controller 331.

承上,當控制器331存入資料A6時,資料區塊652的分頁叢集CL1內的全部的資料分頁已經全部被標示為無效。因此,在與資料區塊652對應的資料區塊使用表335b中,與叢集編號1對應的資料存放位置將被註記為無效(null)。此處以叉號表示資料分頁無法被使用。另一方面,因為資料A6被存入資料區塊653的分頁叢集CL1中的資料分頁P(1, 1)。因此,在與資料區塊653對應的資料區塊使用表335b中,與叢集編號1所對應的資料存放位置更新為”1”。As a result, when the controller 331 stores the data A6, all the data pages in the paging cluster CL1 of the data block 652 have all been marked as invalid. Therefore, in the data block use table 335b corresponding to the data block 652, the data storage location corresponding to the cluster number 1 will be marked as null. The data page cannot be used here with a cross. On the other hand, since the material A6 is stored in the data page P(1, 1) in the paging cluster CL1 of the data block 653. Therefore, in the data block use table 335b corresponding to the data block 653, the data storage location corresponding to the cluster number 1 is updated to "1".

根據前述的說明可以得知,在第16圖中,控制器331不再將資料A2存入資料區塊651,而是將資料A2存放至資料區塊652;以及,在第18圖中,控制器331不再將資料A6存入資料區塊652,而是將資料A2存放至資料區塊653。其中,資料區塊652所對應的資料層級G2高於資料區塊所對應的資料層級G1,且資料區塊653所對應的資料層級G3高於資料區塊所對應的資料層級G2。隨著資料區塊的變更,用於存放資料的資料分頁叢集所包含的資料分頁的數量也隨著增加。因此,本揭露將此種更換儲存的資料區塊的過程定義為資料的升級過程。此種升級過程發的發生,係基於資料不斷被更新所致。As can be seen from the foregoing description, in FIG. 16, the controller 331 no longer stores the data A2 in the data block 651, but stores the data A2 in the data block 652; and, in FIG. 18, the control The device 331 no longer stores the data A6 in the data block 652, but stores the data A2 in the data block 653. The data level G2 corresponding to the data block 652 is higher than the data level G1 corresponding to the data block, and the data level G3 corresponding to the data block 653 is higher than the data level G2 corresponding to the data block. As the data block changes, the number of data pages included in the data paging cluster for storing data also increases. Therefore, the present disclosure defines such a process of replacing a stored data block as a data upgrade process. The occurrence of such an upgrade process is based on the continuous updating of information.

附帶一提的是,隨著資料的升級,儲存資料的資料區塊對應的資料層級DG不斷提升。轉換儲存資料的資料區塊的同時,原本存放過時資料的資料區塊內,與該資料對應的分頁叢集CL中的全部資料分頁也都被標示為無效。針對此種因為資料升級所產生之,分頁叢集內的資料分頁,控制器331可將其清除後,提供給其他資料使用。Incidentally, as the data is upgraded, the data level DG corresponding to the data block of the stored data is continuously improved. At the same time as converting the data block of the stored data, all the data pages in the paging cluster corresponding to the data are also marked as invalid in the data block in which the stale data is originally stored. For the data paging in the paging cluster generated by the data upgrade, the controller 331 can clear the data and provide it to other materials for use.

為此,本揭露的控制器331亦可於控制韌體層3313提供一個刪除功能。該刪除功能可用於針對特定的分頁叢集進行過時資料的清除。當一筆資料被升級時,控制器331可同時執行刪除操作,藉以將相對下層的資料區塊內的分頁叢集清空作為後續使用。或者,控制器331可先記錄該些因為資料升級而可被刪除的分頁叢集,並於記憶體裝置30相對閒置時,才執行刪除操作。由此可知,當控制器331提供擦除功能時,各種資料分頁的管理可更為彈性。To this end, the controller 331 of the present disclosure can also provide a delete function to the control firmware layer 3313. This delete feature can be used to clean up obsolete data for a specific paging cluster. When a piece of material is upgraded, the controller 331 can perform a delete operation at the same time, thereby emptying the paged clusters in the lower layer of the data block for subsequent use. Alternatively, the controller 331 may first record the paging clusters that can be deleted because of the data upgrade, and perform the deletion operation when the memory device 30 is relatively idle. It can be seen that when the controller 331 provides the erasing function, the management of various data paging can be more flexible.

如前所述,本揭露的實施例會係隨著資料的版本變化,改變與寫入資料對應之資料區塊所對應的資料層級DG。接著,係以流程圖的方式方式彙整第15、16、17A~17B、18圖的例子。As described above, the embodiment of the present disclosure changes the data level DG corresponding to the data block corresponding to the written data as the version of the data changes. Next, the examples of Figs. 15, 16, 17A-17B, and 18 are summarized in the form of a flowchart.

請參見第19圖,其係隨著資料的版本變化,改變與寫入資料對應之資料區塊所對應的資料層級DG之流程圖。在控制器331從主控裝置31接收一筆資料後,控制器331先判斷該筆資料是否為第一次寫入(步驟S601)。若是,控制器331便執行第一次寫入程序S603)。其中,步驟S603進一步包含以下步驟:將資料存放至對應於資料層級DG1的資料區塊BLK內的未使用分頁叢集CL(步驟S603a);以及,將資料存放位置儲存於位址轉換表(步驟S603b)。其後,控制器331須同步更新與被寫入之資料區塊對應的資料區塊使用表(步驟S607)。Please refer to FIG. 19, which is a flow chart of changing the data level DG corresponding to the data block corresponding to the written data as the version of the data changes. After the controller 331 receives a piece of data from the main control unit 31, the controller 331 first determines whether the pen data is the first write (step S601). If so, the controller 331 executes the first write process S603). The step S603 further includes the steps of: storing the data to the unused paging cluster CL in the data block BLK corresponding to the data level DG1 (step S603a); and storing the data storage location in the address translation table (step S603b) ). Thereafter, the controller 331 must synchronously update the data block use table corresponding to the data block to be written (step S607).

另一方面,若控制器331判斷該筆資料並非第一次寫入,便執行資料更新程序(步驟S605)。接著,控制器331自快取記憶體335取得先前用於存放該筆資料的過時資料的位置,包含資料區塊BLK、叢集CL#與資料存放位置P#(S605a)。其後,控制器331可依據快取記憶體335提供的資料區塊使用表,判斷先前用於儲存過時資料的分頁叢集內,是否仍有可用的資料分頁(步驟S605b)。On the other hand, if the controller 331 determines that the pen data is not written for the first time, the data update program is executed (step S605). Next, the controller 331 obtains the location of the obsolete data previously stored for the pen data from the cache memory 335, and includes the data block BLK, the cluster CL#, and the data storage location P# (S605a). Thereafter, the controller 331 can determine, according to the data block usage table provided by the cache memory 335, whether there is still available data paging in the paging cluster for storing the stale data (step S605b).

若步驟S605b的判斷結果為肯定,控制器331便將更新資料寫入與過時資料相同的一個資料區塊內的同一個分頁叢集內的另一個資料分頁(步驟S605c)。反之,若先前分配的分頁叢集內,已無空的資料分頁可存放更新資料時,控制器331便將更新資料寫入與較高資料層級DG對應的資料區塊內的分頁叢集內的第一個資料分頁(步驟S605d)。接著,控制器331會更新位址映射表(步驟S605e)並將原本用於儲存過時資料的資料分頁標示為無效的資料分頁(步驟S605f)。此外,控制器331須還需更新資料區塊使用表335b 的內容(步驟S607)。If the result of the determination in the step S605b is affirmative, the controller 331 writes the update data to another material page in the same paging cluster in the same data block as the obsolete material (step S605c). On the other hand, if there is no empty data page in the previously allocated paging cluster to store the updated data, the controller 331 writes the updated data to the first in the paging cluster in the data block corresponding to the higher data level DG. The data is paged (step S605d). Next, the controller 331 updates the address mapping table (step S605e) and marks the data page originally used for storing the stale data as an invalid material page (step S605f). Further, the controller 331 must also update the contents of the material block use table 335b (step S607).

承上,本揭露的實施例可隨著資料的更新,對資料的資料層級加以升級。即,動態地使用與較高資料層級對應的資料區塊。除前述的資料升級外,本揭露的實施例還可將資料對應的資料層級降級。也就是說,資料與其對應的層級可動態地根據資料的屬性或實際需求而調整。接著,以第20圖說明存放資料時,使用的資料區塊所對應的資料層級可動態調整的概念。In conclusion, the embodiments of the present disclosure can upgrade the data level of the data as the data is updated. That is, the data block corresponding to the higher data level is dynamically used. In addition to the foregoing data upgrade, the embodiment of the present disclosure may also downgrade the data level corresponding to the data. That is to say, the data and its corresponding level can be dynamically adjusted according to the attributes of the data or actual needs. Next, the concept of dynamically adjusting the data level corresponding to the data block used when storing the data will be described in FIG.

請參見第20圖,其係本揭露針對存放資料時,因應資料的狀態,動態調整與該資料對應的分頁叢集的資料層級DG之示意圖。在本揭露的實施例中,資料區塊的資料層級可能為資料層級DG1、資料層級DG2或是資料層級DG3。隨著資料的寫入,代表資料的熱度逐漸增加。如果資料的熱度高於原本劃分的資料層級DG,控制器331便將較與較高的資料層級DG對應的資料區塊劃分給該筆資料。Please refer to FIG. 20, which is a schematic diagram of the data level DG of the paging cluster corresponding to the data dynamically adjusted according to the state of the data when the data is stored. In the embodiment of the disclosure, the data level of the data block may be the data level DG1, the data level DG2, or the data level DG3. As the data is written, the heat of the representative data gradually increases. If the heat of the data is higher than the originally classified data level DG, the controller 331 divides the data block corresponding to the higher data level DG into the data.

另一方面,經過一段時間後,控制器331將判斷資料的熱度是否仍然維持。即,判斷先前針對資料熱度所提供資料層級DG是否適合資料的使用狀況。如果資料的熱度已經降低,代表該筆資料不再需要這麼大的儲存空間。因此,如果資料的熱度降低,控制器331就可改用包含較少數量之資料分頁的分頁叢集儲存該筆更新資料。也就是,控制器331可提供降級的做法。例如,將原本劃分為使用資料層級DG3的資料區塊的資料,改為對應於資料層級DG2的資料區塊。或者,原本規劃為使用資料層級DG2的資料區塊,改為對應於資料層級DG1的資料區塊。On the other hand, after a period of time, the controller 331 will judge whether the heat of the data is still maintained. That is, it is judged whether or not the data level DG previously provided for the data heat is suitable for the use of the data. If the heat of the data has been reduced, it means that the data no longer needs such a large storage space. Therefore, if the heat of the data is reduced, the controller 331 can store the updated data by using a paged cluster containing a smaller number of data pages. That is, the controller 331 can provide a downgrade practice. For example, the data originally divided into data blocks using the data level DG3 is changed to the data block corresponding to the data level DG2. Alternatively, the data block originally planned to use the data level DG2 is changed to the data block corresponding to the data level DG1.

此種因應資料的熱度變化而調整資料所對應的資料層級DG的做法,可在控制器331執行垃圾回收時實現。其中,控制器331可對資料所對應的資料層級DG進行升級調整、降級調整或是在同一個層級間平行調整。以下以第21~31C圖,說明控制器331調整與資料對應的資料層級DG的做法。The method of adjusting the data level DG corresponding to the data in response to the change in the heat of the data can be implemented when the controller 331 performs garbage collection. The controller 331 can perform upgrade adjustment, degradation adjustment, or parallel adjustment between the same level for the data level DG corresponding to the data. Hereinafter, the method of adjusting the data level DG corresponding to the data by the controller 331 will be described with reference to Figs. 21 to 31C.

請參見第21圖,其係執行垃圾回收時,因應資料熱度而調整與資料對應的資料層級DG之流程圖。首先,控制器331自記憶體陣列333中,選擇將用於執行垃圾回收的資料區塊(待垃圾回收的資料區塊BLKgc)(步驟S71)。接著,對儲存在待垃圾回收的資料區塊BLKgc內的資料,判斷其資料熱度,並依據對資料熱度的判斷結果,對資料對應的資料層級進行調整(步驟S73);以及對待進行垃圾回收的資料區塊BLKgc執行抹除操作(步驟S75)。其中,步驟S73所述的資料層級的調整,可透過不同的定義方式與判斷過程實現。Please refer to Fig. 21, which is a flow chart of adjusting the data level DG corresponding to the data in response to the heat of the data when performing garbage collection. First, the controller 331 selects, from the memory array 333, a data block (a data block BLKgc to be garbage collected) to be used for garbage collection (step S71). Then, the data stored in the data block BLKgc to be garbage collected is judged, and the data level corresponding to the data is adjusted according to the judgment result of the data heat (step S73); and the garbage disposal is performed. The data block BLKgc performs an erase operation (step S75). The adjustment of the data level described in step S73 can be implemented through different definition methods and determination processes.

以下,第22A、22B圖為,控制器331可選出一個或多個待垃圾回收的資料區塊BLKgc,另,第23~31C圖進一步提到兩種說明可用於調整資料層級的調整方式,但實際應用時,並不以此為限。In the following, the 22A and 22B are diagrams, the controller 331 can select one or more data blocks BLKgc to be garbage collected, and the 23th to 31C diagrams further mention two types of adjustment methods that can be used to adjust the data level, but In actual application, it is not limited to this.

第22A圖所示為,僅選擇一個資料區塊作為待垃圾回收的資料區塊BLKgc。首先,找出具有最多被標示為無效的資料分頁的資料區塊(步驟S711a)。接著,控制器331判斷是否僅有一個資料區塊具有最多被標示為無效的資料分頁的資料區塊(步驟S711b)。若僅有一個資料區塊具有最多被標示為無效的資料分頁時,就以滿足該條件的資料區塊作為待垃圾回收的資料區塊BLKgc (步驟S711d)。As shown in Fig. 22A, only one data block is selected as the data block BLKgc to be garbage collected. First, the data block having the most information page that is marked as invalid is found (step S711a). Next, the controller 331 determines whether only one of the data blocks has the data block of the data page which is marked as invalid at most (step S711b). If only one data block has the data page marked as invalid at most, the data block satisfying the condition is regarded as the data block BLKgc to be garbage collected (step S711d).

另一方面,如果步驟S711b的判斷結果為,有多個資料區塊同樣具有最多無效的資料分頁時,控制器331在這些資料區塊中,選擇所對應之資料層級DG較高的資料區塊做為選定資料區塊(步驟S711c)。On the other hand, if the result of the determination in step S711b is that a plurality of data blocks also have the most invalid data page, the controller 331 selects the data block with the corresponding data level DG higher among the data blocks. As the selected data block (step S711c).

在步驟S711c中,控制器331選擇在資料層級DG較高的資料區塊作為待垃圾回收資料區塊的考量是,因為每個分頁叢集所包含的資料分頁為同一筆資料的不同版本的緣故,而資料層級DG越高的資料區塊所包含的分頁叢集數量越少。由於每個分頁叢集對應於一筆資料,分頁叢集數量較少時,代表存放的有效資料的數量也相對較少。也因此,若針對資料層級DG較高的資料區塊進行抹除時,需備份至其他資料區塊的資料量也相對較少。In step S711c, the controller 331 selects the data block having a higher data level DG as the garbage collection data block, because each paged cluster contains data pages that are different versions of the same data. The data block with a higher data level DG contains fewer paging clusters. Since each paged cluster corresponds to a piece of data, and the number of paged clusters is small, the amount of valid data stored is relatively small. Therefore, if the data block with a higher data level DG is erased, the amount of data to be backed up to other data blocks is relatively small.

第22B圖所示為,選擇多個資料區塊作為待垃圾回收的資料區塊。在第22B圖中,直接以一個資料區塊內的資料分頁使用臨限值Npgth_blk判斷資料區塊內的無效的資料分頁的數量是否已經超過這個臨限值Npgth_blk (步驟S715a)。若是,控制器331便將所有符合這個判斷條件的資料區塊都當作待垃圾回收的資料區塊BLKgc。若步驟S715a的判斷結果為否定,代表還不需要進行資料層級的調整,則流程結束。Figure 22B shows that multiple data blocks are selected as the data blocks to be garbage collected. In Fig. 22B, the threshold Npgth_blk is used directly to determine whether the number of invalid data pages in the data block has exceeded the threshold Npgth_blk by the data index in a data block (step S715a). If so, the controller 331 treats all the data blocks that meet the judgment condition as the data block BLKgc to be garbage collected. If the result of the determination in step S715a is negative, it means that the adjustment of the data level is not required, and the flow ends.

實際應用時,控制器331也可以視記憶體陣列的使用狀態,動態的選擇應採用第22A圖或第22B圖選擇待垃圾回收的資料區塊BLKgc。例如,控制器331雖然預設使用第22A圖選擇待垃圾回收的資料區塊BLKgc,但在記憶體裝置30相對較為閒置時,控制器331便改以第22B圖選擇多個待垃圾回收的資料區塊BLKgc。此外,控制器331選擇待垃圾回收的資料區塊BLKgc的方式,並不以第22A、22B圖為限。In actual application, the controller 331 can also dynamically select the data block BLKgc to be garbage collected by using the 22A map or the 22B map depending on the use state of the memory array. For example, although the controller 331 presets to select the data block BLKgc to be garbage collected using FIG. 22A, when the memory device 30 is relatively idle, the controller 331 changes the data to be garbage collected in the 22B chart. Block BLKgc. In addition, the manner in which the controller 331 selects the data block BLKgc to be garbage collected is not limited to the 22A and 22B drawings.

無論是第22A圖或是第22B圖,當控制器331選出待垃圾回收的資料區塊BLKgc後,都需要進一步判斷待垃圾回收的資料區塊BLKgc內部儲存的資料應該如何進行資料層級DG的調整。接著,以一個存有四筆資料並對應於資料層級DG3的資料區塊為例,說明對待垃圾回收的資料區塊BLKgc進行垃圾回收時,應該如何調整其內部資料所對應之資料層級DG。Regardless of whether it is the 22A map or the 22B graph, when the controller 331 selects the data block BLKgc to be garbage collected, it is necessary to further determine how the data stored in the data block BLKgc to be garbage collected should be adjusted in the data level DG. . Then, taking a data block containing four data and corresponding to the data level DG3 as an example, how to adjust the data level DG corresponding to the internal data when the garbage recovery data block BLKgc is garbage collected.

請參見第23圖,其係一個存有四筆資料並對應於資料層級DG3的資料區塊之示意圖。此圖式以一個對應於第三個資料層級的資料區塊為例,說明四筆資料在四個分頁叢集CL1~CL4的分布情形。Please refer to Fig. 23, which is a schematic diagram of a data block containing four pieces of data and corresponding to the data level DG3. This figure takes a data block corresponding to the third data level as an example to illustrate the distribution of four data in four paging clusters CL1~CL4.

在分頁叢集CL1中,存放著資料X的過時資料X6~X13,以及更新資料X14。在分頁叢集CL2中,存放資料X的過時資料X6~Y7,以及更新資料Y8。在分頁叢集CL3中,存放著資料A的過時資料A6~A16,以及更新資料A17。在分頁叢集CL4中,存放著資料D的過時資料D6~D8,以及更新資料D9。以下,利用第24、25A、25B、26圖說明一種利用一個臨限值,判斷應如何對資料所屬之資料層級G1進行調整的作法,以及利用第29、30A、30B、30C、31A、31B、31C圖說明另一種利用兩個臨限值,判斷應如何對資料所屬之資料層級G1進行調整的作法。In the pagination cluster CL1, the obsolete data X6~X13 of the material X and the update data X14 are stored. In the pagination cluster CL2, the obsolete data X6~Y7 of the material X and the update data Y8 are stored. In the paging cluster CL3, the obsolete data A6~A16 of the data A and the updated data A17 are stored. In the paging cluster CL4, the obsolete data D6~D8 of the data D and the updated data D9 are stored. Hereinafter, using the 24th, 25th, 25th, and 26th drawings, a method of determining how to adjust the data level G1 to which the data belongs by using a threshold value, and using the 29th, 30A, 30B, 30C, 31A, 31B, Figure 31C illustrates another approach that uses two thresholds to determine how the data level G1 to which the data belongs should be adjusted.

請參見第24圖,其係對資料區塊進行垃圾回收時,以一個預設的臨限值判斷應如何調整資料所對應資料層級DG的流程圖。此流程圖說明控制器331如何僅使用一個臨限值比較,並決定是否將資料加以降級的過程。Please refer to Fig. 24, which is a flow chart for determining how to adjust the data level DG corresponding to the data when the data block is garbage collected with a preset threshold. This flow chart illustrates how the controller 331 uses only one threshold comparison and decides whether to downgrade the data.

首先,在待垃圾回收的資料區塊BLKgc中,選擇一個分頁叢集CL進行檢查(步驟S731a)。控制器331將判斷在該分頁叢集CL中,已經使用的資料分頁的數量是否小於針對與該分頁叢集對應的資料層級DG所定義的臨限值(步驟S731b)。First, in the data block BLKgc to be garbage collected, one paging cluster CL is selected for inspection (step S731a). The controller 331 will judge whether or not the number of data pages that have been used in the paged cluster CL is smaller than the threshold value defined for the material level DG corresponding to the paged cluster (step S731b).

若在該分頁叢集CL中,已經使用的資料分頁的數量確實小於針對與該叢集對應的資料層級DG定義的臨限值時,控制器331將視為存放在該分頁叢集的資料熱度相對較低。據此,控制器331判斷該筆資料已經不再需要用到目前使用的資料層級DG。連帶的,控制器331會將該筆資料的最新版本,複製至與較低一個資料層級DG對應的資料區塊內的分頁叢集 (步驟S731c)。即,對資料進行降級調整。If in the paging cluster CL, the number of data pages that have been used is indeed less than the threshold defined for the data level DG corresponding to the cluster, the controller 331 will regard the data stored in the paging cluster to be relatively low. . Accordingly, the controller 331 determines that the data level DG currently used is no longer needed. In addition, the controller 331 copies the latest version of the data to the paging cluster in the data block corresponding to the lower one data level DG (step S731c). That is, the data is downgraded.

另一方面,若在該分頁叢集CL中,已經使用的資料分頁數量大於或等於針對與該叢集對應的資料層級DG定義的臨限值時,控制器331將視為存在該分頁叢集CL的資料熱度符合預期。也就是,控制器331判斷該筆資料確實需要用到目前規畫使用的資料層級DG。連帶的,控制器331會將該筆資料的最新版本,複製至與同一個資料層級DG對應的其他資料區塊內(步驟S731d)。即,對資料進行平移調整。On the other hand, if in the paging cluster CL, the number of data pages that have been used is greater than or equal to the threshold defined for the data level DG corresponding to the cluster, the controller 331 will regard the data of the paging cluster CL as being present. The heat is in line with expectations. That is, the controller 331 judges that the data of the pen does need to use the data level DG currently used for the plan. In addition, the controller 331 copies the latest version of the data to other data blocks corresponding to the same data level DG (step S731d). That is, the data is adjusted for translation.

接著,控制器331判斷在該待垃圾回收的資料區塊 BLKgc中的每一個分頁叢集,是否都已經經過與臨限值的比較與複製至其他資料區塊的前述流程(步驟S731e)。若否,控制器331將選取另一個分頁叢集CL,並重複自步驟S731a開始執行。Next, the controller 331 determines whether each of the paging clusters in the data block BLKgc to be garbage collected has been subjected to the foregoing flow of comparison with the threshold value and copying to other material blocks (step S731e). If not, the controller 331 will select another paged cluster CL and repeat execution from step S731a.

若在該待垃圾回收的資料區塊BLKgc中的每一個分頁叢集,全部都經過步驟S731a~731e判斷流程,則結束對此資料區塊的垃圾回收處理。接著,判斷是否有其他的待垃圾回收資料區塊BLKgc(步驟S731f)。若否,結束流程。若是,則選擇另一個待垃圾回收的資料區塊BLKgc(步驟S731g),並重複前述流程。If each of the paging clusters in the data block BLKgc to be garbage collected is subjected to the determination process in steps S731a to 731e, the garbage collection processing of the data block is ended. Next, it is judged whether or not there is another garbage collection data block BLKgc (step S731f). If no, the process ends. If so, another data block BLKgc to be garbage collected is selected (step S731g), and the foregoing flow is repeated.

請參見第25A圖,其係針對垃圾回收之資料區塊BLKgc所對應的資料層級,定義一個預設的臨限值之示意圖。此圖式針對資料層級DG2的分頁叢集744,定義一個臨限百分比(例如:50%)。因此,控制器331可依據Npg_cl*50%計算臨限值Th,並以臨限值Th與待垃圾回收的資料區塊BLKgc內的分頁叢集內的資料分頁使用數量進行比較。如前所述,本文假設對應於資料層級DG2的分頁叢集包含16個資料分頁(Npg_cl=16)。因此,若與資料層級DG2對應的資料區塊被選為待垃圾回收資料區塊BLKgc時,控制器331便針對該待垃圾回收資料區塊BLKgc所包含的四個分頁叢集,分別以第25A圖定義的臨限值(例如:8個資料分頁)加以比對。Please refer to Figure 25A, which is a schematic diagram of a preset threshold for the data level corresponding to the garbage collection data block BLKgc. This schema defines a threshold percentage (eg, 50%) for the paged cluster 744 of the data level DG2. Therefore, the controller 331 can calculate the threshold value Th according to Npg_cl*50%, and compare the threshold value Th with the number of data page usages in the paged cluster in the data block BLKgc to be garbage collected. As mentioned before, this paper assumes that the paging cluster corresponding to the data level DG2 contains 16 data pages (Npg_cl=16). Therefore, if the data block corresponding to the data level DG2 is selected as the garbage collection data block BLKgc, the controller 331 respectively maps the four paged clusters included in the garbage collection data block BLKgc to the 25A map. The defined thresholds (for example: 8 data pages) are compared.

實際應用時,臨限值的選定並不限於Npg_cl *50%。另,針對其他資料層級DG,也可設定與其對應的臨限值。再者,針對每個資料層級DG所定義的臨限值也可能不同。In practical applications, the selection of the threshold is not limited to Npg_cl *50%. In addition, for other data level DGs, the corresponding threshold can also be set. Furthermore, the thresholds defined for each data level DG may also be different.

請參見第25B圖,其係以一個預設的臨限值比較待進行垃圾回收之資料區塊內的資料熱度之示意圖。此圖式係以第25A圖定義的臨限值,與第23圖的每個分頁叢集進行比較。Please refer to Figure 25B, which is a schematic diagram comparing the heat of data in the data block to be garbage collected with a preset threshold. This pattern is a threshold defined in Figure 25A and compared to each paged cluster in Figure 23.

在第25B圖中,控制器331利用臨限值Th分別與分頁叢集CL1、CL2、CL3、CL4進行比較。其中,與分頁叢集CL1比較時,控制器331確認資料X14的存放位置已經超過臨限值Th。因此,控制器331判斷資料X屬於熱度較高的資料,確實需要使用對應於資料層級DG的資料區塊存放資料X14以及資料X的後續更新版本。In Fig. 25B, the controller 331 compares with the paging clusters CL1, CL2, CL3, CL4 using the threshold value Th, respectively. Here, when compared with the paging cluster CL1, the controller 331 confirms that the storage location of the material X14 has exceeded the threshold value Th. Therefore, the controller 331 judges that the data X belongs to the data with higher heat, and it is necessary to use the data block corresponding to the data level DG to store the data X14 and the subsequent updated version of the data X.

對分頁叢集CL2而言,資料Y8的存放位置低於臨限值。因此,控制器331判斷資料Y的熱度相對較低。據此,控制器331判斷應可以使用較低資料層級DG的分頁叢集,存放資料Y8以及資料Y的後續更新版本。For paged cluster CL2, the storage location of data Y8 is below the threshold. Therefore, the controller 331 determines that the heat of the material Y is relatively low. Accordingly, the controller 331 determines that the paged cluster of the lower data level DG should be used to store the data Y8 and subsequent updated versions of the material Y.

對分頁叢集CL3而言,資料A17的存放位置高於臨限值。因此,資料A的熱度相對較高。據此,控制器331判斷應可以維持使用資料層級DG3的分頁叢集存放資料A17以及資料A的後續更新版本。For the paging cluster CL3, the storage location of the data A17 is higher than the threshold. Therefore, the heat of the data A is relatively high. Accordingly, the controller 331 determines that the paged cluster storage material A17 of the data layer level DG3 and the subsequent update version of the material A should be maintained.

對分頁叢集CL4而言,資料D9的存放位置低於臨限值。因此,資料D的熱度相對較低。據此,控制器331判斷應可以使用較低資料層級DG的分頁叢集存放資料D9以及資料D的後續更新版本。接著說明依據前述的判斷結果,控制器331將資料寫入其他分頁叢集的做法。For paged cluster CL4, the storage location of data D9 is below the threshold. Therefore, the heat of the data D is relatively low. Accordingly, the controller 331 determines that the paged cluster of the lower data level DG should be used to store the material D9 and subsequent updated versions of the material D. Next, the description will be given of the practice in which the controller 331 writes data to other paging clusters in accordance with the foregoing judgment result.

請參見第26圖,其係將進行垃圾回收之資料區塊內的資料,複製至同一個資料層級DG的資料區塊之示意圖。如前所述,經過第25B圖的比較後,控制器331判斷資料X、資料A的更新頻率較高。因此,控制器331將維持使用資料層級DG3的分頁叢集存放資料X、資料A。因此,控制器331將資料X14、資料A17複製至同樣為資料層級DG的資料區塊713中。此處假設將資料X14存放於資料區塊713的分頁叢集CL1;以及將資料A17存放於資料區塊713的分頁叢集CL2。Please refer to Figure 26, which is a schematic diagram of copying the data in the data block for garbage collection to the data block of the same data level DG. As described above, after the comparison of FIG. 25B, the controller 331 judges that the update frequency of the material X and the data A is high. Therefore, the controller 331 will maintain the paging cluster of the usage data level DG3 to store the data X and the data A. Therefore, the controller 331 copies the material X14 and the data A17 into the data block 713 which is also the data level DG. It is assumed here that the material X14 is stored in the paging cluster CL1 of the data block 713; and the material A17 is stored in the paging cluster CL2 of the data block 713.

請參見第27圖,其係將進行垃圾回收之資料區塊內的資料,複製至低一個資料層級DG的資料區塊之示意圖。如前所述,經過第25B圖的比較後,控制器331判斷資料Y、資料D的更新頻率較低。因此,控制器331使用較低資料層級DG的分頁叢集存放資料Y、資料D。因此,控制器331將資料Y8、資料D9複製至較低資料層級DG的資料區塊712中。此處假設將資料Y8存放於資料區塊712的分頁叢集CL1;以及將資料D9存放於資料區塊712的分頁叢集CL2。Please refer to Figure 27, which is a schematic diagram of copying the data in the data block for garbage collection to the data block of the lower data level DG. As described above, after the comparison of FIG. 25B, the controller 331 judges that the update frequency of the material Y and the data D is low. Therefore, the controller 331 stores the material Y and the data D using the paging cluster of the lower data level DG. Therefore, the controller 331 copies the material Y8 and the material D9 into the data block 712 of the lower data level DG. It is assumed here that the material Y8 is stored in the paging cluster CL1 of the data block 712; and the data D9 is stored in the paging cluster CL2 of the data block 712.

請參見第28A、28B圖,其係對進行垃圾回收之資料區塊進行抹除之示意圖。在將資料區塊703的資料複製至資料區塊713、712後,將資料區塊703的資料分頁全部標為無效的資料分頁(如第28A圖所示)。此外,控制器331並可對資料區塊703進行抹除(如第28B圖所示)。Please refer to Figures 28A and 28B, which are schematic diagrams of erasing data blocks for garbage collection. After the data of the data block 703 is copied to the data blocks 713, 712, the data pages of the data block 703 are all marked as invalid data pages (as shown in FIG. 28A). In addition, the controller 331 can erase the data block 703 (as shown in FIG. 28B).

請參見第29圖,其係對資料區塊進行垃圾回收時,以兩個預設的臨限值判斷應如何調整資料所對應資料層級DG的流程圖。此流程圖說明如何僅使用兩個臨限值比較,並決定應將資料加以降級、升級或維持同一個資料層級DG的判斷過程。Please refer to Fig. 29, which is a flow chart for determining how to adjust the data level DG corresponding to the data when the data block is garbage collected with two preset thresholds. This flow chart shows how to use only two threshold comparisons and decides that the data should be downgraded, upgraded, or maintained at the same data level DG.

在待垃圾回收的資料區塊BLKgc中,控制器331選擇一個分頁叢集進行檢查(步驟S735a)。控制器331判斷在該分頁叢集中,已經使用的資料分頁的數量是否小於針對與該分頁叢集對應的資料層級DG所定義的較低臨限值Th_L(步驟S735b)。In the data block BLKgc to be garbage collected, the controller 331 selects a paged cluster for inspection (step S735a). The controller 331 determines whether the number of data pages that have been used in the paged cluster is smaller than the lower threshold Th_L defined for the data level DG corresponding to the paged cluster (step S735b).

若在該分頁叢集中,已經使用的資料分頁數量確實小於針對與該叢集對應的資料層級DG定義的較低臨限值Th_L時,控制器331將視為存在該分頁叢集的資料熱度相對較低。據此,控制器331判斷該筆資料已經不再需要用到目前使用的資料層級DG。連帶的,控制器331會將該筆資料的最新版本,複製至與較低一個資料層級DG對應的資料區塊內的分頁叢集 (步驟S735c)。If, in the paged cluster, the number of data pages that have been used is indeed less than the lower threshold Th_L defined for the data level DG corresponding to the cluster, the controller 331 will consider the presence of the paged cluster to be relatively low. . Accordingly, the controller 331 determines that the data level DG currently used is no longer needed. In addition, the controller 331 copies the latest version of the data to the paging cluster in the data block corresponding to the lower one data level DG (step S735c).

另一方面,若在該分頁叢集中,已經使用的資料分頁數量大於或等於針對與該叢集對應的資料層級DG定義的較低臨限值Th_L時,控制器331將進一步以較高臨限值Th_H較該分頁叢集(步驟S735d)。若分頁叢集儲存的資料低於較高臨限值Th_H時,代表儲存在該分頁叢集的資料熱度符合預期。也就是,控制器331判斷該筆資料確實需要用到目前規畫使用的資料層級DG。連帶的,控制器331會將該筆資料的最新版本,複製至與同一個資料層級DG對應的其他資料區塊內(步驟S735e)。On the other hand, if in the paging cluster, the number of data pages that have been used is greater than or equal to the lower threshold Th_L defined for the data level DG corresponding to the cluster, the controller 331 will further increase the threshold. Th_H is compared to the paging cluster (step S735d). If the data stored in the paging cluster is lower than the higher threshold Th_H, it means that the data stored in the paging cluster is in line with expectations. That is, the controller 331 judges that the data of the pen does need to use the data level DG currently used for the plan. In addition, the controller 331 copies the latest version of the data to other data blocks corresponding to the same data level DG (step S735e).

再者,若在該分頁叢集中,已經使用的資料分頁數量大於或等於針對與該叢集對應的資料層級DG定義的較高臨限值Th_H時,代表儲存在該分頁叢集的資料熱度高於預期。也就是,控制器331判斷該筆資料需要用較高的資料層級DG。連帶的,控制器331會將該筆資料的最新版本,複製至與高一個資料層級DG對應的其他資料區塊內(步驟S735f)。Furthermore, if the number of data pages that have been used in the paging cluster is greater than or equal to the higher threshold Th_H defined for the data level DG corresponding to the cluster, the data stored in the paging cluster is higher than expected. . That is, the controller 331 determines that the pen data requires a higher data level DG. In addition, the controller 331 copies the latest version of the data to another data block corresponding to the higher one of the data levels DG (step S735f).

接著,判斷在該待垃圾回收的資料區塊BLKgc中的每一個分頁叢集,是否都已經執行與臨限值的比較與複製至其他資料區塊的前述流程(步驟S735g)。若否,則選取另一個分頁叢集,並自步驟S735a開始重複執行前述步驟。Next, it is judged whether or not each of the paging clusters in the data block BLKgc to be garbage collected has performed the above-described flow of comparison with the threshold value and copying to other data blocks (step S735g). If not, another paging cluster is selected and the foregoing steps are repeated from step S735a.

若在該待垃圾回收資料區塊BLKgc中的每一個分頁叢集,全部都經過判斷流程,控制器331便結束對此資料區塊的垃圾回收判斷。接著,控制器331將判斷是否有其他的待垃圾回收資料區塊(步驟S735h)。若否,結束流程。若是,控制器331將選擇另一個待垃圾回收的資料區塊BLKgc(步驟S735i),並重複前述流程。If each of the paging clusters in the garbage collection data block BLKgc passes through the judgment flow, the controller 331 ends the garbage collection judgment of the data block. Next, the controller 331 will judge whether there are other pieces of garbage collection data to be garbageed (step S735h). If no, the process ends. If so, the controller 331 will select another data block BLKgc to be garbage collected (step S735i), and repeat the foregoing flow.

請參見第30A、30B圖,其係針對垃圾回收之資料區塊,定義兩個預設的臨限值之示意圖 。第30A圖與第30B圖針對資料層級DG2的分頁叢集751a、751b,分別定義一個較低臨限值Th_L(例如:Npg_cl *25%)與一個較高臨限值Th_H(例如:Npg_cl *75%)。如前所述,本文假設資料層級DG2的分頁叢集包含16個資料分頁(Npg_cl=16)。因此,若與資料層級DG2對應的資料區塊被選為待垃圾回收資料區塊時,控制器331便針對資料區塊所包含的四個分頁叢集,分別以第30A圖定義的較低臨限值(例如:4個資料分頁)加以比對,以及以第30B圖定義的較高臨限值(例如:12個資料分頁)。Please refer to Figures 30A and 30B for a schematic diagram of two preset thresholds for the data block for garbage collection. Figures 30A and 30B define a lower threshold Th_L (for example: Npg_cl *25%) and a higher threshold Th_H (for example, Npg_cl *75%) for the paging clusters 751a, 751b of the data level DG2, respectively. ). As mentioned earlier, this paper assumes that the paging cluster of data level DG2 contains 16 data pages (Npg_cl=16). Therefore, if the data block corresponding to the data level DG2 is selected as the garbage collection data block, the controller 331 determines the lower threshold defined by the 30A picture for the four paging clusters included in the data block respectively. Values (for example: 4 data pages) are compared and higher thresholds defined in Figure 30B (for example: 12 data pages).

據此,在另一個待垃圾回收的資料區塊BLKgc中,當一個分頁叢集內的資料存放位置低於較低臨限值Th_L時,控制器331便將該分頁叢集用於儲存的資料改為對應至較低資料層級DG的分頁叢集;當一個分頁叢集內的資料存放位置高於或等於較低臨限值Th_L,並同時低於較高臨限值Th_H時,控制器331便將該分頁叢集用於儲存的資料維持對應於同一個資料層級DG的分頁叢集;或者,當一個分頁叢集內的資料存放位置高於或等於較高臨限值Th_H時,控制器331便將該分頁叢集用於儲存的資料改為對應至較高資料層級DG的分頁叢集。According to this, in another data block BLKgc to be garbage collected, when the data storage location in a paging cluster is lower than the lower threshold Th_L, the controller 331 changes the paging cluster for storing the data. Corresponding to the paging cluster of the lower data level DG; when the data storage location in a paging cluster is higher than or equal to the lower threshold Th_L and simultaneously lower than the higher threshold Th_H, the controller 331 will page the paging The data stored in the cluster for maintaining the paging hierarchy corresponding to the same data level DG; or, when the data storage location in a paging cluster is higher than or equal to the higher threshold Th_H, the controller 331 uses the paging cluster The stored data is changed to a paged cluster corresponding to a higher data level DG.

實際應用時,較低臨限值的選定並不限於Npg_cl *25%,且較高臨限值的選定並不限於Npg_cl*75%。另,針對其他資料層級DG,也可設定與其對應的臨限值。再者,針對每個資料層級DG定義的臨限值也可能不同。In practical applications, the selection of the lower threshold is not limited to Npg_cl *25%, and the selection of the higher threshold is not limited to Npg_cl*75%. In addition, for other data level DGs, the corresponding threshold can also be set. Furthermore, the thresholds defined for each data level DG may also be different.

請參見第30C圖,其係以兩個預設的臨限值比較待進行垃圾回收之資料區塊內的資料熱度之示意圖。此圖式係以第30A、30B圖定義的較低臨限值Th_L與較高臨限值Th_H,與第23圖的每個分頁叢集進行比較。Please refer to Figure 30C, which is a schematic diagram comparing the heat of data in the data block to be garbage collected with two preset thresholds. This graph is compared with the lower threshold Th_L defined by the 30A, 30B map and the higher threshold Th_H, with each paged cluster of FIG.

在第30C圖中,控制器331使用較低臨限值Th_L與較高臨限值Th_H與分頁叢集CL1、CL2、CL3、CL4進行比較。其中,分頁叢集CL1而言,資料X14的存放位置已經過較低臨限值Th_H且低於較高臨限值Th_H。因此,資料X的熱度大致符合目前分頁叢集的資料層級DG,控制器331維持使用資料層級DG3的資料區塊存放資料X14以及資料X的後續更新版本。In Fig. 30C, the controller 331 compares with the higher threshold Th_H and the paged clusters CL1, CL2, CL3, CL4 using the lower threshold Th_L. Among them, for the paging cluster CL1, the storage location of the data X14 has passed the lower threshold Th_H and is lower than the higher threshold Th_H. Therefore, the heat of the data X roughly conforms to the data level DG of the current paged cluster, and the controller 331 maintains the data block X14 of the data level DG3 and the subsequent updated version of the data X.

對分頁叢集CL2而言,資料Y8的存放位置低於較低臨限值Th_L。因此,資料Y的熱度相對較低。據此,控制器331可以使用較低資料層級DG的分頁叢集存放資料Y8以及資料Y的後續更新版本。For the paging cluster CL2, the storage location of the material Y8 is lower than the lower threshold Th_L. Therefore, the heat of the data Y is relatively low. Accordingly, the controller 331 can use the paged cluster of the lower data level DG to store the material Y8 and subsequent updated versions of the material Y.

對分頁叢集CL3而言,資料A17的存放位置等於較高臨限值Th_H。因此,資料A的熱更高。據此,控制器331改為使用第四個資料層級DG的分頁叢集存放資料A17以及資料A的後續更新版本。For the paging cluster CL3, the storage location of the data A17 is equal to the higher threshold Th_H. Therefore, the heat of the data A is higher. Accordingly, the controller 331 instead uses the paged cluster of the fourth data level DG to store the data A17 and subsequent updated versions of the material A.

對分頁叢集CL4而言,資料D9的存放位置等於較低臨限值。因此,資料D的熱度大致符合目前對應的資料層級DG。據此,控制器331維持使用相同資料層級DG的分頁叢集,存放資料D9以及資料D的後續更新版本。For paged cluster CL4, the storage location of data D9 is equal to the lower threshold. Therefore, the heat of the data D is roughly in line with the current data level DG. Accordingly, the controller 331 maintains a paged cluster using the same data level DG, storing the data D9 and subsequent updated versions of the material D.

請參見第31A圖,其係將進行垃圾回收之資料區塊內的資料,複製至低一個資料層級DG的資料區塊之示意圖。如前所述,經過第30C圖的比較後,控制器331判斷資料Y的更新頻率較低。因此,可降低與資料X、資料Y所儲存之分頁叢集的資料層級DG。因此,將資料Y8複製至資料層級DG2的資料區塊752中。此處假設將資料Y8存放於資料區塊752的分頁叢集CL1。Please refer to Figure 31A, which is a schematic diagram of copying the data in the data block for garbage collection to the data block of the lower data level DG. As described above, after the comparison of the 30Cth chart, the controller 331 judges that the update frequency of the material Y is low. Therefore, the data level DG of the paged cluster stored with the material X and the data Y can be reduced. Therefore, the material Y8 is copied to the data block 752 of the data level DG2. It is assumed here that the material Y8 is stored in the paging cluster CL1 of the data block 752.

請參見第31B圖,其係將進行垃圾回收之資料區塊內的資料,複製至高一個資料層級DG的資料區塊之示意圖。如前所述,經過第30C圖的比較後,控制器331判斷資料A的更新頻率較高。因此,須使使用更高資料層級DG的分頁叢集存放資料A。因此,控制器331將資料A17複製至對應於第四個資料層級DG的資料區塊754中。此處假設將資料X14存放於資料區塊753的分頁叢集CL1。Please refer to Fig. 31B, which is a schematic diagram of copying the data in the data block for garbage collection to the data block of the higher data level DG. As described above, after the comparison of the 30Cth chart, the controller 331 judges that the update frequency of the material A is high. Therefore, a paged cluster using a higher data level DG must be used to store data A. Therefore, the controller 331 copies the material A17 into the data block 754 corresponding to the fourth data level DG. It is assumed here that the material X14 is stored in the paging cluster CL1 of the data block 753.

請參見第31C圖,其係將進行垃圾回收之資料區塊內的資料,複製至同一個資料層級DG的資料區塊之示意圖。如前所述,經過第30C圖的比較後,判斷資料X、資料D的更新頻率大致符合目前規劃的分頁叢集的資料層級DG。因此,控制器331維持使用資料層級DG3的分頁叢集存放資料X、資料D。因此,控制器331將資料X14、資料 D9複製至同樣為資料層級DG3的資料區塊753中。此處假設將資料X14存放於資料區塊713的分頁叢集CL1;以及將資料D9存放於資料區塊753的分頁叢集CL2。Please refer to Figure 31C, which is a schematic diagram of copying the data in the data block for garbage collection to the data block of the same data level DG. As described above, after the comparison of the 30C chart, it is judged that the update frequency of the data X and the data D substantially conforms to the data level DG of the currently planned paging cluster. Therefore, the controller 331 maintains the paging cluster of the data hierarchy DG3 to store the data X and the data D. Therefore, the controller 331 copies the material X14 and the data D9 into the data block 753 which is also the data level DG3. It is assumed here that the material X14 is stored in the paging cluster CL1 of the data block 713; and the data D9 is stored in the paging cluster CL2 of the data block 753.

前述的舉例中,分別說明以一個臨限值與兩個臨限值比較分頁叢集的使用情形。另須留意的是,實際應用時,關於臨限值的選用、臨限值的數量,以及如何針對臨限值的比較結果調整資料所對應的資料層級等,並不以此處的舉例為限。In the foregoing examples, the use cases of paging clusters with one threshold and two thresholds are respectively described. It should also be noted that, in actual application, the selection of the threshold value, the number of threshold values, and how to adjust the data level corresponding to the data for the comparison of the threshold values are not limited to the examples here. .

除了針對資料存放位置進行級別調整外,為減少在彼此相鄰的資料分頁進行再程式化時,對相鄰資料分頁可能產生的干擾現象,本揭露進一步針對記憶體區塊提出以棋盤式方式管理分頁叢集的寫入狀態的做法。In addition to the level adjustment for the data storage location, in order to reduce the interference phenomenon that may occur on the adjacent data paging when re-programming the adjacent data pages, the disclosure further proposes a checkerboard management method for the memory block. The practice of writing state of paged clusters.

本揭露的實施例將資料區塊所包含的多個分頁叢集中,一部分預設為開啟狀態CLon,另一部分預設為關閉狀態CLoff。其中,被預設為開啟狀態CLon與關閉狀態CLoff的分頁叢集在資料區塊中,彼此交錯。當控制器331寫入資料時,僅先針對開啟狀態CLon的分頁叢集寫入資料。因為被預設為開啟狀態CLon與關閉狀態CLoff的分頁叢集在資料區塊中彼此交錯的緣故,在將資料寫入至被預設開啟狀態CLon的各個分頁叢集時,並不會產生因為對資料分頁進行再程式化,反而導致其他資料分頁的資料受到干擾的現象。The embodiment of the present disclosure sets a plurality of paging clusters included in the data block, one part is preset to the on state CLon, and the other part is preset to the off state CLoff. The paged clusters preset to the on state CLon and the off state CLoff are interleaved in the data block. When the controller 331 writes data, only the data is written for the paged cluster of the ON state CLon. Because the paging clusters preset to the on state CLon and the off state CLoff are interleaved in the data block, when the data is written to the respective paging clusters of the preset ON state CLon, the data is not generated. Paging is reprogrammed, which in turn causes the data of other data to be interfered.

其後,待預設為開啟狀態CLon的分頁叢集均已用於寫入資料後,控制器331再依據在該些預設為開啟狀態CLon的分頁叢集中,資料分頁的使用情況,動態選擇是否能變更原本預設為關閉狀態CLoff的分頁叢集的使用狀態。Thereafter, after the paging clusters to be preset to the ON state CLon have been used for writing data, the controller 331 dynamically selects whether the data paging is used according to the paging clusters in which the presets are the ON state CLon. It is possible to change the usage status of the paging cluster that was originally set to the off state CLoff.

請參見第32A、32B圖,其係以棋盤式配置方式,對資料層級DG3的資料區塊,規劃其分頁叢集的使用狀態之示意圖。如前所述,對應於資料層級DG3的資料區塊80包含四個分頁叢集CL1、CL2、CL3、CL4。Please refer to the figure 32A, 32B, which is a schematic diagram of the use state of the paging cluster for the data block of the data level DG3 in a checkerboard configuration manner. As previously mentioned, the data block 80 corresponding to the data level DG3 contains four paged clusters CL1, CL2, CL3, CL4.

第32A圖假設將分頁叢集CL1、CL4預設為關閉狀態CLoff;以及,將分頁叢集CL2、CL3預設為開啟狀態CLon。因為分頁叢集CL1、CL4被預設為關閉狀態CLoff的緣故,在資料區塊對應表中,與分頁叢集CL1、CL4對應的資料存放位置以叉號表示。另一方面,對被預設為開啟狀態CLon的與分頁叢集CL2、CL3而言,與叢集編號2、3對應的資料存放位置標示為”0”。 因此,記憶體控器會優先利用分頁叢集CL2、CL3的資料分頁寫入資料,並需於分頁叢集CL2、CL3都已經被用於存放資料後,才判斷分頁叢集CL1、CL4是否可以預設的關閉狀態CLoff,轉變為開啟狀態CLon。The 32A diagram assumes that the paging clusters CL1, CL4 are preset to the off state CLoff; and, the paging clusters CL2, CL3 are preset to the on state CLon. Since the paging clusters CL1 and CL4 are preset to the OFF state CLoff, in the data block correspondence table, the data storage locations corresponding to the paging clusters CL1 and CL4 are indicated by crosses. On the other hand, for the paging clusters CL2 and CL3 which are preset to the ON state CLon, the data storage locations corresponding to the cluster numbers 2 and 3 are indicated as "0". Therefore, the memory controller will preferentially use the data of the paging clusters CL2 and CL3 to page the data, and it is necessary to determine whether the paging clusters CL1 and CL4 can be preset after the paging clusters CL2 and CL3 have been used for storing data. The state CLoff is turned off and turned to the on state CLon.

第32B圖假設將分頁叢集CL1、CL4預設為開啟狀態CLon;以及,將分頁叢集CL2、CL3預設為關閉狀態CLoff。因為分頁叢集CL2、CL3被預設為關閉狀態CLoff的緣故,在資料區塊對應表中,與分頁叢集CL2、CL3對應的資料存放位置以叉號表示。另一方面,對被預設為開啟狀態CLon的與分頁叢集CL1、CL4而言,與叢集編號1、4對應的資料存放位置標示為”0”。 因此,記憶體控器會優先利用分頁叢集CL1、CL4的資料分頁寫入資料,並需於分頁叢集CL1、CL4都已經被用於存放資料後,才判斷分頁叢集CL2、CL3是否可以預設的關閉狀態CLoff,轉變為開啟狀態CLon。Fig. 32B assumes that the paging clusters CL1, CL4 are preset to the on state CLon; and, the paging clusters CL2, CL3 are preset to the off state CLoff. Since the paging clusters CL2 and CL3 are preset to the OFF state CLoff, in the data block correspondence table, the data storage locations corresponding to the paging clusters CL2 and CL3 are indicated by crosses. On the other hand, for the paging clusters CL1 and CL4 which are preset to the ON state CLon, the data storage locations corresponding to the cluster numbers 1 and 4 are indicated as "0". Therefore, the memory controller will preferentially use the data of the paging clusters CL1 and CL4 to page the data, and it is necessary to determine whether the paging clusters CL2 and CL3 can be preset after the paging clusters CL1 and CL4 have been used for storing data. The state CLoff is turned off and turned to the on state CLon.

請參見第33圖,其係針對棋盤式配置的分頁叢集要如何決定寫入資料分頁的流程圖。See Figure 33, which is a flow chart for how the paging cluster of the checkerboard configuration decides to write the data page.

首先,控制器331依據分頁叢集CL在資料區塊BLK的位置而將一部分的分頁叢集預設為開啟狀態CLon的分頁叢集CLon,以及將另一部分的分頁叢集預設為關閉狀態CLoff的分頁叢集CLoff(步驟S81)。其次,隨著資料寫入的過程,控制器331動態調整分頁叢集的狀態(步驟S83)。其中,步驟S83將反覆進行。First, the controller 331 presets a part of the paging cluster as the paging cluster CLon of the ON state CLon according to the position of the paging cluster CL in the data block BLK, and presets the pagination cluster of the other section to the pagination cluster CLoff of the OFF state CLoff. (Step S81). Next, as the data is written, the controller 331 dynamically adjusts the state of the paged cluster (step S83). Among them, step S83 will be repeated.

步驟S83進一步包含以下步驟。首先,控制器331自主控裝置31接收一筆資料(步驟S831),並判斷該筆資料是否為新的資料(步驟S832)。若步驟S832的判斷結果為否定,代表先前已經分配過與該筆資料對應的分頁叢集。因此,將資料寫入先前所分配與其對應的分頁叢集內(步驟S838) ,且控制器331依據資料的寫入位置,判斷是否有任何預設為關閉狀態CLoff的分頁叢集因為該筆資料的寫入而符合開啟狀態CLon。換言之,控制器331會動態的隨著資料的寫入位置,判斷是否應該調整分頁叢集的狀態(步驟S839)。第37圖將進一步說明步驟S839的相關細節。Step S83 further includes the following steps. First, the controller 331 automatically controls the device 31 to receive a piece of data (step S831), and judges whether or not the pen data is new data (step S832). If the result of the determination in step S832 is negative, it means that the paged cluster corresponding to the pen data has been previously allocated. Therefore, the data is written into the paging cluster corresponding to which it was previously allocated (step S838), and the controller 331 determines whether there is any paging cluster preset to the closed state CLoff according to the writing position of the material because the writing of the data is written. Into the open state CLon. In other words, the controller 331 dynamically determines whether the state of the paged cluster should be adjusted as the data is written (step S839). Figure 37 will further illustrate the relevant details of step S839.

若步驟S832的判斷結果為肯定,代表需要分配一個分頁叢集,用於儲存該筆資料的各個版本。此時,控制器331將判斷是否有設為開啟狀態CLon的分頁叢集可供寫入資料(步驟S833)。若是,便使用設為開啟狀態CLon的分頁叢集寫入該筆資料(步驟S834)。反之,則需確認是否有原本預設為關閉狀態CLoff的分頁叢集是否符合轉換為開啟狀態CLon的開啟條件(步驟S835)。If the result of the determination in step S832 is affirmative, it means that a paged cluster needs to be allocated for storing each version of the piece of data. At this time, the controller 331 judges whether or not there is a paging cluster set to the ON state CLon for writing data (step S833). If so, the pen data is written using the paged cluster set to the ON state CLon (step S834). On the other hand, it is necessary to confirm whether or not there is a paging cluster originally scheduled to be in the OFF state CLoff, whether or not the paging condition converted to the ON state CLon is met (step S835).

若步驟S835的判斷結果為,並無任何分頁叢集可以從關閉狀態CLoff轉換為開啟狀態CLon。則,控制器331將據以判斷資料區塊目前並無適合的分頁叢集可供存放該筆資料。因此,控制器331會將該筆資料存放至其他的資料區塊(步驟S837)。If the result of the determination in step S835 is that no paging cluster can be switched from the off state CLoff to the on state CLon. Then, the controller 331 will determine that the data block currently has no suitable paging cluster for storing the data. Therefore, the controller 331 stores the pen data in other data blocks (step S837).

另一方面,若步驟S835的判斷結果為,確實有分頁叢集已經符合開啟條件,並可從關閉狀態CLoff轉換為開啟狀態CLon。則,控制器331將在被轉換至開啟狀態CLon的分頁叢集存入該筆資料(步驟S836)。On the other hand, if the result of the determination in step S835 is that there is indeed a paging cluster that has met the ON condition, and can be switched from the OFF state CLoff to the ON state CLon. Then, the controller 331 stores the page bundle in the page transition converted to the on state CLon into the pen data (step S836).

承上,本揭露可將資料區塊內的分頁叢集區分兩個部分,其中一部分的分頁叢集預先設定為開啟狀態CLon,另一部分的分頁叢集預先設定為關閉狀態CLoff。控制器331儲存資料時,優先使用預設為開啟狀態CLon的分頁叢集存入資料,並於預設為開啟狀態CLon的分頁叢集均被使用後,依據開啟條件逐步判斷原本被預設為關閉狀態CLoff的分頁叢集是否可以開始用於儲存資料。關於原本預設為關閉狀態CLoff的分頁叢集依據何種開啟條件進行判斷,以及在何種情況下判斷開啟條件的細節,將進一步說明如下。In the above disclosure, the paging cluster in the data block can be divided into two parts, wherein a part of the paging cluster is preset to the on state CLon, and the other part of the paging cluster is preset to the off state CLoff. When storing the data, the controller 331 preferentially uses the paging cluster preset to the ON state CLon to store the data, and after the paging clusters that are preset to the ON state CLon are used, gradually determine that the original is turned off according to the ON condition. Whether CLoff's paging cluster can be used to store data. Regarding the determination as to which opening condition the paging cluster originally set to the OFF state CLoff is based on, and under what circumstances, the details of the opening condition are determined, as will be further explained below.

請參見第34圖,其係記憶體控制規劃如第34圖所示之棋盤式配置的分頁叢集的流程圖。此圖式為第33圖的步驟S81的一種舉例首先,設定i=1, j=1(步驟S901)。其次,計算i%2與j%2(步驟S903)。接著,依據i%2與 j%2的不同結果,決定分頁叢集CL應被預設為開啟狀態CLon或為關閉狀態CLoff。See Figure 34, which is a flow diagram of the paged cluster of the checkerboard configuration as shown in Figure 34 for the memory control plan. This figure is an example of the step S81 of Fig. 33. First, i = 1, j = 1 is set (step S901). Next, i%2 and j%2 are calculated (step S903). Then, based on the different results of i%2 and j%2, it is determined that the paging cluster CL should be preset to the on state CLon or the off state CLoff.

若i%2=1且j%2=1時,將分頁叢集CL(i, j)設定為開啟狀態(步驟S905a)。若i%2=0且j%2=1時,將分頁叢集CL(i, j)設定為關閉狀態CLoff步驟S905b)。若i%2=1且j%2=0時,將分頁叢集CL(i, j)設定為關閉狀態CLoff(步驟S905c)。若i%2=0且j%2=0時,將分頁叢集CL(i, j)設定為開啟狀態CLon(步驟S905d)。If i%2=1 and j%2=1, the paged cluster CL(i, j) is set to the on state (step S905a). If i%2=0 and j%2=1, the paged cluster CL(i, j) is set to the off state CLoff step S905b). If i%2=1 and j%2=0, the paged cluster CL(i, j) is set to the off state CLoff (step S905c). If i%2 = 0 and j%2 = 0, the paged cluster CL(i, j) is set to the on state CLon (step S905d).

接著,判斷i是否等於Ig(步驟S907)。若否,累加i(步驟S909),並重複自步驟S903開始執行。若i等於Ig時,判斷j是否等於Jg(步驟S911)。若否,設定i=1並累加j(步驟S913)。若j=Jg時,決定分頁叢集CL之預設狀態的流程結束。Next, it is judged whether or not i is equal to Ig (step S907). If not, i is accumulated (step S909), and the execution from step S903 is repeated. If i is equal to Ig, it is judged whether or not j is equal to Jg (step S911). If not, i=1 is set and j is accumulated (step S913). If j = Jg, the flow of determining the preset state of the paging cluster CL ends.

針對對應於資料層級DG2的資料區塊,若依據此流程圖決定分頁叢集的資狀態時,產生的棋盤式配置如第35圖所示。對資料層級DG2的資料區塊而言,Ig=I2=4、Jg=J2=4、Og=O2=2、Pg=P2=2。For the data block corresponding to the data level DG2, if the resource status of the paging cluster is determined according to this flowchart, the generated checkerboard configuration is as shown in FIG. For the data block of the data level DG2, Ig=I2=4, Jg=J2=4, Og=O2=2, Pg=P2=2.

請參見第35圖,其係以對應於資料層級DG2的資料區塊為例,說明一種棋盤式配置的分頁叢集之示意圖。第35圖以CL(i, j)代表分頁叢集CL在資料區塊BLK的位置。其中,每個分頁叢集CL包含排列為Og行與Pg列的資料分頁。此處同樣以細格狀的網底代表被設為關閉狀態CLoff的分頁叢集CL;以及以空白方格代表被預設為開啟狀態CLon的分頁叢集CL。Referring to FIG. 35, a schematic diagram of a paging cluster of a checkerboard configuration is illustrated by taking a data block corresponding to the data level DG2 as an example. Figure 35 shows the position of the paging cluster CL in the data block BLK with CL(i, j). Among them, each paged cluster CL contains data pages arranged in Og rows and Pg columns. Here, the fine-grained net bottom also represents the paging cluster CL which is set to the OFF state CLoff; and the blank square represents the paging cluster CL which is preset to the ON state CLon.

第34圖的步驟S905a對應於此圖式中,位於第一列或第三列中的奇數行的分頁叢集,例如,分頁叢集CL(1, 1)、CL(3, 1)、CL(1, 3)、CL(3, 3)。因此,第35圖的分頁叢集CL(1, 1)、CL(3, 1)、CL(1, 3)、CL(3, 3)被預設為開啟狀態CLon。Step S905a of Fig. 34 corresponds to a paged cluster of odd rows located in the first column or the third column in this figure, for example, paged clusters CL(1, 1), CL(3, 1), CL(1) , 3), CL (3, 3). Therefore, the page clusters CL(1, 1), CL(3, 1), CL(1, 3), CL(3, 3) of Fig. 35 are preset to the on state CLon.

第34圖的步驟S905b對應於此圖式中,位於第一列或第三列中的偶數行的分頁叢集,例如,分頁叢集CL(2, 1)、CL(4, 1)、CL(2, 3)、CL(4, 3)。因此,第35圖的分頁叢集CL(2, 1)、CL(4, 1)、CL(2, 3)、CL(4, 3)被預設為關閉狀態CLoff。Step S905b of Fig. 34 corresponds to a paged cluster of even-numbered rows in the first column or the third column in this figure, for example, paging clusters CL(2, 1), CL(4, 1), CL(2) , 3), CL (4, 3). Therefore, the page clusters CL(2, 1), CL(4, 1), CL(2, 3), CL(4, 3) of Fig. 35 are preset to the off state CLoff.

第34圖的步驟S905對應於此圖式中,位於第二列或第四列中的奇數行的分頁叢集,例如,分頁叢集CL(1, 2)、CL(3, 2)、CL(1, 4)、CL(3, 4)。因此,第35圖的分頁叢集CL(1, 2)、CL(3, 2)、CL(1, 4)、CL(3,4)被預設為關閉狀態CLoff。Step S905 of Fig. 34 corresponds to a paged cluster of odd rows located in the second column or the fourth column in this figure, for example, paged clusters CL(1, 2), CL(3, 2), CL(1) , 4), CL (3, 4). Therefore, the page clusters CL(1, 2), CL(3, 2), CL(1, 4), CL(3, 4) of Fig. 35 are preset to the off state CLoff.

第34圖的步驟S905b對應於此圖式中,位於第二列或第四列中的偶數行的分頁叢集,例如,分頁叢集CL(2, 2)、CL(4, 2)、CL(2, 4)、CL(4,4)。因此,第35圖的分頁叢集CL(2, 2)、CL(4, 2)、CL(2, 4)、CL(4, 4)被預設為開啟狀態CLon。Step S905b of Fig. 34 corresponds to a paged cluster of even rows located in the second column or the fourth column in this figure, for example, paged clusters CL(2, 2), CL(4, 2), CL(2) , 4), CL (4, 4). Therefore, the page clusters CL(2, 2), CL(4, 2), CL(2, 4), CL(4, 4) of Fig. 35 are preset to the on state CLon.

請參見第36圖,其係採用棋盤式配置時,原本被設為關閉狀態CLoff的分頁叢集應該如何判斷相鄰的分頁叢集的使用狀態,進而從關閉狀態CLoff改變為開啟狀態CLon之示意圖。此圖式的中心為擬判斷狀態的分頁叢集CL(i, j),其中,i、j分別代表擬判斷的分頁叢集在資料區塊的行方向的位置、列方向的位置。如前所述,判斷一個分頁叢集可否開啟時,需視與其相鄰的資料分頁是否已經寫入資料。隨著在分頁叢集的上方、下方、左側、右側的不同,與其相鄰之分頁叢集中,需用於判斷的資料分頁的位置也不完全相同。Please refer to Fig. 36, which is a schematic diagram of how the paging cluster originally set to the closed state CLoff should judge the use state of the adjacent paging clusters and then change from the closed state CLoff to the open state CLon when the checkerboard configuration is adopted. The center of this graph is the paging cluster CL(i, j) of the state to be judged, where i and j respectively represent the position of the paging cluster to be judged in the row direction of the data block and the position of the column direction. As mentioned above, when judging whether a paging cluster can be turned on, it is necessary to regard whether the adjacent data paging has been written. With the difference in the top, bottom, left, and right sides of the paging cluster, and the adjacent paging clusters, the positions of the data pages to be used for judgment are not completely the same.

判斷分頁叢集CL(i, j)是否可被開啟時,必須判斷位在分頁叢集CL(i, j)上方、下方、左側、右側的分頁叢集的資料分頁中,與分頁叢集CL(i, j)相鄰接的資料分頁是否已經被標示為無效。其中,分頁叢集CL(i, j)的上方為分頁叢集CL(i, j-1);分頁叢集CL(i, j)的下方為分頁叢集CL(i, j+1);分頁叢集CL(i, j)的左側為分頁叢集CL(i-1, j);以及,分頁叢集CL(i, j)的右側為分頁叢集CL(i+1, j)。When judging whether the paging cluster CL(i, j) can be turned on, it must be judged in the data pagination of the pagination cluster above, below, to the left, and right of the pagination cluster CL(i, j), and the pagination cluster CL(i, j) Whether the adjacent data page has been marked as invalid. Wherein, the paging cluster CL(i, j) is above the paging cluster CL(i, j-1); the paging cluster CL(i, j) is the paging cluster CL(i, j+1); the paging cluster CL ( The left side of i, j) is the paging cluster CL(i-1, j); and the right side of the paging cluster CL(i, j) is the paging cluster CL(i+1, j).

在判斷分頁叢集CL(i, j-1)中,與分頁叢集CL(i, j)相鄰的資料分頁是否已經存入資料,相當於判斷在分頁叢集CL(i, j-1)中,位於最後一列的資料分頁是否都已經寫入資料。另,因為本揭露採用由左而右、由上而下的順序將資料寫入資料分頁,因此,僅在分頁叢集CL(i, j-1)的資料分頁P(Og, Pg)已經被標示為無效時,才代表與分頁叢集CL(i, j)的上方相鄰接的資料分頁均已經被標示為無效。In judging the paging cluster CL(i, j-1), whether the data page adjacent to the paging cluster CL(i, j) has been stored in the data is equivalent to judging in the paging cluster CL(i, j-1), Whether the data pages in the last column have been written. In addition, because the disclosure uses the left-to-right, top-down order to write data into the data page, only the data page P(Og, Pg) of the paged cluster CL(i, j-1) has been marked. If it is invalid, it means that the data page adjacent to the top of the paging cluster CL(i, j) has been marked as invalid.

在判斷分頁叢集CL(i, j+1)中,與分頁叢集CL(i, j)相鄰的資料分頁是否已經被標示為無效,相當於判斷在分頁叢集CL(i, j-1)中,位於第一列的資料分頁是否被標示為無效。另,因為本揭露採用由左而右、由上而下的順序將資料寫入資料分頁,因此,僅在分頁叢集CL(i, j+1)的資料分頁P(Og, 1)已經被標示為無效時,代表與分頁叢集CL(i, j)的下方相鄰接的資料分頁均已經被標示為無效。In judging whether the paged cluster CL(i, j+1), the data page adjacent to the paged cluster CL(i, j) has been marked as invalid, is equivalent to being judged in the paged cluster CL(i, j-1) Whether the data page in the first column is marked as invalid. In addition, because the disclosure uses the left-to-right, top-down order to write data into the data page, only the data page P(Og, 1) of the paged cluster CL(i, j+1) has been marked. When invalid, the data pages that are adjacent to the lower side of the paging cluster CL(i, j) have been marked as invalid.

在判斷分頁叢集CL(i-1, j)中,與分頁叢集CL(i, j)相鄰的資料分頁是否已經被標示為無效,相當於判斷在分頁叢集CL(i, j-1)中,位於第Pg行的資料分頁是否都已經被標示為無效。另,因為本揭露採用由左而右、由上而下的順序將資料寫入資料分頁,因此,僅在分頁叢集CL(i, j-1)的資料分頁P(Og, Pg)已經被標示為無效時,控制器331方能聚確認與分頁叢集CL(i, j)的左側相鄰接的資料分頁均被使用。In judging whether the paged cluster CL(i-1, j), the data page adjacent to the paged cluster CL(i, j) has been marked as invalid, is equivalent to being judged in the paged cluster CL(i, j-1) Whether the data pages located in the Pg line have been marked as invalid. In addition, because the disclosure uses the left-to-right, top-down order to write data into the data page, only the data page P(Og, Pg) of the paged cluster CL(i, j-1) has been marked. When invalid, the controller 331 can collectively confirm that the data pages adjacent to the left side of the paged cluster CL(i, j) are used.

在判斷分頁叢集CL(i+1, j)中,與分頁叢集CL(i, j)相鄰的資料分頁是否已經被標示為無效,相當於判斷在分頁叢集CL(i+1, j)中,位於第一行的資料分頁是否都已經被標示為無效。另,因為本揭露採用由左而右、由上而下的順序將資料寫入資料分頁,因此,僅在分頁叢集CL(i, j+1)的資料分頁P(1, Pg)已經被標示為無效時,代表與分頁叢集CL(i, j)的右側相鄰接的資料分頁均已經被標示為無效。In judging whether the paged cluster CL(i+1, j), the data page adjacent to the paged cluster CL(i, j) has been marked as invalid, is equivalent to being judged in the paged cluster CL(i+1, j) Whether the data pages in the first line have been marked as invalid. In addition, because the disclosure uses the left-to-right, top-down order to write data into the data page, only the data page P(1, Pg) of the paged cluster CL(i, j+1) has been marked. When invalid, the data pages that are adjacent to the right side of the paging cluster CL(i, j) have been marked as invalid.

承上,分頁叢集CL(i, j)的開啟條件包含以下四個判斷條件:其一為,判斷分頁叢集CL(i, j-1)的資料分頁P(Og, Pg)是否已經被標示為無效;其二為,判斷分頁叢集CL(i, j+1) 的資料分頁P(Og, 1)是否已經被標示為無效;其三為,判斷斷分頁叢集CL(i-1, j) 的資料分頁P(Og, Pg)是否已經被標示為無效;其四為,判斷分頁叢集CL(i+1, j) 的資料分頁P(1, Pg)是否已經被標示為無效。當控制器331判斷這四個判斷條件均為肯定時,確認開啟條件已經成立。據此,控制器331可將符合開啟條件的分頁叢集CL(i, j)從關閉狀態CLoff轉換為開啟狀態CLon。In the above, the opening condition of the paging cluster CL(i, j) includes the following four judgment conditions: one is to determine whether the data page P(Og, Pg) of the paged cluster CL(i, j-1) has been marked as Invalid; the second is to determine whether the data page P(Og, 1) of the paged cluster CL(i, j+1) has been marked as invalid; the third is to judge the page split cluster CL(i-1, j) Whether the data page P(Og, Pg) has been marked as invalid; the fourth is to determine whether the data page P(1, Pg) of the paged cluster CL(i+1, j) has been marked as invalid. When the controller 331 judges that the four determination conditions are all affirmative, it is confirmed that the open condition has been established. According to this, the controller 331 can convert the paging cluster CL(i, j) that conforms to the ON condition from the OFF state CLoff to the ON state CLon.

針對原本為關閉狀態CLoff的分頁叢集CL,依據其於資料區塊的位置不同,所需判斷之相鄰的分頁叢集CL的位置也不盡相同。以下進一步歸納,如何根據分頁叢集在資料區塊的位置,判斷被設為關閉狀態CLoff的分頁叢集CL是否可轉變為開啟狀態CLon。其中Ig、Jg分別代表在資料區塊的行方向與列方向包行的分頁叢集的個數。因此,隨著資料層級的不同,Ig與Jg的數值也不相同。其中,g代表資料層級DG。For the paging cluster CL which is originally the off state CLoff, depending on the location of the data block, the position of the adjacent paging cluster CL to be determined is also different. It is further summarized below how to determine whether the paging cluster CL set to the off state CLoff can be turned into the on state CLon according to the position of the paging cluster in the data block. Where Ig and Jg respectively represent the number of paging clusters wrapped in the row direction and the column direction of the data block. Therefore, the values of Ig and Jg are different depending on the level of the data. Where g is the data level DG.

首先,若分頁叢集CL(i, j)位於資料區塊的第1行與第1列(左上角)時,i=1, j=1(即,分頁叢集CL(1, 1))。此時,控制器331需判斷位於分頁叢集CL(i, j)右側的分頁叢集CL(2, 1),以及位於分頁叢集CL(i, j)下方的分頁叢集CL(1, 2)所包含的資料分頁之使用情形。First, if the paging cluster CL(i, j) is located in the first row and the first column (upper left corner) of the data block, i=1, j=1 (ie, the paging cluster CL(1, 1)). At this time, the controller 331 needs to judge the paging cluster CL(2, 1) located on the right side of the paging cluster CL(i, j), and the paging cluster CL(1, 2) located below the paging cluster CL(i, j). The use of data pagination.

若分頁叢集CL(i, j)位於資料區塊的第一列中,非第一行亦非第Ig行的位置時,j=1(即,分頁叢集CL(1, Jg))。此時,控制器331需判斷位於分頁叢集CL(i, j)左側的分頁叢集CL(i-1, 1)、位於分頁叢集CL(i, j)右側的分頁叢集CL(i+1, 1)與位於分頁叢集CL(i, j)下方的分頁叢集CL(i, 2)所包含的資料分頁使用情形。If the paging cluster CL(i, j) is located in the first column of the data block, and the non-first row is not the location of the Ig row, j=1 (ie, the paging cluster CL(1, Jg)). At this time, the controller 331 needs to judge the paging cluster CL(i-1, 1) located on the left side of the paging cluster CL(i, j) and the paging cluster CL (i+1, 1 located on the right side of the paging cluster CL(i, j). The data paging use case contained in the paging cluster CL(i, 2) located below the paging cluster CL(i, j).

若分頁叢集CL(i, j)位於資料區塊的第Ig行與第1列(右上角)時,i=Ig、j=1(即,分頁叢集CL(Ig, 1))。此時,控制器331需判斷位於分頁叢集CL(i, j)左側的分頁叢集CL(Ig-1, 1)、位於分頁叢集CL(i, j)下方的分頁叢集CL(Ig, 2)所包含的資料分頁之使用情形。If the paging cluster CL(i, j) is located in the Ig row and the first column (upper right corner) of the data block, i=Ig, j=1 (ie, paging cluster CL(Ig, 1)). At this time, the controller 331 needs to judge the paging cluster CL (Ig-1, 1) located on the left side of the paging cluster CL(i, j) and the paging cluster CL (Ig, 2) located below the paging cluster CL(i, j). The use of the included data pagination.

若分頁叢集CL(i, j)位於資料區塊的第一行中,非第一列亦非第Jg列的位置時, i=1、j≠1、j≠Ig(即,分頁叢集CL(1, j))。此時,控制器331需判斷位於分頁叢集CL(i, j)上方的分頁叢集CL(1, j-1)、位於分頁叢集CL(i, j)右側的分頁叢集CL(2, j ),以及位於分頁叢集CL(i, j)下方的分頁叢集CL(1, j+1)所包含的資料分頁使用情形。If the paging cluster CL(i, j) is located in the first row of the data block, and the non-first column is not the position of the Jg column, i=1, j≠1, j≠Ig (ie, paging cluster CL ( 1, j)). At this time, the controller 331 needs to judge the paging cluster CL(1, j-1) located above the paging cluster CL(i, j), and the paging cluster CL(2, j) located to the right of the paging cluster CL(i, j), And the data paging use case of the paging cluster CL(1, j+1) located under the paging cluster CL(i, j).

若分頁叢集CL(i, j)位於資料區塊中非第1行、非第Ig行、非第1列亦非第Jg列的位置時,控制器331需判斷位於分頁叢集CL(i, j)上方的分頁叢集CL(i, j-1)、位於分頁叢集CL(i, j)下方的分頁叢集CL(i, j+1)、位於分頁叢集CL(i, j)左側的分頁叢集CL(i-1, j)、位於分頁叢集CL(i, j)右側的分頁叢集CL(i+1, j)所包含的資料分頁之使用情形。If the paging cluster CL(i, j) is located at a position other than the first row, the non-Ig row, the non-first column, or the Jg column in the data block, the controller 331 needs to judge that the paging cluster CL(i, j) is located. The pagination cluster CL(i, j-1) above, the pagination cluster CL(i, j+1) located below the pagination cluster CL(i, j), and the pagination cluster CL located to the left of the pagination cluster CL(i, j) (i-1, j), the use of data pagination contained in the pagination cluster CL(i+1, j) to the right of the pagination cluster CL(i, j).

若分頁叢集CL(i, j)位於資料區塊的第Ig行中,非第一列亦非第Jg列的位置時, i= Ig、j≠1、j≠Jg (即,分頁叢集CL(Ig, j))。此時,控制器331需判斷在分頁叢集CL(i, j)上方的分頁叢集CL(Ig, j-1)、位於分頁叢集CL(i, j)左側的分頁叢集CL(Ig-1,j),以及位於分頁叢集CL(i, j)下方的分頁叢集CL(Ig,j+1)所包含的資料分頁使用情形。If the paging cluster CL(i, j) is located in the Ig row of the data block, and the non-first column is not the position of the Jg column, i=Ig, j≠1, j≠Jg (ie, paging cluster CL ( Ig, j)). At this time, the controller 331 needs to judge the paging cluster CL (Ig, j-1) above the paging cluster CL(i, j) and the paging cluster CL (Ig-1, j located to the left of the paging cluster CL(i, j). ), and the data paging use case of the paging cluster CL(Ig, j+1) located under the paging cluster CL(i, j).

若分頁叢集CL(i, j)位於資料區塊的第1行與第Jg列(左下角)時,i=1, j=Jg (即,分頁叢集CL(1, Jg))。此時,控制器331需要判斷在分頁叢集CL(i, j)上方的分頁叢集CL(1, Jg-1)、位於分頁叢集CL(i, j)右側的分頁叢集CL(2, Jg)所包含的資料分頁之使用情形。If the paging cluster CL(i, j) is located in the first row and the Jg column (lower left corner) of the data block, i=1, j=Jg (ie, the paging cluster CL(1, Jg)). At this time, the controller 331 needs to judge the paging cluster CL(1, Jg-1) above the paging cluster CL(i, j) and the paging cluster CL(2, Jg) located to the right of the paging cluster CL(i, j). The use of the included data pagination.

若分頁叢集CL(i, j)位於資料區塊的第Jg列中,非第一行亦非第Ig行的位置時,i≠1、i≠Ig、j=Jg(即,分頁叢集CL(i, Jg))。此時,控制器331需判斷位於分頁叢集CL(i, j)左側的分頁叢集CL(i-1, Jg)、位於分頁叢集CL(i, j)右側的分頁叢集CL(i+1,Jg)、位於分頁叢集CL(i, j)上方的分頁叢集CL(i, Jg-1)所包含的資料分頁的使用情形。If the paging cluster CL(i, j) is located in the Jg column of the data block, and the non-first row is not the position of the Ig row, i≠1, i≠Ig, j=Jg (ie, paging cluster CL ( i, Jg)). At this time, the controller 331 needs to judge the paging cluster CL(i-1, Jg) located on the left side of the paging cluster CL(i, j) and the paging cluster CL (i+1, Jg located on the right side of the paging cluster CL(i, j). The use of data pagination contained in the pagination cluster CL(i, Jg-1) located above the pagination cluster CL(i, j).

若分頁叢集CL(i, j)位於資料區塊的第Ig行與第Jg列(右下角)時,i=Ig, j=Jg(即,分頁叢集CL(Ig, Jg))。此時,控制器331需判斷在需判斷位於分頁叢集CL(i, j)上方的分頁叢集CL(Ig, Jg-1)、位於分頁叢集CL(i, j)左側的分頁叢集CL(Ig-1, Jg)所包含的資料分頁之使用情形。If the paging cluster CL(i, j) is located in the Ig row and the Jg column (lower right corner) of the data block, i=Ig, j=Jg (ie, paging cluster CL(Ig, Jg)). At this time, the controller 331 needs to judge the paging cluster CL (Ig, Jg-1) located above the paging cluster CL(i, j) and the paging cluster CL (Ig- located to the left of the paging cluster CL(i, j). 1, Jg) The use of data pages included in the page.

請參見第37圖,其係採用棋盤式配置時,控制器因應資料所寫入的位置,確認分頁叢集的狀態是否隨著改變的流程圖。首先,判斷該筆資料是否被存放在被預設為開啟狀態CLon的分頁叢集 (步驟S839a)。若步驟S839a的判斷結果為否定,代表被用於寫入該筆資料的分頁叢集是由預設的關閉狀態CLoff轉換為開啟狀態CLon。因此,該筆資料被寫入位置處的相鄰的分頁叢集必為原本即預設為開啟狀態CLon,故流程結束。Please refer to Fig. 37, which is a flow chart for confirming whether the state of the paging cluster changes with the position written by the data in the checkerboard configuration. First, it is judged whether or not the pen data is stored in the paging cluster which is preset to the ON state CLon (step S839a). If the result of the determination in step S839a is negative, the paged cluster representing the data to be written is converted from the preset off state CLoff to the on state CLon. Therefore, the adjacent paging cluster at which the data is written must be originally set to the ON state CLon, so the flow ends.

若步驟S839a的判斷結果為肯定,控制器331將進一步判斷是否仍有預設為開啟狀態CLon的分頁叢集可供新資料寫入(步驟S839b)。若步驟S839b的判斷結果為肯定,代表控制器331還不需要判斷原本被預設為關閉狀態CLoff的分頁叢集是否符合開啟條件,故流程結束。If the result of the determination in step S839a is affirmative, the controller 331 further determines whether there is still a paging cluster preset to the ON state CLon for new data writing (step S839b). If the result of the determination in step S839b is affirmative, the representative controller 331 does not need to determine whether the paged cluster originally set to the off state CLoff meets the open condition, and the flow ends.

若步驟S839b的判斷結果為否定,控制器331便需要與該筆資料的存入位置相鄰的分頁叢集是否為開啟狀態CLon (步驟S839c)。若步驟S839c的 判斷結果為肯定,代表該筆資料的寫入並不會影響其周邊的分頁叢集的狀態,則流程結束。If the result of the determination in step S839b is negative, the controller 331 needs whether or not the paging cluster adjacent to the storage location of the pen data is the on state CLon (step S839c). If the result of the determination in step S839c is affirmative, the writing of the data does not affect the state of the paging clusters around it, the flow ends.

若步驟S839c的判斷結果為否定,代表該筆資料的寫入可能會影響其周邊的分頁叢集的狀態。此時,控制器331需判斷該筆資料的寫入位置是否影響其周邊之分頁叢集的狀態(步驟S839d)。若步驟S839d的判斷結果為否定,控制器331不需要改變分頁叢集的狀態,則流程結束。若步驟S839d的判斷結果為肯定,則須待控制器331將符合開啟條件的分頁叢集轉換為關閉狀態CLoff (步驟S839e)後,流程結束。If the result of the determination in step S839c is negative, the writing representing the data may affect the state of the paging clusters around it. At this time, the controller 331 needs to judge whether or not the writing position of the pen data affects the state of the paging cluster around it (step S839d). If the result of the determination in step S839d is negative, the controller 331 does not need to change the state of the paged cluster, and the flow ends. If the result of the determination in step S839d is affirmative, the flow waits after the controller 331 converts the paged cluster meeting the open condition into the closed state CLoff (step S839e).

當然,實際應用時,控制器331還需考慮其他相關因素。例如,控制器331實際將資料存入資料分頁的過程,並不一定需要判斷周邊分頁叢集的狀態。例如,若分頁叢集包含多列、多行的資料分頁時,控制器331若將資料存入非第一列、非最後一列、非第一行、非最後一行的資料分頁時,就不需要判斷存入資料的分頁叢集的周邊的分頁叢集的狀態。又如,對位於分頁叢集的右上角、左下角、右下角位置的資料分頁而言,與其相鄰的分頁叢集有兩個,且這兩個相鄰的分頁叢集是否滿足開啟條件的判斷各自獨立。因此,可能出現針對同樣一筆寫入的資料,控制器331將一個相鄰的分頁叢集轉換為開啟狀態CLon(即,執行步驟S839d後,判斷結果為肯定並執行步驟S839e);卻維持另一個相鄰的分頁叢集為關閉狀態CLoff(即,執行步驟S839d後,判斷結果為否定)。Of course, in practical applications, the controller 331 also needs to consider other relevant factors. For example, the process by which the controller 331 actually stores data into the material paging does not necessarily require judging the state of the surrounding paging cluster. For example, if the paging cluster includes multiple columns or multiple rows of data paging, the controller 331 does not need to determine whether to store data in non-first column, non-last column, non-first row, and non-last row data paging. The state of the paging clusters around the paging cluster in which the data is stored. For example, for the data page located at the upper right corner, the lower left corner, and the lower right corner of the paged cluster, there are two adjacent page clusters, and the two adjacent page clusters are judged independently of whether the open condition is satisfied. . Therefore, the data may be written for the same write, and the controller 331 converts an adjacent paged cluster into the on state CLon (ie, after performing step S839d, the determination is affirmative and step S839e is performed); The adjacent paging cluster is the off state CLoff (that is, after the execution of step S839d, the judgment result is negative).

請參見第38A~38H圖,其係以多筆資料寫入過程,說明如何在使用棋盤式規劃的資料區塊內,因應分頁叢集的狀態而存放資料之示意圖。 此處假設控制器331將分頁叢集CL2、CL4、CL5、CL7、CL10、CL12、CL13與CL15預設為關閉狀態CLoff,且將分頁叢集CL1、CL3、CL4、CL6、CL9、CL11、CL14與CL16預設為開啟狀態CLon。Please refer to pictures 38A~38H, which are written in multiple data, showing how to store data in the data block using the checkerboard layout in response to the state of the paging cluster. It is assumed here that the controller 331 presets the paging clusters CL2, CL4, CL5, CL7, CL10, CL12, CL13, and CL15 to the off state CLoff, and will page the clusters CL1, CL3, CL4, CL6, CL9, CL11, CL14, and CL16. The preset is the on state CLon.

在第38A圖中,控制器331已經在原本預設為開啟狀態CLon的分頁叢集寫入資料。其中,分頁叢集CL1已用於存放資料A的多個版本(A2、A3、A4、A5);分頁叢集CL3已用於儲存資料B的多個版本(B2、B3、 B4、B5)。此外,分頁叢集CL6、CL8、CL9、CL11、CL14與CL16也分別用於存放資料C、資料D、資料E、資料F、資料G、資料H的多個版本。附帶一提,在寫入資料A2、B2、C2、D2、E2、F2、G2、H2時,控制器331執行的步驟相當於第33圖的步驟S831、S832、S833、S834。寫入資料A3~A5、B3~B5、C3~C4、D3~D5、E3~E4、F3~F5、G3~G5、H3~H5時,控制器331執行的步驟相當於第33圖的步驟S831、S832、S838以及第37圖的步驟S839a、S839b。In Fig. 38A, the controller 331 has written data to the paged cluster originally set to the ON state CLon. Among them, the paging cluster CL1 has been used to store multiple versions of the material A (A2, A3, A4, A5); the paging cluster CL3 has been used to store multiple versions of the material B (B2, B3, B4, B5). In addition, the paging clusters CL6, CL8, CL9, CL11, CL14 and CL16 are also used to store multiple versions of data C, data D, data E, data F, data G, and data H, respectively. Incidentally, when the data A2, B2, C2, D2, E2, F2, G2, and H2 are written, the step executed by the controller 331 corresponds to steps S831, S832, S833, and S834 of Fig. 33. When the data A3~A5, B3~B5, C3~C4, D3~D5, E3~E4, F3~F5, G3~G5, H3~H5 are written, the steps performed by the controller 331 are equivalent to the step S831 of the 33rd figure. Steps S839a and S839b of S832, S838 and Fig. 37.

在第38A圖的資料區塊使用表335b中,被設為關閉狀態CLoff的分頁叢集(CL2、CL4、CL5、CL7、CL10、CL12、CL13、CL15)均以叉號標示屬於該分頁叢集的資料分頁不可用於存放資料。另一方面,對開啟狀態CLon的分頁叢集而言,每個分頁叢集內的資料分頁的使用狀態將同步更新。以分頁叢集CL1為例,因為已經使用第四個資料分頁且第四個資料分頁儲存著有效資料,所以在資料區塊使用表335中,分頁叢集CL1的編號對應於4。再以分頁叢集CL3為例,分頁叢集3對應的數字為 4,代表分頁叢集內的資料分頁中,已經有四個資料分頁被陸續用於存放資料B的不同版本(B2~B5)。其餘的分頁叢集與其對應的編號、數字亦可類推而不再詳述。In the data block usage table 335b of Fig. 38A, the paging clusters (CL2, CL4, CL5, CL7, CL10, CL12, CL13, CL15) set to the off state CLoff are marked with the crosses to the data belonging to the paging cluster. Pagination cannot be used to store data. On the other hand, for the paging cluster of the open state CLon, the usage status of the material paging in each paging cluster will be updated synchronously. Taking the paging cluster CL1 as an example, since the fourth material paging has been used and the fourth material paging stores the valid data, in the data block usage table 335, the number of the paging cluster CL1 corresponds to 4. Taking the paging cluster CL3 as an example, the number corresponding to the paging cluster 3 is 4, which represents that the data paging in the paging cluster has been used to store different versions of the data B (B2~B5). The remaining paged clusters and their corresponding numbers and numbers can be analogized and not detailed.

當資料區塊852內,原本預設為開啟狀態CLon的分頁叢集CL1、CL4、CL5、CL7、CL10、CL12、CL13、CL15都已經被用於存放資料後,控制器331會在接收尚未寫入過資料區塊852的資料時,執行步驟第33圖的步驟S831、S832、S833、S835。當控制器331執行步驟S835時,會依照如第36圖所說明的判斷方式,判斷原本預設為關閉狀態CLoff的分頁叢集(CL2、CL4、CL6、CL8、CL9、CL11、CL14、CL16)是否滿足開啟條件。In the data block 852, after the paging clusters CL1, CL4, CL5, CL7, CL10, CL12, CL13, CL15 which are originally set to the ON state CLon have been used for storing data, the controller 331 will not be written yet. When the data of the data block 852 has passed, steps S831, S832, S833, and S835 of step 33 are executed. When the controller 331 executes step S835, it determines whether the paged clusters (CL2, CL4, CL6, CL8, CL9, CL11, CL14, CL16) originally set to the off state CLoff are determined according to the determination mode as illustrated in FIG. Meet the opening condition.

控制器331判斷在分頁叢集CL2左側的資料分頁存有有效資料A5,因此分頁叢集CL2仍不符合開啟條件,不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL4左側的資料分頁存有有效資料B5,因此分頁叢集CL4仍不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL5上方的資料分頁存有有效資料A5、右側的資料分頁存有有效資料C4,因此分頁叢集CL5仍不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL7上方的資料分頁存有有效資料B5、左側的資料分頁尚未被使用,因此分頁叢集CL7仍不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL10上方有一個資料分頁存有有效資料C4、一個資料分頁尚未被使用,且在其左側的一個資料分頁尚未被使用,因此分頁叢集CL10仍不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL12左側的資料分頁仍存有有效資料F5,因此分頁叢集CL12仍不能被設為開啟。控制器331判斷在分頁叢集CL13上方有一個資料分頁仍存有有效資料E4、一個資料分頁尚未被使用,因此分頁叢集CL13仍不能被設為開啟狀態CLon。控制器331判斷在分頁叢集CL15上方的資料分頁存有有效資料F5、左側的資料分頁存有有效資料G5,因此分頁叢集CL15仍不能被設為開啟狀態CLon。根據前述說明可以得知,在第38A圖中,控制器331仍然無法使用分頁叢集CL2、CL4、CL5、CL7、CL10、CL12、CL13與CL15存放資料。The controller 331 determines that the material page on the left side of the paged cluster CL2 has the valid data A5, so the paged cluster CL2 still does not meet the open condition and cannot be set to the on state CLon. The controller 331 judges that the material page on the left side of the page cluster CL4 has the valid material B5, so the page cluster CL4 cannot be set to the on state CLon. The controller 331 determines that the data page above the paged cluster CL5 has the valid data A5, and the data page on the right has the valid data C4, so the paged cluster CL5 cannot be set to the on state CLon. The controller 331 determines that the data page above the paged cluster CL7 has the valid data B5, and the data page on the left side has not been used, so the paged cluster CL7 cannot be set to the on state CLon. The controller 331 determines that there is a data page above the paged cluster CL10 that has a valid data C4, a data page has not been used, and a data page on the left side thereof has not been used, so the paged cluster CL10 cannot be set to the on state CLon. . The controller 331 judges that the material page on the left side of the page cluster CL12 still has the valid data F5, so the page cluster CL12 cannot be set to be on. The controller 331 judges that there is a data page above the paged cluster CL13 and still has the valid data E4, and one data page has not been used yet, so the paged cluster CL13 cannot be set to the on state CLon. The controller 331 determines that the data page above the paged cluster CL15 has the valid data F5, and the data page on the left side stores the valid data G5, so the paged cluster CL15 cannot be set to the on state CLon. As can be seen from the foregoing description, in Fig. 38A, the controller 331 is still unable to store data using the paging clusters CL2, CL4, CL5, CL7, CL10, CL12, CL13, and CL15.

在第38B圖中,假設資料A、C再度被更新。連帶地,位在分頁叢集CL1中,原本用於存放資料A5的資料分頁已經被標示為無效;位在分頁叢集CL6中,原本用於存放資料C4的資料分頁已經被標示為無效。此時,控制器331須因應資料A、C的更新而執行第33圖的步驟S831、S832、S839以及第37圖的步驟S839a、S839b、S839c、S839d。在此同時,資料區塊使用表中,分頁叢集CL1以叉號表示,且與分頁叢集CL6對應於4。In Fig. 38B, it is assumed that the materials A, C are updated again. In addition, in the paging cluster CL1, the data page originally used to store the data A5 has been marked as invalid; in the paging cluster CL6, the data page originally used to store the data C4 has been marked as invalid. At this time, the controller 331 has to perform steps S831, S832, and S839 of FIG. 33 and steps S839a, S839b, S839c, and S839d of FIG. 37 in response to the update of the materials A and C. At the same time, in the data block usage table, the paging cluster CL1 is represented by a cross, and corresponds to 4 with the paging cluster CL6.

在分頁叢集CL1中,原本用於存放資料A5的資料分頁與分頁叢集CL2、CL5相鄰。因此,當存放資料A5的資料分頁被標示為無效時,控制器331需判斷分頁叢集CL2、CL5的狀態是否需要改變。在分頁叢集CL6中,原本用於存放資料C4的資料分頁與分頁叢集CL5、CL10相鄰。因此,當存放資料C4的資料分頁被標示為無效時,控制器331需判斷分頁叢集CL5、CL10的狀態是否需要改變。In the paging cluster CL1, the data page originally used to store the material A5 is adjacent to the paging clusters CL2 and CL5. Therefore, when the data page storing the material A5 is marked as invalid, the controller 331 needs to judge whether the state of the page clusters CL2, CL5 needs to be changed. In the paging cluster CL6, the data page originally used to store the data C4 is adjacent to the paging clusters CL5 and CL10. Therefore, when the data page storing the material C4 is marked as invalid, the controller 331 needs to judge whether the state of the page clusters CL5, CL10 needs to be changed.

據此,在第38B圖中,隨著資料A、C的更新,控制器331須判斷分頁叢集CL2、CL5、CL10是否可被啟用。如第38B圖所示,分頁叢集CL2、CL4、CL5、CL7、CL10、CL12、CL13、CL15原本為關閉狀態CLoff。然而,隨著資料A、C被更新的緣故,控制器331確認在這些被設為關閉狀態CLoff的分頁叢集中,分頁叢集CL2、CL5可轉換為開啟狀態CLon,而分頁叢集CL10尚不可轉換為開啟狀態CLon。即,隨著資料A、C被更新,控制器S839d執行步驟S839d的判斷結果可能分為兩類,一類為執行步驟S839e的分頁叢集CL2、CL5,另一類則是不改變狀態的分頁叢集CL10。另一方面,對分頁叢集CL4、CL7、CL12、CL13、CL15而言,因為與其相鄰的資料分頁的狀態並未更新,所以分頁叢集CL4、CL7、CL12、CL13、CL15仍維持為關閉狀態CLoff。Accordingly, in Fig. 38B, as the data A, C are updated, the controller 331 must determine whether the paging clusters CL2, CL5, CL10 can be enabled. As shown in Fig. 38B, the paging clusters CL2, CL4, CL5, CL7, CL10, CL12, CL13, CL15 are originally in the off state CLoff. However, as the data A, C are updated, the controller 331 confirms that in these paging clusters set to the off state CLoff, the paging clusters CL2, CL5 can be converted to the on state CLon, and the paging cluster CL10 is not yet convertible to Turn on the state CLon. That is, as the data A, C are updated, the result of the determination by the controller S839d executing step S839d may be divided into two categories, one is the paging clusters CL2 and CL5 performing step S839e, and the other is the paging cluster CL10 which does not change state. On the other hand, for the paging clusters CL4, CL7, CL12, CL13, and CL15, the paging clusters CL4, CL7, CL12, CL13, and CL15 remain in the off state because the state of the adjacent material paging is not updated. .

比較第38A、38B圖可以看出,控制器331在判斷哪些分頁叢集的狀態可以轉換時,並不是依據分頁叢集在資料區塊852的位置而決定,而是更具在那些位置上的資料分頁隨著資料的更新而被標示為無效而判斷。換言之,控制器331會依據資料的更新,判斷有哪些分頁叢集會因應該些資料更新而須重新判斷相關的分頁叢集的開啟狀態CLon。As can be seen by comparing the 38A, 38B, the controller 331 determines whether the state of the paging cluster can be converted, not based on the position of the paging cluster in the data block 852, but more data paging at those locations. Judging as the data is updated and marked as invalid. In other words, the controller 331 determines, based on the update of the data, which paging clusters have to re-determine the open state CLon of the related paging clusters in response to the update of the data.

請同時參看第38B、38C圖。因為在第38B圖中,控制器331判斷分頁叢集CL2、CL5可被啟用,因此,在第38C圖中,分頁叢集CL2、CL5均被開啟(由格狀網底改變為無網底),且在資料區塊使用表中,分頁叢集CL2、CL5對應於0。Please also refer to Figures 38B and 38C. Because in FIG. 38B, the controller 331 determines that the paging clusters CL2, CL5 can be enabled, therefore, in the 38Cth, the paging clusters CL2, CL5 are all turned on (changed from the grid floor to the bottomless grid), and In the data block usage table, the paging clusters CL2, CL5 correspond to 0.

在第38C圖中,假設資料C、F、G再度被更新。連帶地,位在分頁叢集CL6中,原本用於存放資料C5的資料分頁已經被標示為無效;位在分頁叢集CL11中,原本用於存放資料F5的資料分頁已經被標示為無效;以及,位在分頁叢集CL14中,原本用於存放資料G5的資料分頁已經被標示為無效。在此同時,資料區塊使用表中,分頁叢集CL6、CL11、CL14均以叉號表示。In Figure 38C, it is assumed that the data C, F, G are updated again. In addition, in the paging cluster CL6, the data page originally used to store the data C5 has been marked as invalid; in the paging cluster CL11, the data page originally used to store the data F5 has been marked as invalid; In the paging cluster CL14, the data page originally used to store the data G5 has been marked as invalid. At the same time, in the data block usage table, the paging clusters CL6, CL11, and CL14 are all represented by crosses.

在分頁叢集CL1中,原本用於存放資料C5的資料分頁與被預設為關閉狀態CLoff的分頁叢集CL7、CL10相鄰。因此,當存放資料C5的資料分頁被標示為無效時,控制器331需判斷分頁叢集CL7、CL10的狀態是否需要改變。在分頁叢集CL11中,原本用於存放資料F5的資料分頁與分頁叢集CL12、CL15相鄰。因此,當存放資料F5的資料分頁被標示為無效時,控制器331需判斷分頁叢集CL12、CL15的狀態是否需要改變。在分頁叢集CL14中,原本用於存放資料G5的資料分頁同樣與分頁叢集CL15相鄰。因此,當存放資料G5的資料分頁被標示為無效時,控制器331需判斷分頁叢集CL15的狀態是否需要改變。據此,在第38C圖中,隨著資料C、F、G的更新,控制器331須判斷分頁叢集CL7、CL10、CL12、CL15是否可被啟用。關於控制器331判斷分頁叢集CL7、CL10、CL12、CL15是否符合開啟條件並可被轉換為開啟狀態CLon的細節此處不再詳述。In the paging cluster CL1, the data page originally used to store the material C5 is adjacent to the paging clusters CL7, CL10 which are preset to the closed state CLoff. Therefore, when the data page storing the material C5 is marked as invalid, the controller 331 needs to judge whether the state of the page clusters CL7, CL10 needs to be changed. In the paging cluster CL11, the data page originally used to store the data F5 is adjacent to the paging clusters CL12 and CL15. Therefore, when the data page storing the material F5 is marked as invalid, the controller 331 needs to judge whether the state of the page clusters CL12, CL15 needs to be changed. In the paging cluster CL14, the data page originally used to store the data G5 is also adjacent to the paging cluster CL15. Therefore, when the data page storing the material G5 is marked as invalid, the controller 331 needs to judge whether the state of the paged cluster CL15 needs to be changed. Accordingly, in Fig. 38C, as the data C, F, G are updated, the controller 331 has to determine whether the paging clusters CL7, CL10, CL12, CL15 can be enabled. Details regarding whether the controller 331 determines whether the paging clusters CL7, CL10, CL12, CL15 meet the ON condition and can be converted to the ON state CLon will not be described in detail herein.

如第38C圖所示,分頁叢集CL4、CL7、CL10、CL12、CL13、CL15原本為關閉狀態CLoff。然而,隨著資料C、F、G被更新的緣故,控制器331確認在這些被設為關閉狀態CLoff的分頁叢集中,分頁叢集CL15可轉換為開啟狀態CLon,而分頁叢集CL7、CL10、CL12、CL15尚不可轉換為開啟狀態CLon。另一方面,對分頁叢集CL4而言,因為與其相鄰的資料分頁的狀態並未更新,所以分頁叢集CL4仍維持為關閉狀態CLoff。As shown in Fig. 38C, the paging clusters CL4, CL7, CL10, CL12, CL13, CL15 are originally in the off state CLoff. However, as the data C, F, G are updated, the controller 331 confirms that in these paging clusters set to the off state CLoff, the paging cluster CL15 can be converted to the on state CLon, and the paging clusters CL7, CL10, CL12 CL15 is not yet convertible to the on state CLon. On the other hand, for the paging cluster CL4, since the state of the material paging adjacent thereto is not updated, the paging cluster CL4 remains in the OFF state CLoff.

請同時參看第38C、38D圖。因為在第38C圖中,控制器331判斷分頁叢集CL15可被啟用,因此,分頁叢集CL15由第38C圖的格狀網底改變為第38D圖的無網底。且,在第38D圖的資料區塊使用表中,分頁叢集CL15對應於0。Please also refer to Figures 38C and 38D. Since in the Fig. 38C, the controller 331 judges that the paged cluster CL15 can be enabled, the paged cluster CL15 is changed from the latticed bottom of Fig. 38C to the bottomless of the 38D. Further, in the data block use table of Fig. 38D, the paging cluster CL15 corresponds to 0.

在第38D圖中,假設資料D、E、I、J再度被更新。其中,控制器331執行第33圖的步驟S831、S832、S833、S835、S836以寫入資料I2、J2。因此,資料I2、J2被控制器331存放在開啟後的分頁叢集CL2、CL5的資料分頁。連帶的,在第38D圖的資料區塊使用表中,分頁叢集CL2對應於1,且分頁叢集CL5對應於1。由於資料I2、J2被存放在原先預設為關閉狀態CLoff並經轉換為開啟狀態CLon的分頁叢集內,代表資料I2、J2並不涉及分頁叢集的轉換狀態的判斷。因此,控制器331並不需要判斷有哪些分頁叢集與存放資料I2、J2的資料分頁相鄰。In Fig. 38D, it is assumed that the data D, E, I, J are updated again. The controller 331 executes steps S831, S832, S833, S835, and S836 of FIG. 33 to write the data I2 and J2. Therefore, the data I2, J2 are stored by the controller 331 in the data page of the opened page clusters CL2, CL5. Incidentally, in the data block usage table of Fig. 38D, the paging cluster CL2 corresponds to 1, and the paging cluster CL5 corresponds to 1. Since the data I2, J2 are stored in the paging cluster originally scheduled to be the off state CLoff and converted to the on state CLon, the representative data I2, J2 does not involve the judgment of the transition state of the paging cluster. Therefore, the controller 331 does not need to determine which paged clusters are adjacent to the data pages storing the data I2, J2.

此外,位在分頁叢集CL8中,原本用於存放資料D5的資料分頁已經被標示為無效;位在分頁叢集CL9中,原本用於存放資料E4的資料分頁被標示為無效,且資料E5儲存於分頁叢集Cl9的另一個資料分頁。接著,控制器331需判斷資料D、E的更新是否影響相關的分頁叢集的開啟狀態CLon。In addition, in the paging cluster CL8, the data page originally used to store the data D5 has been marked as invalid; in the paging cluster CL9, the data page originally used to store the data E4 is marked as invalid, and the data E5 is stored in Another data pagination of the pagination cluster Cl9. Next, the controller 331 needs to determine whether the update of the data D, E affects the open state CLon of the associated paged cluster.

在分頁叢集CL8中,原本用於存放資料D5的資料分頁與被預設為關閉狀態CLoff的分頁叢集CL12相鄰。因此,控制器331需判斷分頁叢集CL12的狀態是否需要改變。在分頁叢集CL9中,原本用於存放資料E4的資料分頁與分頁叢集CL13相鄰。因此,控制器331需判斷分頁叢集CL13的狀態是否需要改變。據此,在第38D圖中,隨著資料D、E的更新,控制器331判斷分頁叢集CL12可被啟用,但分頁叢集CL13尚無法啟用。In the paging cluster CL8, the data page originally used to store the material D5 is adjacent to the page cluster CL12 which is preset to the closed state CLoff. Therefore, the controller 331 needs to judge whether or not the state of the paging cluster CL12 needs to be changed. In the paging cluster CL9, the data page originally used to store the material E4 is adjacent to the paging cluster CL13. Therefore, the controller 331 needs to judge whether or not the state of the paging cluster CL13 needs to be changed. Accordingly, in Fig. 38D, as the data D, E are updated, the controller 331 determines that the paged cluster CL12 can be enabled, but the paged cluster CL13 is not yet enabled.

承上,在第38D圖中,控制器331已經確認分頁叢集CL12可轉換為開啟狀態CLon,因此,在第38E圖中,分頁叢集CL12未以網底標示,且在資料區塊使用表中,分頁叢集CL12對應於0。另須留意的是,無論是因為更新資料或是判斷分頁叢集可轉換為開啟狀態CLon之判斷結果等。控制器331都需要同步更改在資料區塊使用表的相關紀錄。In the figure 38D, the controller 331 has confirmed that the paged cluster CL12 can be converted into the on state CLon. Therefore, in the 38E picture, the paged cluster CL12 is not marked with the bottom of the network, and in the data block use table, The paged cluster CL12 corresponds to zero. It should also be noted that whether it is because of updating the data or judging the paging cluster can be converted into the judgment result of the open state CLon. The controller 331 needs to synchronously change the relevant records in the data block usage table.

關於第38E~38H圖的細節均可類推前述說明得出,此處不再詳述。簡言之,在第38E圖中,隨著資料E的更新,儲存資料E5的資料分頁被設為無效,連帶使分頁叢集CL10、CL13符合開啟條件。因此,在第37F圖中,分頁叢集CL10、CL13被設為開啟狀態CLon。在第37F圖中,隨著資料B的更新,儲存資料B5的資料分頁被設為無效,連帶使分頁叢集CL4、CL7可轉換為開啟狀態CLon。因此,在第38G圖中,分頁叢集CL4、CL7被設為開啟狀態CLon。在第38G圖中,所有原本被預設為關閉狀態CLoff的分頁叢集已經全部轉換為開啟狀態CLon,並陸續用於儲存新的資料。在第38H圖中,分頁叢集CL4、CL7也開始用於儲存資料O、P的更新版本。The details of the figures 38E~38H can be derived from the foregoing description and will not be described in detail herein. In short, in the 38E picture, as the data E is updated, the data page of the stored material E5 is set to be invalid, and the paging clusters CL10 and CL13 are associated with the opening condition. Therefore, in the FIG. 37F, the paging clusters CL10 and CL13 are set to the on state CLon. In Fig. 37F, as the data B is updated, the data page of the stored data B5 is set to be invalid, and the paging clusters CL4 and CL7 can be converted into the on state CLon. Therefore, in the 38Gth diagram, the paging clusters CL4 and CL7 are set to the on state CLon. In Fig. 38G, all the paging clusters that were originally scheduled to be in the off state CLoff have all been converted to the on state CLon, and are successively used to store new data. In Figure 38H, the paging clusters CL4, CL7 are also used to store updated versions of the data O, P.

由第38A~38H圖可以看出,控制器331使用原本預設為開啟狀態CLon的分頁叢集CL1、CL3、CL4、CL6、CL9、CL11、CL14與CL16存放資料時,會依照該些分頁叢集在資料區塊的排列順序,由左而右、由上而下先後用於存放資料。As can be seen from the figures 38A-38H, when the controller 331 stores the data using the paging clusters CL1, CL3, CL4, CL6, CL9, CL11, CL14 and CL16 which are originally set to the ON state CLon, the controller will follow the paging clusters. The order of the data blocks is used to store data from left to right and top to bottom.

另一方面,對原本預設為關閉狀態CLoff的叢集分頁叢集CL2、CL4、CL5、CL7、CL10、CL12、CL13與CL15而言,其轉換為開啟狀態CLon的順序會受到那些資料被更新、被更新之資料的位置等因素而影響。也就是說,原本預設為關閉狀態CLoff的叢集分頁叢集CL2、CL4、CL5、CL7、CL10、CL12、CL13與CL15實際轉換為開啟狀態CLon的順序並不是依照該些分頁叢集在資料區塊的排列位置而決定。On the other hand, for the cluster paging clusters CL2, CL4, CL5, CL7, CL10, CL12, CL13 and CL15 which are originally set to the off state CLoff, the order in which they are converted to the on state CLon is affected by those data being updated. The location of the updated information is affected by factors such as the location. That is to say, the order in which the cluster paging clusters CL2, CL4, CL5, CL7, CL10, CL12, CL13, and CL15 which are originally set to the off state CLoff are actually converted to the on state CLon is not in accordance with the paging clusters in the data block. It is decided by arranging the positions.

承上,本揭露的實施例基於全盤性的考量,針對記憶體裝置在在寫入階段、垃圾回收階段、讀取階段等面向加以管理。在考慮這些面向後提出的資料管理方法,能確保記憶體裝置能以較有效率的方式達到資料清除的目的。In view of the above, the embodiment of the present disclosure manages the memory device in the writing phase, the garbage collection phase, the reading phase, and the like based on the overall consideration. Considering these post-oriented data management methods, it can ensure that the memory device can achieve data clearing in a more efficient manner.

首先,根據本揭露構想的實施例,基於以資料分頁作為資料清除時的基本單位的作法,於記憶體裝置內提供擦除操作的功能。據此,控制器331可評估使用抹除操作與使用擦除操作所需的時間較短後,以較有效率的方式進行資料清除。First, in accordance with an embodiment of the presently disclosed concept, the function of an erase operation is provided within the memory device based on the practice of data paging as the basic unit of data clearing. Accordingly, the controller 331 can evaluate the data clearing in a more efficient manner after the time required to use the erase operation and the erase operation is shorter.

再者,為使擦除操作的執行效率提升,本揭露的實施例進一步提出以分頁叢集管理資料存放的作法。藉由分頁叢集的設置,同一筆資料的不同版本會儲存在資料區塊內的同一個分頁叢集內。其後,若需要對該筆資料的過時版本時,便可基於在分頁叢集內的資料分頁彼此相鄰的特性,大幅縮短執行擦除操作所需的時間。Moreover, in order to improve the execution efficiency of the erasing operation, the embodiment of the present disclosure further proposes a method of managing data storage by paging clustering. With the setting of paging clusters, different versions of the same data are stored in the same paging cluster within the data block. Thereafter, if an outdated version of the data is needed, the time required to perform the erase operation can be greatly shortened based on the characteristics of the data pages adjacent to each other in the paging cluster.

此外,本揭露還針對資料更新頻率所對應的熱度,動態調整存放資料所使用的分頁叢集。據此,記憶體區塊可提供較合適的分頁叢集儲存資料。當一筆資料熱度較高時,將該筆資料存入至包含資料分頁數量較多的分頁叢集;當該筆資料熱度較低時,則將該筆資料存入至包含資料分頁數量較少的分頁叢集內。In addition, the disclosure also dynamically adjusts the paging cluster used to store the data for the heat corresponding to the data update frequency. Accordingly, the memory block can provide a suitable paging cluster to store data. When the data is hot, the data is stored in a paged cluster containing a large number of pages; when the data is low, the data is stored in a page containing a small number of pages. Within the cluster.

更進一步的,本揭露的實施例還提出棋盤式規劃的方式,避免資料分頁所儲存的內容受到相鄰的資料分頁進行存取所干擾。因此,本揭露能在有效率的清除資料,達到資料安全的目的的同時,維持資料的正確性。Further, the embodiment of the present disclosure also proposes a checkerboard planning manner to prevent the content stored in the data paging from being interfered by accessing adjacent data pages. Therefore, the present disclosure can maintain the correctness of the data while efficiently clearing the data and achieving the purpose of data security.

綜上所述,雖然本發明已以實施例揭露如上,然其並非用以限定本發明。本發明所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾。因此,本發明之保護範圍當視後附之申請專利範圍所界定者為準。In conclusion, the present invention has been disclosed in the above embodiments, but it is not intended to limit the present invention. A person skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, the scope of the invention is defined by the scope of the appended claims.

10‧‧‧主控裝置 10‧‧‧Master control unit

11‧‧‧記憶體裝置 11‧‧‧ memory device

111、311‧‧‧控制器 111, 311‧‧‧ controller

115‧‧‧記憶體陣列 115‧‧‧ memory array

111a、3311‧‧‧快閃轉譯層 111a, 3311‧‧‧ flash translation layer

115a、215、P(1,1)、P(1,2)、P(1,3)、P(1,4)、P(2,1)、P(2,2)、P(2,3)、P(2,4)、P(3,1)、P(3,2)、P(3,3)、P(3,4)、P(4,1)、P(4,2)、P(4,3)、P(4,4)、451a、451b、451c、451d、451e、451f、452a、452b、452c、452d、452e、452f、453a、453b、453c、453d、453e、453f、P(1,3)、P(2,3)、P(3,3)、P(4,4)、P(4,5)、P(4,6)、P(1,7)、P(2,7)、P(3,7)‧‧‧資料分頁 115a, 215, P(1,1), P(1,2), P(1,3), P(1,4), P(2,1), P(2,2), P(2, 3), P(2,4), P(3,1), P(3,2), P(3,3), P(3,4), P(4,1), P(4,2 ), P(4,3), P(4,4), 451a, 451b, 451c, 451d, 451e, 451f, 452a, 452b, 452c, 452d, 452e, 452f, 453a, 453b, 453c, 453d, 453e, 453f, P(1,3), P(2,3), P(3,3), P(4,4), P(4,5), P(4,6), P(1,7) , P(2,7), P(3,7)‧‧‧ data paging

215a‧‧‧記憶胞 215a‧‧‧ memory cells

335‧‧‧快取記憶體 335‧‧‧ Cache memory

333‧‧‧記憶體陣列 333‧‧‧ memory array

3313‧‧‧控制韌體層 3313‧‧‧Control firmware layer

333a‧‧‧敏感資料儲存區 333a‧‧ Sensitive data storage area

333b‧‧‧非敏感資料儲存區 333b‧‧‧ non-sensitive data storage area

3311a‧‧‧位址轉譯器 3311a‧‧‧ Address Translator

3311b‧‧‧資料區塊分配器 3311b‧‧‧Data Block Distributor

3311c‧‧‧垃圾回收器 3311c‧‧‧Garbage Collector

3311d‧‧‧耗損平均器 3311d‧‧‧Abrasive averager

3311e‧‧‧擦除管理程式 3311e‧‧‧Erasing Manager

3313a‧‧‧讀取功能 3313a‧‧‧Read function

3313b‧‧‧程式化功能 3313b‧‧‧ Stylized function

3313c‧‧‧抹除功能 3313c‧‧‧Erase function

3313d‧‧‧擦除功能 3313d‧‧‧Erase function

40、20、41、42、23、BLKa、BLKb、BLKc、BLKd、BLKe、BLKf、BLKg、BLKh、BLKi、BLKj、BLKl、651、652、653、703、713、712、80、802、852、853‧‧‧資料區塊 40, 20, 41, 42, 23, BLKa, BLKb, BLKc, BLKd, BLKe, BLKf, BLKg, BLKh, BLKi, BLKj, BLKl, 651, 652, 653, 703, 713, 712, 80, 802, 852, 853‧‧‧data block

S501、S501a、S501b、S503、S503a、S503b、S505、S507、S507a、S507b、S509、S509a、S509b、S601、S603、S603a、S603b、S605、S607、S609、S611、S613、S615、S71、S73、S75、S711a、S711b、S711c、S711d、S715a、S715b、S731a、S731b、S731c、S731d、S731e、S731f、S731g、S735a、S735b、S735c、S735d、S735e、S735f、S735g、S735h、S735i、S81、S83、S831、S832、S833、S834、S835、S836、S837、S838、S839、S901、S903、S905a、S905b、S905c、S905d、S907、S909、S911、S913‧‧‧步驟 S501, S501a, S501b, S503, S503a, S503b, S505, S507, S507a, S507b, S509, S509a, S509b, S601, S603, S603a, S603b, S605, S607, S609, S611, S613, S615, S71, S73, S75, S711a, S711b, S711c, S711d, S715a, S715b, S731a, S731b, S731c, S731d, S731e, S731f, S731g, S735a, S735b, S735c, S735d, S735e, S735f, S735g, S735h, S735i, S81, S83, S831, S832, S833, S834, S835, S836, S837, S838, S839, S901, S903, S905a, S905b, S905c, S905d, S907, S909, S911, S913‧‧

A、B、C、D、A1、A2、A3、A4、A5、A6、X7、X8、X9、X10、X11、X12、X13、X14、Y6、Y7、Y8、A7、A8、A9、A10、A11、A12、A13、A14、A15、A16、A17、D6、D7、D8、D9、I2、I3、B2、B3、B4、B5、M2、M3、M4、J2、J3、J4、J5、C2、C3、C4、C5、N2、N3、D2、D3、D4、D5、E2、E3、E4、E5、F1、F2、F3、F4、F5、K2、K3、Q1、Q2、G2、G3、G4、G5、L2、L3、L4、H2、H3、H4、H5、H6‧‧‧資料 A, B, C, D, A1, A2, A3, A4, A5, A6, X7, X8, X9, X10, X11, X12, X13, X14, Y6, Y7, Y8, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, D6, D7, D8, D9, I2, I3, B2, B3, B4, B5, M2, M3, M4, J2, J3, J4, J5, C2 C3, C4, C5, N2, N3, D2, D3, D4, D5, E2, E3, E4, E5, F1, F2, F3, F4, F5, K2, K3, Q1, Q2, G2, G3, G4, G5, L2, L3, L4, H2, H3, H4, H5, H6‧‧‧ Information

333a‧‧‧敏感資料儲存區 333a‧‧ Sensitive data storage area

333b‧‧‧非敏感資料儲存區 333b‧‧‧ non-sensitive data storage area

CL1、CL2、CL3、CL4、CL5、CL6、CL7、CL8、CL9、CL10、CL11、CL12、CL13、CL14、CL15、CL16、CL(1,1)、CL(1,2)、CL(1,3)、CL(1,4)、CL(2,1)、CL(2,2)、CL(2,3)、CL(2,4)、CL(3,1)、CL(3,2)、CL(3,3)、CL(3,4)、CL(4,1)、CL(4,2)、CL(4,3)、CL(4,4)‧‧‧分頁叢集 CL1, CL2, CL3, CL4, CL5, CL6, CL7, CL8, CL9, CL10, CL11, CL12, CL13, CL14, CL15, CL16, CL(1,1), CL(1,2), CL(1, 3), CL (1, 4), CL (2, 1), CL (2, 2), CL (2, 3), CL (2, 4), CL (3, 1), CL (3, 2 ), CL(3,3), CL(3,4), CL(4,1), CL(4,2), CL(4,3), CL(4,4)‧‧ ‧pound cluster

335a‧‧‧資料區塊分級表 335a‧‧‧Information Block Rating Table

335b‧‧‧資料區塊使用表 335b‧‧‧Data Block Usage Table

335c‧‧‧位址映射表 335c‧‧‧ Address Mapping Table

744、751a、751b‧‧‧資料層級DG2的分頁叢集 744, 751a, 751b‧‧‧ paged clusters of data level DG2

Th‧‧‧臨限值 Th‧‧‧ threshold

Th_L‧‧‧較低臨限值 Th_L‧‧‧low threshold

Th_H‧‧‧較高臨限值 Th_H‧‧‧high threshold

第1圖,其係記憶體裝置之示意圖。 第2A~2C圖,其係習用技術的記憶體裝置,以異地更新方式儲存資料之示意圖。 第3A圖,其係資料分頁的記憶胞存有資料之示意圖。 第3B圖,其係針對原本存放資料位元”1”的記憶胞,改以資料位元”0”進行再程式化之示意圖。 第4圖,其係依據本揭露構想的實施例,於控制器設置操作管理程式與擦除功能之示意圖。 第5A-5D,其係對一個選定的資料分頁進行再程式化時,對與該選定的資料分頁相鄰的資料分頁造成影響之示意圖。 第 6A-6E圖,其係擬進行擦除操作的資料分頁的位置所影響之其他資料分頁的個數之示意圖。 第7A、7B、7C圖,其係說明隨著待擦除的資料分頁的位置不同,受干擾的資料分頁數量也隨著改變之示意圖。 第8A圖,其係依照待擦除資料分頁的排列順序,對資料分頁進行擦除操作之示意圖。 第8B圖,其係未依照待擦除資料分頁的排列順序,對資料分頁進行擦除操作之示意圖。 第9圖,其係對資料區塊中,排列為3*3的資料分頁進行擦除操作之示意圖。 第10A圖,其係以一個包含4行與8列之資料分頁的資料區塊為例,執行抹除操作之示意圖。 第10B圖,其係以一個包含4行與8列之資料分頁的資料區塊為例,執行擦除指令之示意圖。 第11圖,其係控制器對抹除操作與擦除操作評估所需時間後,選擇操作類別之流程圖。 第12圖,其係根據本揭露構想之記憶裝置之方塊圖。 第13A、13B、13C圖,其似分別對應於三個資料層級DG的資料區塊BLK,以及該些資料區塊內的分頁叢集CL之示意圖。 第14圖,其係快取記憶體內部之示意圖。 第15圖,其係儲存資料A1時,將資料A1寫入對應於資料層級DG1的資料區塊之示意圖。 第16圖,其係儲存資料A2時,不再存入對應於資料層級DG1的資料區塊,而是將資料A2改為寫入至對應於資料層級DG2的資料區塊之示意圖。 第17A~17C圖,其係將資料A3、A4與A5寫入對應於資料層級DG2的資料區塊之示意圖。 第18圖,其係儲存資料A6時,不再存入對應於資料層級DG2的資料區塊,而是將資料A6存入至對應於資料層級DG3的資料區塊之示意圖。 第19圖,其係隨著資料的版本變化,改變與寫入資料對應之資料區塊所對應的資料層級DG之流程圖。 第20圖,其係本揭露針對存放資料時,因應資料的狀態,動態調整與該資料對應的分頁叢集的資料層級DG之示意圖。 第21圖,其係執行垃圾回收時,因應資料熱度而調整與資料對應的資料層級DG之流程圖。 第22A、22B圖,其係選擇需進行垃圾回收之資料區塊的流程圖。 第23圖,其係一個存有四筆資料並對應於第三個資料層級DG的資料區塊之示意圖。 第24圖,其係執行垃圾回收時,以一個預設的臨限值判斷應如何調整在一個資料區塊所存放的資料所對應之資料層級DG的流程圖。 第25A圖,其係針對垃圾回收之資料區塊,定義一個預設的臨限值之示意圖。 第25B圖,其係以一個預設的臨限值比較待進行垃圾回收之資料區塊內的資料熱度之示意圖。 第26圖,其係將進行垃圾回收之資料區塊內的資料,複製至同一個資料層級DG的資料區塊之示意圖。 第27圖,其係將進行垃圾回收之資料區塊內的資料,複製至低一個資料層級DG的資料區塊之示意圖。 第28A、28B圖,其係對進行垃圾回收之資料區塊進行抹除之示意圖。 第29圖,其係對資料區塊進行垃圾回收時,以兩個預設的臨限值判斷應如何調整資料所對應資料層級DG的流程圖。 第30A、30B圖,其係針對垃圾回收之資料區塊,定義兩個預設的臨限值之示意圖。 第30C圖,其係以兩個預設的臨限值比較待進行垃圾回收之資料區塊內的資料熱度之示意圖。 第31A圖,其係將進行垃圾回收之資料區塊內的資料,複製至低一個資料層級DG的資料區塊之示意圖。 第31B圖,其係將進行垃圾回收之資料區塊內的資料,複製至高一個資料層級DG的資料區塊之示意圖。 第31C圖,其係將進行垃圾回收之資料區塊內的資料,複製至同一個資料層級DG的資料區塊之示意圖。 第32A、32B圖,其係以棋盤式配置方式,規劃分頁叢集的使用狀態之示意圖。 第33圖,其係針對棋盤式配置的分頁叢集要如何決定寫入資料分頁的流程圖。 第34圖,其係一種產生棋盤式配置的分頁叢集的流程圖。 第35圖,其係以對應於資料層級DG2的資料區塊為例,搭配第34圖的流程所定義的棋盤式配置的分頁叢集之示意圖。 第36圖,其係採用棋盤式配置時,原本被設為關閉狀態的分頁叢集應該如何判斷相鄰的分頁叢集的使用狀態,進而從關閉狀態改變為開啟狀態之示意圖。 第37圖,其係採用棋盤式配置時,控制器因應資料所寫入的位置,確認分頁叢集的狀態是否隨著改變的流程圖。 第38A~38H圖,其係以多筆資料的寫入與更新過程,說明如何在使用棋盤式規劃的資料區塊內,因應分頁叢集的狀態而存放資料之示意圖。Figure 1, which is a schematic diagram of a memory device. 2A~2C, which is a schematic diagram of a memory device of a conventional technology for storing data in an off-site update manner. Figure 3A is a schematic diagram of the data stored in the memory cells of the data page. Figure 3B is a schematic diagram of the reprogramming of the memory cell originally storing the data bit "1" by the data bit "0". FIG. 4 is a schematic diagram of setting an operation management program and an erasing function in a controller according to an embodiment of the present disclosure. 5A-5D, which is a schematic diagram of the impact on the page of data adjacent to the selected data page when reprogramming a selected data page. Figure 6A-6E, which is a schematic diagram of the number of other data pages affected by the location of the data page to be erased. 7A, 7B, and 7C are diagrams illustrating the number of pages of the interfered data as the position of the data to be erased is different. FIG. 8A is a schematic diagram of performing an erase operation on a data page according to an arrangement order of pages to be erased. FIG. 8B is a schematic diagram of the erasing operation of the data page according to the arrangement order of the pages to be erased. Figure 9 is a schematic diagram showing the erasing operation of data pages arranged in 3*3 in the data block. Figure 10A is a schematic diagram of performing an erase operation by taking a data block containing 4 rows and 8 columns of data pages as an example. FIG. 10B is a schematic diagram of executing an erase command by taking a data block including 4 rows and 8 columns of data pages as an example. Figure 11 is a flow chart for selecting an operation category after the controller has evaluated the time required for the erase operation and the erase operation. Figure 12 is a block diagram of a memory device in accordance with the present disclosure. Figures 13A, 13B, and 13C are diagrams corresponding to the data blocks BLK of the three data level levels DG and the paged clusters CL within the data blocks, respectively. Figure 14, which is a schematic diagram of the internal memory of the cache. Figure 15 is a schematic diagram of the data A1 written to the data block corresponding to the data level DG1 when the data A1 is stored. In Fig. 16, when the data A2 is stored, the data block corresponding to the data level DG1 is no longer stored, but the data A2 is written to the data block corresponding to the data level DG2. Figures 17A-17C are diagrams showing the data A3, A4, and A5 being written to the data block corresponding to the data level DG2. In Fig. 18, when the data A6 is stored, the data block corresponding to the data level DG2 is no longer stored, but the data A6 is stored in the data block corresponding to the data level DG3. Figure 19 is a flow chart of changing the data level DG corresponding to the data block corresponding to the written data as the version of the data changes. Figure 20 is a schematic diagram showing the data level DG of the paging cluster corresponding to the data dynamically adjusted according to the state of the data when the data is stored. Figure 21 is a flow chart of adjusting the data level DG corresponding to the data in response to the heat of the data when performing garbage collection. 22A, 22B, which is a flow chart for selecting a data block to be garbage collected. Figure 23 is a schematic diagram of a data block containing four pieces of data and corresponding to the third data level DG. Figure 24 is a flow chart for determining how to adjust the data level DG corresponding to the data stored in a data block by a predetermined threshold when performing garbage collection. Figure 25A, which is a schematic diagram of a preset threshold for a data block for garbage collection. Figure 25B is a schematic diagram comparing the heat of data in a data block to be garbage collected with a preset threshold. Figure 26 is a schematic diagram of copying data in a data block for garbage collection to a data block of the same data level DG. Figure 27 is a schematic diagram of copying data in a data block for garbage collection to a data block of a lower data level DG. Figures 28A and 28B are schematic diagrams showing the erasure of the data block for garbage collection. Figure 29 is a flow chart for determining how to adjust the data level DG corresponding to the data when the data block is garbage collected with two preset thresholds. Figures 30A and 30B are schematic diagrams for defining two preset thresholds for the data block of garbage collection. Figure 30C is a schematic diagram comparing the heat of data in a data block to be garbage collected with two preset thresholds. Figure 31A is a schematic diagram of copying data in a data block for garbage collection to a data block of a lower data level DG. Figure 31B is a schematic diagram of copying data in a data block for garbage collection to a data block of a higher data level DG. Figure 31C is a schematic diagram of copying data in a data block for garbage collection to a data block of the same data level DG. 32A, 32B, which is a schematic diagram of the use state of the paging cluster in a checkerboard configuration. Figure 33 is a flow chart for how the paging cluster of the checkerboard configuration decides to write the data page. Figure 34 is a flow diagram of a paged cluster that produces a checkerboard configuration. Fig. 35 is a schematic diagram showing the paging cluster of the checkerboard configuration defined by the flow of the data layer level DG2, taking the data block corresponding to the data level DG2 as an example. In Fig. 36, when a checkerboard configuration is used, the paging cluster that was originally set to the off state should determine how the adjacent paging clusters are used, and thus change from the off state to the on state. In Fig. 37, when the checkerboard configuration is adopted, the controller confirms whether the state of the paging cluster changes according to the position written by the data. Figure 38A~38H, which is a process of writing and updating data in multiple data sheets, showing how to store data in response to the state of paged clusters in a data block using a checkerboard plan.

Claims (10)

一種記憶體裝置,包含: 一記憶體陣列,包含: 一第一儲存區域,對應於一第一資料層級,其中該第一儲存區域係包含排列為一I1行與一J1列的複數個第一子區域叢集,且各該第一子區域叢集係包含排列為一O1行與一P1列的複數個子區域,其中I1、J1、O1與P1係與該第一資料層級相關;以及 一第二儲存區域,對應於一第二資料層級,其中該第二儲存區域係包含排列為一I2行與一J2列的複數個第二子區域叢集,且各該第二子區域叢集係包含排列為一O2行與一P2列的複數個子區域,其中I2、J2、O2與P2係與該第二資料層級相關,且該等第一子區域叢集的數量大於該等第二子區域叢集的數量;以及 一控制器,電連接於該記憶體陣列,其中, 該控制器係利用該等第一子區域叢集中的一第一第一子區域叢集以及該等第二子區域叢集中的一第一第二子區域叢集之其中一者存取一第一資料,且 該控制器係利用該等第一子區域叢集中的一第二第一子區域叢集以及該等第二子區域叢集中的一第二第二子區域叢集之其中一者存取一第二資料,其中該控制器係隨著該第一資料的更新頻率而將該第一資料存放於該第一第一子區域叢集與該第二第一子區域叢集之一者, 其中,I1、I2、J1、J2、O1、O2、P1與P2均為正整數, I1與O1的乘積等於I2與O2的乘積,且J1與P1的乘積等於J2與P2的乘積。A memory device, comprising: a memory array, comprising: a first storage area corresponding to a first data level, wherein the first storage area comprises a plurality of first ones arranged in an I1 row and a J1 column a sub-region cluster, and each of the first sub-region clusters includes a plurality of sub-regions arranged in an O1 row and a P1 column, wherein I1, J1, O1, and P1 are associated with the first data level; and a second storage a region corresponding to a second data hierarchy, wherein the second storage region comprises a plurality of second sub-region clusters arranged in an I2 row and a J2 column, and each of the second sub-region clusters comprises an O2 array a plurality of sub-regions of a row and a P2 column, wherein the I2, J2, O2, and P2 systems are associated with the second data hierarchy, and the number of clusters of the first sub-regions is greater than the number of clusters of the second sub-regions; a controller electrically coupled to the memory array, wherein the controller utilizes a first first sub-region cluster of the first sub-region clusters and a first and second of the second sub-region clusters One of the sub-region clusters Accessing a first data, and the controller utilizes a second first sub-region cluster of the first sub-region clusters and a second second sub-region cluster of the second sub-region clusters One of the two accesses a second data, wherein the controller stores the first data in the first first sub-region cluster and the second first sub-region cluster along with the update frequency of the first data In one case, I1, I2, J1, J2, O1, O2, P1 and P2 are all positive integers, the product of I1 and O1 is equal to the product of I2 and O2, and the product of J1 and P1 is equal to the product of J2 and P2. 如申請專利範圍第1項所述之記憶體裝置,其中, 當該第一資料的更新頻率較低時,該控制器係將該第一資料存放於該第一第一子區域叢集所包含的該等個子區域中的一者;以及 當該第一資料的更新頻率較高時,該控制器係將該第一資料存放於該第一第二子區域叢集所包含的該等個子區域中的一者。The memory device of claim 1, wherein, when the update frequency of the first data is low, the controller stores the first data in the first first sub-region cluster One of the sub-regions; and when the update frequency of the first material is high, the controller stores the first data in the sub-regions included in the first second sub-region cluster One. 如申請專利範圍第2項所述之記憶體裝置,其中, 隨著該第一資料的更新,該控制器將該第一資料存放於該第一第二子區域叢集,並將該第一第一子區域叢集所包含的該等子區域標示無效的子區域。The memory device of claim 2, wherein, with the updating of the first data, the controller stores the first data in the first and second sub-region clusters, and the first The sub-regions contained in a sub-region cluster indicate invalid sub-regions. 如申請專利範圍第3項所述之記憶體裝置,其中,該控制器係透過下列兩種指令之一者,清除在該第一第一子區域叢集中,被標示為無效的子區域: 對該第一儲存區域執行一抹除指令;以及 對該第一第一子區域叢集所包含之該等子區域執行一擦除指令。The memory device of claim 3, wherein the controller clears the sub-area marked as invalid in the first first sub-region cluster by one of the following two instructions: The first storage area executes an erase command; and an erase command is executed on the sub-areas included in the first first sub-region cluster. 如申請專利範圍第4項所述之記憶體裝置,其中該控制器係透過該擦除指令,依照一列方向遞增與一行方向遞增的順序而擦除該第一第一子區域叢集所包含之該等子區域的內容。The memory device of claim 4, wherein the controller erases the inclusion of the first first sub-region cluster by increasing the order of increasing the row direction according to the column direction by the erasing command The content of the sub-region. 如申請專利範圍第1項所述之記憶體裝置,其中當該控制器將該第一資料存放於該第一第一子區域叢集所包含的該O1行與P1列的該等個子區域中的一者時,該控制器係隨著該第一資料的更新,依照一列方向遞增與一行方向遞增的順序儲存該第一資料。The memory device of claim 1, wherein the controller stores the first data in the sub-areas of the O1 row and the P1 column included in the first first sub-region cluster In one case, the controller stores the first data in an order of increasing in a row direction and increasing in a row direction as the first data is updated. 如申請專利範圍第1項所述之記憶體裝置,其中該第一第一子區域叢集在該第一儲存區域中的位置,與該第二第一子區域叢集在該第一儲存區域中的位置不相鄰。The memory device of claim 1, wherein the first first sub-region is clustered in the first storage region, and the second first sub-region is clustered in the first storage region. The location is not adjacent. 一種應用於記憶體裝置的資料管理方法,應用於包含一第一儲存區域與一第二儲存區域的一記憶體陣列,其中該第一儲存區域與該第二儲存區域係分別對應於一第一資料層級與一第二資料層級,其中 該第一儲存區域係包含排列為一I1行與一J1列的複數個第一子區域叢集,且各該第一子區域叢集係包含排列為一O1行與一P1列的複數個子區域,其中 該第二儲存區域係包含排列為一I2行與一J2列的複數個第二子區域叢集,且各該第二子區域叢集係包含排列為一O2行與一P2列的複數個子區域,其中該等第一子區域叢集的數量大於該等第二子區域叢集的數量,且該資料管理方法係包含以下步驟: 利用該等第一子區域叢集中的一第一第一子區域叢集以及該等第二子區域叢集中的一第一第二子區域叢集之其中一者存取一第一資料; 利用該等第一子區域叢集中的一第二第一子區域叢集以及該等第二子區域叢集中的一第二第二子區域叢集之其中一者存取一第二資料;以及, 隨著該第一資料的更新頻率而將該第一資料存放於該第一第一子區域叢集與該第二第一子區域叢集之一者,其中I1、J1、O1與P1係與該第一資料層級相關,而I2、J2、O2與P2係與該第二資料層級相關,其中,I1、I2、J1、J2、O1、O2、P1與P2均為正整數, I1與O1的乘積等於I2與O2的乘積,且J1與P1的乘積等於J2與P2的乘積。A data management method for a memory device is applied to a memory array including a first storage area and a second storage area, wherein the first storage area and the second storage area respectively correspond to a first a data hierarchy and a second data hierarchy, wherein the first storage region comprises a plurality of first sub-region clusters arranged in an I1 row and a J1 column, and each of the first sub-region clusters comprises an O1 row And a plurality of sub-regions of a P1 column, wherein the second storage region comprises a plurality of second sub-region clusters arranged in an I2 row and a J2 column, and each of the second sub-region clusters comprises an O2 row And a plurality of sub-regions of a P2 column, wherein the number of clusters of the first sub-regions is greater than the number of clusters of the second sub-regions, and the data management method comprises the steps of: utilizing the clusters of the first sub-regions One of the first first sub-region clusters and one of the first and second sub-region clusters of the second sub-region clusters accesses a first data; utilizing one of the first sub-region clusters One of the first sub-region clusters and one of the second and second sub-region clusters of the second sub-region clusters accesses a second data; and, the first data is updated with the frequency of the first data The data is stored in one of the first first sub-region cluster and the second first sub-region cluster, wherein I1, J1, O1 and P1 are related to the first data level, and I2, J2, O2 and P2 are Corresponding to the second data level, wherein I1, I2, J1, J2, O1, O2, P1 and P2 are positive integers, the product of I1 and O1 is equal to the product of I2 and O2, and the product of J1 and P1 is equal to J2. The product of P2. 如申請專利範圍第8項所述之資料管理方法,其中更包含以下步驟: 當該第一資料的更新頻率較低時,將該第一資料存放於該第一第一子區域叢集所包含的該等個子區域中的一者;以及 當該第一資料的更新頻率較高時,將該第一資料存放於該第一第二子區域叢集所包含的該等個子區域中的一者。The method for managing data according to claim 8 , further comprising the steps of: storing the first data in the first first sub-region cluster when the update frequency of the first data is low; One of the sub-regions; and when the update frequency of the first material is high, storing the first data in one of the sub-regions included in the first second sub-region cluster. 如申請專利範圍第9項所述之資料管理方法,其中更包含以下步驟: 隨著該第一資料的更新,將該第一資料係存放於該第一第二子區域叢集;以及, 將該第一第一子區域叢集所包含的該等子區域標示為無效的子區域。The method for managing data according to claim 9 , further comprising the steps of: storing the first data system in the first and second sub-region clusters as the first data is updated; and The sub-regions included in the first first sub-region cluster are marked as invalid sub-regions.
TW106136746A 2017-10-25 2017-10-25 Memory device and data management method thereof TWI629592B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW106136746A TWI629592B (en) 2017-10-25 2017-10-25 Memory device and data management method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW106136746A TWI629592B (en) 2017-10-25 2017-10-25 Memory device and data management method thereof

Publications (2)

Publication Number Publication Date
TWI629592B TWI629592B (en) 2018-07-11
TW201917583A true TW201917583A (en) 2019-05-01

Family

ID=63640664

Family Applications (1)

Application Number Title Priority Date Filing Date
TW106136746A TWI629592B (en) 2017-10-25 2017-10-25 Memory device and data management method thereof

Country Status (1)

Country Link
TW (1) TWI629592B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI770668B (en) * 2019-11-25 2022-07-11 旺宏電子股份有限公司 Operation method for artificial neural network

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI671631B (en) * 2018-08-01 2019-09-11 大陸商深圳大心電子科技有限公司 Memory management method and storage controller
TWI696073B (en) * 2019-04-02 2020-06-11 群聯電子股份有限公司 Memory control method, memory storage device and memory control circuit unit
CN111813325B (en) * 2019-04-12 2023-06-27 群联电子股份有限公司 Memory control method, memory storage device and memory control circuit unit
US11222693B2 (en) 2020-05-27 2022-01-11 Macronix International Co., Ltd. Data management method for memory and memory apparatus using the same

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8130554B1 (en) * 2008-09-29 2012-03-06 Emc Corporation Securely erasing flash-based memory
US8463983B2 (en) * 2009-09-15 2013-06-11 International Business Machines Corporation Container marker scheme for reducing write amplification in solid state devices
CN103458023B (en) * 2013-08-30 2016-12-28 清华大学 Distribution type flash memory storage
TWI625729B (en) * 2015-11-25 2018-06-01 旺宏電子股份有限公司 Data allocating method and electric system using the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI770668B (en) * 2019-11-25 2022-07-11 旺宏電子股份有限公司 Operation method for artificial neural network
US12327185B2 (en) 2019-11-25 2025-06-10 Macronix International Co., Ltd. Operation method for artificial neural network

Also Published As

Publication number Publication date
TWI629592B (en) 2018-07-11

Similar Documents

Publication Publication Date Title
TWI629592B (en) Memory device and data management method thereof
US8566504B2 (en) Dynamic metablocks
KR100849221B1 (en) Method for managing non-volatile memory, and memory-based apparatus including the non-volatile memory
CN100419714C (en) Flash memory access method, block replacement method and management device for flash memory file system
US8312203B2 (en) Semiconductor storage device and method of controlling a semiconductor storage device by allocating a physical block composed of plural pages to a group of logical addresses
US5860082A (en) Method and apparatus for allocating storage in a flash memory
US7882300B2 (en) Apparatus and method for managing nonvolatile memory
JP3708047B2 (en) Managing flash memory
US7818493B2 (en) Adaptive block list management
CN103425588B (en) Block management method of data storage device and flash memory
CN101382918B (en) NAND flash memory optimizing and managing method based on data interchange zone
KR101089150B1 (en) Nonvolatile Memory with Scheduled Reclaim Operations
CN108572922A (en) data storage device and operation method thereof
CN101278267A (en) Nonvolatile memory with scheduled reclamation
WO2005106673A1 (en) Nonvolatile storage device and data write method
US20170235489A1 (en) Data storage device and data maintenance method thereof
JP4738038B2 (en) Memory card
KR20090088858A (en) Worst Case Non-volatile Memory and Management Methods Using Control Data Management
KR20090108694A (en) How to use a direct data file system with a contiguous logical address space interface
KR20080038368A (en) Indexing file data into reprogrammable nonvolatile memory that stores data files directly
JP2008225576A (en) NAND flash memory control device
JP4636005B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US10810132B1 (en) Object based extent mapping for flash memory
CN109710173B (en) Memory device and data management method applied thereto
CN117555478A (en) Flash memory-based EEPROM (electrically erasable programmable read-Only memory) simulation read-write method