TWI470428B - Memory managing method for non-volatile memory and controller using the same - Google Patents

Memory managing method for non-volatile memory and controller using the same Download PDF

Info

Publication number
TWI470428B
TWI470428B TW97138243A TW97138243A TWI470428B TW I470428 B TWI470428 B TW I470428B TW 97138243 A TW97138243 A TW 97138243A TW 97138243 A TW97138243 A TW 97138243A TW I470428 B TWI470428 B TW I470428B
Authority
TW
Taiwan
Prior art keywords
memory
block
data
memory unit
unit
Prior art date
Application number
TW97138243A
Other languages
Chinese (zh)
Other versions
TW201015314A (en
Inventor
Chih Kang Yeh
Original Assignee
Phison Electronics Corp
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 Phison Electronics Corp filed Critical Phison Electronics Corp
Priority to TW97138243A priority Critical patent/TWI470428B/en
Publication of TW201015314A publication Critical patent/TW201015314A/en
Application granted granted Critical
Publication of TWI470428B publication Critical patent/TWI470428B/en

Links

Description

用於非揮發性記憶體的資料程式規劃系統、記憶體管 理方法及其控制器Data programming system, memory tube for non-volatile memory Method and controller

本發明關於一種記憶體管理方法,尤指一種用於非揮發性記憶體的子系統均勻抹除方法及其控制器。The invention relates to a memory management method, in particular to a subsystem uniform erasing method for non-volatile memory and a controller thereof.

諸如快閃記憶體儲存系統的非揮發性記憶體系統,由於其記憶體系統小巧的實體尺寸及非揮發性記憶體可重複程式規劃的能力,使得其使用性更為增加。快閃記憶體儲存系統小巧的實體尺寸,亦讓其在日趨普遍的電子裝置上的使用需求提高。使用快閃記憶體儲存系統的裝置包含,但不拘限於數位相機、數位攝錄影機、數位音樂播放器、可攜式電腦、全球定位裝置。快閃記憶體儲存系統的非揮發性記憶體可重複程式規劃的能力讓快閃記憶體儲存系統可以被重複使用。Non-volatile memory systems, such as flash memory storage systems, have increased their usability due to their compact physical size and non-volatile memory reprogramming capabilities. The compact physical size of the flash memory storage system also increases the need for use on increasingly popular electronic devices. Devices that use flash memory storage systems include, but are not limited to, digital cameras, digital video cameras, digital music players, portable computers, and global positioning devices. The ability of the non-volatile memory of the flash memory storage system to be reprogrammed allows the flash memory storage system to be reused.

一般來說,快閃記憶體儲存系統可包含快閃記憶卡及快閃記憶體晶片組。快閃記憶體晶片組一般包含快閃記憶體元件及一控制器。原則上,一快閃記憶體晶片組可組裝於一嵌入式系統。裝配或主系統的製造業者一般取得的快閃記憶體,如同其他配件,是以元件的形式呈現,然後,該快閃記憶體及其他配件會再被組裝到一主系統內。In general, a flash memory storage system can include a flash memory card and a flash memory chip set. A flash memory chip set typically includes a flash memory component and a controller. In principle, a flash memory chip set can be assembled in an embedded system. The flash memory generally obtained by the manufacturer of the assembly or main system, like other accessories, is presented in the form of components, and then the flash memory and other accessories are assembled into a main system.

雖然非揮發性記憶體,或更明確地說,快閃記憶體系統中的快閃記憶體儲存區塊可被重複程式規劃及抹除,每一個區塊或實體位置在耗損前,僅能以一特定的次數被抹 除,意即,在記憶體容量開始變小之前。換言之,每一個區塊具有一程式規劃及抹除循環限制。對於某些記憶體而言,在區塊被視為無法使用之前,一個區塊約可被抹除一萬次。而對於其他記憶體而言,在區塊被視為耗損之前,一個區塊約可被抹除十萬次或甚至百萬次。當一個區塊耗損而導致無法使用或快閃記憶體系統部分儲存容量的效能相當程度地降低時,可能會對快閃記憶體系統的使用者相當不利,例如:遺失已程式規劃的資料或無法程式規劃資料。Although non-volatile memory, or more specifically, flash memory storage blocks in a flash memory system, can be repeatedly programmed and erased, each block or physical location can only be used before consumption. a specific number of times is wiped Except, that is, before the memory capacity begins to get smaller. In other words, each block has a program plan and erase cycle limit. For some memories, a block can be erased about 10,000 times before the block is considered unusable. For other memory, a block can be erased about 100,000 times or even millions of times before the block is considered to be wasted. When a block is worn out and the performance of the memory capacity of the flash memory system is reduced to a considerable extent, it may be disadvantageous to users of the flash memory system, such as missing programmed data or Program planning information.

快閃記憶體系統區塊或實體位置的耗損,會因為每一個區塊程式規劃的次數而有所不同。假若一個區塊,或更明確地說,一儲存元件,被程式規劃一次,然後不再被重新的程式規劃,則程式規劃及抹除循環的次數將相對於耗損的區塊來得低。然而,假若一個區塊重複地寫入及抹除,例如,以一個循環,則該區塊的耗損程度將相對來得高。熟悉此技藝者應了解,由於主機(即存取或使用快閃記憶體系統的系統)常使用邏輯區塊位址來存取程式規劃於快閃記憶體系統的資料,假若一個主機重複地使用相同的邏輯區塊位址來重複寫入資料時,則快閃記憶體系統中相同的實體位置或區塊將被重複地寫入及抹除。The loss of the flash memory system block or physical location will vary depending on the number of times each block program is planned. If a block, or more specifically a storage component, is programmed once and then no longer being reprogrammed, the number of program programming and erase cycles will be lower relative to the worn block. However, if a block is repeatedly written and erased, for example, in a loop, the degree of wear of the block will be relatively high. Those skilled in the art should understand that since the host (ie, the system that accesses or uses the flash memory system) often uses the logical block address to access the data programmed by the program in the flash memory system, if a host repeatedly uses the data. When the same logical block address is used to repeatedly write data, the same physical location or block in the flash memory system will be repeatedly written and erased.

當一些區塊耗損而其餘區塊仍有效時,耗損的區塊會讓快閃記憶體系統的整體性能遭到影響。耗損的區塊除了本身會讓性能降低之外,快閃記憶體系統的整體性能亦會在有效區塊數量不足以程式規劃資料時受到影響。通常, 當快閃記憶體系統中出現過多的耗損區塊時,即使快閃記憶體系統仍然存在有效的其他區塊,但該快閃記憶體系統還是會被視為無法使用。當包含相當數量未耗損區塊的快閃記憶體系統被視為無法使用時,很多關聯於該快閃記憶體系統的資源將遭到浪費。When some blocks are worn out and the remaining blocks are still valid, the worn blocks can affect the overall performance of the flash memory system. In addition to degrading the performance of the block itself, the overall performance of the flash memory system will also be affected when the number of valid blocks is insufficient to program the data. usually, When there are too many worn blocks in the flash memory system, even if there are still other valid blocks in the flash memory system, the flash memory system will still be considered unusable. When a flash memory system containing a significant number of undepleted blocks is considered unusable, many of the resources associated with the flash memory system will be wasted.

為了讓快閃記憶體系統的區塊能夠均勻的耗損,常會進行一均勻抹除程序。均勻抹除程序,如熟悉此技藝者所知,是用來允許實體位置或關聯於特定邏輯區塊位址的區塊被替換,使得相同的邏輯區塊位址並不永遠屬於同一個實體位置或區塊。藉由變更區塊關聯的邏輯區塊位址,可以讓特定區塊比較不會在其他區塊耗損前先行耗損。In order to make the blocks of the flash memory system evenly wear out, a uniform erase process is often performed. The uniform erase procedure, as is known to those skilled in the art, is used to allow physical locations or blocks associated with a particular logical block address to be replaced such that the same logical block address does not always belong to the same physical location. Or block. By changing the logical block address associated with the block, it is possible to make the specific block less expensive before the other blocks are worn out.

最近,以區塊組合為單位來傳輸資料的非揮發性記憶體正快速地發展,歸因於該非揮發性記憶體具有比以單區塊為單位來傳輸資料的傳統非揮發性記憶體來得快的存取速度,或讓區塊管理更為容易或能減少一映射表的容量。換句話說,該非揮發性記憶體是以記憶體單元而非區塊為單位來管理資料。因此,資料亦以記憶體單元為單位來抹除。然而,記憶體單元中未使用的區塊有可能在抹除的同時亦被抹除,且讓記憶體單元的區塊產生使用上不平均的情況。因此,一種可以延長非揮發性記憶體壽命並用於非揮發性記憶體的子系統均勻抹除方法及其控制器為目前此一相關領域所亟需。Recently, non-volatile memory that transmits data in units of block combinations is rapidly evolving due to the fact that the non-volatile memory has a faster rate than conventional non-volatile memory that transmits data in units of a single block. Access speed, or make block management easier or reduce the capacity of a mapping table. In other words, the non-volatile memory manages data in units of memory cells rather than blocks. Therefore, the data is also erased in units of memory cells. However, unused blocks in the memory unit may be erased at the same time as the erase, and the blocks of the memory cells may be used unevenly. Therefore, a subsystem uniform erasing method which can prolong the life of non-volatile memory and is used for non-volatile memory and its controller are urgently needed in this related field.

由於先前技藝受限於上述問題。本發明之一目的為提供一種用於非揮發性記憶體的記憶體管理方法及其控制器,以防止記憶體單元的區塊在使用上的不平均。The prior art is limited by the above problems. It is an object of the present invention to provide a memory management method for a non-volatile memory and a controller thereof to prevent unevenness in use of blocks of memory cells.

本發明第一個目的為提供一種記憶體管理方法,用於具有複數個區塊的非揮發性記憶體,其中該等區塊具有第一數量,該記憶體管理方法包括以下步驟:(a)將該複數個區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量;(b)將資料寫入到該等記憶體單元當中的至少一區塊;(c)在該等記憶體單元其中之一所屬的區塊皆被寫入後,增加該所屬區塊皆被寫入的記憶體單元相對應的計數值;及(d)依據至少部份個記憶體單元的計數值,對該非揮發性記憶體進行一均勻抹除程序。A first object of the present invention is to provide a memory management method for a non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the memory management method comprises the following steps: (a) Combining the plurality of blocks into a plurality of memory cells, wherein the memory cells have a second number, and the second number is less than the first number; (b) writing data into the memory cells At least one block; (c) increasing a count value corresponding to the memory unit to which the belonging block is written after the blocks to which one of the memory cells belongs is written; and (d) A uniform erase process is performed on the non-volatile memory based on the count value of at least a portion of the memory cells.

根據本案構想,該記憶體管理方法在步驟(b)及(c)之間,進一步包括標記寫入區塊的步驟。According to the present concept, the memory management method further includes the step of marking the write block between steps (b) and (c).

根據本案構想,在將資料寫入到該等記憶體單元當中的至少一區塊後,更包括一在一參考表中標記該寫入區塊,用以標示該寫入區塊的使用狀態之步驟。According to the concept of the present invention, after the data is written to at least one of the memory cells, the method further includes marking the write block in a reference table to indicate the use state of the write block. step.

根據本案構想,在該等記憶體單元其中之一所屬的區塊皆被寫入後,更包括從參考表中刪除標示該記憶體單元寫入區塊的標記之步驟。According to the present invention, after the blocks to which one of the memory cells belongs are written, the step of deleting the mark indicating the memory cell write block from the reference table is further included.

根據本案構想,在所有標示該寫入區塊的標記被刪除後,該記憶體單元的計數值將增加一預設值。According to the present concept, after all the flags indicating the write block are deleted, the count value of the memory unit is increased by a preset value.

根據本案構想,在該寫入區塊的資料被抹除後,該記憶體單元的計數值將增加一預設值。According to the concept of the present invention, after the data of the write block is erased, the count value of the memory unit is increased by a preset value.

根據本案構想,該計數值代表記憶體單元的抹除次數累積值。According to the concept of the present invention, the count value represents the cumulative value of the erasing times of the memory unit.

根據本案構想,該記憶體管理方法在步驟(b)及(c)之間,進一步包括選取一無標記區塊並將另一資料寫入到該選取無標記區塊的步驟。According to the present invention, the memory management method between steps (b) and (c) further includes the steps of selecting an unmarked block and writing another material to the selected unmarked block.

根據本案構想,步驟(d)包括:(d1)計算至少部份記憶體單元的計數值;(d2)從至少部份的該等記憶體單元當中找出空的記憶體單元;及(d3)從空的記憶體單元當中再選擇一具有最少計數值的記憶體單元。According to the present concept, step (d) includes: (d1) calculating a count value of at least a portion of the memory cells; (d2) finding an empty memory cell from at least a portion of the memory cells; and (d3) A memory unit having the smallest count value is selected from the empty memory cells.

根據本案構想,該記憶體管理方法在步驟(a)及(b)之之,進一步包括以下步驟:(a1)從至少部份的該等記憶體單元當中選擇一記憶體單元;及(a2)從該被選擇的記憶體單元當中再選取至少一區塊。According to the present invention, the memory management method in the steps (a) and (b) further includes the steps of: (a1) selecting a memory unit from at least a portion of the memory units; and (a2) At least one block is selected from the selected memory cells.

根據本案構想,該被選擇的記憶體單元是隨機、依序、或經由一均勻抹除程序從至少部份的該等記憶體單元當中選擇出來。According to the present invention, the selected memory cells are randomly, sequentially, or selected from at least a portion of the memory cells via a uniform erase process.

根據本案構想,該選取區塊是隨機或依序從該被選擇的記憶體單元當中選取出來。According to the concept of the present invention, the selected block is randomly or sequentially selected from the selected memory cells.

根據本案構想,該資料比該記憶體單元的容量小。According to the present concept, the data is smaller than the capacity of the memory unit.

根據本案構想,該資料包括暫存物件、表格、映射檔或比該記憶體單元容量小的資料。According to the concept of the present case, the data includes a temporary object, a table, a map file or a data having a smaller capacity than the memory unit.

根據本案構想,該非揮發性記憶體包括多個通道或資料匯流排。According to the present concept, the non-volatile memory includes a plurality of channels or data bus bars.

本發明第二個目的為提供一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一系統均勻抹除構件,用以對該非揮發性記憶體進行第一均勻抹除程序,以選擇一記憶體單元;及一子系統均勻抹除構件,用以對該被選擇的記憶體單元進行第二均勻抹除程序,以從該被選擇的記憶體單元選取至少一區塊來程式規劃一資料;藉以防止被選擇的記憶體單元的區塊在使用上的不平均。A second object of the present invention is to provide a controller for non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the blocks are combined into a plurality of memories. a body unit, wherein the memory units have a second quantity, and the second quantity is less than the first quantity, the controller includes: a system uniform erasing member for performing a first uniform erasing of the non-volatile memory a program for selecting a memory unit; and a subsystem uniformly erasing member for performing a second uniform erase process on the selected memory unit to select at least one block from the selected memory unit The program plans a data; thereby preventing the block of the selected memory unit from being used unevenly.

本發明第三個目的為提供一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資料;一計算單元,耦合於該微處理器,用來計算每一個該等記憶體單元的計數值;及一選取器,耦合於該微處理器,用來選擇具有空的記憶體空間及最少計數值的記憶體單元,並用來從被選擇的記憶體單元中選取至少一區塊。A third object of the present invention is to provide a controller for non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the blocks are combined into a plurality of memories a body unit, wherein the memory units have a second quantity, and the second quantity is less than the first quantity, the controller includes: a microprocessor for programming the selected block and erasing the selected block Data, a computing unit coupled to the microprocessor for calculating a count value of each of the memory units; and a selector coupled to the microprocessor for selecting an empty memory space and A memory unit that has a minimum count value and is used to select at least one block from the selected memory unit.

根據本案構想,該選取器包括:一子系統均勻抹除構件,用以對該等記憶體單元其中一個進行第一均勻抹除程 序,以從該記憶體單元當中選取至少一區塊;及一系統均勻抹除構件,用以對該非揮發性記憶體進行第二均勻抹除程序,以選擇一記憶體單元來程式規劃一資料。According to the concept of the present invention, the selector includes: a subsystem uniform erasing member for performing a first uniform erasing process on one of the memory units a method for selecting at least one block from the memory unit; and a system for uniformly erasing the member for performing a second uniform erase process on the non-volatile memory to select a memory unit to program a data .

根據本案構想,該控制器進一步包括一緩衝記憶體用來程式規劃一參考表;及一標記管理單元,用來在該資料被程式規劃到該選取區塊時,於參考表中加入一標記,以標示該被選擇的記憶體單元的區塊的使用狀態,並在所有該被選擇的記憶體單元的區塊被使用後,用來刪除該參考表中的標記。According to the concept of the present invention, the controller further includes a buffer memory for programming a reference table; and a tag management unit for adding a mark to the reference table when the data is planned by the program to the selected block. To indicate the usage status of the block of the selected memory unit, and after all the blocks of the selected memory unit are used, to delete the mark in the reference table.

根據本案構想,該計數值代表每一個記憶體單元的抹除次數累積值。一旦被選擇的記憶體單元的區塊的標記被標記管理單元刪除,則該計算單元將把被選擇的記憶體單元的計數值增加一預設值。According to the present concept, the count value represents the cumulative value of the number of erasures for each memory cell. Once the tag of the block of the selected memory cell is deleted by the tag management unit, the computing unit will increase the count value of the selected memory cell by a predetermined value.

根據本案構想,該被選取區塊為一無標記區塊。該選取器依序或隨機從被選擇的記憶體單元當中選取一區塊。According to the concept of the present invention, the selected block is an unmarked block. The selector sequentially or randomly selects a block from the selected memory cells.

本發明第四個目的為提供一種資料程式規劃系統,包括:多個記憶體模組,每一個皆具有複數個區塊,各別記憶體模組的區塊被組合成各別的記憶體單元;及一控制器,用來控制複數個記憶體模組,包含:一計算單元,用來計算該記憶體單元的計數值;一選取器,用來選擇一具有空的記憶體空間且最少計數值的記憶體單元,並用來從被選擇的記憶體單元當中選取至少一區塊;及一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資 料;藉以防止被選擇的記憶體單元的區塊在使用上的不平均。A fourth object of the present invention is to provide a data program planning system, comprising: a plurality of memory modules each having a plurality of blocks, and the blocks of the respective memory modules are combined into respective memory units. And a controller for controlling a plurality of memory modules, comprising: a calculation unit for calculating a count value of the memory unit; and a selector for selecting an empty memory space with a minimum a value memory unit for selecting at least one block from the selected memory unit; and a microprocessor for programming the selected block and erasing the selected block Material; to prevent the block of the selected memory unit from being used unevenly.

根據本案構想,該控制器進一步包括一緩衝記憶體,用來程式規劃一參考表;及一標記管理單元,用來在該資料被程式規劃到該選取區塊時,於參考表中加入一標記,以標示該被選擇的記憶體單元的區塊的使用狀態,並在所有該被選擇的記憶體單元的區塊被使用後,用來刪除該參考表中的標記。According to the concept of the present invention, the controller further includes a buffer memory for programming a reference table; and a tag management unit for adding a tag to the reference table when the data is planned by the program to the selected block To indicate the usage status of the block of the selected memory unit, and to delete the mark in the reference table after all the blocks of the selected memory unit are used.

本發明第五個目的為提供一種記憶體管理方法,用於具有複數個區塊的非揮發性記憶體,其中該等區塊具有第一數量,該記憶體管理方法包括以下步驟:(e)將該複數個區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量;(b)計算每一個記憶體單元的第一計數值;(c)從該記憶體單元當中找出空的記憶體單元;(d)計算該記憶體單元的每一個區塊的第二計數值;(e)從該空的記憶體單元當中選擇一具有最少第一計數值的記憶體單元;(f)從該被選擇的記憶體單元當中選取一具有最少第二計數值的區塊;及(g)將一資料程式規劃到該選取區塊;藉以防止被選擇的記憶體單元的區塊在使用上的不平均。A fifth object of the present invention is to provide a memory management method for a non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the memory management method comprises the following steps: (e) Combining the plurality of blocks into a plurality of memory cells, wherein the memory cells have a second quantity, and the second quantity is less than the first quantity; (b) calculating a first count value of each memory unit; (c) finding an empty memory unit from the memory unit; (d) calculating a second count value for each block of the memory unit; (e) selecting one of the empty memory units a memory unit having a minimum first count value; (f) selecting a block having the least second count value from the selected memory cells; and (g) planning a data program to the selected block; Prevents the block of selected memory cells from being used unevenly.

根據本案構想,該第一計數值及該第二計數值分別代表每一個記憶體單元的抹除次數累積值及每一個區塊的抹除次數累積值。According to the concept of the present invention, the first count value and the second count value respectively represent an accumulated value of the erasing times of each memory unit and an accumulated value of the erasing times of each block.

本發明第六個目的為提供一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一計算單元,用來計算每一個記憶體單元的第一計數值及該記憶體單元每一個區塊的第二計數值;一選取器,用來選擇具有空的記憶體空間且最少第一計數值的記憶體單元,並用來從被選擇的記憶體單元當中選取具有最少第二計數值的一區塊;及一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資料;藉以防止被選擇的記憶體單元的區塊在使用上的不平均。A sixth object of the present invention is to provide a controller for non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the blocks are combined into a plurality of memories a body unit, wherein the memory units have a second quantity, and the second quantity is less than the first quantity, the controller includes: a calculating unit, configured to calculate a first count value of each memory unit and the memory a second count value of each block of the unit; a selector for selecting a memory unit having an empty memory space and a minimum first count value, and for selecting a least second of the selected memory units a block of the count value; and a microprocessor for programming the selected block and erasing the data on the selected block; thereby preventing the block of the selected memory unit from being used unevenly.

本發明第七個目的為提供一種資料程式規劃系統,包括:多個記憶體模組,每一個皆具有複數個區塊,各別記憶體模組的區塊被組合成各別的記憶體單元;及一控制器,用來控制複數個記憶體模組,包含:一計算單元,用來計算每一個記憶體單元的第一計數值及該記憶體單元每一個區塊的第二計數值;一選取器,用來選擇一具有空的記憶體空間且最少第一計數值的記憶體單元,並用來從被選擇的記憶體單元當中選取一具有最少第二計數值的區塊;及一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資料;藉以防止被選擇的記憶體單元的區塊在使用上的不平均。A seventh object of the present invention is to provide a data program planning system, comprising: a plurality of memory modules each having a plurality of blocks, and the blocks of the respective memory modules are combined into respective memory units. And a controller for controlling the plurality of memory modules, comprising: a calculating unit, configured to calculate a first count value of each memory unit and a second count value of each block of the memory unit; a selector for selecting a memory unit having an empty memory space and a minimum first count value, and for selecting a block having a minimum second count value from among the selected memory cells; The processor is configured to program the selected block and erase the data on the selected block; thereby preventing the block of the selected memory unit from being used unevenly.

體現本發明特徵與優點的一些典型實施例將在後段的說明中詳細敘述。應理解的是本發明能夠在不同的態樣上具有各種的變化,其皆不脫離本發明的範圍,且其中的說明及圖式在本質上係當作說明之用,而非用以限制本發明。Some exemplary embodiments embodying the features and advantages of the present invention are described in detail in the following description. It is to be understood that the invention is capable of various modifications in the various embodiments of the invention invention.

在本實施例中,將以四個通道非揮發性記憶體來呈現本發明,其中通道的數量與資料匯流排的數量相等。然而,熟悉此技藝者應了解,由多個區塊組合成記憶體單元的單一通道非揮發性記憶體亦可用於實現本發明的精神。第1圖為四個通道非揮發性記憶體的概念圖,其中,該非揮發性記憶體之區塊數為第一數量。如第1圖所示,四個通道非揮發性記憶體100具有四個記憶體模組101、102、103、104,且每一個記憶體模組皆具有n個區塊,n為一整數,故,上文所稱之第一數量,在本實施例中即為4n。舉例來說,記憶體模組101包含區塊A1~An、記憶體模組102包含區塊B1~Bn、記憶體模組103包含區塊C1~Cn、記憶體模組104包含區塊D1~Dn。為了增加四個通道非揮發性記憶體100的資料存取速度,並讓區塊管理更為容易或減少映射表的容量,將具有第一數量4n個區塊的非揮發性記憶體100中的記憶體模組101、102、103、104中的各別區塊組合成複數個記憶體單元U1~Un,其中,該等記憶體單元U1~Un具有第二數量,且該第二數量小於第一數量,在本實施例中該第二數量即為n。舉例來說,將區塊A1、區塊B1、區塊C1、區塊D1組合成記憶體單元U1。換句話說,該四個通道非揮發性記憶體100具有n個記憶體單元U1~Un。In the present embodiment, the invention will be presented in four channels of non-volatile memory in which the number of channels is equal to the number of data bus bars. However, those skilled in the art will appreciate that a single channel non-volatile memory composed of a plurality of blocks combined into a memory unit can also be used to implement the spirit of the present invention. Figure 1 is a conceptual diagram of four channels of non-volatile memory, wherein the number of blocks of the non-volatile memory is the first number. As shown in FIG. 1, the four-channel non-volatile memory 100 has four memory modules 101, 102, 103, and 104, and each memory module has n blocks, and n is an integer. Therefore, the first quantity referred to above is 4n in this embodiment. For example, the memory module 101 includes blocks A1 to An, the memory module 102 includes blocks B1 to Bn, the memory module 103 includes blocks C1 to Cn, and the memory module 104 includes blocks D1 and Dn. In order to increase the data access speed of the four-channel non-volatile memory 100 and make the block management easier or reduce the capacity of the mapping table, it will have the first number of 4n blocks in the non-volatile memory 100. The respective blocks in the memory modules 101, 102, 103, and 104 are combined into a plurality of memory cells U1 to Un, wherein the memory cells U1 to Un have a second number, and the second number is smaller than the number In one embodiment, the second quantity is n in this embodiment. For example, the block A1, the block B1, the block C1, and the block D1 are combined into the memory unit U1. In other words, the four-channel non-volatile memory 100 has n memory cells U1~Un.

再者,為了有效程式規劃(意即寫入與抹除)該非揮發性記憶體100,記憶體模組101、102、103、104中的各別區塊A1~An、B1~Bn、C1~Cn、D1~Dn,將邏輯性地組合成一系統區、一資料區、及一備用區。意即,該非揮發性記憶體100分別在每一個記憶體模組中具有一系統區、一資料區、及一備用區。一般來說,資料區約占整個記憶體模組的90%。Furthermore, in order to efficiently program (ie, write and erase) the non-volatile memory 100, the respective blocks A1~An, B1~Bn, C1~ in the memory modules 101, 102, 103, 104 Cn, D1~Dn will be logically combined into a system area, a data area, and a spare area. That is, the non-volatile memory 100 has a system area, a data area, and a spare area in each memory module. In general, the data area accounts for approximately 90% of the entire memory module.

系統區主要用來記載系統資料,諸如記憶體模組的區域碼;每一個區域的區塊碼;每一個區塊的頁碼;及邏輯/實體映射表等等。資料區主要用來儲存使用者資料。而備用區是用來提供替代的空區塊,以取代資料區中的區塊。詳細地說,當欲將一新的資料寫入到一個已經存有資料的位址時,則必須將既有的資料先行抹除。The system area is mainly used to record system data, such as the area code of the memory module; the block code of each area; the page number of each block; and the logical/entity mapping table. The data area is mainly used to store user data. The spare area is used to provide an alternative empty block to replace the block in the data area. In detail, when a new data is to be written to an address where the data already exists, the existing data must be erased first.

由於記憶體單元資料區內仍有效的記憶體單元為映射表中一個最小的管理單位,故在原始記憶體單元即將被抹除之前,儲存於其內的資料將會被複製到備用區內的另一個記憶體單元中。舉例來說,當一個新的資料即將被寫入到已經儲存有資料並位於資料區的記憶體單元U1時,則會從備用區當中選取另一個記憶體單元U2,然後,儲存於記憶體單元U1的有效資料將被複製到該記憶體單元U2,而新的資料會被寫入到記憶體單元U2。接下來,該記憶體單元U1上的資料會被抹除且該記憶體單元U1會被挪到備用區以供未來使用。同時,該記憶體單元U2會被挪到資料區。換句話說,該記憶體單元U1邏輯上屬於備用區,而該記憶體單元U2則邏輯上屬於資料區。熟悉此技藝者應了解,資料 區內的記憶體單元的邏輯關係可由邏輯/實體映射表來取得。再者,記憶體單元中每一個區塊皆具有相同的邏輯單元數量。意即,記憶體單元U1中的區塊A1、區塊B1、區塊C1、區塊D1皆具有相同的邏輯單元數量。Since the memory unit still in the memory unit data area is a minimum management unit in the mapping table, the data stored in the original memory unit will be copied to the spare area before the original memory unit is about to be erased. In another memory unit. For example, when a new data is about to be written to the memory unit U1 in which the data is already stored and located in the data area, another memory unit U2 is selected from the spare area and then stored in the memory unit. The valid data of U1 will be copied to the memory unit U2, and the new data will be written to the memory unit U2. Next, the data on the memory unit U1 will be erased and the memory unit U1 will be moved to the spare area for future use. At the same time, the memory unit U2 will be moved to the data area. In other words, the memory unit U1 logically belongs to the spare area, and the memory unit U2 logically belongs to the data area. Those familiar with this art should understand that the information The logical relationship of the memory cells in the region can be obtained by a logical/entity mapping table. Furthermore, each block in the memory unit has the same number of logical units. That is, the block A1, the block B1, the block C1, and the block D1 in the memory unit U1 all have the same number of logical units.

請參照第2圖。第2圖為依據本發明資料程式規劃系統的方塊圖。該資料程式規劃系統包含四個通道非揮發性記憶體100及一控制器210。該控制器210是用來控制該四個通道非揮發性記憶體100的操作,諸如資料的程式規劃、讀取、抹除等等。該控制器210包含一計算單元211、一選取器212、一微處理器213、一緩衝記憶體214、一標記管理單元215。該計算單元211、選取器212、標記管理單元214皆可經由程式規劃於控制器210或非揮發性記憶體100中記憶體區塊(未顯示)的硬體或韌體來執行。該微處理器213負責將資料程式規劃於區塊中及將資料從該區塊中抹除。Please refer to Figure 2. Figure 2 is a block diagram of a data program planning system in accordance with the present invention. The data programming system includes four channels of non-volatile memory 100 and a controller 210. The controller 210 is used to control the operation of the four-channel non-volatile memory 100, such as program planning, reading, erasing, and the like of data. The controller 210 includes a computing unit 211, a selector 212, a microprocessor 213, a buffer memory 214, and a tag management unit 215. The computing unit 211, the selector 212, and the tag management unit 214 can all be executed by hardware or firmware programmed in the controller 210 or the memory block (not shown) in the non-volatile memory 100. The microprocessor 213 is responsible for planning the data program in the block and erasing the data from the block.

該選取器212包含一系統均勻抹除構件2121。該系統均勻抹除構件2121主要對該四個通道非揮發性記憶體100進行一第一均勻抹除程序,以從備用區而非資料區當中選擇一記憶體單元。在另一個實施例中,該選取器212可進一步包含一子系統均勻抹除構件2122,該子系統均勻抹除構件2122會對該被選擇的記憶體單元進行一第二均勻抹除程序或經由標記管理單元215檢查儲存於參考表的標記,以從被選擇的記憶體單元當中選取至少一區塊作為資料程式規劃。The picker 212 includes a system uniform wiper member 2121. The system uniform erasing member 2121 performs a first uniform erasing process on the four-channel non-volatile memory 100 to select a memory unit from the spare area instead of the data area. In another embodiment, the picker 212 can further include a subsystem uniform eraser member 2122 that performs a second uniform erase procedure on the selected memory unit or via The tag management unit 215 checks the tags stored in the reference table to select at least one of the selected memory cells as the data program plan.

簡言之,上述第一均勻抹除程序包含下列步驟:(e)計算每一個記憶體單元U1~Un的第一計數值,其中該第一計數值代表每一個記憶體單元U1~Un的抹除次數累積值;(b)從記憶體單元U1~Un當中找出空的記憶體單元;及(c)從空的記憶體單元當中選擇一具有最少第一計數值的記憶體單元。在另一個實施例中,該第一計數值可包括每一個記憶體單元U1~Un的抹除次數、使用次序、錯誤修正碼(ECC)的修正位元數、讀取次數、使用次數、或閒置次數其中之一。In short, the first uniform erase program includes the following steps: (e) calculating a first count value of each of the memory units U1 to Un, wherein the first count value represents a wipe of each of the memory units U1 to Un. (b) finding an empty memory cell from the memory cells U1 to Un; and (c) selecting a memory cell having a minimum first count value from the empty memory cells. In another embodiment, the first count value may include the number of erasures of each memory unit U1~Un, the order of use, the number of correction bits of the error correction code (ECC), the number of readings, the number of uses, or One of the number of idle times.

上述第二均勻抹除程序包含下列步驟:(a)計算每一個區塊的第二計數值,其中該第二計數值代表四個通道非揮發性記憶體100中每一個區塊的抹除次數累積值;(b)從被選擇的記憶體單元的區塊當中找出空的區塊;及(c)從空的區塊當中選取至少一具有最少計數值的區塊。依據所欲程式規劃的資料的大小決定選取區塊的數量。所欲程式規劃的資料一般包含諸如:暫存物件、表格、映射檔或比記憶體單元容量小的資訊。在另一個實施例中,該第二計數值可包括四個通道非揮發性記憶體100中每一個區塊的抹除次數、使用次序、錯誤修正碼(ECC)的修正位元數、讀取次數、使用次數、或閒置次數其中之一。The second uniform erase program includes the following steps: (a) calculating a second count value for each of the blocks, wherein the second count value represents the number of erases of each of the four channels of non-volatile memory 100. Cumulative value; (b) finding an empty block from among the blocks of the selected memory unit; and (c) selecting at least one block having the least count value from the empty blocks. The number of selected blocks is determined according to the size of the data planned by the desired program. The data planned by the program generally includes information such as temporary storage objects, tables, mapping files or smaller than the capacity of the memory unit. In another embodiment, the second count value may include the number of erasures, the order of use, the number of correction bits of the error correction code (ECC), and the read number of each of the four channels of non-volatile memory 100. One of the number of times, the number of uses, or the number of idles.

該計算單元211主要計算每一個記憶體單元U1~Un的第一計數值,該第一計數值可為每一個記憶體單元U1~Un的抹除次數、使用次序、錯誤修正碼(ECC)的修正位元數、讀取次數、使用次數、或閒置次數的一個累積值或前述數值的組合累積值。在另一個實施例中,該計算單元211進一步計 算一第二計數值,該第二計數值可為四個通道非揮發性記憶體100中每一個區塊的抹除次數、使用次序、錯誤修正碼(ECC)的修正位元數、讀取次數、使用次數、或閒置次數的一個累積值或前述數值的組合累積值。在另一個實施例中,該計算單元211只計算部份個記憶體單元U1~Un的第一計數值,或第二計數值。The calculating unit 211 mainly calculates a first count value of each of the memory units U1 to Un, and the first count value may be the erasing frequency, the use order, and the error correction code (ECC) of each of the memory units U1 to Un. Corrects a cumulative value of the number of bits, the number of readings, the number of uses, or the number of idle times or a combined cumulative value of the aforementioned values. In another embodiment, the computing unit 211 further calculates Calculating a second count value, which may be the number of erasures, the order of use, the number of correction bits of the error correction code (ECC), and the read number of each of the four channels of non-volatile memory 100 A cumulative value of the number of times, the number of uses, or the number of idle times or a combined cumulative value of the aforementioned values. In another embodiment, the calculating unit 211 calculates only the first count value or the second count value of the partial memory units U1~Un.

因此,上述記憶體單元可從備用區當中隨機、依序、或依據該第一計數值來作選擇。同樣地,上述區塊亦可從被選擇的記憶體單元當中隨機、依序、或依據該第二計數值來作選擇。若記憶體單元是依據第一計數值來選擇的話,則被選擇的記憶體單元將是具有空的記憶體空間及最少第一計數值的一個記憶體單元。同樣地,若區塊是依據第二計數值來選取的話,則被選取的區塊將是具有空的記憶體空間及最少第二計數值的一個區塊。Therefore, the above memory unit can be selected randomly, sequentially, or according to the first count value from the spare area. Similarly, the above blocks may also be selected randomly, sequentially, or according to the second count value from the selected memory cells. If the memory unit is selected based on the first count value, then the selected memory unit will be a memory unit having an empty memory space and a minimum first count value. Similarly, if the block is selected based on the second count value, the selected block will be a block having an empty memory space and a minimum second count value.

選取區塊的數量取決於所欲程式規劃的資料大小。在本發明中,所欲程式規劃的資料一般包含諸如暫存物件、表格、映射檔或比記憶體單元容量小的資訊。The number of selected blocks depends on the size of the data planned by the program. In the present invention, the data to be programmed generally includes information such as a temporary object, a table, a map file, or a smaller capacity than the memory unit.

控制器210的緩衝記憶體214是用來讓四個通道非揮發性記憶體100暫時程式規劃系統資料,諸如參考表或映射表。緩衝記憶體214為一靜態隨機存取記憶體(SRAM)。然而,本發明並不限於此。應了解,其亦可為一動態隨機存取記憶體(DRAM)、磁性隨機存取記憶體(MRAM)、相變化隨機存取記憶體(PRAM)或其他適當的記憶體皆可用於實現本發明。The buffer memory 214 of the controller 210 is used to temporarily program the four-channel non-volatile memory 100 with system data, such as a reference table or a mapping table. Buffer memory 214 is a static random access memory (SRAM). However, the invention is not limited thereto. It should be understood that it can also be a dynamic random access memory (DRAM), magnetic random access memory (MRAM), phase change random access memory (PRAM) or other suitable memory for implementing the present invention. .

在本實施例中,一旦資料程式規劃於選取區塊中,則標記管理單元215會在參考表中加入一標記,以標示被選擇的記憶體單元的區塊的使用狀態,並在所有被選擇的記憶體單元的區塊被使用後,將參考表中的標記予以刪除。在標記管理單元215將參考表中的標記刪除後,計算單元211會以一預設值增加被選擇的記憶體單元的第一計數值。再者,前述標記不僅可被加入到參考表中,亦可被加入到區塊的冗餘區。每當程式規劃於選取區塊的資料被抹除,計算單元211會進一步以一預設值增加選取區塊的第二計數值。In this embodiment, once the data program is planned in the selected block, the tag management unit 215 adds a flag to the reference table to indicate the usage status of the block of the selected memory unit, and is selected at all. After the block of the memory unit is used, the tag in the reference table is deleted. After the mark management unit 215 deletes the mark in the reference table, the calculation unit 211 increments the first count value of the selected memory unit by a preset value. Furthermore, the aforementioned markers can be added not only to the reference list but also to the redundant areas of the block. Whenever the data planned by the program in the selected block is erased, the calculating unit 211 further increases the second count value of the selected block by a preset value.

如上所述,該選取器212會從記憶體單元U1~Un當中選擇具有空的記憶體空間及最少第一計數值的記憶體單元,再從被選擇的記憶體單元當中選取至少一具有空的記憶體空間及最少第二計數值的區塊。此外,該選取器212會從參考表中沒有被標記的記憶體單元當中選取該區塊。在另一個實施例中,該選取器212會從記憶體單元U1~Un當中選擇具有空的記憶體空間及最少第一計數值的記憶體單元,再直接從參考表中沒有被標記的記憶體單元當中選取該區塊。As described above, the selector 212 selects a memory unit having an empty memory space and a minimum first count value from among the memory units U1 to Un, and selects at least one of the selected memory units from the selected memory unit. A block of memory space and a minimum of second count values. In addition, the picker 212 selects the block from among the memory cells that are not marked in the reference table. In another embodiment, the selector 212 selects a memory unit having an empty memory space and a minimum first count value from the memory cells U1~Un, and directly from the referenced memory in the reference table. Select the block from the unit.

在此一示範實施例中,該系統均勻抹除構件2121並不會在每一次資料被程式規劃時,進行該第一均勻抹除程序。該第一均勻抹除程序只會在第一計數值達到一第一預設值時,才會被啟動。因此,在第一計數值達到一第一預設值之前,記憶體單元會經由該選取器212隨機或依序進行 選擇。在另一個實施例中,該系統均勻抹除構件2121會在每一次資料被程式規劃時,進行該第一均勻抹除程序。In this exemplary embodiment, the system evenly erases the member 2121 and does not perform the first uniform erase procedure each time the data is programmed. The first uniform erase program will only be activated when the first count value reaches a first preset value. Therefore, before the first count value reaches a first preset value, the memory unit is randomly or sequentially performed via the selector 212. select. In another embodiment, the system uniform erase component 2121 performs the first uniform erase process each time the data is programmed.

同樣地,在此一示範實施例中,該子系統均勻抹除構件2122並不會在每一次資料被程式規劃時,進行該第二均勻抹除程序。該第二均勻抹除程序只會在第二計數值達到一第二預設值時,才會被啟動。因此,在第二計數值達到一第二預設值之前,區塊會經由該選取器212隨機或依序進行選取。不同之處在於,區塊的選取無關於選取方式,而是基於該區塊是否為一無標記區塊而定。在另一個實施例中,該子系統均勻抹除構件2122會在每一次資料被程式規劃時,進行該第二均勻抹除程序。Similarly, in this exemplary embodiment, the subsystem evenly erases the member 2122 and does not perform the second uniform erase procedure each time the data is programmed. The second uniform erase program will only be activated when the second count value reaches a second preset value. Therefore, before the second count value reaches a second preset value, the block is randomly or sequentially selected by the selector 212. The difference is that the selection of the block is not related to the selection method, but based on whether the block is an unmarked block. In another embodiment, the subsystem uniform erase component 2122 performs the second uniform erase process each time the data is programmed.

該四個通道非揮發性記憶體100為一快閃記憶體。更明確地說,該四個通道非揮發性記憶體100為一多級單元(MLC)NAND快閃記憶體。然而,本發明並不限於此。該四個通道非揮發性記憶體100亦可為單級單元(SLC)NAND快閃記憶體。The four-channel non-volatile memory 100 is a flash memory. More specifically, the four-channel non-volatile memory 100 is a multi-level cell (MLC) NAND flash memory. However, the invention is not limited thereto. The four-channel non-volatile memory 100 can also be a single-level cell (SLC) NAND flash memory.

請參照第3A-3C圖及第4圖。第3A-3C圖為依據本發明非揮發性記憶體管理方法的流程圖,而第4圖為依據本發明顯示記憶體單元U1狀態的參考表的概念圖。如上所述,四個記憶體模組101、102、103、104中的各別區塊組合成各別的記憶體單元U1~Un以增加該四個通道非揮發性記憶體100的資料存取速度,如步驟S301所示。然後,藉由該選取器212隨機、依序、或經由第一均勻抹除程序從備用區中記憶體單元U1~Un當中選擇一記憶體單元,諸如記憶體單元 U1,如步驟S302所示。接著,藉由該選取器212隨機、依序、或經由第二均勻抹除程序從被選擇的記憶體單元U1當中選取至少一區塊,如步驟S303-S305所示。第4圖顯示區塊在依序被選取時,一記憶體單元U1的參考表概念圖。Please refer to Figures 3A-3C and Figure 4. 3A-3C is a flow chart of a non-volatile memory management method according to the present invention, and FIG. 4 is a conceptual diagram showing a reference table showing the state of the memory unit U1 in accordance with the present invention. As described above, the respective blocks of the four memory modules 101, 102, 103, and 104 are combined into the respective memory cells U1 to Un to increase the data access of the four channels of the non-volatile memory 100. The speed is as shown in step S301. Then, the memory unit, such as a memory unit, is selected from the memory cells U1~Un in the spare area by the selector 212 randomly, sequentially, or via the first uniform erase program. U1 is as shown in step S302. Then, at least one block is selected from the selected memory cells U1 by the selector 212 randomly, sequentially, or via a second uniform erase program, as shown in steps S303-S305. Figure 4 shows a conceptual diagram of a reference table of a memory unit U1 when the blocks are sequentially selected.

若區塊是依序或隨機被選取,一旦區塊被選取,則資料會被寫入該選取區塊,如步驟S306所示,而一標記會藉由標記管理單元215在參考表中被加入,以標示該選取區塊的使用狀態,如步驟S307所示。除非該選取區塊上的資料被抹除,否則該選取區塊不會再被選取以供任何進一步資料的程式規劃。If the block is selected sequentially or randomly, once the block is selected, the data is written into the selected block, as shown in step S306, and a flag is added to the reference table by the tag management unit 215. To indicate the usage status of the selected block, as shown in step S307. Unless the data on the selected block is erased, the selected block will no longer be selected for programming of any further data.

在這同時,標記管理單元215會持續判定被選擇的記憶體單元U1中每一個區塊是否已被標記,如步驟S308所示。假如每一個被選擇的記憶體單元U1的區塊皆已被標記(意即該被選擇的記憶體單元U1已被完全的使用且沒有包含任何無標記區塊),那麼標記管理單元215會將對應於被選擇的記憶體單元U1的標記全部刪除,如步驟S309所示。舉例來說,如第4圖所示,當區塊A1、區塊B1、區塊C1、區塊D1已全部被使用且標記時,對應於該被選擇的記憶體單元U1的標記將全部被刪除。在標記管理單元215刪除該被選擇的記憶體單元U1的標記後,記憶體單元U1的第一計數值就會以一預設值增加,例如:增加1,如步驟S310所示。At the same time, the tag management unit 215 continues to determine whether each of the selected memory cells U1 has been marked, as shown in step S308. If the block of each selected memory unit U1 has been marked (ie, the selected memory unit U1 has been completely used and does not contain any unmarked blocks), then the tag management unit 215 will The flags corresponding to the selected memory unit U1 are all deleted, as shown in step S309. For example, as shown in FIG. 4, when the block A1, the block B1, the block C1, and the block D1 have all been used and marked, the marks corresponding to the selected memory unit U1 will all be marked. delete. After the mark management unit 215 deletes the mark of the selected memory unit U1, the first count value of the memory unit U1 is increased by a preset value, for example, by one, as shown in step S310.

相反地,在步驟S306,資料寫入後,假若被選擇的記憶體單元U1仍包含無標記區塊,則該無標記區塊將供未來使用且該標記將維持現狀,不會從參考表中被刪除。如上 所述,每當欲寫入一資料,記憶體單元會被隨機、依序、或經由第一均勻抹除程序被選擇,如步驟S302所示,也因此,記憶體單元U1並不會每一次都被選擇。若同一個記憶體單元在步驟S302再度被選擇,則選取的區塊將無關於選取方式,而是基於該區塊是否為一無標記區塊而定,如步驟S311所示。之後,資料會被寫入該無標記區塊,如步驟S312所示,且另一個標記會藉由標記管理單元215被加入到該參考表中,以標示該選取的無標記區塊的使用狀態,如步驟S313所示。接下來,該管理方法將從步驟S308接續。因此步驟S308-S313會持續地重複。Conversely, in step S306, after the data is written, if the selected memory unit U1 still contains an unmarked block, the unmarked block will be used for future use and the mark will maintain the status quo, and will not be from the reference table. been deleted. As above As described above, each time a data is to be written, the memory unit is selected randomly, sequentially, or via a first uniform erase program, as shown in step S302, and therefore, the memory unit U1 does not occur every time. Have been chosen. If the same memory unit is selected again in step S302, the selected block will be irrelevant to the selection mode, but based on whether the block is an unmarked block, as shown in step S311. Thereafter, the data is written to the unmarked block, as shown in step S312, and another tag is added to the reference table by the tag management unit 215 to indicate the usage status of the selected unmarked block. , as shown in step S313. Next, the management method will continue from step S308. Therefore, steps S308-S313 are continuously repeated.

如第4圖所示,區塊A1在步驟S401被選取及標記。之後,當資料從區塊A1被抹除後,區塊A1的標記會維持不變,而區塊B1會在步驟S402被選取及標記。接下來,當資料從區塊B1被抹除後,區塊A1及B1的標記會維持不變,而區塊C1會在步驟S403被選取及標記。最後,當資料從區塊C1被抹除後,區塊A1、B1、C1的標記會維持不變,而區塊D1會在步驟S404被選取及標記。此時,區塊A1、B1、C1、D1的標記將全部被刪除,且全部成為無標記區塊,如所示S405步驟。As shown in Fig. 4, block A1 is selected and marked in step S401. Thereafter, when the data is erased from the block A1, the mark of the block A1 remains unchanged, and the block B1 is selected and marked in step S402. Next, when the data is erased from the block B1, the marks of the blocks A1 and B1 remain unchanged, and the block C1 is selected and marked in step S403. Finally, when the data is erased from block C1, the flags of blocks A1, B1, C1 will remain unchanged, and block D1 will be selected and marked in step S404. At this point, the tags of blocks A1, B1, C1, D1 will all be deleted and all become unmarked blocks, as shown in step S405.

再者,在另一個實施例中,無標記區塊並不保證其為空的區塊。無標記區塊僅僅表示其尚未被用來程式規劃具有小容量的資料,諸如暫存物件、表格、映射檔或比記憶體單元容量小的資料。若被選擇的記憶體單元不但已由資料所佔據並在參考表中已標記之外,且該記憶體單元邏輯 上屬於資料區時,則該標記管理單元215並不會標記該記憶體單元,而是改以標記邏輯上屬於備用區且對應於該被選擇的記憶體單元的另一個記憶體單元。因此,一旦該被選擇的記憶體單元中的資料被抹除且該被選擇的記憶體單元改屬於備用區時,則該被選擇的記憶體單元會接續參與該程式規劃循環。換包話說,假若一無標記區塊邏輯上屬於一資料區中的記憶體單元,則該無標記區塊會等到該記憶體單元邏輯上屬於備用區時才會被選取。在另一個實施例中,參考表可被動態儲存於非揮發性記憶體100的緩衝記憶體214、備用區、資料區、或其他上述位置中。Moreover, in another embodiment, an unmarked block does not guarantee that it is an empty block. An untagged block simply indicates that it has not been used to program a material with a small capacity, such as a temporary object, a table, a map file, or a data smaller than the memory unit. If the selected memory cell is not only occupied by the data but has been marked in the reference table, and the memory cell logic When the upper part belongs to the data area, the mark management unit 215 does not mark the memory unit, but instead marks another memory unit that logically belongs to the spare area and corresponds to the selected memory unit. Therefore, once the data in the selected memory unit is erased and the selected memory unit is changed to the spare area, the selected memory unit will continue to participate in the program planning loop. In other words, if an unmarked block logically belongs to a memory cell in a data area, the unmarked block will be selected until the memory cell logically belongs to the spare area. In another embodiment, the reference table can be dynamically stored in the buffer memory 214 of the non-volatile memory 100, the spare area, the data area, or other locations as described above.

藉由標記管理單元215加入標記是為了標示資料已程式規劃於一記憶體單元的區塊中,而該標記在所有的記憶體單元的區塊皆被標記後予以刪除。意即,該標記會以記憶體單元為單位,而非以區塊為單位,進行刪除。然而,應了解,在別的實施例中,該標記亦可以區塊為單位,分開予以刪除。The mark is added by the mark management unit 215 to indicate that the data has been programmed in a block of a memory unit, and the mark is deleted after all the blocks of the memory unit are marked. That is, the tag is deleted in units of memory cells instead of in blocks. However, it should be understood that in other embodiments, the tag may also be deleted in units of blocks.

再者,在步驟S303-305,假若區塊是經由第二均勻抹除程序從被選擇的記憶體單元U1當中作選取,則在區塊被選取後,資料會被寫入到該選取區塊,如步驟S314所示。其中該第二均勻抹除程序是依據該四個通道非揮發性記憶體100中每一個區塊的下列數值的一個累積值或組合累積值而進行:抹除次數、使用次序、錯誤修正碼(ECC)的修正位元數、讀取次數、使用次數、或閒置次數。之後,一旦寫入的資料從選取區塊被抹除,如步驟S315所示,計算單元 211會以一預設值增加選取區塊的第二計數值,如步驟S316所示。接下來,在選擇記憶體單元之後,當欲寫入另一資料時,該選取器212會依據該第二計數值選取一區塊。意即,該選取區塊為被選擇的記憶體單元中具有最少第二計數值的一個區塊,如步驟S317所示。然後,該管理方法將從步驟S314接續。而步驟S314-S317會持續地重複。Furthermore, in steps S303-305, if the block is selected from the selected memory unit U1 via the second uniform erase program, the data is written to the selected block after the block is selected. , as shown in step S314. The second uniform erasing procedure is performed according to a cumulative value or a combined cumulative value of the following values of each of the four channels of non-volatile memory 100: erasing times, order of use, error correction code ( ECC) The number of modified bits, the number of reads, the number of uses, or the number of idles. Thereafter, once the written data is erased from the selected block, as shown in step S315, the computing unit 211 will increase the second count value of the selected block by a preset value, as shown in step S316. Next, after selecting the memory unit, when another data is to be written, the selector 212 selects a block according to the second count value. That is, the selected block is one of the selected memory cells having the least second count value, as shown in step S317. Then, the management method will continue from step S314. Steps S314-S317 will continue to repeat.

簡言之,隨機或依序選取一個區塊與經由第二均勻抹除程序來選取一個區塊在流程上的差異,主要在於前者是依據一個區塊是否為一無標記區塊來作選取,而後者是依據一個區塊是否具有最少第二計數值來作選取。In short, the difference between the random selection or the sequential selection of a block and the selection of a block via the second uniform erase program is mainly because the former is selected according to whether a block is an unmarked block. The latter is selected based on whether a block has a minimum second count value.

本發明主要防止未使用的記憶體單元區塊同時被抹除並避免不均勻地使用記憶體單元中的區塊,以延長非揮發性記憶體的壽命。The present invention primarily prevents unused memory cell blocks from being erased at the same time and avoids uneven use of blocks in the memory cells to extend the life of the non-volatile memory.

縱使本發明已由上述之實施例詳細敘述而可由熟悉本技藝之人士任施匠思而為諸般修飾,然皆不脫如附申請專利範圍所欲保護者。The present invention has been described in detail by the above-described embodiments, and may be modified by those skilled in the art, without departing from the scope of the appended claims.

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

101~104‧‧‧記憶體模組101~104‧‧‧ memory module

A1~An‧‧‧區塊Block A1~An‧‧‧

B1~Bn‧‧‧區塊B1~Bn‧‧‧ Block

C1~Cn‧‧‧區塊C1~Cn‧‧‧ Block

D1~Dn‧‧‧區塊D1~Dn‧‧‧ Block

U1~Un‧‧‧記憶體單元U1~Un‧‧‧ memory unit

210‧‧‧控制器210‧‧‧ Controller

211‧‧‧計算單元211‧‧‧Computation unit

212‧‧‧選取器212‧‧‧Selector

2121‧‧‧系統均勻抹除構件2121‧‧‧ system uniform wiping member

2122‧‧‧子系統均勻抹除構件2122‧‧‧Subsystem uniform wiping member

213‧‧‧微處理器213‧‧‧Microprocessor

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

215‧‧‧標記管理單元215‧‧‧Mark Management Unit

S301~S317‧‧‧步驟S301~S317‧‧‧Steps

S401~S405‧‧‧步驟S401~S405‧‧‧Steps

第1圖為四個通道非揮發性記憶體的概念圖;第2圖為依據本發明資料程式規劃系統的方塊圖;第3A-3C圖為依據本發明非揮發性記憶體管理方法的流程圖;及第4圖為依據本發明顯示記憶體單元狀態的參考表的概念圖。1 is a conceptual diagram of four-channel non-volatile memory; FIG. 2 is a block diagram of a data programming system according to the present invention; and FIG. 3A-3C is a flow chart of a non-volatile memory management method according to the present invention; And FIG. 4 is a conceptual diagram of a reference table showing the state of the memory cell in accordance with the present invention.

110‧‧‧非揮發性記憶體110‧‧‧Non-volatile memory

210‧‧‧控制器210‧‧‧ Controller

211‧‧‧計算單元211‧‧‧Computation unit

212‧‧‧選取器212‧‧‧Selector

2121‧‧‧系統均勻抹除構件2121‧‧‧ system uniform wiping member

2122‧‧‧子系統均勻抹除構件2122‧‧‧Subsystem uniform wiping member

213‧‧‧微處理器213‧‧‧Microprocessor

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

215‧‧‧標記管理單元215‧‧‧Mark Management Unit

Claims (59)

一種記憶體管理方法,用於具有複數個區塊的非揮發性記憶體,其中該等區塊具有第一數量,該記憶體管理方法包括以下步驟:(a)將該複數個區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量;(b)將資料寫入到該等記憶體單元當中的至少一區塊;(c)在該等記憶體單元其中之一所屬的區塊皆被寫入後,增加該所屬區塊皆被寫入的記憶體單元相對應的計數值;及(d)依據至少部份個記憶體單元的計數值,對該非揮發性記憶體進行一均勻抹除程序。 A memory management method for a non-volatile memory having a plurality of blocks, wherein the blocks have a first number, the memory management method comprising the steps of: (a) combining the plurality of blocks into a plurality of memory cells, wherein the memory cells have a second number, and the second number is less than the first number; (b) writing data to at least one of the memory cells; (c) After the blocks to which one of the memory cells belongs are written, the count value corresponding to the memory cells to which the associated block is written is increased; and (d) according to at least part of the memory cells The count value is a uniform erase procedure for the non-volatile memory. 如申請專利範圍第1項所述之記憶體管理方法,在步驟(b)及(c)之間,進一步包括標記寫入區塊的步驟。 The memory management method according to claim 1, wherein the step of marking the writing block is further included between the steps (b) and (c). 如申請專利範圍第2項所述之記憶體管理方法,其中在將資料寫入到該等記憶體單元當中的至少一區塊後,更包括一在一參考表中標記該寫入區塊,用以標示該寫入區塊的使用狀態之步驟。 The memory management method of claim 2, wherein after the data is written to at least one of the memory cells, the method further includes: marking the write block in a reference table, The step of indicating the state of use of the write block. 如申請專利範圍第3項所述之記憶體管理方法,其中在該等記憶體單元其中之一所屬的區塊皆被寫入後,更包括從參考表中刪除標示該記憶體單元寫入區塊的標記之步驟。 The memory management method of claim 3, wherein after the block to which one of the memory cells belongs is written, the method further includes deleting the memory cell write area from the reference table. The step of marking the block. 如申請專利範圍第4項所述之記憶體管理方法,其中在所有標示該寫入區塊的標記被刪除後,該記憶體單元的計數值將增加一預設值。 The memory management method of claim 4, wherein the count value of the memory unit is increased by a preset value after all the marks indicating the write block are deleted. 如申請專利範圍第1項所述之記憶體管理方法,其中在該 寫入區塊的資料被抹除後,該記憶體單元的計數值將增加一預設值。 The method for managing a memory as described in claim 1, wherein After the data of the write block is erased, the count value of the memory unit is increased by a preset value. 如申請專利範圍第1項所述之記憶體管理方法,在步驟(b)及(c)之間,進一步包括選取一無標記區塊並將另一資料寫入到該選取無標記區塊的步驟。 The memory management method according to claim 1, wherein between steps (b) and (c), further comprising: selecting an unmarked block and writing another data to the selected unmarked block. step. 如申請專利範圍第1項所述之記憶體管理方法,其中該計數值代表記憶體單元的抹除次數累積值。 The memory management method according to claim 1, wherein the count value represents an accumulated value of the erasing times of the memory unit. 如申請專利範圍第1項所述之記憶體管理方法,其中步驟(d)包括:(d1)計算至少部份記憶體單元的計數值;(d2)從至少部份的該等記憶體單元當中找出空的記憶體單元;及(d3)從空的記憶體單元當中再選擇一具有最少計數值的記憶體單元。 The memory management method of claim 1, wherein the step (d) comprises: (d1) calculating a count value of at least a portion of the memory unit; (d2) from at least a portion of the memory units. Finding an empty memory unit; and (d3) selecting a memory unit having the least count value from the empty memory unit. 如申請專利範圍第1項所述之記憶體管理方法,在步驟(a)及(b)之間,進一步包括以下步驟:(a1)從至少部份的該等記憶體單元當中選擇一記憶體單元;及(a2)從該被選擇的記憶體單元當中再選取至少一區塊。 The memory management method of claim 1, further comprising the steps of: (a1) selecting a memory from at least a portion of the memory cells between steps (a) and (b); And (a2) selecting at least one block from the selected memory unit. 如申請專利範圍第10項所述之記憶體管理方法,其中該被選擇的記憶體單元是隨機從至少部份的該等記憶體單元當中選擇出來。 The memory management method of claim 10, wherein the selected memory unit is randomly selected from at least a portion of the memory units. 如申請專利範圍第10項所述之記憶體管理方法,其中該被選擇的記憶體單元是依序從至少部份的該等記憶體單元當 中選擇出來。 The memory management method of claim 10, wherein the selected memory unit is sequentially from at least a portion of the memory units Choose it out. 如申請專利範圍第10項所述之記憶體管理方法,其中該被選擇的記憶體單元是經由一均勻抹除程序從至少部份的該等記憶體單元當中選擇出來。 The memory management method of claim 10, wherein the selected memory unit is selected from at least a portion of the memory units via a uniform erase program. 如申請專利範圍第10項所述之記憶體管理方法,其中該選取區塊是隨機從該被選擇的記憶體單元當中選取出來。 The memory management method of claim 10, wherein the selected block is randomly selected from the selected memory unit. 如申請專利範圍第10項所述之記憶體管理方法,其中該選取區塊是依序從該被選擇的記憶體單元當中選取出來。 The memory management method according to claim 10, wherein the selected block is sequentially selected from the selected memory unit. 如申請專利範圍第1項所述之記憶體管理方法,其中該資料比該記憶體單元的容量小。 The memory management method according to claim 1, wherein the data is smaller than a capacity of the memory unit. 如申請專利範圍第1項所述之記憶體管理方法,其中該資料包括暫存物件、表格、映射檔或比該記憶體單元容量小的資料。 The memory management method according to claim 1, wherein the data comprises a temporary storage object, a table, a mapping file or a data having a smaller capacity than the memory unit. 如申請專利範圍第1項所述之記憶體管理方法,其中該非揮發性記憶體包括多個通道。 The memory management method of claim 1, wherein the non-volatile memory comprises a plurality of channels. 如申請專利範圍第1項所述之記憶體管理方法,其中該非揮發性記憶體包括多個資料匯流排。 The memory management method of claim 1, wherein the non-volatile memory comprises a plurality of data bus bars. 一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一系統均勻抹除構件,用以對該非揮發性記憶體進行第一均勻抹除程序,其中,該第一均勻抹除程序用以選擇一另一記憶體單元,以將一原始記憶體單元的有效資料複製到該另 一記憶體單元,並抹除該原始記憶體單元的資料;及一子系統均勻抹除構件,用以對該被選擇的記憶體單元進行第二均勻抹除程序,以從該被選擇的記憶體單元的複數個區塊中選取至少一區塊作為資料程式規劃,其中該被選取的該至少一區塊不具有一標記;藉以防止該被選擇的記憶體單元的區塊在使用上的不平均。 A controller for non-volatile memory, the non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the blocks are combined into a plurality of memory cells, wherein the memory The unit has a second quantity, and the second quantity is less than the first quantity, the controller includes: a system uniform erasing member for performing a first uniform erasing process on the non-volatile memory, wherein the first uniform An erase program for selecting another memory unit to copy valid data of a raw memory unit to the other a memory unit and erasing data of the original memory unit; and a subsystem uniformly erasing member for performing a second uniform erasing process on the selected memory unit to select from the selected memory Selecting at least one block from the plurality of blocks of the volume unit as a data program plan, wherein the selected at least one block does not have a mark; thereby preventing the block of the selected memory unit from being used. average. 一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資料;一計算單元,耦合於該微處理器,用來計算該等記憶體單元的計數值;及一選取器,耦合於該微處理器,用來選擇具有空的記憶體空間及最少計數值的記憶體單元,並用來從被選擇的記憶體單元中選取至少一區塊,其中唯有該記憶體單元中的所有區塊皆被寫入後,該記憶體單元相對應的計數值才會增加。 A controller for non-volatile memory, the non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the blocks are combined into a plurality of memory cells, wherein the memory The unit has a second quantity, and the second quantity is less than the first quantity. The controller includes: a microprocessor for programming the selected block and erasing the data on the selected block; a computing unit, coupling The microprocessor is configured to calculate a count value of the memory cells; and a selector coupled to the microprocessor for selecting a memory cell having an empty memory space and a minimum count value, and for At least one block is selected from the selected memory cells, wherein only the corresponding count values of the memory cells are increased after all the blocks in the memory cells are written. 如申請專利範圍第21項所述之控制器,其中該選取器包括:一子系統均勻抹除構件,用以對該等記憶體單元其中一個進行第二均勻抹除程序,以從該記憶體單元當中選取至少一 區塊;及一系統均勻抹除構件,用以對該非揮發性記憶體進行第一均勻抹除程序,以選擇一記憶體單元來程式規劃一資料。 The controller of claim 21, wherein the selector comprises: a subsystem uniform erasing member for performing a second uniform erasing procedure on one of the memory units to extract from the memory Select at least one of the units a block; and a system for uniformly erasing the component for performing a first uniform erase process on the non-volatile memory to select a memory cell to program a data. 如申請專利範圍第21項所述之控制器,進一步包括一緩衝記憶體,用來程式規劃一參考表。 The controller of claim 21, further comprising a buffer memory for programming a reference table. 如申請專利範圍第23項所述之控制器,進一步包括一標記管理單元,用來在該資料被程式規劃到該選取區塊時,於參考表中加入一標記,以標示該被選擇的記憶體單元的區塊的使用狀態,並在所有該被選擇的記憶體單元的區塊被使用後,用來刪除該參考表中的標記。 The controller of claim 23, further comprising a tag management unit for adding a flag to the reference table to indicate the selected memory when the data is programmed into the selected block. The state of use of the block of the body unit, and after all the blocks of the selected memory unit are used, are used to delete the mark in the reference table. 如申請專利範圍第24項所述之控制器,其中該被選取區塊為一無標記區塊。 The controller of claim 24, wherein the selected block is an unmarked block. 如申請專利範圍第21項所述之控制器,其中該計數值代表每一個記憶體單元的抹除次數累積值。 The controller of claim 21, wherein the count value represents an accumulated value of the number of erasures of each memory unit. 如申請專利範圍第24項所述之控制器,其中一旦被選擇的記憶體單元的區塊的標記被標記管理單元刪除,則該計算單元將把被選擇的記憶體單元的計數值增加一預設值。 The controller of claim 24, wherein once the tag of the selected memory cell block is deleted by the tag management unit, the computing unit increases the count value of the selected memory cell by one Set the value. 如申請專利範圍第21項所述之控制器,其中該選取器依序從被選擇的記憶體單元當中選取一區塊。 The controller of claim 21, wherein the selector sequentially selects a block from the selected memory unit. 如申請專利範圍第21項所述之控制器,其中該選取器隨機從被選擇的記憶體單元當中選取一區塊。 The controller of claim 21, wherein the selector randomly selects a block from the selected memory cells. 如申請專利範圍第21項所述之控制器,其中該資料包括暫存物件、表格、映射檔或比記憶體單元容量小的資料。 The controller of claim 21, wherein the data comprises a temporary object, a table, a mapping file or a data smaller than a memory unit. 如申請專利範圍第21項所述之控制器,其中該資料比被 選擇的記憶體單元的容量小。 For example, the controller described in claim 21, wherein the data ratio is The capacity of the selected memory unit is small. 如申請專利範圍第21項所述之控制器,其中該非揮發性記憶體包括多個通道。 The controller of claim 21, wherein the non-volatile memory comprises a plurality of channels. 如申請專利範圍第21項所述之控制器,其中該非揮發性記憶體包括多個資料匯流排。 The controller of claim 21, wherein the non-volatile memory comprises a plurality of data bus bars. 一種資料程式規劃系統,包括:多個記憶體模組,每一個皆具有複數個區塊,各別記憶體模組的區塊被組合成各別的記憶體單元;及一控制器,用來控制複數個記憶體模組,包含:一計算單元,用來計算該記憶體單元的計數值;一選取器,用來選擇一具有空的記憶體空間且最少計數值的記憶體單元,並用來從被選擇的記憶體單元當中選取至少一區塊,藉以防止被選擇的記憶體單元的區塊在使用上的不平均;及一微處理器,用來程式規劃被選取區塊及抹除被選取區塊上的資料,其中唯有該記憶體單元中的所有區塊皆被寫入後,該記憶體單元相對應的計數值才會增加。 A data program planning system includes: a plurality of memory modules each having a plurality of blocks, the blocks of the respective memory modules being combined into respective memory units; and a controller for Controlling a plurality of memory modules, comprising: a calculation unit for calculating a count value of the memory unit; and a selector for selecting a memory unit having an empty memory space and a minimum count value, and Selecting at least one block from the selected memory cells to prevent uneven use of the selected memory cells; and a microprocessor for programming the selected blocks and erasing the blocks The data on the block is selected, and only the corresponding counts of the memory unit are increased after all the blocks in the memory unit are written. 如申請專利範圍第34項所述之資料程式規劃系統,其中該控制器進一步包括一緩衝記憶體,用來程式規劃一參考表。 The data programming system of claim 34, wherein the controller further comprises a buffer memory for programming a reference table. 如申請專利範圍第35項所述之資料程式規劃系統,其中該控制器進一步包括一標記管理單元,用來在該資料被程式規劃到該選取區塊時,於參考表中加入一標記,以標示該被選擇的記憶體單元的區塊的使用狀態,並在所有該被選擇的 記憶體單元的區塊被使用後,用來刪除該參考表中的標記。 The data program planning system of claim 35, wherein the controller further comprises a mark management unit for adding a mark to the reference table when the data is planned by the program to the selected block, Marking the usage status of the block of the selected memory unit and selecting all of the selected ones After the block of the memory unit is used, it is used to delete the mark in the reference table. 如申請專利範圍第36項所述之資料程式規劃系統,其中該被選取區塊為一無標記區塊。 The data programming system of claim 36, wherein the selected block is an unmarked block. 如申請專利範圍第34項所述之資料程式規劃系統,其中該計數值代表每一個記憶體單元的抹除次數累積值。 The data programming system of claim 34, wherein the count value represents an accumulated value of the number of erasures per memory unit. 如申請專利範圍第36項所述之資料程式規劃系統,其中一旦被選擇的記憶體單元的區塊的標記被標記管理單元刪除,則該計算單元將把被選擇的記憶體單元的計數值增加一預設值。 The data program planning system according to claim 36, wherein the calculation unit will increase the count value of the selected memory unit once the mark of the selected memory unit block is deleted by the mark management unit. A preset value. 如申請專利範圍第34項所述之資料程式規劃系統,其中該選取器依序從被選擇的記憶體單元選取區塊。 The data program planning system of claim 34, wherein the selector sequentially selects the block from the selected memory unit. 如申請專利範圍第34項所述之資料程式規劃系統,其中該選取器隨機從被選擇的記憶體單元選取區塊。 The data programming system of claim 34, wherein the selector randomly selects a block from the selected memory unit. 如申請專利範圍第34項所述之資料程式規劃系統,其中該資料包括暫存物件、表格、映射檔或比記憶體單元容量小的資料。 For example, the data program planning system described in claim 34, wherein the data includes a temporary storage object, a table, a mapping file or a data smaller than a memory unit. 如申請專利範圍第34項所述之資料程式規劃系統,其中該資料比被選擇的記憶體單元的容量小。 For example, the data program planning system described in claim 34, wherein the data is smaller than the capacity of the selected memory unit. 一種記憶體管理方法,用於具有複數個區塊的非揮發性記憶體,其中該等區塊具有第一數量,該記憶體管理方法包括以下步驟:(a)將該複數個區塊組合成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量;(b)計算每一個記憶體單元的第一計數值; (c)從該記憶體單元當中找出空的記憶體單元;(d)計算該記憶體單元的每一個區塊的第二計數值;(e)從該空的記憶體單元當中選擇一具有最少第一計數值的另一記憶體單元;(f)從該被選擇的記憶體單元中選取至少一具有最少第二計數值的區塊;及(g)將一原始記憶體單元的有效資料複製到該另一記憶體單元,並抹除該原始記憶體單元的資料;藉以防止該被選擇的記憶體單元的區塊在使用上的不平均。 A memory management method for a non-volatile memory having a plurality of blocks, wherein the blocks have a first number, the memory management method comprising the steps of: (a) combining the plurality of blocks into a plurality of memory cells, wherein the memory cells have a second number, and the second number is less than the first number; (b) calculating a first count value of each memory cell; (c) finding an empty memory unit from the memory unit; (d) calculating a second count value for each block of the memory unit; (e) selecting one of the empty memory units Another memory unit having a minimum first count value; (f) selecting at least one block having the least second count value from the selected memory unit; and (g) validating data of a raw memory unit Copying to the other memory unit and erasing the data of the original memory unit; thereby preventing the block of the selected memory unit from being used unevenly. 如申請專利範圍第44項所述之記憶體管理方法,其中該第一計數值及該第二計數值分別代表每一個記憶體單元的抹除次數累積值及每一個區塊的抹除次數累積值。 The memory management method according to claim 44, wherein the first count value and the second count value respectively represent an accumulated value of erasing times of each memory unit and an accumulation of erasure times of each block. value. 如申請專利範圍第44項所述之記憶體管理方法,其中該資料包括暫存物件、表格、映射檔或比記憶體單元容量小的資料。 The memory management method according to claim 44, wherein the data comprises a temporary storage object, a table, a mapping file or a data having a smaller capacity than a memory unit. 如申請專利範圍第44項所述之記憶體管理方法,其中該資料比被選擇的記憶體單元的容量小。 The memory management method of claim 44, wherein the data is smaller than a capacity of the selected memory unit. 如申請專利範圍第44項所述之記憶體管理方法,其中該非揮發性記憶體包括多個通道。 The memory management method of claim 44, wherein the non-volatile memory comprises a plurality of channels. 如申請專利範圍第44項所述之記憶體管理方法,其中該非揮發性記憶體包括多個資料匯流排。 The memory management method of claim 44, wherein the non-volatile memory comprises a plurality of data bus bars. 一種用於非揮發性記憶體的控制器,該非揮發性記憶體具有複數個區塊,其中該等區塊具有第一數量,該等區塊組合 成複數個記憶體單元,其中該等記憶體單元具有第二數量,且該第二數量小於第一數量,該控制器包括:一計算單元,用來計算每一個記憶體單元的第一計數值及該記憶體單元每一個區塊的第二計數值;一選取器,用來選擇具有空的記憶體空間且最少第一計數值的另一記憶體單元,並用來從被選擇的記憶體單元的該等區塊當中選取至少一具有最少第二計數值的區塊;及一微處理器,用來將一原始記憶體單元的有效資料複製到該另一記憶體單元,並抹除該原始記憶體單元的資料;藉以防止該被選擇的記憶體單元的區塊在使用上的不平均。 A controller for non-volatile memory, the non-volatile memory having a plurality of blocks, wherein the blocks have a first number, and the block combinations And a plurality of memory cells, wherein the memory cells have a second quantity, and the second quantity is less than the first quantity, the controller includes: a calculating unit, configured to calculate a first count value of each memory unit And a second count value of each block of the memory unit; a selector for selecting another memory cell having an empty memory space and a minimum first count value, and for selecting from the selected memory unit And selecting at least one block having a minimum second count value among the blocks; and a microprocessor for copying valid data of a original memory unit to the other memory unit and erasing the original The data of the memory unit; thereby preventing the use of the blocks of the selected memory unit from being uneven. 如申請專利範圍第50項所述之控制器,其中該第一計數值及該第二計數值分別代表每一個記憶體單元的抹除次數累積值及每一個區塊的抹除次數累積值。 The controller of claim 50, wherein the first count value and the second count value respectively represent an accumulated value of erasure times of each memory unit and an accumulated value of erasure times of each block. 如申請專利範圍第50項所述之控制器,其中該資料包括暫存物件、表格、映射檔或比記憶體單元容量小的資料。 The controller of claim 50, wherein the data comprises a temporary storage object, a table, a mapping file or a data smaller than a memory unit. 如申請專利範圍第50項所述之控制器,其中該資料比被選擇的記憶體單元的容量小。 The controller of claim 50, wherein the data is smaller than a capacity of the selected memory unit. 如申請專利範圍第50項所述之控制器,其中該非揮發性記憶體包括多個通道。 The controller of claim 50, wherein the non-volatile memory comprises a plurality of channels. 如申請專利範圍第50項所述之控制器,其中該非揮發性記憶體包括多個資料匯流排。 The controller of claim 50, wherein the non-volatile memory comprises a plurality of data busses. 一種資料程式規劃系統,包括:多個記憶體模組,每一個皆具有複數個區塊,各別記憶體 模組的區塊被組合成各別的記憶體單元;及一控制器,用來控制複數個記憶體模組,包含:一計算單元,用來計算每一個記憶體單元的第一計數值及該記憶體單元每一個區塊的第二計數值;一選取器,用來選擇一具有空的記憶體空間且最少第一計數值的另一記憶體單元,並用來從被選擇的記憶體單元的多個區塊當中選取至少一具有最少第二計數值的區塊;及一微處理器,用來將一原始記憶體單元的有效資料複製到該另一記憶體單元,並抹除該原始記憶體單元的資料;藉以防止該被選擇的記憶體單元的區塊在使用上的不平均。 A data program planning system includes: a plurality of memory modules, each of which has a plurality of blocks, and respective memories The blocks of the module are combined into separate memory units; and a controller for controlling the plurality of memory modules, comprising: a calculating unit for calculating the first count value of each memory unit and a second count value of each block of the memory unit; a selector for selecting another memory cell having an empty memory space and a minimum first count value, and for selecting from the selected memory unit Selecting at least one block having a minimum second count value among the plurality of blocks; and a microprocessor for copying valid data of a original memory unit to the other memory unit and erasing the original The data of the memory unit; thereby preventing the use of the blocks of the selected memory unit from being uneven. 如申請專利範圍第56項所述之資料程式規劃系統,其中該第一計數值及該第二計數值分別代表每一個記憶體單元的抹除次數累積值及每一個區塊的抹除次數累積值。 The data program planning system of claim 56, wherein the first count value and the second count value respectively represent an accumulated value of erasing times of each memory unit and an accumulation of erasure times of each block. value. 如申請專利範圍第56項所述之資料程式規劃系統,其中該資料包括暫存物件、表格、映射檔或比記憶體單元容量小的資料。 For example, the data program planning system described in claim 56, wherein the data includes a temporary storage object, a table, a mapping file or a data smaller than a memory unit. 如申請專利範圍第56項所述之資料程式規劃系統,其中該資料比被選擇的記憶體單元的容量小。 For example, the data program planning system described in claim 56, wherein the data is smaller than the capacity of the selected memory unit.
TW97138243A 2008-10-03 2008-10-03 Memory managing method for non-volatile memory and controller using the same TWI470428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97138243A TWI470428B (en) 2008-10-03 2008-10-03 Memory managing method for non-volatile memory and controller using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW97138243A TWI470428B (en) 2008-10-03 2008-10-03 Memory managing method for non-volatile memory and controller using the same

Publications (2)

Publication Number Publication Date
TW201015314A TW201015314A (en) 2010-04-16
TWI470428B true TWI470428B (en) 2015-01-21

Family

ID=44829979

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97138243A TWI470428B (en) 2008-10-03 2008-10-03 Memory managing method for non-volatile memory and controller using the same

Country Status (1)

Country Link
TW (1) TWI470428B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI622044B (en) * 2016-09-06 2018-04-21 合肥兆芯電子有限公司 Memory managing method, memory control circuit unit and memory storage apparatus

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6230233B1 (en) * 1991-09-13 2001-05-08 Sandisk Corporation Wear leveling techniques for flash EEPROM systems
US20040083335A1 (en) * 2002-10-28 2004-04-29 Gonzalez Carlos J. Automated wear leveling in non-volatile storage systems
US20040177212A1 (en) * 2002-10-28 2004-09-09 Sandisk Corporation Maintaining an average erase count in a non-volatile storage system
US20060106972A1 (en) * 2004-11-15 2006-05-18 Gorobets Sergey A Cyclic flash memory wear leveling
TW200735124A (en) * 2006-03-03 2007-09-16 Sunplus Technology Co Ltd Wear leveling method and apparatus for nonvolatile memory
US20070294490A1 (en) * 2006-06-20 2007-12-20 International Business Machines Corporation System and Method of Updating a Memory to Maintain Even Wear
TWI297893B (en) * 2002-10-28 2008-06-11 Sandisk Corp Method and apparatus for managing an erase count block

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6230233B1 (en) * 1991-09-13 2001-05-08 Sandisk Corporation Wear leveling techniques for flash EEPROM systems
US20040083335A1 (en) * 2002-10-28 2004-04-29 Gonzalez Carlos J. Automated wear leveling in non-volatile storage systems
US20040177212A1 (en) * 2002-10-28 2004-09-09 Sandisk Corporation Maintaining an average erase count in a non-volatile storage system
TWI297893B (en) * 2002-10-28 2008-06-11 Sandisk Corp Method and apparatus for managing an erase count block
US20060106972A1 (en) * 2004-11-15 2006-05-18 Gorobets Sergey A Cyclic flash memory wear leveling
TW200735124A (en) * 2006-03-03 2007-09-16 Sunplus Technology Co Ltd Wear leveling method and apparatus for nonvolatile memory
US20070294490A1 (en) * 2006-06-20 2007-12-20 International Business Machines Corporation System and Method of Updating a Memory to Maintain Even Wear

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI622044B (en) * 2016-09-06 2018-04-21 合肥兆芯電子有限公司 Memory managing method, memory control circuit unit and memory storage apparatus

Also Published As

Publication number Publication date
TW201015314A (en) 2010-04-16

Similar Documents

Publication Publication Date Title
US8386697B2 (en) Memory managing method for non-volatile memory and controller using the same
US8037232B2 (en) Data protection method for power failure and controller using the same
US8103820B2 (en) Wear leveling method and controller using the same
US8108589B2 (en) Wear leveling method and controller using the same
US8086787B2 (en) Wear leveling method, and storage system and controller using the same
US8046526B2 (en) Wear leveling method and controller using the same
US8001317B2 (en) Data writing method for non-volatile memory and controller using the same
US9098395B2 (en) Logical block management method for a flash memory and control circuit storage system using the same
US8296507B2 (en) Memory management and writing method and rewritable non-volatile memory controller and storage system using the same
US8250286B2 (en) Block management method, and storage system and controller using the same
US9298534B2 (en) Memory system and constructing method of logical block
US7649794B2 (en) Wear leveling method and controller using the same
US8055873B2 (en) Data writing method for flash memory, and controller and system using the same
US8275931B2 (en) Block management method for flash memory, and storage system and controller using the same
US8504760B2 (en) Method and apparatus for managing erase count of memory device
US20090307413A1 (en) Data writing method for flash memory and storage system and controller using the same
US8074128B2 (en) Block management and replacement method, flash memory storage system and controller using the same
US8037236B2 (en) Flash memory writing method and storage system and controller using the same
CN101609431B (en) Flash memory apparatus and method for operating the same
JP5494086B2 (en) Nonvolatile storage device and nonvolatile memory controller
US8417909B2 (en) Block management and data writing method, and flash memory storage system and controller using the same
TWI470428B (en) Memory managing method for non-volatile memory and controller using the same
CN101727396B (en) Memory management method for nonvolatile memory and controller thereof
CN106469019A (en) Storage management method, memorizer control circuit unit and memorizer memory devices
Firmware et al. A Beginner’s Guide to SSD Firmware