TWI385520B - Management methods and systems for storage units - Google Patents

Management methods and systems for storage units Download PDF

Info

Publication number
TWI385520B
TWI385520B TW97140886A TW97140886A TWI385520B TW I385520 B TWI385520 B TW I385520B TW 97140886 A TW97140886 A TW 97140886A TW 97140886 A TW97140886 A TW 97140886A TW I385520 B TWI385520 B TW I385520B
Authority
TW
Taiwan
Prior art keywords
block
page
definition
candidate
storage unit
Prior art date
Application number
TW97140886A
Other languages
Chinese (zh)
Other versions
TW200937195A (en
Inventor
Jiang Pei-Jun
Original Assignee
Via Tech Inc
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 Via Tech Inc filed Critical Via Tech Inc
Priority to TW97140886A priority Critical patent/TWI385520B/en
Publication of TW200937195A publication Critical patent/TW200937195A/en
Application granted granted Critical
Publication of TWI385520B publication Critical patent/TWI385520B/en

Links

Description

儲存單元管理方法及系統Storage unit management method and system

本發明係有關於一種儲存單元管理方法及系統,且特別有關於一種可以用於非揮發性記憶體,將儲存單元之實體區塊進行分類管理之儲存單元管理方法及系統。The present invention relates to a storage unit management method and system, and more particularly to a storage unit management method and system that can be used for non-volatile memory to classify and manage physical blocks of storage units.

目前來說,非揮發性記憶體,如快閃記憶體已經非常廣泛的使用。其特徵在於以頁面(Page)為單位讀寫、以區塊(Block)為單位刪除、以及在寫之前必須刪除。由於上述特徵,使得主機或是應用程式所使用之邏輯區塊位址(Logic Block Address,LBA)的讀寫指令非常難以管理,且難以將邏輯位址轉換為實體位址,以存取非揮發性記憶體的實體區塊。因此,通常在主機之檔案系統與非揮發性記憶體之間會使用一轉換層來管理來自主機的讀寫命令,以存取記憶體中的資料。在習知對於非揮發性記憶體進行儲存管理時,資料通常係依據頁面映射(Page Mapping)、或區塊映射(Block Mapping)等模式進行存取與定址。Currently, non-volatile memory, such as flash memory, has been used very widely. It is characterized in that it is read and written in units of pages, deleted in units of blocks, and must be deleted before writing. Due to the above characteristics, the read/write instructions of the logical block address (LBA) used by the host or the application are very difficult to manage, and it is difficult to convert the logical address into a physical address to access the non-volatile The physical block of sexual memory. Therefore, a conversion layer is usually used between the host's file system and non-volatile memory to manage read and write commands from the host to access data in the memory. In the conventional storage management of non-volatile memory, the data is usually accessed and addressed according to modes such as page mapping or block mapping.

在頁面映射模式中,儲存單元中的資料係以頁面為單位進行儲存,且具有相應之頁面映射表。頁面映射表中,邏輯頁面的編號為一索引,且實體頁面的位址為表項(項目內容)。當採用頁面映射之儲存系統處理讀寫命令時,則可以直接查找、以及更新頁面映射表以完成相關資料頁面之定位。在區塊映射模式中,儲存單元中的資料係以區塊為單位進行儲存,且具有相應之區塊映射表。區塊映射表中, 邏輯區塊的編號為索引,且實體區塊的位址為表項。當採用區塊映射之儲存系統處理讀寫命令時,則可以直接查找、以及更新區塊映射表以完成相關資料頁面之定位。In the page mapping mode, the data in the storage unit is stored in units of pages and has a corresponding page mapping table. In the page mapping table, the logical page number is an index, and the address of the entity page is an entry (project content). When the page mapping storage system is used to process the read and write commands, the page mapping table can be directly searched and updated to complete the positioning of the related data page. In the block mapping mode, the data in the storage unit is stored in units of blocks and has a corresponding block mapping table. In the block mapping table, The logical block number is an index, and the address of the physical block is an entry. When the block mapping storage system is used to process the read and write commands, the block mapping table can be directly searched and updated to complete the positioning of the related data page.

近年來,隨著積體電路技術的發展,儲存單元的頁面/區塊尺寸已經大幅提高。此外,高密度儲存單元,如NAND(與非)快閃記憶體中每個區塊的個別頁面必須依照順序寫入,不能隨機寫入。另外,由於NAND快閃記憶體具有以頁面為單位讀寫、以區塊為單位刪除、以及在寫之前必須刪除的特點。因此,當採用區塊映射的儲存系統處理寫入命令時,必須先分配一個區塊,以至於可以將要求的頁面寫入分配之區塊中。之後,再將屬於相應此要求頁面之邏輯區塊中其他的頁面複製至此分配之區塊中,其中此分配之區塊中的原有資料必須先被刪除。因此,特別是對於可能包括頻繁被主機存取之熱資料的要求頁面而言,當區塊尺寸增大後,將導致寫入性能大大降低。在頁面映射模式中,資料的分佈非常複雜與繁亂。當空閒區塊用盡時,資料合併以獲取新空閒區塊的過程將會非常複雜。In recent years, with the development of integrated circuit technology, the page/block size of the storage unit has been greatly improved. In addition, high-density storage units, such as individual pages of each block in NAND flash memory, must be written in order and cannot be randomly written. In addition, since NAND flash memory has the characteristics of reading and writing in units of pages, deleting in units of blocks, and having to be deleted before writing. Therefore, when a block-mapped storage system processes a write command, a block must first be allocated so that the requested page can be written to the allocated block. After that, the other pages in the logical block belonging to the corresponding request page are copied into the allocated block, and the original data in the allocated block must be deleted first. Therefore, especially for demand pages that may include hot data that is frequently accessed by the host, when the block size is increased, the write performance is greatly reduced. In the page mapping mode, the distribution of data is very complicated and confusing. When the free block is used up, the process of merging the data to acquire the new free block will be very complicated.

因此,一些儲存管理系統提出可以結合區塊映射與頁面映射之混合型映射模式。在這些系統中,儲存單元中可以包括相應區塊映射與頁面映射的個別區域,且個別區域的使用僅能透過資料合併作業來進行切換。雖然具有混合型映射模式之儲存管理系統可以提供較大的彈性來儲存資料,然而,在實際使用上,儲存單元中相應區塊映射與頁面映射的實體區塊中仍然會存在許多未利用之實體頁面, 進而使得儲存單元中資料的分佈非常複雜與繁亂。類似地,進行相關資料合併時亦會造成系統的效能負擔。Therefore, some storage management systems propose a hybrid mapping mode that can combine block mapping with page mapping. In these systems, the storage unit may include individual areas of the corresponding block mapping and page mapping, and the use of the individual areas can only be switched through the data merge operation. Although the storage management system with hybrid mapping mode can provide greater flexibility to store data, in actual use, there are still many unused entities in the physical block of the corresponding block mapping and page mapping in the storage unit. page, In turn, the distribution of data in the storage unit is very complicated and confusing. Similarly, the consolidation of related data will also cause a systemic performance burden.

有鑑於此,本發明提供儲存單元管理方法及系統。In view of this, the present invention provides a storage unit management method and system.

本發明實施例之儲存單元管理方法,用以管理包括複數實體區塊之儲存單元,其中每一實體區塊具有複數區塊種類定義中之一者。首先,取得一子寫入命令,其中子寫入命令係要求對於相應至少一邏輯區塊之至少一邏輯頁面進行資料寫入作業。判斷儲存單元中是否存在具有區塊種類定義中之一第一區塊定義之一候選區塊,其中依據第一區塊定義邏輯區塊之邏輯頁面無法映射至候選區塊。若候選區塊存在,將第一區塊定義轉換為區塊種類定義中之一第二區塊定義。將一資料寫入候選區塊中之一特定頁面,且記錄邏輯區塊之邏輯頁面與候選區塊之特定頁面之一映射關係。The storage unit management method of the embodiment of the present invention is configured to manage a storage unit including a plurality of physical blocks, wherein each physical block has one of a plurality of block type definitions. First, a sub-write command is obtained, wherein the sub-write command requires a data write operation for at least one logical page of the corresponding at least one logical block. Determining whether there is one candidate block in the storage unit having one of the block type definitions, wherein the logical page of the logical block according to the first block definition cannot be mapped to the candidate block. If the candidate block exists, the first block definition is converted to one of the block type definitions. A material is written to a specific page in the candidate block, and a logical page of the recording logical block is mapped to one of the specific pages of the candidate block.

本發明實施例之儲存單元管理系統包括一儲存單元與一處理模組。儲存單元包括複數實體區塊,每一實體區塊具有複數區塊種類定義中之一者。處理模組取得一子寫入命令,其中子寫入命令係要求對於相應至少一邏輯區塊之至少一邏輯頁面進行資料寫入作業。處理模組判斷儲存單元中是否存在具有區塊種類定義中之一第一區塊定義之一候選區塊,其中依據第一區塊定義邏輯區塊之邏輯頁面無法映射至候選區塊。若候選區塊存在,處理模組將第一區塊定義轉換為區塊種類定義中之一第二區塊定義,且將一 資料寫入候選區塊中之一特定頁面,並記錄邏輯區塊之邏輯頁面與候選區塊之特定頁面之一映射關係。The storage unit management system of the embodiment of the invention includes a storage unit and a processing module. The storage unit includes a plurality of physical blocks, each of which has one of a plurality of block type definitions. The processing module obtains a sub-write command, wherein the sub-write command requires a data write operation for at least one logical page of the corresponding at least one logical block. The processing module determines whether there is one candidate block in the storage unit having one of the block type definitions, wherein the logical page of the logical block according to the first block cannot be mapped to the candidate block. If the candidate block exists, the processing module converts the first block definition into one of the block type definitions, and the second block definition The data is written into one of the specific pages of the candidate block, and the logical page of the logical block is mapped to one of the specific pages of the candidate block.

本發明上述方法可以透過程式碼方式收錄於實體媒體中。當程式碼被機器載入且執行時,機器變成用以實行本發明之裝置。The above method of the present invention can be recorded in physical media through code. When the code is loaded and executed by the machine, the machine becomes the means for practicing the invention.

為使本發明之上述目的、特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖示,詳細說明如下。The above described objects, features, and advantages of the invention will be apparent from the description and appended claims appended claims

第1圖顯示依據本發明實施例之儲存單元管理系統。Figure 1 shows a storage unit management system in accordance with an embodiment of the present invention.

依據本發明實施例之儲存單元管理系統100包括一儲存單元110、一記憶體120與一處理模組130。The storage unit management system 100 according to the embodiment of the present invention includes a storage unit 110, a memory 120, and a processing module 130.

儲存單元110可以是一非揮發性記憶體,如NAND快閃記憶體。儲存單元110中的資料可以以區塊映射模式與頁面映射模式分別以區塊與頁面為單位進行儲存。值得注意的是,在本案中儲存單元110的實體區塊可以具有不同的區塊種類定義,以分類進行管理。第2圖顯示儲存單元110之實體區塊。在此實施例中,區塊種類定義可以包括一資料區塊定義、一連續區塊定義、一奉獻區塊定義、與一共享區塊定義。儲存單元110中之每一實體區塊可以分別具有上述區塊種類定義中之一者,且可以進行轉換。其中,具有資料區塊定義之實體區塊111係依據區塊映射模式儲存資料,且實體區塊中之所有頁面都已經被寫入資料。具有連續區塊定義之實體區塊112中,從第一個頁面開始之複數個頁面係依據區塊映射模式儲存資料,且實體 區塊112中存在至少一個未寫入資料之頁面。具有奉獻區塊定義之實體區塊113中的資料皆係對應至同一個邏輯區塊,從第一個頁面開始之複數個頁面係依據區塊映射模式儲存資料,且存在至少一頁面並不依據區塊映射模式儲存資料。具有共享區塊定義之實體區塊114中的資料係依據頁面映射模式儲存資料,且對應至至少二特定邏輯區塊。值得注意的是,儲存單元110亦可包括並未指定區塊種類定義之空閒實體區塊(未顯示)。區塊種類定義間之轉換將於後進行說明。The storage unit 110 can be a non-volatile memory such as NAND flash memory. The data in the storage unit 110 can be stored in units of blocks and pages in a block mapping mode and a page mapping mode, respectively. It should be noted that the physical blocks of the storage unit 110 in this case may have different block type definitions and are managed by classification. FIG. 2 shows a physical block of the storage unit 110. In this embodiment, the block type definition may include a data block definition, a contiguous block definition, a dedication block definition, and a shared block definition. Each of the physical blocks in the storage unit 110 may have one of the above-described block type definitions and may be converted. The physical block 111 having the data block definition stores data according to the block mapping mode, and all pages in the physical block have been written into the data. In the physical block 112 having the contiguous block definition, the plurality of pages starting from the first page are stored according to the block mapping mode, and the entity is There is at least one page of unwritten material in block 112. The data in the physical block 113 having the dedication block definition corresponds to the same logical block, and the plurality of pages starting from the first page are stored according to the block mapping mode, and at least one page is not based on The block mapping mode stores data. The data in the physical block 114 having the shared block definition stores data according to the page mapping mode and corresponds to at least two specific logical blocks. It should be noted that the storage unit 110 may also include an idle physical block (not shown) that does not specify a block type definition. The transition between the definitions of the block types will be described later.

另外,儲存單元110亦包括一映射目錄、複數區塊映射表、複數頁面映射區塊表、以及複數頁面映射表。記憶體120可以是一隨機存取記憶體(Random Access Memory,RAM),在該儲存單元管理系統100正常運作時,用於存儲從儲存單元110載入的映射目錄、區塊映射表、頁面映射區塊表、以及頁面映射表。而映射目錄、區塊映射表、頁面映射區塊表、以及頁面映射表將於下說明。In addition, the storage unit 110 also includes a mapping directory, a complex block mapping table, a complex page mapping block table, and a complex page mapping table. The memory 120 may be a random access memory (RAM) for storing a mapping directory, a block mapping table, and a page mapping loaded from the storage unit 110 when the storage unit management system 100 is operating normally. Block table, and page mapping table. The mapping directory, the block mapping table, the page mapping block table, and the page mapping table will be described below.

第3圖顯示依據本發明實施例之映射目錄之其中一項目的格式。映射目錄係映射使用者資料的根目錄。映射目錄包含多個如第3圖所示的項目,且每一項目可以指向一包含複數區塊映射表中一部分的頁面,該頁面包含的區塊映射表與一既定大小,如256MB的使用者資料相對應。如第3圖所示,映射目錄項目300包括一’MappingDirectoryNumber’欄位340、一’bInCache’欄位310、一’CachedBmtNumber,欄位320、與 一’BmtPageLocation’欄位330。’MappingDirectoryNumber’欄位340係記錄一映射目錄編號,用以作為此映射目錄項目300之索引。’bInCache’欄位310係表示相應之區塊映射表頁面是否已經由儲存單元110載入記憶體120中。舉例來說,若區塊映射表頁面已經載入在記憶體120中,則’bInCache’欄位310中記錄’1’;若區塊映射表頁面尚未載入至記憶體120中,則’bInCache’欄位310中記錄’0’。對於已經載入至記憶體120中的區塊映射表頁面,’CachedBmtNumber’欄位320記錄相應此區塊映射表頁面在記憶體120中的位址。對於尚未載入至記憶體120中的區塊映射表頁面,則’CachedBmtNumber’欄位320為’Invalid’,且區塊映射表頁面在儲存單元110上的實體儲存位址被記錄在’BmtPageLocation’欄位330中。Figure 3 shows one of the destination formats of the mapping directory in accordance with an embodiment of the present invention. The mapping directory maps the root directory of user data. The mapping directory contains a plurality of items as shown in FIG. 3, and each item can point to a page containing a part of the complex block mapping table, the page contains a block mapping table and a user of a predetermined size, such as 256 MB. The data corresponds. As shown in FIG. 3, the mapping directory item 300 includes a 'MappingDirectoryNumber' field 340, a 'bInCache' field 310, a 'CachedBmtNumber, field 320, and A 'BmtPageLocation' field 330. The 'MappingDirectoryNumber' field 340 records a mapping directory number as an index to this mapping directory entry 300. The 'bInCache' field 310 indicates whether the corresponding block map table page has been loaded into the memory 120 by the storage unit 110. For example, if the block mapping table page is already loaded in the memory 120, the 'bInCache' field 310 records '1'; if the block mapping table page has not been loaded into the memory 120, then 'bInCache '0' is recorded in field 310. For the tile mapping table page already loaded into the memory 120, the 'CachedBmtNumber' field 320 records the address of the corresponding tile mapping table page in the memory 120. For the tile mapping table page that has not been loaded into the memory 120, the 'CachedBmtNumber' field 320 is 'Invalid', and the physical storage address of the tile mapping table page on the storage unit 110 is recorded in 'BmtPageLocation' In field 330.

第4圖顯示依據本發明實施例之區塊映射表之其中一項目的格式。區塊映射表包含多個如第4圖所示的項目,其中每一項目記錄相應此邏輯區塊之資料的存儲位置資訊。如第4圖所示,區塊映射表項目400包括一’BlockOffset’欄位430、一’bPageMapped’欄位410、與一’BlockInfo’欄位420。’BlockOffset’欄位430記錄一區塊位移,用以作為區塊映射表項目400之索引。如前所述,儲存單元110中的資料可以是以區塊映射模式或頁面映射模式進行儲存。因此,’bPageMapped’欄位410係用以表示擁有此區塊映射表之一邏輯區塊所採用的映射模式。舉例來說。若此邏輯區塊是採用區塊映射模式, 則’bPageMapped’欄位410中記錄’0’:若此邏輯區塊是採用頁面映射模式,則’bPageMapped’欄位410中記錄’1’。’BlockInfo’欄位420則係記錄詳細之映射資訊。其中,對於採用區塊映射模式之邏輯區塊,’BlockInfo’欄位420中記錄相應資料區塊的實體位置,如實體區塊編號。對於採用頁面映射模式之邏輯區塊,’BlockInfo’欄位420中記錄一頁面映射區塊編號,用以表示此邏輯區塊為哪個頁面映射區塊。Figure 4 shows one of the destination formats of the block map in accordance with an embodiment of the present invention. The block mapping table contains a plurality of items as shown in FIG. 4, wherein each item records storage location information of the data corresponding to the logical block. As shown in FIG. 4, the tile mapping table entry 400 includes a 'BlockOffset' field 430, a 'bPageMapped' field 410, and a 'BlockInfo' field 420. The 'BlockOffset' field 430 records a block displacement for use as an index to the block map entry 400. As previously mentioned, the data in the storage unit 110 can be stored in a block mapping mode or a page mapping mode. Therefore, the 'bPageMapped' field 410 is used to indicate the mapping mode employed by the logical block that owns one of the block mapping tables. for example. If this logical block is in block mapping mode, Then '0' is recorded in the 'bPageMapped' field 410: If the logical block is in the page mapping mode, '1' is recorded in the 'bPageMapped' field 410. The 'BlockInfo' field 420 records detailed mapping information. Wherein, for the logical block adopting the block mapping mode, the physical location of the corresponding data block, such as the physical block number, is recorded in the 'BlockInfo' field 420. For a logical block that uses the page mapping mode, a page mapping block number is recorded in the 'BlockInfo' field 420 to indicate which page mapping block this logical block is.

第5圖顯示依據本發明實施例之頁面映射區塊表之其中一項目的格式。頁面映射區塊表包含多個如第5圖所示的項目,其中每一項目記錄相應此邏輯區塊之頁面映射表在記憶體120中的起始位址。如第5圖所示,頁面映射區塊表項目500包括一’PageMappedBlockNum’欄位510、與一’PageMappingTableInfo’欄位520。其中,’PageMappedBlockNum’欄位510係用以記錄頁面映射區塊編號,當邏輯區塊使用頁面映射模式時,’PageMappedBlockNum’欄位510中之頁面映射區塊編號係對應至區塊映射表項目400之’BlockInfo’欄位420中所記錄的資料。’PageMappingTableInfo’欄位520係用以記錄相應此邏輯區塊之頁面映射表在記憶體120中的起始位址。Figure 5 shows one of the destination formats of the page mapping block table in accordance with an embodiment of the present invention. The page mapping block table contains a plurality of items as shown in FIG. 5, wherein each item records a starting address in the memory 120 corresponding to the page mapping table of the logical block. As shown in FIG. 5, the page mapping block table item 500 includes a 'PageMappedBlockNum' field 510 and a 'PageMappingTableInfo' field 520. The 'PageMappedBlockNum' field 510 is used to record the page mapping block number. When the logical block uses the page mapping mode, the page mapping block number in the 'PageMappedBlockNum' field 510 corresponds to the block mapping table item 400. The data recorded in the 'BlockInfo' field 420. The 'PageMappingTableInfo' field 520 is used to record the start address of the page mapping table corresponding to the logical block in the memory 120.

每一頁面映射區塊擁有被’PageMappingTableInfo’欄位520定址的一頁面映射表。第6圖顯示依據本發明實施例之頁面映射表之一項目的格式。頁面映射表包含多個如 第6圖所示的項目,其中每一項目記錄相應此邏輯區塊中邏輯頁面的實體儲存位置,如裝置編號、實體區塊編號與相應此頁面映射邏輯區塊之一邏輯頁面的實體頁面位移等。如第6圖所示,頁面映射表項目600包括一’PageOffset’欄位610、與一’PageInfo’欄位620。其中,’PageOffset’欄位610係用以記錄頁面位移以作為該項目之索引,且’PageInfo’欄位620係用以記錄相應此邏輯區塊中邏輯頁面的實體儲存位置。注意的是,在一些實施例中,頁面映射表中的項目數目等於一個邏輯區塊中所包含的頁面數量。Each page mapping block has a page mapping table addressed by the 'PageMappingTableInfo' field 520. Figure 6 shows the format of an item of a page mapping table in accordance with an embodiment of the present invention. The page mapping table contains multiple The item shown in Figure 6, wherein each item records the physical storage location of the logical page in the corresponding logical block, such as the device number, the physical block number, and the physical page displacement of the logical page of one of the corresponding logical blocks of the page mapping Wait. As shown in Fig. 6, the page mapping table item 600 includes a 'PageOffset' field 610 and a 'PageInfo' field 620. The 'PageOffset' field 610 is used to record the page displacement as an index of the item, and the 'PageInfo' field 620 is used to record the physical storage location of the logical page in the corresponding logical block. Note that in some embodiments, the number of items in the page map is equal to the number of pages included in one logical block.

請繼續參考第1圖。處理模組130可以由上層,如主機中之應用程式接收寫入命令,將寫入命令分解為以頁面為單位之至少一子寫入命令,該子寫入命令包括一邏輯區塊位址(Logic Block Address,LBA)。處理模組130依據映射目錄、區塊映射表、頁面映射區塊表、與頁面映射表將將子寫入命令轉換為一實體寫入命令,即將該邏輯區塊位址(LBA)轉換為一實體位址,以存取儲存單元110中之實體頁面,且執行寫入命令與轉換實體區塊之區塊種類定義,以將資料寫入儲存單110元中特定實體區塊之特定頁面中。Please continue to refer to Figure 1. The processing module 130 can receive a write command from an upper layer, such as an application in the host, and decompose the write command into at least one sub-write command in units of pages, the sub-write command including a logical block address ( Logic Block Address, LBA). The processing module 130 converts the sub-write command into a physical write command according to the mapping directory, the block mapping table, the page mapping block table, and the page mapping table, that is, converting the logical block address (LBA) into one The physical address is used to access the physical page in the storage unit 110, and the write command and the block type definition of the converted physical block are executed to write the data into a specific page of the specific physical block in the storage unit 110.

第7A~7D圖顯示依據本發明實施例之儲存單元管理方法。7A to 7D are diagrams showing a storage unit management method according to an embodiment of the present invention.

首先,如步驟S702(第7A圖),由上層,如應用程式等接收一寫入命令,且如步驟S704,將接收之寫入命令分解 為以邏輯頁面為單位之至少一子寫入命令。其中,子寫入命令可以包括一邏輯區塊位址(Logic Block Address,LBA),其中邏輯區塊位址包括映射目錄編號(Mapping Directory Number)、一區塊位移(Block Offset)、一頁面位移(Page Offset)、一裝置編號(Device Number)與/或一磁區位移(Sector Offset)。第8圖顯示依據本發明實施例之子寫入命令中邏輯區塊位址的格式。如第8圖所示,邏輯區塊位址(Logic Block Address,LBA)800包括一’MDN’欄位、一’BO’欄位、一’PO’欄位、’DN’欄位、與一’SO’欄位。其中,’MDN’欄位記錄映射目錄編號(Mapping Directory Number),’BO’欄位記錄區塊位移(Block Offset),’PO’欄位記錄頁面位移(Page Offset),’DN’欄位記錄裝置編號(Device Number),且’SO’欄位記錄磁區位移(Sector Offset)。值得注意的是,透過子寫入命令可以得知資料欲寫入至少一邏輯區塊之至少一邏輯頁面。如步驟S706,依據子寫入命令中之’MDN’欄位由映射目錄中之複數區塊映射表中定位一特定區塊映射表。如步驟S708,判斷此特定區塊映射表是否已經載入於記憶體中。提醒的是,判斷特定區塊映射表是否已經載入於記憶體中可以依據邏輯區塊位址800中相應如第3圖所示的映射目錄編號之項目300中’bInCache’欄位310的資料來判斷。若特定區塊映射表不在記憶體中(步驟S708的否),如步驟S710,由已經載入記憶體中之區塊映射表中選擇一候選區塊映射表,且如步驟S712,將特定區塊映射表載入記憶體中以取代候選區塊映射表。值得注意 的是,在一些實施例中,當記憶體空間不足時,才需要進行選擇候選區塊映射表之操作,且候選區塊映射表可以依據一最久未使用(LRU)演算法來進行選擇。若記憶體仍具有空間,則可以直接將特定區塊映射表載入記憶體中。將特定區塊映射表載入之後可以執行步驟S714。First, as in step S702 (FIG. 7A), a write command is received by an upper layer, such as an application, and the received write command is decomposed as in step S704. Writes a command for at least one child in units of logical pages. The sub-write command may include a logical block address (LBA), wherein the logical block address includes a mapping directory number, a block offset (Block Offset), and a page shift. (Page Offset), a Device Number, and/or a Sector Offset. Figure 8 shows the format of a logical block address in a sub-write command in accordance with an embodiment of the present invention. As shown in FIG. 8, the Logic Block Address (LBA) 800 includes an 'MDN' field, a 'BO' field, a 'PO' field, a 'DN' field, and a 'SO' field. Among them, 'MDN' field record mapping directory number (Mapping Directory Number), 'BO' field record block shift (Block Offset), 'PO' field record page shift (Page Offset), 'DN' field record Device Number, and the 'SO' field records the sector offset (Sector Offset). It should be noted that the sub-write command can be used to know that the data is to be written to at least one logical page of at least one logical block. In step S706, a specific block mapping table is located in the complex block mapping table in the mapping directory according to the 'MDN' field in the sub-write command. In step S708, it is determined whether the specific block mapping table has been loaded in the memory. It is reminded that determining whether a specific block mapping table has been loaded into the memory may be based on the data of the 'bInCache' field 310 in the item 300 of the logical directory address 800 corresponding to the mapping directory number as shown in FIG. To judge. If the specific block mapping table is not in the memory (No in step S708), in step S710, a candidate block mapping table is selected from the block mapping table already loaded in the memory, and in step S712, the specific area is selected. The block map table is loaded into the memory to replace the candidate block map. Noteworthy In some embodiments, when the memory space is insufficient, the operation of selecting the candidate block mapping table is required, and the candidate block mapping table may be selected according to a longest unused (LRU) algorithm. If the memory still has space, you can directly load the specific block mapping table into the memory. Step S714 may be performed after loading the specific block mapping table.

若特定區塊映射表已經在記憶體中(步驟S708的是),執行步驟S714。如步驟S714,依據子寫入命令之邏輯區塊位址800中之區塊位移(記錄在’BO’欄位)由特定區塊映射表中定位一第一特定項目(如第4圖所示的一區塊映射表項目400)。第一特定項目包括一映射模式設定(’bPageMapped’欄位410之資料)與一區塊資訊(’BlockInfo’欄位420之資料)。如步驟S716,依據映射模式設定判斷相應區塊之映射模式是否為頁面映射模式。若映射模式為區塊映射模式時(步驟S716的否),執行步驟S718。如步驟S718,判斷頁面映射區塊表中是否有空閒的項目(如第5圖所示的頁面映射區塊表項目500)。若頁面映射區塊表中有空閒的項目(步驟S718的是),進行步驟S722的操作。若頁面映射區塊表中沒有空閒的項目(步驟S718的否),如步驟S720,進行資料頁面之資料合併作業,以由頁面映射區塊表中取得至少一空閒的項目(就像是頁面映射區塊表項目500)。如步驟S722,將子寫入命令相應之空閒項目加入頁面映射區塊表中,並進行步驟S724的操作。若映射模式為頁面映射模式時(步驟S716的是),執行步驟S724。如步驟S724,依據第一特定項目中之區塊資訊(’BlockInfo’欄位 420中之頁面映射區塊編號)由一頁面映射區塊表中定位一第二特定項目(如頁面映射區塊表項目500),且如步驟S726,依據第二特定項目定位至相應特定頁面映射區塊之一特定頁面映射表。If the specific block mapping table is already in the memory (YES in step S708), step S714 is performed. In step S714, a first specific item is located in the specific block mapping table according to the block displacement (recorded in the 'BO' field) in the logical block address 800 of the sub-write command (as shown in FIG. 4). A block mapping table item 400). The first specific item includes a mapping mode setting (data of the 'bPageMapped' field 410) and a block information (data of the 'BlockInfo' field 420). In step S716, it is determined according to the mapping mode setting whether the mapping mode of the corresponding block is a page mapping mode. If the mapping mode is the block mapping mode (NO in step S716), step S718 is performed. In step S718, it is determined whether there is a free item in the page mapping block table (such as the page mapping block table item 500 shown in FIG. 5). If there is an idle item in the page mapping block table (YES in step S718), the operation in step S722 is performed. If there is no free item in the page mapping block table (No in step S718), in step S720, the data merge job of the data page is performed to obtain at least one free item from the page mapping block table (like a page mapping). Block Table Item 500). In step S722, the corresponding idle item of the sub-write command is added to the page mapping block table, and the operation of step S724 is performed. If the mapping mode is the page mapping mode (YES in step S716), step S724 is performed. In step S724, according to the block information in the first specific item ('BlockInfo' field The page mapping block number in 420 is located by a page mapping block table to locate a second specific item (such as page mapping block table item 500), and according to step S726, positioning to a corresponding specific page mapping according to the second specific item. A specific page mapping table for one of the blocks.

定位該特定頁面映射表以後,首先判斷該儲存單元110中是否存在如第2圖中所示的區塊種類定義中之一的候選區塊,即,判斷是否存在第一區塊定義之候選區塊,其中依據該第一區塊定義,欲寫入資料之邏輯區塊之邏輯頁面無法映射至該候選區塊。其中無法映射的情形,舉例而言為當該第一區塊定義為如第2圖中所示的連續區塊定義112,而欲寫入之邏輯頁面包含相應此邏輯區塊之第一個頁面時的情形。由於依據連續區塊定義112,該候選區塊從第一個頁面開始之複數個頁面係依據區塊映射模式儲存資料,因此則要寫入資料之邏輯頁面無法映射至該候選區塊。再舉例而言,無法映射的情況為當該第一區塊定義為如第2圖中所示的連續區塊定義112,而欲寫入之邏輯頁面的邏輯區塊位址LBA與該候選區塊中已寫入資料之頁面中的最後一個頁面之位址不連續的情形。由於依據連續區塊定義112,該候選區塊依據區塊映射模式儲存資料,即是說,其中邏輯頁面的邏輯位址LBA應連續,因此也無法將資料寫到該候選區塊剩餘的空白頁面中。After locating the specific page mapping table, first determining whether there is a candidate block in one of the block type definitions shown in FIG. 2 in the storage unit 110, that is, determining whether there is a candidate area defined by the first block. a block, wherein a logical page of a logical block to be written to the data cannot be mapped to the candidate block according to the first block definition. Where the map cannot be mapped, for example, when the first block is defined as a contiguous block definition 112 as shown in FIG. 2, and the logical page to be written contains the first page of the corresponding logical block. The situation at the time. Since the plurality of pages starting from the first page of the candidate block are stored according to the block mapping mode according to the contiguous block definition 112, the logical page to be written into the data cannot be mapped to the candidate block. For another example, the case where the map cannot be mapped is when the first block is defined as the contiguous block definition 112 as shown in FIG. 2, and the logical block address LBA of the logical page to be written and the candidate area are The address of the last page in the page where the data has been written in the block is not continuous. According to the contiguous block definition 112, the candidate block stores data according to the block mapping mode, that is, the logical address LBA of the logical page should be continuous, and therefore the data cannot be written to the remaining blank page of the candidate block. in.

當發生上述欲寫入資料之邏輯區塊之邏輯頁面無法映射至該候選區塊的情況時,本發明是將該第一區塊定義轉換為該等區塊種類定義中之一第二區塊定義。舉例而言, 是將為如第2圖中所示的連續區塊定義112轉換為奉獻區塊定義113,或將奉獻區塊定義113轉換為共享區塊定義114,并將要寫入的資料寫入該候選區塊中之一特定頁面。更詳細說明可參考下述第7A圖至第7D圖之說明內容。When the logical page of the logical block to which the data is to be written cannot be mapped to the candidate block, the present invention converts the first block definition into one of the block types. definition. For example, It is to convert the contiguous block definition 112 as shown in FIG. 2 into the dedication block definition 113, or convert the dedication block definition 113 into the shared block definition 114, and write the data to be written into the candidate area. One of the specific pages in the block. For a more detailed description, reference may be made to the description of the following FIGS. 7A to 7D.

如步驟S728(第7A-2圖),依據子寫入命令判斷其欲寫入之邏輯頁面是否包含相應此邏輯區塊之第一個頁面。若是(步驟S728的是),如步驟S730(第7B-1圖),判斷儲存單元中是否存在具有連續區塊定義之一候選區塊。若儲存單元中不存在具有連續區塊定義之候選區塊(步驟S730的否),如步驟S732,判斷儲存單元中是否存在具有奉獻區塊定義之一候選區塊。若儲存單元中存在具有奉獻區塊定義之候選區塊(步驟S732的是),如步驟S733,將此候選區塊由奉獻區塊定義轉換為共享區塊定義,之後執行步驟S738(第7B-2圖)。如步驟S738,重新配置一空閒區塊為具有連續區塊定義之候選區塊,並如步驟S740,依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有連續區塊定義之候選區塊中的特定頁面中。之後,進行步驟S774(第7D圖)的操作。如果儲存單元中沒有具有奉獻區塊定義之候選區塊時(第7B-1圖之步驟S732的否),則直接執行步驟S738與S740(第7B-2圖)。In step S728 (Fig. 7A-2), it is determined according to the sub-write command whether the logical page to be written contains the first page of the corresponding logical block. If so (YES in step S728), as in step S730 (Fig. 7B-1), it is judged whether or not there is one candidate block having a contiguous block definition in the storage unit. If there is no candidate block having the contiguous block definition in the storage unit (NO in step S730), in step S732, it is determined whether there is one candidate block having the dedication block definition in the storage unit. If there is a candidate block with a dedication block definition in the storage unit (YES in step S732), in step S733, the candidate block is converted from the dedication block definition to a shared block definition, and then step S738 is performed (step 7B- 2 picture). In step S738, a free block is reconfigured as a candidate block having a contiguous block definition, and in step S740, an entity write command of the corresponding storage unit is generated according to the sub-write command to write the data to have continuous The specific block in the candidate block defined by the block. Thereafter, the operation of step S774 (Fig. 7D) is performed. If there is no candidate block having the dedication block definition in the storage unit (No in step S732 of Fig. 7B-1), steps S738 and S740 (Fig. 7B-2) are directly executed.

若儲存單元中存在具有連續區塊定義之候選區塊(第7B-1圖之步驟S730的是),如步驟S742,判斷此候選區塊是否已經或是接近滿了。若候選區塊已經或是接近滿了(步驟S742的是),如步驟S744,將此候選區塊由連續區塊定 義轉換為資料區塊定義,並進行步驟S738與S740(第7B-2圖)的操作。若候選區塊並未滿或是並未接近滿(第7B-1圖之步驟S742的否),如步驟S746,將此候選區塊由連續區塊定義轉換為奉獻區塊定義,並如步驟S748(第7B-2圖),依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有奉獻區塊定義之候選區塊中的特定頁面中。之後,如步驟S750,判斷具有奉獻區塊定義之候選區塊是否已經滿了。若具有奉獻區塊定義之候選區塊已經滿了(步驟S750的是),進行步驟S734與S736的操作。如步驟S734,將此候選區塊由奉獻區塊定義轉換為共享區塊定義,並如步驟S736,依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有共享區塊定義之其它候選區塊中的特定頁面中。也就是說,剩下的欲寫入之邏輯頁面,會寫入至其它具有共享區塊定義之候選區塊中,與屬於其它邏輯區塊的頁面共用該具有共享區塊定義之候選區塊的實體存儲空間。之後,進行步驟S774(第7D圖)的操作。若具有奉獻區塊定義之候選區塊並未滿了(第7B-2圖之步驟S750的否),直接進行步驟S774(第7D圖)的操作。值得注意的是,由於子寫入命令欲寫入之邏輯頁面的數目可能超過具有奉獻區塊定義之候選區塊可以提供的頁面數目,因此必須進行步驟S750的判斷。If there is a candidate block having a contiguous block definition in the storage unit (Yes in step S730 of FIG. 7B-1), in step S742, it is determined whether the candidate block is already near or nearly full. If the candidate block is already nearly full (YES in step S742), in step S744, the candidate block is determined by the continuous block. The meaning is converted into a data block definition, and the operations of steps S738 and S740 (Fig. 7B-2) are performed. If the candidate block is not full or is not nearly full (No in step S742 of FIG. 7B-1), in step S746, the candidate block is converted from the contiguous block definition to the dedication block definition, and steps are as follows. S748 (Fig. 7B-2), generating a physical write command of the corresponding storage unit according to the sub-write command to write the data into a specific page in the candidate block having the dedication block definition. Thereafter, as in step S750, it is determined whether the candidate block having the dedication block definition is full. If the candidate block having the dedication block definition is already full (YES in step S750), the operations of steps S734 and S736 are performed. In step S734, the candidate block is converted from the dedication block definition to the shared block definition, and in step S736, one of the corresponding storage unit entity write commands is generated according to the sub-write command to write the data to have a share. The block is defined in a specific page in other candidate blocks. That is to say, the remaining logical pages to be written are written into other candidate blocks with shared block definitions, and the candidate blocks with shared block definitions are shared with pages belonging to other logical blocks. Entity storage space. Thereafter, the operation of step S774 (Fig. 7D) is performed. If the candidate block having the dedication block definition is not full (No in step S750 of FIG. 7B-2), the operation of step S774 (FIG. 7D) is directly performed. It is worth noting that since the number of logical pages to be written by the sub-write command may exceed the number of pages that the candidate block having the dedication block definition can provide, the judgment of step S750 must be performed.

若子寫入命令欲寫入之邏輯頁面並未包含相應邏輯區塊之第一個頁面(第7A-2圖之步驟S728的否),如步驟S752(第7C-1圖),判斷儲存單元中是否存在具有連續區塊 定義之一候選區塊。若儲存單元中不存在具有連續區塊定義之候選區塊(步驟S752的否),如步驟S754,判斷儲存單元中是否存在具有奉獻區塊定義之一候選區塊。若儲存單元中並未存在具有奉獻區塊定義之候選區塊(步驟S754的否),進行步驟S762(第7C-2圖)的操作。若儲存單元中存在具有奉獻區塊定義之候選區塊(第7C-1圖之步驟S754的是),如步驟S756(第7C-2圖),依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有奉獻區塊定義之候選區塊中的特定頁面中。之後,如步驟S758,判斷具有奉獻區塊定義之候選區塊是否已經滿了。若具有奉獻區塊定義之候選區塊已經滿了(步驟S758的是),如步驟S760,將此候選區塊由奉獻區塊定義轉換為共享區塊定義,並如步驟S762,依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有共享區塊定義之其它候選區塊中的特定頁面中。也就是說,剩下的欲寫入之邏輯頁面,會寫入至其它具有共享區塊定義之候選區塊中,與屬於其它邏輯區塊的頁面共用該具有共享區塊定義之候選區塊的實體存儲空間。之後,進行步驟S774(第7D圖)的操作。若具有奉獻區塊定義之候選區塊並未滿了(第7C-2圖之步驟S758的否),直接進行步驟S774的操作。If the logical page to be written by the sub-write command does not include the first page of the corresponding logical block (No in step S728 of FIG. 7A-2), as in step S752 (FIG. 7C-1), the storage unit is determined. Whether there is a continuous block Define one of the candidate blocks. If there is no candidate block having a contiguous block definition in the storage unit (NO in step S752), in step S754, it is determined whether there is one candidate block having a dedication block definition in the storage unit. If there is no candidate block having the dedication block definition in the storage unit (NO in step S754), the operation in step S762 (Fig. 7C-2) is performed. If there is a candidate block having a dedication block definition in the storage unit (Yes in step S754 of FIG. 7C-1), in step S756 (FIG. 7C-2), one entity of the corresponding storage unit is generated according to the sub-write command. A command is written to write the data to a particular page in the candidate block with the dedication block definition. Thereafter, as in step S758, it is determined whether the candidate block having the dedication block definition is full. If the candidate block having the dedication block definition is full (YES in step S758), in step S760, the candidate block is converted from the dedication block definition to the shared block definition, and according to step S762, the sub-write is performed according to step S762. The command generates an entity write command for the corresponding storage unit to write the data to a particular page in other candidate blocks with shared block definitions. That is to say, the remaining logical pages to be written are written into other candidate blocks with shared block definitions, and the candidate blocks with shared block definitions are shared with pages belonging to other logical blocks. Entity storage space. Thereafter, the operation of step S774 (Fig. 7D) is performed. If the candidate block having the dedication block definition is not full (NO in step S758 of FIG. 7C-2), the operation of step S774 is directly performed.

若儲存單元中存在具有連續區塊定義之候選區塊時(第7C-1圖之步驟S752的是),如步驟S764,判斷子寫入命令欲寫入之邏輯頁面與此候選區塊中具有資料之最後一頁面是否相連續。若相連續(步驟S764的是),如步驟 S766,依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有連續區塊定義之候選區塊中的特定頁面中。若不連續(步驟S764的否),如步驟S768,判斷子寫入命令欲寫入之邏輯頁面與具有連續區塊定義之候選區塊中具有資料之最後一頁面的位址是否發生突衝(換言之,判斷欲寫入之邏輯頁面的邏輯區塊位址LBA是否小於候選區塊中具有資料之頁面中的最後一個頁面的位址)。若並未發生突衝(步驟S768的否),進行步驟S762(第7C-2圖)的操作。由於現在的高密度儲存單元,如NAND(與非)快閃記憶體中每個區塊的個別頁面必須依照順序寫入,不能隨機寫入,因此當LBA未發生突衝時(即當欲寫入之邏輯頁面的邏輯區塊位址LBA大於候選區塊中具有資料之頁面中的最後一個頁面的位址時),應將資料寫入至具有共享區塊定義之其它候選區塊中的特定頁面中,即執行步驟S762。若發生突衝(第7C-1圖之步驟S768的是),如步驟S770,將此候選區塊由連續區塊定義轉換為奉獻區塊定義,並如步驟S772,依據子寫入命令產生相應儲存單元之一實體寫入命令,以將資料寫入至具有奉獻區塊定義之候選區塊中的特定頁面中。之後,進行步驟S758(第7C-2圖)的操作。If there is a candidate block with a contiguous block definition in the storage unit (Yes in step S752 of FIG. 7C-1), in step S764, it is determined that the logical page to be written by the sub-write command has the logical page in the candidate block. Whether the last page of the data is continuous. If the phases are continuous (YES in step S764), as steps S766. Generate a physical write command of the corresponding storage unit according to the sub-write command to write the data into a specific page in the candidate block with the contiguous block definition. If it is not continuous (No in step S764), in step S768, it is determined whether the logical page to be written by the sub-write command and the address of the last page having the data in the candidate block having the contiguous block definition have a burst ( In other words, it is determined whether the logical block address LBA of the logical page to be written is smaller than the address of the last page in the page of the candidate block having the data. If the burst does not occur (NO in step S768), the operation in step S762 (Fig. 7C-2) is performed. Since the current high-density storage unit, such as NAND (non-) flash memory, each page of each block must be written in order, can not be randomly written, so when the LBA does not burst, that is, when you want to write When the logical block address LBA of the incoming logical page is larger than the address of the last page in the page with the data in the candidate block, the data should be written to the specific candidate block having the shared block definition. In the page, step S762 is performed. If a burst occurs (Yes in step S768 of FIG. 7C-1), in step S770, the candidate block is converted from the contiguous block definition to the dedication block definition, and in step S772, corresponding to the sub-write command is generated. One of the storage units entity writes a command to write the data to a particular page in the candidate block with the dedication block definition. Thereafter, the operation of step S758 (Fig. 7C-2) is performed.

之後,如步驟S774(第7D圖),執行產生之實體寫入命令,以將資料寫入儲存單元中之特定頁面。值得注意的是,如前所述,子寫入命令更可以包括裝置編號與/或磁區位移。當子寫入命令包括裝置編號與/或磁區位移時,則更可 以依據裝置編號與/或磁區位移將資料寫入儲存單元中。如步驟S776,依據相應子寫入命令欲寫入之邏輯區塊之邏輯頁面與實際儲存單元中候選區塊之特定頁面之映射關係,更新頁面映射表與/或特定區塊映射表。如步驟S778,判斷步驟S776之映射表更新是否牽涉區塊等級之映射表更新。若否(步驟S778的否),結束整個寫入流程。若是(步驟S778的是),如步驟S780,將更新後之特定區塊映射表寫入至儲存單元中。Thereafter, as in step S774 (Fig. 7D), the generated physical write command is executed to write the data to a specific page in the storage unit. It is worth noting that, as previously mentioned, the sub-write command may include device number and/or magnetic zone displacement. When the sub-write command includes the device number and/or the magnetic zone displacement, it is even more The data is written into the storage unit according to the device number and/or the magnetic zone displacement. In step S776, the page mapping table and/or the specific block mapping table are updated according to the mapping relationship between the logical page of the logical block to be written by the corresponding sub-write command and the specific page of the candidate block in the actual storage unit. In step S778, it is determined whether the mapping table update of step S776 involves a block level mapping table update. If not (NO in step S778), the entire writing process is ended. If so (YES in step S778), in step S780, the updated specific block mapping table is written to the storage unit.

有鑑於此,透過本案之儲存單元管理方法及系統可以將儲存單元之實體區塊進行分類管理,以更有效率地利用儲存單元。In view of this, the storage unit management method and system of the present invention can classify and manage the physical blocks of the storage unit to utilize the storage unit more efficiently.

本發明之方法,或特定型態或其部份,可以以在主機之檔案系統與非揮發性記憶體間使用之軟體轉換層(如程式碼)的型態包含於實體媒體,如軟碟、光碟片、硬碟、或是任何其他機器可讀取(如電腦可讀取)儲存媒體,其中,當程式碼被機器,如電腦載入且執行時,此機器變成用以參與本發明之裝置。本發明之方法與裝置也可以以程式碼型態透過一些傳送媒體,如電線或電纜、光纖、或是任何傳輸型態進行傳送,其中,當程式碼被機器,如電腦接收、載入且執行時,此機器變成用以參與本發明之裝置。當在一般用途處理器實作時,程式碼結合處理器提供一操作類似於應用特定邏輯電路之獨特裝置。The method of the present invention, or a specific type or part thereof, may be included in a physical medium such as a floppy disk, in the form of a software conversion layer (such as a code) used between a host file system and a non-volatile memory. A storage medium that can be read (eg, computer readable) by a disc, hard disk, or any other machine, wherein the device becomes a device for participating in the present invention when the code is loaded and executed by a machine, such as a computer. . The method and apparatus of the present invention can also be transmitted in a code format through some transmission medium such as a wire or cable, an optical fiber, or any transmission type, wherein the code is received, loaded, and executed by a machine such as a computer. At this time, the machine becomes a device for participating in the present invention. When implemented in a general purpose processor, the code in conjunction with the processor provides a unique means of operation similar to application specific logic.

雖然本發明已以較佳實施例揭露如上,然其並非用以限定本發明,任何熟悉此項技藝者,在不脫離本發明之精 神和範圍內,當可做些許更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above preferred embodiments, it is not intended to limit the invention, and any one skilled in the art can In the context of God and the scope, the scope of protection of the present invention is defined by the scope of the appended claims.

100‧‧‧儲存單元管理系統100‧‧‧Storage Unit Management System

110‧‧‧儲存單元110‧‧‧ storage unit

111‧‧‧資料區塊定義之區塊111‧‧‧ Blocks defined by the data block

112‧‧‧連續區塊定義之區塊112‧‧‧ Blocks defined by contiguous blocks

113‧‧‧奉獻區塊定義之區塊113‧‧‧Dedicated block definition block

114‧‧‧共享區塊定義之區塊114‧‧‧ Blocks defined by shared blocks

120‧‧‧記憶體120‧‧‧ memory

130‧‧‧處理模組130‧‧‧Processing module

300‧‧‧映射目錄項目300‧‧‧Map Directory Project

310‧‧‧’bInCache’欄位310‧‧‧’bInCache’ field

320‧‧‧’CachedBmtNumber’欄位320‧‧‧’CachedBmtNumber’ field

330‧‧‧’BmtPageLocation’欄位330‧‧‧’BmtPageLocation’ field

340‧‧‧’MappingDirectoryNumber’欄位340‧‧‧’MappingDirectoryNumber’ field

400‧‧‧區塊映射表項目400‧‧‧block mapping table project

410‧‧‧’bPageMapped’欄位410‧‧‧’bPageMapped’ field

420‧‧‧’BlockInfo’欄位420‧‧‧’BlockInfo’ field

430‧‧‧’BlockOffset’欄位430‧‧‧’BlockOffset’ field

500‧‧‧頁面映射區塊表項目500‧‧‧Page Mapping Block Table Item

510‧‧‧’PageMappedBlockNum’欄位510‧‧‧’PageMappedBlockNum’ field

520‧‧‧’PageMappingTableInfo’欄位520‧‧‧’PageMappingTableInfo’ field

600‧‧‧頁面映射表項目600‧‧‧ page mapping table project

610‧‧‧’PageOffset’欄位610‧‧‧’PageOffset’ field

620‧‧‧’PageInfo’欄位620‧‧‧’PageInfo’ field

S702、S704、...、S780‧‧‧步驟S702, S704, ..., S780‧‧‧ steps

800‧‧‧邏輯區塊位址800‧‧‧ Logical Block Address

MDN‧‧‧映射目錄編號欄位MDN‧‧‧ mapping directory number field

BO‧‧‧區塊位移欄位BO‧‧‧ block displacement field

PO‧‧‧頁面位移欄位PO‧‧‧ page shift field

DN‧‧‧裝置編號欄位DN‧‧‧ device number field

SO‧‧‧磁區位移欄位SO‧‧‧ magnetic zone displacement field

第1圖為一示意圖係顯示依據本發明實施例之儲存單元管理系統。Figure 1 is a schematic diagram showing a storage unit management system in accordance with an embodiment of the present invention.

第2圖為一示意圖係顯示依據本發明實施例之儲存單元中之實體區塊。Figure 2 is a schematic diagram showing physical blocks in a storage unit in accordance with an embodiment of the present invention.

第3圖為一示意圖係顯示依據本發明實施例之映射目錄項目的格式。Figure 3 is a schematic diagram showing the format of a mapping directory entry in accordance with an embodiment of the present invention.

第4圖為一示意圖係顯示依據本發明實施例之區塊映射表項目的格式。Figure 4 is a schematic diagram showing the format of a block map entry in accordance with an embodiment of the present invention.

第5圖為一示意圖係顯示依據本發明實施例之頁面映射區塊表項目的格式。Figure 5 is a schematic diagram showing the format of a page mapping block table entry in accordance with an embodiment of the present invention.

第6圖為一示意圖係顯示依據本發明實施例之頁面映射表項目的格式。Figure 6 is a schematic diagram showing the format of a page mapping table entry in accordance with an embodiment of the present invention.

第7A~7D圖為流程圖係顯示依據本發明實施例之儲存單元管理方法。7A to 7D are flowcharts showing a storage unit management method according to an embodiment of the present invention.

第8圖為一示意圖係顯示依據本發明實施例之寫入命令中包含的一邏輯區塊位址(Logic Block Address,LBA)的格式。Figure 8 is a diagram showing the format of a logical block address (LBA) included in a write command according to an embodiment of the present invention.

110‧‧‧儲存單元110‧‧‧ storage unit

111‧‧‧資料區塊定義之區塊111‧‧‧ Blocks defined by the data block

112‧‧‧連續區塊定義之區塊112‧‧‧ Blocks defined by contiguous blocks

113‧‧‧奉獻區塊定義之區塊113‧‧‧Dedicated block definition block

114‧‧‧共享區塊定義之區塊114‧‧‧ Blocks defined by shared blocks

Claims (28)

一種儲存單元管理方法,包括下列步驟:提供一儲存單元,其中該儲存單元包括複數實體區塊,每一該等實體區塊具有複數區塊種類定義中之一者;取得至少一子寫入命令,其中該子寫入命令係要求對於相應至少一邏輯區塊之至少一邏輯頁面進行資料寫入作業;判斷該儲存單元中是否存在具有該等區塊種類定義中之一第一區塊定義之一候選區塊,其中依據該第一區塊定義,該邏輯區塊之該邏輯頁面無法映射至該候選區塊;若該候選區塊存在,將該第一區塊定義轉換為該等區塊種類定義中之一第二區塊定義;以及將一資料儲寫入該候選區塊中之一特定頁面,且記錄該邏輯區塊之該邏輯頁面與該候選區塊之該特定頁面之一映射關係,其中該等區塊種類定義包括一連續區塊定義及一奉獻區塊定義,其中,具有該連續區塊定義之該實體區塊中從第一個頁面開始之複數個頁面係依據一區塊映射模式儲存資料,且該實體區塊中存在至少一個未寫入資料之頁面,具有該奉獻區塊定義之該實體區塊中的資料皆係對應至一特定邏輯區塊,從第一個頁面開始之複數個頁面係依據該區塊映射模式儲存資料,且存在至少一頁面並不依據該區塊映射模式儲存資料。 A storage unit management method, comprising the steps of: providing a storage unit, wherein the storage unit comprises a plurality of physical blocks, each of the physical blocks having one of a plurality of block type definitions; obtaining at least one sub-write command The sub-write command is configured to perform a data write operation on at least one logical page of the at least one logical block; and determine whether there is a first block definition in the storage unit having one of the block type definitions. a candidate block, wherein the logical page of the logical block cannot be mapped to the candidate block according to the first block definition; if the candidate block exists, the first block definition is converted into the block Determining, in the category definition, a second block definition; and writing a data store to a specific page of the candidate block, and recording the logical page of the logical block to map with one of the specific pages of the candidate block a relationship, wherein the block type definition includes a contiguous block definition and a dedication block definition, wherein the contiguous block definition of the physical block from the first page The plurality of pages are stored according to a block mapping mode, and at least one page of unwritten data exists in the physical block, and the data in the physical block defined by the dedication block corresponds to one For a specific logical block, a plurality of pages starting from the first page store data according to the block mapping mode, and at least one page does not store data according to the block mapping mode. 如申請專利範圍第1項所述之儲存單元管理方法, 其中該子寫入命令至少包括一映射目錄編號、一區塊位移、與一頁面位移,且該方法更包括下列步驟;依據該映射目錄編號由複數區塊映射表中定位至一特定區塊映射表;依據該區塊位移由該特定區塊映射表中定位一第一特定項目,其中該第一特定項目包括一映射模式設定與一區塊資訊;當該映射模式設定為一頁面映射模式時,依據該區塊資訊由一頁面映射區塊表中定位一第二特定項目,且依據該第二特定項目由複數頁面映射表中定位相應一特定頁面映射區塊之一特定頁面映射表;以及依據該映射關係更新該特定區塊映射表或該頁面映射表。 For example, the storage unit management method described in claim 1 of the patent scope, The sub-write command includes at least a mapping directory number, a block displacement, and a page offset, and the method further includes the following steps: positioning the specific block mapping from the complex block mapping table according to the mapping directory number. a first specific item is located in the specific block mapping table according to the block displacement, wherein the first specific item includes a mapping mode setting and a block information; when the mapping mode is set to a page mapping mode Locating a second specific item from a page mapping block table according to the block information, and locating a specific page mapping table corresponding to a specific page mapping block by the plurality of page mapping tables according to the second specific item; Updating the specific block mapping table or the page mapping table according to the mapping relationship. 如申請專利範圍第2項所述之儲存單元管理方法,更包括下列步驟:依據該映射目錄編號判斷該特定區塊映射表是否已經載入於一記憶體中;以及若該特定區塊映射表並未載入於該記憶體中,由已經載入該記憶體中之該等區塊映射表中選擇一候選區塊映射表;以及將該特定區塊映射表載入該記憶體中以取代該候選區塊映射表。 The storage unit management method according to claim 2, further comprising the steps of: determining, according to the mapping directory number, whether the specific block mapping table is already loaded in a memory; and if the specific block mapping table Not loaded in the memory, selecting a candidate block mapping table from the block mapping tables already loaded into the memory; and loading the specific block mapping table into the memory to replace The candidate block mapping table. 如申請專利範圍第2項所述之儲存單元管理方法,其中當該映射模式設定為一區塊映射模式時,新增一空閒 項目至該頁面映射區塊表。 The storage unit management method according to claim 2, wherein when the mapping mode is set to a block mapping mode, a new idle is added. Project to this page maps the block table. 如申請專利範圍第1項所述之儲存單元管理方法,更包括下列步驟:依據該映射關係將該子寫入命令轉換為相應該儲存單元之至少一實體寫入命令;以及執行該實體寫入命令,以將該資料寫入至該儲存單元中該候選區塊中之該特定頁面。 The storage unit management method of claim 1, further comprising the steps of: converting the sub-write command to at least one entity write command corresponding to the storage unit according to the mapping relationship; and performing the entity write a command to write the data to the particular page in the candidate block in the storage unit. 如申請專利範圍第1項所述之儲存單元管理方法,其中該等區塊種類定義還包括一資料區塊定義與一共享區塊定義,其中,具有該資料區塊定義之該實體區塊係依據該區塊映射模式儲存資料,且該實體區塊中之所有頁面都已經被寫入資料,具有該共享區塊定義之該實體區塊中的資料係依據一頁面映射模式儲存資料,且對應至至少二特定邏輯區塊。 The storage unit management method according to claim 1, wherein the block type definition further includes a data block definition and a shared block definition, wherein the physical block system having the data block definition The data is stored according to the block mapping mode, and all the pages in the physical block have been written into the data, and the data in the physical block defined by the shared block is stored according to a page mapping mode, and corresponding Up to at least two specific logical blocks. 如申請專利範圍第6項所述之儲存單元管理方法,更包括下列步驟:判斷該至少一邏輯頁面是否包含該邏輯區塊之第一個頁面;若該至少一邏輯頁面包含該邏輯區塊之第一個頁面,判斷該儲存單元中是否存在具有該連續區塊定義之該候選區塊;若該儲存單元中存在具有該連續區塊定義之該候選區塊,將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義,以將該資料儲存至該候選區塊中之該特定頁面中;以 及若該儲存單元中不存在具有該連續區塊定義之該候選區塊,配置一空閒區塊為具有該連續區塊定義之該候選區塊,以將該資料儲存至具有該連續區塊定義之該候選區塊中之該特定頁面中。 The storage unit management method of claim 6, further comprising the steps of: determining whether the at least one logical page includes the first page of the logical block; and if the at least one logical page includes the logical block a first page, determining whether the candidate block having the contiguous block definition exists in the storage unit; if the candidate block having the contiguous block definition exists in the storage unit, the candidate block is from the contiguous block The block definition is converted to the dedication block definition to store the data in the particular page in the candidate block; And if the candidate block having the contiguous block definition does not exist in the storage unit, configuring a free block as the candidate block having the contiguous block definition to store the data to have the contiguous block definition In the particular page in the candidate block. 如申請專利範圍第7項所述之儲存單元管理方法,其中當該儲存單元中不存在具有該連續區塊定義之該候選區塊時,該方法更包括下列步驟:判斷該儲存單元中是否存在具有該奉獻區塊定義之該候選區塊;以及若該儲存單元中存在具有該奉獻區塊定義之該候選區塊,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義。 The storage unit management method of claim 7, wherein when there is no candidate block having the contiguous block definition in the storage unit, the method further comprises the step of: determining whether the storage unit exists The candidate block having the dedication block definition; and if the candidate block having the dedication block definition exists in the storage unit, converting the candidate block from the dedication block definition to the shared block definition. 如申請專利範圍第7項所述之儲存單元管理方法,其中當該儲存單元中存在具有該連續區塊定義之該候選區塊,且將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義之後,該方法更包括下列步驟:判斷具有該奉獻區塊定義之該候選區塊是否已經滿了;以及若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,以將該資料儲存至具有該共享區塊定義之其他候選區塊中之該特定頁面中。 The storage unit management method of claim 7, wherein the candidate block having the contiguous block definition exists in the storage unit, and converting the candidate block from the contiguous block definition to the offering After the block definition, the method further comprises the steps of: determining whether the candidate block having the dedication block definition is full; and if the candidate block having the dedication block definition is full, the candidate area is The block is converted to the shared block definition by the dedication block definition to store the data in the particular page in the other candidate block having the shared block definition. 如申請專利範圍第6項所述之儲存單元管理方法, 更包括下列步驟:判斷該至少一邏輯頁面是否包含該邏輯區塊之第一個頁面;若該至少一邏輯頁面不包含該邏輯區塊之該第一個頁面,判斷該儲存單元中是否存在具有該連續區塊定義之該候選區塊;若該儲存單元中不存在具有該連續區塊定義之該候選區塊,判斷該儲存單元中是否存在具有該奉獻區塊定義之該候選區塊;若該儲存單元中存在具有該奉獻區塊定義之該候選區塊,直接將該資料儲存至該候選區塊中之該特定頁面中;以及若該儲存單元中不存在具有該奉獻區塊定義之該候選區塊,將該資料儲存至該儲存單元中具有一共享區塊定義之其它候選區塊中之該特定頁面中。 The storage unit management method described in claim 6 of the patent application scope, The method further includes the following steps: determining whether the at least one logical page includes the first page of the logical block; if the at least one logical page does not include the first page of the logical block, determining whether the storage unit has a Determining the candidate block by the contiguous block; if the candidate block having the contiguous block definition is not present in the storage unit, determining whether the candidate block having the dedication block definition exists in the storage unit; Having the candidate block with the dedication block definition in the storage unit, directly storing the data in the specific page in the candidate block; and if the storage unit does not have the definition of the dedication block The candidate block stores the data in the specific page of the other candidate blocks in the storage unit having a shared block definition. 如申請專利範圍第10項所述之儲存單元管理方法,其中當該儲存單元中存在具有該奉獻區塊定義之該候選區塊時,該方法更包括下列步驟:判斷具有該奉獻區塊定義之該候選區塊是否已經滿了;以及若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,以將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中。 The storage unit management method of claim 10, wherein when there is the candidate block having the dedication block definition in the storage unit, the method further comprises the step of: determining that the dedication block definition is Whether the candidate block is full; and if the candidate block having the dedication block definition is full, converting the candidate block from the dedication block definition to the shared block definition to store the data To this particular page in other candidate blocks with shared block definitions. 如申請專利範圍第10項所述之儲存單元管理方法,其中當該儲存單元中存在具有該連續區塊定義之該候選區塊時,該方法更包括下列步驟:判斷該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面是否相連續;若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面相連續,直接將該資料儲存至該候選區塊中之該特定頁面中;若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面並非相連續,判斷該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址是否發生突衝;若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址並未發生突衝,將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中;以及若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址發生突衝,將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義,以將該資料儲存至具有奉獻區塊定義之該候選區塊中之該特定頁面中。 The storage unit management method of claim 10, wherein when there is the candidate block having the contiguous block definition in the storage unit, the method further comprises the step of: determining that the logical page has the continuity Whether the last page of the candidate block in the block definition is continuous; if the logical page is continuous with the last page of the candidate block having the contiguous block definition, the data is directly stored Going to the specific page in the candidate block; if the logical page is not consecutive with the last page having the data in the candidate block having the contiguous block definition, determining the logical page and having the contiguous block definition Whether the address of the last page of the candidate block has a burst in the candidate block; if the logical page does not protrude from the address of the last page of the candidate block having the contiguous block definition The data is stored in the particular page in the other candidate blocks having the shared block definition; and if the logical page has the contiguous area Defining an address of the last page of the candidate block with the data in the candidate block, and converting the candidate block from the contiguous block definition to the dedication block definition to store the data to the dedication block definition In the particular page in the candidate block. 如申請專利範圍第12項所述之儲存單元管理方法,其中在將該資料儲存至具有奉獻區塊定義之該候選區塊中之該特定頁面之步驟之後,該方法更包括下列步驟:判斷具有該奉獻區塊定義之該候選區塊是否已經滿 了;以及若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,以將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中。 The storage unit management method of claim 12, wherein after the step of storing the data to the specific page in the candidate block having the dedication block definition, the method further comprises the step of: determining that Whether the candidate block defined by the dedication block is full And if the candidate block having the dedication block definition is full, converting the candidate block from the dedication block definition to the shared block definition to store the data to have a shared block definition Among the other candidate blocks in this particular page. 如申請專利範圍第1項所述之儲存單元管理方法,更包括將更新後之該特定區塊映射表寫入至該儲存單元中。 The storage unit management method of claim 1, further comprising writing the updated specific block mapping table to the storage unit. 一種儲存單元管理系統,包括:一儲存單元,包括複數實體區塊,每一該等實體區塊具有複數區塊種類定義中之一者;以及一處理模組,取得至少一子寫入命令,其中該子寫入命令係要求對於相應至少一邏輯區塊之至少一邏輯頁面進行資料寫入作業,判斷該儲存單元中是否存在具有該等區塊種類定義中之一第一區塊定義之一候選區塊,其中依據該第一區塊定義該邏輯區塊之該邏輯頁面無法映射至該候選區塊,若該候選區塊存在,將該第一區塊定義轉換為該等區塊種類定義中之一第二區塊定義,將一資料寫入該候選區塊中之一特定頁面,且記錄該邏輯區塊之該邏輯頁面與該候選區塊之該特定頁面之一映射關係,其中該等區塊種類定義包括一連續區塊定義及一奉獻區塊定義,其中,具有該連續區塊定義之該實體區塊中從第一個頁面開始之複數個頁面係依據一區塊映射模式儲存資料,且該實體區塊中存在至少一個未寫入資料之頁面, 具有該奉獻區塊定義之該實體區塊中的資料皆係對應至一特定邏輯區塊,從第一個頁面開始之複數個頁面係依據該區塊映射模式儲存資料,且存在至少一頁面並不依據該區塊映射模式儲存資料。 A storage unit management system, comprising: a storage unit, comprising a plurality of physical blocks, each of the physical blocks having one of a plurality of block type definitions; and a processing module that obtains at least one sub-write command, The sub-write command is configured to perform a data write operation on at least one logical page of the at least one logical block, and determine whether there is one of the first block definitions in the storage unit having one of the block type definitions. a candidate block, wherein the logical page defining the logical block according to the first block cannot be mapped to the candidate block, and if the candidate block exists, converting the first block definition to the block type definition One of the second blocks defines that a material is written to a specific page of the candidate block, and the logical page of the logical block is recorded and mapped to one of the specific pages of the candidate block, wherein the The equal block type definition includes a contiguous block definition and a dedication block definition, wherein the plurality of page pages starting from the first page in the physical block defined by the contiguous block According to a data storage block mapping mode, and there is at least one unwritten page of the entity data block, The data in the physical block having the dedication block definition corresponds to a specific logical block, and the plurality of pages starting from the first page are stored according to the block mapping mode, and at least one page exists. Data is not stored according to the block mapping mode. 如申請專利範圍第15項所述之儲存單元管理系統,其中該子寫入命令至少包括一映射目錄編號、一區塊位移、與一頁面位移,且該處理模組更依據該映射目錄編號由複數區塊映射表中定位至一特定區塊映射表,依據該區塊位移由該特定區塊映射表中定位一第一特定項目,其中該第一特定項目包括一映射模式設定與一區塊資訊,當該映射模式設定為一頁面映射模式時,依據該區塊資訊由一頁面映射區塊表中定位一第二特定項目,依據該第二特定項目由複數頁面映射表中定位相應一特定頁面映射區塊之一特定頁面映射表,且依據該映射關係更新該特定區塊映射表或該頁面映射表。 The storage unit management system of claim 15, wherein the sub-write command comprises at least a mapping directory number, a block displacement, and a page displacement, and the processing module is further configured according to the mapping directory number. Positioning a specific block mapping table in the complex block mapping table, and positioning a first specific item in the specific block mapping table according to the block displacement, wherein the first specific item includes a mapping mode setting and a block Information, when the mapping mode is set to a page mapping mode, a second specific item is located in a page mapping block table according to the block information, and a specific one is located in the plurality of page mapping table according to the second specific item. A page mapping block is a specific page mapping table, and the specific block mapping table or the page mapping table is updated according to the mapping relationship. 如申請專利範圍第16項所述之儲存單元管理系統,其中該處理模組更依據該映射目錄編號判斷該特定區塊映射表是否已經載入於一記憶體中,若該特定區塊映射表並未載入於該記憶體中,由已經載入該記憶體中之該等區塊映射表中選擇一候選區塊映射表,且將該特定區塊映射表載入該記憶體中以取代該候選區塊映射表。 The storage unit management system of claim 16, wherein the processing module further determines, according to the mapping directory number, whether the specific block mapping table has been loaded into a memory, if the specific block mapping table Not loaded in the memory, a candidate block mapping table is selected from the block mapping tables already loaded in the memory, and the specific block mapping table is loaded into the memory to replace The candidate block mapping table. 如申請專利範圍第16項所述之儲存單元管理系統,其中該處理模組更當該映射模式設定為一區塊映射模式時,新增一空閒項目至該頁面映射區塊表。 The storage unit management system of claim 16, wherein the processing module adds a free item to the page mapping block table when the mapping mode is set to a block mapping mode. 如申請專利範圍第15項所述之儲存單元管理系統,其中該處理模組更依據該映射關係將該子寫入命令轉換為相應該儲存單元之至少一實體寫入命令,且執行該實體寫入命令,以將該資料寫入至該儲存單元中該候選區塊中之該特定頁面。 The storage unit management system of claim 15, wherein the processing module further converts the sub-write command into at least one entity write command corresponding to the storage unit according to the mapping relationship, and performs the entity write Entering a command to write the data to the particular page in the candidate block in the storage unit. 如申請專利範圍第15項所述之儲存單元管理系統,其中該等區塊種類定義還包括一資料區塊定義與一共享區塊定義,其中,具有該資料區塊定義之該實體區塊係依據該區塊映射模式儲存資料,且該實體區塊中之所有頁面都已經被寫入資料,具有該共享區塊定義之該實體區塊中的資料係依據一頁面映射模式儲存資料,且對應至至少二特定邏輯區塊。 The storage unit management system of claim 15, wherein the block type definition further comprises a data block definition and a shared block definition, wherein the physical block definition having the data block definition The data is stored according to the block mapping mode, and all the pages in the physical block have been written into the data, and the data in the physical block defined by the shared block is stored according to a page mapping mode, and corresponding Up to at least two specific logical blocks. 如申請專利範圍第20項所述之儲存單元管理系統,其中該處理模組更判斷該至少一邏輯頁面是否包含該邏輯區塊之第一個頁面,若該至少一邏輯頁面包含該邏輯區塊之第一個頁面,判斷該儲存單元中是否存在具有該連續區塊定義之該候選區塊,若該儲存單元中存在具有該連續區塊定義之該候選區塊,將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義,以將該資料儲存至該候選區塊中之該特定頁面中,若該儲存單元中不存在具有該連續區塊定義之該候選區塊,配置一空閒區塊為具有該連續區塊定義之該候選區塊,以將該資料儲存至具有該連續區塊定義之該候選區塊中之該特定頁面中。 The storage unit management system of claim 20, wherein the processing module further determines whether the at least one logical page includes a first page of the logical block, and if the at least one logical page includes the logical block a first page, determining whether the candidate block having the contiguous block definition exists in the storage unit, and if the candidate block having the contiguous block definition exists in the storage unit, the candidate block is Converting the contiguous block definition to the dedication block definition to store the data in the specific page in the candidate block, if there is no candidate block having the contiguous block definition in the storage unit, configuring one The free block is the candidate block defined by the contiguous block to store the data in the particular page in the candidate block having the contiguous block definition. 如申請專利範圍第21項所述之儲存單元管理系 統,其中當該儲存單元中不存在具有該連續區塊定義之該候選區塊時,該處理模組更判斷該儲存單元中是否存在具有該奉獻區塊定義之該候選區塊,若該儲存單元中存在具有該奉獻區塊定義之該候選區塊,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義。 The storage unit management system as described in claim 21 The processing module further determines whether the candidate block having the dedication block definition exists in the storage unit if the candidate block having the contiguous block definition does not exist in the storage unit, if the storage block exists The candidate block having the dedication block definition is present in the unit, and the candidate block is converted from the dedication block definition to the shared block definition. 如申請專利範圍第21項所述之儲存單元管理系統,其中當該儲存單元中存在具有該連續區塊定義之該候選區塊,且將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義之後,該處理模組更判斷具有該奉獻區塊定義之該候選區塊是否已經滿了,若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,並將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中。 The storage unit management system of claim 21, wherein the candidate block having the contiguous block definition exists in the storage unit, and converting the candidate block from the contiguous block definition to the offering After the block is defined, the processing module further determines whether the candidate block having the dedication block definition is full. If the candidate block having the dedication block definition is full, the candidate block is used by the candidate block. The dedication block definition is converted to the shared block definition and the data is stored in the particular page in the other candidate blocks with the shared block definition. 如申請專利範圍第20項所述之儲存單元管理系統,其中該處理模組更判斷該至少一邏輯頁面是否包含該邏輯區塊之第一個頁面,當該邏輯頁面不包含該邏輯區塊之第一個頁面時,判斷該儲存單元中是否存在具有該連續區塊定義之該候選區塊,若該儲存單元中不存在具有該連續區塊定義之該候選區塊,判斷該儲存單元中是否存在具有該奉獻區塊定義之該候選區塊,若該儲存單元中存在具有該奉獻區塊定義之該候選區塊,直接將該資料儲存至該候選區塊中之該特定頁面中,若該儲存單元中不存在具有該奉獻區塊定義之該候選區塊,將該資料儲存至該儲存單元中具有一共享區塊定義之其他候選區塊中之該特定頁面 中。 The storage unit management system of claim 20, wherein the processing module further determines whether the at least one logical page includes the first page of the logical block, and when the logical page does not include the logical block Determining, in the first page, whether the candidate block having the contiguous block definition exists in the storage unit, and if the candidate block having the contiguous block definition is not present in the storage unit, determining whether the storage unit is in the storage unit There is the candidate block having the definition of the dedication block. If the candidate block having the dedication block definition exists in the storage unit, the data is directly stored in the specific page in the candidate block, if The candidate block having the dedication block definition does not exist in the storage unit, and the data is stored in the storage unit to the specific page in another candidate block having a shared block definition. in. 如申請專利範圍第24項所述之儲存單元管理系統,其中當該儲存單元中存在具有該奉獻區塊定義之該候選區塊時,該處理模組更判斷具有該奉獻區塊定義之該候選區塊是否已經滿了,若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,以將該資料儲存至具有共享區塊定義之其他該候選區塊中之該特定頁面中。 The storage unit management system of claim 24, wherein when the candidate unit having the dedication block definition exists in the storage unit, the processing module further determines the candidate having the dedication block definition Whether the block is full, if the candidate block having the dedication block definition is full, converting the candidate block from the dedication block definition to the shared block definition to store the data to have a share The block is defined in the other specific page of the candidate block. 如申請專利範圍第24項所述之儲存單元管理系統,其中當該儲存單元中存在具有該連續區塊定義之該候選區塊時,該處理模組更判斷該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面是否相連續,若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面相連續,直接將該資料儲存至該候選區塊中之該特定頁面中,若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面並非相連續,判斷該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址是否發生突衝,若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址並未發生突衝,將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中,若該邏輯頁面與具有該連續區塊定義之該候選區塊中具有資料之最後一頁面的位址發生突衝,將該候選區塊由該連續區塊定義轉換為該奉獻區塊定義,以將該資料儲存至具有奉獻區塊 定義之該候選區塊中之該特定頁面中。 The storage unit management system of claim 24, wherein when the candidate block having the contiguous block definition exists in the storage unit, the processing module further determines the logical page and has the contiguous block. Determining whether the last page of the candidate block in the candidate block is continuous. If the logical page is continuous with the last page of the candidate block having the contiguous block definition, the data is directly stored in the candidate block. In the specific page in the candidate block, if the logical page is not consecutive with the last page of the candidate block having the contiguous block definition, the logical page is determined to have the contiguous block definition Whether the address of the last page of the candidate block in the candidate block has a burst, and if the logical page does not have a burst with the address of the last page of the candidate block having the contiguous block definition, Storing the data in the particular page in the other candidate block having the shared block definition, if the logical page and the candidate having the contiguous block definition Last address of a page of data having red block projection occurs, the candidate block of the consecutive block is defined by the switching block is defined for dedication to the dedicated data storage block having to Defined in that particular page in the candidate block. 如申請專利範圍第26項所述之儲存單元管理系統,其中在將該資料儲存至具有奉獻區塊定義之該候選區塊中之該特定頁面之後,該處理模組更判斷具有該奉獻區塊定義之該候選區塊是否已經滿了,若具有該奉獻區塊定義之該候選區塊已經滿了,將該候選區塊由該奉獻區塊定義轉換為該共享區塊定義,以將該資料儲存至具有共享區塊定義之其他候選區塊中之該特定頁面中。 The storage unit management system of claim 26, wherein after processing the data to the specific page in the candidate block having the dedication block definition, the processing module further determines that the dedication block is Determining whether the candidate block is full, and if the candidate block having the dedication block definition is full, converting the candidate block from the dedication block definition to the shared block definition to use the data Stored in that particular page in other candidate blocks with shared block definitions. 如申請專利範圍第15項所述之儲存單元管理系統,其中該處理模組更將更新後之該特定區塊映射表寫入至該儲存單。 The storage unit management system of claim 15, wherein the processing module further writes the updated specific block mapping table to the storage list.
TW97140886A 2008-02-29 2008-10-24 Management methods and systems for storage units TWI385520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW97140886A TWI385520B (en) 2008-02-29 2008-10-24 Management methods and systems for storage units

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
TW97107100 2008-02-29
TW97140886A TWI385520B (en) 2008-02-29 2008-10-24 Management methods and systems for storage units

Publications (2)

Publication Number Publication Date
TW200937195A TW200937195A (en) 2009-09-01
TWI385520B true TWI385520B (en) 2013-02-11

Family

ID=44866991

Family Applications (1)

Application Number Title Priority Date Filing Date
TW97140886A TWI385520B (en) 2008-02-29 2008-10-24 Management methods and systems for storage units

Country Status (1)

Country Link
TW (1) TWI385520B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI421869B (en) * 2009-10-14 2014-01-01 Phison Electronics Corp Data writing method for a flash memory, and controller and storage system using the same
CN102789427B (en) 2012-07-17 2015-11-25 威盛电子股份有限公司 Data memory device and its method of operating

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060161725A1 (en) * 2005-01-20 2006-07-20 Lee Charles C Multiple function flash memory system
US20070033330A1 (en) * 2005-08-03 2007-02-08 Sinclair Alan W Reclaiming Data Storage Capacity in Flash Memory Systems
TW200732917A (en) * 2005-12-21 2007-09-01 Sandisk Corp Dual mode access for non-volatile storage devices
TW200809594A (en) * 2005-12-13 2008-02-16 Sandisk Corp Logically-addressed file storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060161725A1 (en) * 2005-01-20 2006-07-20 Lee Charles C Multiple function flash memory system
US20070033330A1 (en) * 2005-08-03 2007-02-08 Sinclair Alan W Reclaiming Data Storage Capacity in Flash Memory Systems
TW200809594A (en) * 2005-12-13 2008-02-16 Sandisk Corp Logically-addressed file storage
TW200732917A (en) * 2005-12-21 2007-09-01 Sandisk Corp Dual mode access for non-volatile storage devices

Also Published As

Publication number Publication date
TW200937195A (en) 2009-09-01

Similar Documents

Publication Publication Date Title
US8386746B2 (en) Storage unit management methods and systems
US11048624B2 (en) Methods for multi-stream garbage collection
US7610434B2 (en) File recording apparatus
EP2096546B1 (en) Write once recording device
US20070288711A1 (en) Snapshot copy management method used for logic volume manager
KR101329068B1 (en) Nonvolatile memory with block management
US8645614B2 (en) Method and apparatus for managing data of flash memory via address mapping
EP2631916A1 (en) Data deletion method and device
US20130227198A1 (en) Flash memory device and electronic device employing thereof
US20100169556A1 (en) Nonvolatile storage device, information recording system, and information recording method
JPWO2005106673A1 (en) Nonvolatile storage device and data writing method
US7747810B2 (en) Address assigning method, disk drive, and data writing method
JPWO2005029311A1 (en) Semiconductor memory card, semiconductor memory control device, and semiconductor memory control method
KR102603070B1 (en) Memory system, a method of writing data to the memory system, and a method of reading data from the memory system
KR20100011698A (en) Solid state storage system for data merging and method of controlling the same
CN104065906B (en) Video recording method and device of digital video recording equipment
JP4547028B2 (en) Nonvolatile memory with block management
TWI385520B (en) Management methods and systems for storage units
JP4130808B2 (en) Formatting method
JP2010237907A (en) Storage device and recording method
US7062603B2 (en) External storage device for selectively storing data between first and second recording media
CN1993764A (en) Managing data space on a record carrier
JPWO2010001606A1 (en) Controller, information recording device, access device, information recording system, and information recording method
KR101433860B1 (en) Information process device capable of managing efficiently file and operation method thereof
WO2021015174A1 (en) Storage management device, storage management method and program