TWI497292B - A Method of Finding System Data Based on Index Block - Google Patents
A Method of Finding System Data Based on Index Block Download PDFInfo
- Publication number
- TWI497292B TWI497292B TW102100705A TW102100705A TWI497292B TW I497292 B TWI497292 B TW I497292B TW 102100705 A TW102100705 A TW 102100705A TW 102100705 A TW102100705 A TW 102100705A TW I497292 B TWI497292 B TW I497292B
- Authority
- TW
- Taiwan
- Prior art keywords
- block
- index
- index block
- memory
- control chip
- Prior art date
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Description
本發明是有關於一種系統資料尋找方法,特別是指一種基於索引區塊的系統資料尋找方法。The invention relates to a system data searching method, in particular to a system data searching method based on an index block.
隨著記憶體製程的改良,近年來,快閃記憶體的應用層面也越來越廣泛,其中最常見之一莫過於內含快閃記憶體的快閃記憶體儲存裝置。一般而言,快閃記憶體通常會包含多個記憶體區塊與一控制晶片。而該等記憶體區塊的其中至少一者會儲存快閃記憶體儲存裝置啟動時所需的系統資料,例如,邏輯實體對照表(Logical to Physical Table,L2P Table)、區塊抹除次數(Block Erase Count),及錯誤頁面數量(Invalid Page Count)等系統管理資訊。而在快閃記憶體儲存裝置啟動的過程中,該控制晶片必須先自該等記憶體區塊中找出儲存上述系統資料的記憶體區塊位置,以自相對應的記憶體區塊讀取快閃記憶體儲存裝置啟動時所需的系統資料,進而完成其啟動程序。With the improvement of the memory system, in recent years, the application level of flash memory has become more and more extensive, and one of the most common ones is a flash memory storage device containing flash memory. In general, flash memory typically contains multiple memory blocks and a control chip. At least one of the memory blocks stores system data required for the flash memory storage device to be started, for example, a Logical to Physical Table (L2P Table), a block erase count ( Block Erase Count), and system management information such as the number of error pages (Invalid Page Count). During the startup of the flash memory storage device, the control chip must first find the location of the memory block storing the system data from the memory blocks to read from the corresponding memory block. The system data required for the flash memory storage device to start up, and then complete its startup procedure.
此外由於先天構造使然,快閃記憶體有抹寫循環的次數限制,亦即,該等記憶體區塊的抹除次數與寫入次數是有上限的。為了解決上述的問題,現有的方式是採用耗損平衡(Wear Leveling)的技術手段均衡地使用每一個記憶體區塊,而非頻繁地固定使用部分記憶體區塊,以延長快閃記憶體的使用壽命。In addition, due to the innate structure, the flash memory has a limit on the number of times of erasing, that is, the number of erasures and the number of writes of the memory blocks are limited. In order to solve the above problem, the existing method is to use each of the memory blocks in a balanced manner by using Wear Leveling technology, instead of frequently fixing some memory blocks to prolong the use of flash memory. life.
然而也基於此原因,該控制晶片便不會將重要的系統 資料存放於固定的記憶體區塊。換句話說,每次進行快閃記憶體儲存裝置啟動程序時,該控制晶片都必須花費相當多的時間自所有的記憶體區塊中找出存放上述系統資料的記憶體區塊,以完成啟動程序,因此顯得不是很有效率。However, for this reason, the control chip will not be an important system. The data is stored in a fixed memory block. In other words, each time the flash memory storage device startup program is executed, the control chip must spend a considerable amount of time to find the memory block storing the system data from all the memory blocks to complete the startup. The program is therefore not very efficient.
因此,本發明之目的,即在提供一種基於索引區塊的系統資料尋找方法。Accordingly, it is an object of the present invention to provide a method for finding a system data based on an index block.
於是,本發明基於索引區塊的系統資料尋找方法,適用於一包含多個記憶體區塊與一控制晶片的快閃記憶體。該等記憶體區塊包括一主要索引區塊、一次要索引區塊,及一儲存系統資料的管理區塊。該基於索引區塊的系統資料尋找方法包含以下步驟:(A)該控制晶片自該等記憶體區塊搜尋該主要索引區塊;(B)當搜尋到該主要索引區塊後,該控制晶片還根據一儲存於該主要索引區塊的次要索引區塊位址搜尋該次要索引區塊;(C)該控制晶片根據一儲存於該次要索引區塊的管理區塊位址搜尋該管理區塊;及(D)該控制晶片自該管理區塊獲得系統資料。Therefore, the system data searching method based on the index block of the present invention is applicable to a flash memory including a plurality of memory blocks and a control chip. The memory blocks include a primary index block, a primary index block, and a management block for storing system data. The index block-based system data searching method comprises the following steps: (A) the control chip searches for the main index block from the memory blocks; (B) after searching the main index block, the control chip And searching for the secondary index block according to a secondary index block address stored in the primary index block; (C) the control chip searching for the location according to a management block address stored in the secondary index block a management block; and (D) the control chip obtains system data from the management block.
有關本發明之前述及其他技術內容、特點與功效,在以下配合參考圖式之一個較佳實施例的詳細說明中,將可清楚的呈現。The above and other technical contents, features and advantages of the present invention will be apparent from the following detailed description of the preferred embodiments.
參閱圖1與圖2,本發明基於索引區塊的系統資料尋找方法之較佳實施例,適用於一包含多個記憶體區塊與一控制晶片的快閃記憶體(圖未示)。該等記憶體區塊包括一主要 索引區塊、至少一次要索引區塊,及至少一儲存系統資料的管理區塊。其中該主要索引區塊包括多個記憶體頁面,且該等記憶體頁面包括一儲存該次要索引區塊位址的主要索引頁面。又,該次要索引區塊亦包括多個記憶體頁面,且該等記憶體頁面包括一儲存一管理區塊位址的次要索引頁面。亦即,該主要索引頁面儲存的該次要索引區塊位址,對應該次要索引區塊的記憶體位址。而該次要索引頁面儲存的該管理區塊位址,則是對應該管理區塊的記憶體位址。此外該管理區塊所儲存的系統資料包括邏輯實體對照表、區塊抹除次數,及錯誤頁面數量等等。值得一提的是,儲存該管理區塊之記憶體位址的該次要索引區塊為工作(Active)狀態,故亦可稱其為工作次要索引區塊。當然,若一次要索引區塊並無儲存該管理區塊之記憶體位址,則其非為工作次要索引區塊。Referring to FIG. 1 and FIG. 2, a preferred embodiment of the system for searching for system data based on an index block is applicable to a flash memory (not shown) including a plurality of memory blocks and a control chip. The memory blocks include a primary An index block, at least one index block to be indexed, and at least one management block storing system data. The primary index block includes a plurality of memory pages, and the memory pages include a primary index page that stores the secondary index block address. Moreover, the secondary index block also includes a plurality of memory pages, and the memory pages include a secondary index page storing a management block address. That is, the secondary index block address stored in the primary index page corresponds to the memory address of the secondary index block. The management block address stored in the secondary index page is the memory address corresponding to the management block. In addition, the system data stored in the management block includes a logical entity comparison table, the number of block erases, and the number of error pages. It is worth mentioning that the secondary index block storing the memory address of the management block is in an active state, so it can also be called a working secondary index block. Of course, if the index block does not store the memory address of the management block at a time, it is not a working secondary index block.
以下將針對該基於索引區塊的系統資料尋找方法進一步地說明。The index block based system data finding method will be further explained below.
如步驟S01所示,該控制晶片自該等記憶體區塊搜尋該主要索引區塊。亦即,該控制晶片自該等記憶體區塊中循序地判斷目前所搜尋到的記憶體區塊是否為該主要索引區塊。若否,則繼續搜尋下一個記憶體區塊;若是,則進行步驟S02。As shown in step S01, the control chip searches for the main index block from the memory blocks. That is, the control chip sequentially determines from the memory blocks whether the currently searched memory block is the primary index block. If not, the search for the next memory block continues; if yes, proceed to step S02.
如步驟S02所示,當搜尋到該主要索引區塊後,該控制晶片自該主要索引區塊的該等記憶體頁面搜尋該主要索引頁面,並自該主要索引頁面獲得該次要索引區塊位址。 亦即,該主要索引區塊的記憶體頁面中,僅有其中一記憶體頁面儲存該次要索引區塊位址。而儲存該次要索引區塊位址的記憶體頁面即為該主要索引頁面,故必須先搜尋到該主要索引頁面。As shown in step S02, after the main index block is searched, the control chip searches the main index page from the memory pages of the main index block, and obtains the secondary index block from the main index page. Address. That is, only one of the memory pages of the main index block stores the secondary index block address. The memory page storing the address of the secondary index block is the main index page, so the main index page must be searched first.
值得一提的是,該主要索引區塊的每一記憶體頁面具有一時間屬性,且該主要索引頁面的時間屬性對應的時間點,晚於其他所有記憶體頁面的時間屬性對應的時間點。換句話說,該控制晶片可以透過現有的二元搜尋(Bi-Search)的方式,並根據該等記憶體頁面的時間屬性,快速地自該等記憶體頁面中搜尋到該主要索引頁面,以獲得該次要索引區塊位址。It is worth mentioning that each memory page of the main index block has a time attribute, and the time point corresponding to the time attribute of the main index page is later than the time point corresponding to the time attribute of all other memory pages. In other words, the control chip can quickly search for the main index page from the memory pages according to the existing bi-search manner and according to the time attributes of the memory pages. Obtain the secondary index block address.
如步驟S03所示,該控制晶片根據該次要索引區塊位址搜尋該次要索引區塊。由於該次要索引區塊位址即該次要索引區塊的記憶體位址,因此該控制晶片可以直接根據該次要索引區塊位址找到該次要索引區塊。As shown in step S03, the control chip searches for the secondary index block according to the secondary index block address. Since the secondary index block address is the memory address of the secondary index block, the control chip can directly find the secondary index block according to the secondary index block address.
如步驟S04所示,該控制晶片自該等記憶體頁面搜尋該次要索引頁面,並自該次要索引頁面獲得該管理區塊位址。亦即,該次要索引區塊的記憶體頁面中,僅有其中一記憶體頁面儲存該管理區塊位址。而儲存該管理區塊位址的記憶體頁面,即為該次要索引頁面,故必須先搜尋到該次要索引頁面。As shown in step S04, the control chip searches the secondary index page from the memory pages, and obtains the management block address from the secondary index page. That is, only one of the memory pages of the secondary index block stores the management block address. The memory page storing the management block address is the secondary index page, so the secondary index page must be searched first.
值得一提的是,如同該主要索引區塊的記憶體頁面,該次要索引區塊的每一記憶體頁面亦具有該時間屬性,且該次要索引頁面的時間屬性對應的時間點,晚於其他所有 記憶體頁面的時間屬性對應的時間點。換句話說,該控制晶片亦可透過上述的二元搜尋的方式,並根據該等記憶體頁面的時間屬性,快速地自該等記憶體頁面中搜尋到該次要索引頁面,以獲得該管理區塊位址。It is worth mentioning that, like the memory page of the primary index block, each memory page of the secondary index block also has the time attribute, and the time attribute corresponding to the time attribute of the secondary index page is late. All other The time point corresponding to the time attribute of the memory page. In other words, the control chip can also quickly search for the secondary index page from the memory pages according to the time attribute of the memory pages to obtain the management. Block address.
如步驟S05所示,該控制晶片根據該管理區塊位址搜尋該管理區塊。由於該管理區塊位址即該管理區塊的記憶體位址,因此該控制晶片可以直接根據該管理區塊位址找到該管理區塊。As shown in step S05, the control chip searches for the management block according to the management block address. Since the management block address is the memory address of the management block, the control chip can directly find the management block according to the management block address.
如步驟S06所示,該控制晶片自該管理區塊獲得系統資料,以完成啟動程序。As shown in step S06, the control chip obtains system data from the management block to complete the startup process.
亦即,有別於現有的機制,該控制晶片不須自所有的記憶體區塊中一一地搜尋該管理區塊,而可以透過本較佳實施例將該等記憶體區塊階層化地區分為該主要索引區塊、該次要索引區塊與該管理區塊的方式,僅需於部分的記憶體區塊中搜尋到該主要索引區塊後,即可快速地透過該主要索引頁面與該次要索引頁面,找到該管理區塊。That is, unlike the existing mechanism, the control chip does not need to search for the management block one by one from all the memory blocks, and the memory blocks can be layered by the preferred embodiment. Dividing into the main index block, the secondary index block and the management block, the main index page can be quickly accessed only after searching the main index block in a part of the memory block. With the secondary index page, find the management block.
值得一提的是,系統資料有可能會因為特殊的因素而需要改為儲存於其它的記憶體區塊,例如原先的該管理區塊已經損壞,或者是基於現有的耗損平衡機制而必須變更其存放的位置。以下的步驟將進一步地介紹在上述情況下,該主要索引區塊、該次要索引區塊與該管理區塊之間的對應操作。It is worth mentioning that the system data may need to be stored in other memory blocks due to special factors. For example, the original management block has been damaged, or it must be changed based on the existing wear leveling mechanism. The location of the deposit. The following steps will further describe the corresponding operations between the primary index block, the secondary index block, and the management block in the above case.
如步驟S11所示,若必需選擇其它的記憶體區塊取代原先的管理區塊以儲存系統資料,則進行步驟S12。亦即, 若該控制晶片判斷需要把系統資料儲存於其它的記憶體區塊,則會自該等記憶體區塊中選擇一異於該主要索引區塊、該次要索引區塊,及該管理區塊的記憶體區塊,做為一新管理區塊,以取代原先的管理區塊。As shown in step S11, if it is necessary to select another memory block instead of the original management block to store the system data, step S12 is performed. that is, If the control chip determines that the system data needs to be stored in another memory block, then the main index block, the secondary index block, and the management block are selected from the memory blocks. The memory block acts as a new management block to replace the original management block.
如步驟S12所示,判斷該次要索引區塊是否有剩餘的空間。由於步驟S11中該控制晶片已經將選擇新的管理區塊儲存系統資料,因此該次要索引區塊也必須修正其記憶體頁面的內容。首先該控制晶片會先判斷該次要索引區塊是否無剩餘空間,亦即,其所有的記憶體頁面是否都已存放資料。若仍有剩餘空間,則進行步驟S16;若無剩餘空間,則進行步驟S13。As shown in step S12, it is determined whether the secondary index block has remaining space. Since the control chip has selected a new management block storage system data in step S11, the secondary index block must also correct the contents of its memory page. First, the control chip first determines whether the secondary index block has no remaining space, that is, whether all of its memory pages have stored data. If there is still space left, step S16 is performed; if there is no remaining space, step S13 is performed.
如步驟S13所示,抹除該次要索引區塊。由於該次要索引區塊的所有記憶體頁面都已存放資料,然而卻又必須更新該管理區塊位址,因此必須抹除該次要索引區塊。接著,自該等記憶體頁面中選擇其中一者做為該次要索引頁面,以將對應新的管理區塊的管理區塊位址,儲存於該次要索引頁面。The secondary index block is erased as shown in step S13. Since all the memory pages of the secondary index block have stored data, but the management block address has to be updated, the secondary index block must be erased. Then, one of the memory pages is selected as the secondary index page to store the management block address corresponding to the new management block on the secondary index page.
如步驟S14所示,判斷該次要索引區塊是否已損毀。由於當該控制晶片抹除該次要索引區塊的次數過於頻繁時,該次要索引區塊有可能會因此而損毀。因此若該控制晶片判斷該次要索引區塊無損毀時,則回到步驟S12;若該控制晶片判斷該次要索引區塊已損毀時,則進行步驟S15。As shown in step S14, it is determined whether the secondary index block has been corrupted. Since the number of times the control chip erases the secondary index block is too frequent, the secondary index block may be destroyed as a result. Therefore, if the control chip determines that the secondary index block is not damaged, the process returns to step S12; if the control chip determines that the secondary index block has been damaged, then step S15 is performed.
如步驟S15所示,變更該次要索引區塊,並更新該主要索引頁面。由於該次要索引區塊已損毀,因此該控制晶 片必須自該等記憶體區塊中指定一異於該主要索引區塊、該次要索引區塊,及該管理區塊的記憶體區塊做為一新次要索引區塊,以取代原先的次要索引區塊。As shown in step S15, the secondary index block is changed and the main index page is updated. Since the secondary index block has been destroyed, the control crystal The slice must be different from the main index block, the secondary index block, and the memory block of the management block as a new secondary index block to replace the original Secondary index block.
又,由於該次要索引區塊已變更,因此原先儲存於該主要索引頁面的該次要索引區塊位址亦需要變更。亦即,該控制晶片必須將新的次要索引區塊的記憶體位址做為該次要索引區塊位址,並加以儲存於該主要索引頁面。Moreover, since the secondary index block has been changed, the secondary index block address originally stored in the main index page also needs to be changed. That is, the control chip must use the memory address of the new secondary index block as the secondary index block address and store it on the main index page.
此外如上述所提,若該控制晶片判斷該次要索引區塊仍有剩餘空間,則會進行步驟S16。Further, as mentioned above, if the control chip determines that there is still space left in the secondary index block, step S16 is performed.
如步驟S16與S17所示,更新該次要索引頁面。亦即,該次要索引頁面會將新管理區塊的記憶體位址做為該管理區塊位址,並將其儲存於該次要索引頁面。The secondary index page is updated as shown in steps S16 and S17. That is, the secondary index page will use the memory address of the new management block as the management block address and store it on the secondary index page.
故在現有的耗損平衡的機制下,即使該控制晶片頻繁地選擇新的記憶體區塊做為儲存系統資料的該管理區塊,透過本較佳實施例的機制,仍然可以很有效率地獲得系統資料,以完成啟動程序。Therefore, under the existing wear leveling mechanism, even if the control chip frequently selects a new memory block as the management block for storing system data, the mechanism of the preferred embodiment can still be obtained efficiently. System information to complete the startup process.
綜上所述,基於該主要索引區塊、該次要索引區塊,及該管理區塊的階層關係,系統資料得以有效率地被找出;若系統資料所儲存的位置頻繁地變更,透過更新該主要索引頁面與該次要索引頁面,系統資料亦能有效率地被找出,而不影響啟動程序,故確實能達成本發明之目的。In summary, based on the primary index block, the secondary index block, and the hierarchical relationship of the management block, system data can be efficiently found; if the location of the system data is frequently changed, By updating the main index page and the secondary index page, the system data can be efficiently found without affecting the startup program, so that the object of the present invention can be achieved.
惟以上所述者,僅為本發明之較佳實施例而已,當不能以此限定本發明實施之範圍,即大凡依本發明申請專利範圍及發明說明內容所作之簡單的等效變化與修飾,皆仍 屬本發明專利涵蓋之範圍內。The above is only the preferred embodiment of the present invention, and the scope of the invention is not limited thereto, that is, the simple equivalent changes and modifications made by the scope of the invention and the description of the invention are Still It is within the scope of the patent of the present invention.
S01~S06‧‧‧步驟S01~S06‧‧‧Steps
S11~S17‧‧‧步驟S11~S17‧‧‧Steps
圖1是一流程圖,說明本發明基於索引區塊的系統資料尋找方法的較佳實施例;及圖2是一流程圖,說明本較佳實施例更新管理區塊、次要索引頁面,及主要索引頁面的流程。1 is a flow chart illustrating a preferred embodiment of a method for finding a system data based on an index block according to the present invention; and FIG. 2 is a flowchart illustrating an update management block, a secondary index page, and The process of the main index page.
S01~S06‧‧‧步驟S01~S06‧‧‧Steps
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW102100705A TWI497292B (en) | 2013-01-09 | 2013-01-09 | A Method of Finding System Data Based on Index Block |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW102100705A TWI497292B (en) | 2013-01-09 | 2013-01-09 | A Method of Finding System Data Based on Index Block |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201428492A TW201428492A (en) | 2014-07-16 |
TWI497292B true TWI497292B (en) | 2015-08-21 |
Family
ID=51726087
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW102100705A TWI497292B (en) | 2013-01-09 | 2013-01-09 | A Method of Finding System Data Based on Index Block |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI497292B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW591385B (en) * | 2001-06-05 | 2004-06-11 | Infineon Technologies Ag | Apparatus and method for determining a physical address from a virtual address by using a hierarchical mapping regulation with compressed nodes |
US20110258386A1 (en) * | 2001-01-19 | 2011-10-20 | Conley Kevin M | Partial Block Data Programming And Reading Operations In A Non-Volatile Memory |
TW201227741A (en) * | 2010-11-15 | 2012-07-01 | Samsung Electronics Co Ltd | Data storage device, user device and data write method |
-
2013
- 2013-01-09 TW TW102100705A patent/TWI497292B/en not_active IP Right Cessation
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110258386A1 (en) * | 2001-01-19 | 2011-10-20 | Conley Kevin M | Partial Block Data Programming And Reading Operations In A Non-Volatile Memory |
TW591385B (en) * | 2001-06-05 | 2004-06-11 | Infineon Technologies Ag | Apparatus and method for determining a physical address from a virtual address by using a hierarchical mapping regulation with compressed nodes |
TW201227741A (en) * | 2010-11-15 | 2012-07-01 | Samsung Electronics Co Ltd | Data storage device, user device and data write method |
Also Published As
Publication number | Publication date |
---|---|
TW201428492A (en) | 2014-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10783071B2 (en) | Data storage device and operating method thereof, wherein mapping table for valid data of source block that has not been copied to destination block has a higher priority than mapping information collected by reverse scanning from end of the destination block | |
US8478796B2 (en) | Uncorrectable error handling schemes for non-volatile memories | |
US7831783B2 (en) | Effective wear-leveling and concurrent reclamation method for embedded linear flash file systems | |
US7127551B2 (en) | Flash memory management method | |
US7783851B2 (en) | Methods of reusing log blocks in non-volatile memories and related non-volatile memory devices | |
KR100843543B1 (en) | System comprising flash memory device and data recovery method thereof | |
EP2530612B1 (en) | Mount-time unmapping of unused logical addresses in non-volatile memory systems | |
US10936207B2 (en) | Linked lists in flash memory | |
US20090287875A1 (en) | Memory module and method for performing wear-leveling of memory module | |
US20130151754A1 (en) | Lba bitmap usage | |
CN108959119B (en) | Method and system for garbage collection in storage system | |
US8825946B2 (en) | Memory system and data writing method | |
US10521123B2 (en) | Additive library for data structures in a flash memory | |
US7925821B2 (en) | Nonvolatile semiconductor storage device and method of managing the same | |
US20180189144A1 (en) | Apparatus and method for memory storage to protect data-loss after power loss | |
US10318201B2 (en) | Flash interface for processing datasets | |
US10552335B2 (en) | Method and electronic device for a mapping table in a solid-state memory | |
US9959044B2 (en) | Memory device including risky mapping table and controlling method thereof | |
US9329994B2 (en) | Memory system | |
US10635654B2 (en) | Data journaling for large solid state storage devices with low DRAM/SRAM | |
KR101676175B1 (en) | Apparatus and method for memory storage to protect data-loss after power loss | |
TWI497292B (en) | A Method of Finding System Data Based on Index Block | |
US11204880B2 (en) | Hash tables in flash memory | |
Kang et al. | Per-block-group journaling for improving fsync response time | |
KR20150139383A (en) | Semiconductor device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |