TWI894007B - Storage management method and storage management device - Google Patents
Storage management method and storage management deviceInfo
- Publication number
- TWI894007B TWI894007B TW113137461A TW113137461A TWI894007B TW I894007 B TWI894007 B TW I894007B TW 113137461 A TW113137461 A TW 113137461A TW 113137461 A TW113137461 A TW 113137461A TW I894007 B TWI894007 B TW I894007B
- Authority
- TW
- Taiwan
- Prior art keywords
- sub
- logical
- logic
- block
- identification code
- Prior art date
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本案是關於存儲管理方法及存儲管理裝置,尤其是關於將邏輯塊劃分為子邏輯塊以進行有效存儲的存儲管理方法及存儲管理裝置。This case relates to a storage management method and a storage management device, and more particularly to a storage management method and a storage management device that divide a logical block into sub-logical blocks for efficient storage.
嵌入式電子產品會使用串列外設介面NAND快閃記憶體(SPI NAND flash)作為外部大容量存儲器,包括複數個可擦除的區塊(block),以存儲系統映像檔以及文件系統等資料。文件系統是以區塊(block)為單位來進行資料存儲,在上述分配方式下,即便文件的資料量較小,此文件依舊會占用整個區塊,因此,上述分配方式將導致空間利用率低。Embedded electronic products use SPI NAND flash memory as external mass storage. This memory consists of multiple erasable blocks to store system images and file system data. File systems store data in blocks. Under the aforementioned allocation method, even small files will occupy the entire block, resulting in low space utilization.
鑑於先前技術之不足,本案的目的之一為提供一種存儲管理方法及存儲管理裝置,以改善先前技術的不足。In view of the shortcomings of the prior art, one of the purposes of this case is to provide a storage management method and a storage management device to improve the shortcomings of the prior art.
於一些實施態樣中,存儲管理方法藉由一文件系統存取一存儲設備,該存儲設備包括複數個區塊,該文檔系統中包括映射於該複數個區塊的複數個邏輯塊,該複數個邏輯塊的每一者有一個邏輯塊號;該存儲管理方法包含:接收一第一存儲請求以存儲第一類型的一第一資料;回應該第一存儲請求將該複數個邏輯塊中的一第一邏輯塊劃分為複數個子邏輯塊;分配該複數個子邏輯塊的一第一子邏輯塊予該第一資料;生成映射於該第一子邏輯塊的一第一邏輯識別碼以在該第一邏輯識別碼中記錄該第一類型對應的一為第一值的狀態標記、該第一子邏輯塊的一子邏輯塊號以及該第一邏輯塊的邏輯塊號;接收一第二存儲請求以存儲第二類型的一第二資料;回應該第二存儲請求將該複數個邏輯塊中的一第二邏輯塊分配予該第二資料;以及生成映射於該第二邏輯塊的一第二邏輯識別碼以在該第二邏輯識別碼中記錄該第二類型對應的一為第二值的狀態標記、一預設子邏輯塊號以及該第二邏輯塊的邏輯塊號。In some embodiments, a storage management method accesses a storage device through a file system, the storage device including a plurality of blocks, the file system including a plurality of logical blocks mapped to the plurality of blocks, each of the plurality of logical blocks having a logical block number; the storage management method includes: receiving a first storage request to store a first data of a first type; in response to the first storage request, dividing a first logical block of the plurality of logical blocks into a plurality of sub-logical blocks; allocating a first sub-logical block of the plurality of sub-logical blocks to the first data; generating a first logical block mapped to the first sub-logical block; The logic identification code records a state flag of a first value corresponding to the first type, a sub-logic block number of the first sub-logic block, and a logic block number of the first logic block in the first logic identification code; receives a second storage request to store a second data of a second type; responds to the second storage request A second logic block among the plurality of logic blocks is allocated to the second data; and a second logic identification code mapped to the second logic block is generated to record a status flag with a second value corresponding to the second type, a default sub-logic block number, and the logic block number of the second logic block in the second logic identification code.
於一些實施態樣中,存儲管理裝置藉由一文件系統存取一存儲設備,該存儲設備包括複數個區塊,該文檔系統中包括映射於該複數個區塊的複數個邏輯塊,該複數個邏輯塊的每一者有一個邏輯塊號;該存儲管理裝置包含處理器,處理器根據記憶體中至少一指令以執行以下步驟:接收一第一存儲請求以存儲第一類型的一第一資料;回應該第一存儲請求將該複數個邏輯塊中的一第一邏輯塊劃分為複數個子邏輯塊;分配該複數個子邏輯塊的一第一子邏輯塊予該第一資料;生成映射於該第一子邏輯塊的一第一邏輯識別碼以在該第一邏輯識別碼中記錄該第一類型對應的一為第一值的狀態標記、該第一子邏輯塊的一子邏輯塊號以及該第一邏輯塊的邏輯塊號;接收一第二存儲請求以存儲第二類型的一第二資料;回應該第二存儲請求將該複數個邏輯塊中的一第二邏輯塊分配予該第二資料;以及生成映射於該第二邏輯塊的一第二邏輯識別碼以在該第二邏輯識別碼中記錄該第二類型對應的一為第二值的狀態標記、一預設子邏輯塊號以及該第二邏輯塊的邏輯塊號。In some embodiments, a storage management device accesses a storage device through a file system, the storage device includes a plurality of blocks, the file system includes a plurality of logical blocks mapped to the plurality of blocks, each of the plurality of logical blocks has a logical block number; the storage management device includes a processor, the processor according to At least one instruction in the memory is configured to execute the following steps: receiving a first storage request to store a first data of a first type; dividing a first logic block of the plurality of logic blocks into a plurality of sub-logic blocks in response to the first storage request; allocating a first sub-logic block of the plurality of sub-logic blocks to the first data; generating a mapping In a first logic identification code of the first sub-logic block, a state flag of a first value corresponding to the first type, a sub-logic block number of the first sub-logic block, and a logic block number of the first logic block are recorded in the first logic identification code; a second storage request is received to store a second data of a second type; and a second storage request is received in response to the second storage request. The storage request allocates a second logic block among the plurality of logic blocks to the second data; and generates a second logic identification code mapped to the second logic block to record a state flag with a second value corresponding to the second type, a default sub-logic block number, and the logic block number of the second logic block in the second logic identification code.
本案之存儲管理方法及存儲管理裝置將邏輯塊進一步劃分為複數個子邏輯塊,再以邏輯塊中的多個子邏輯塊來分別存儲資料量較小的多筆資料,因此,若同一個邏輯塊尚有空閒的子邏輯塊,上述空閒的子邏輯塊將被分配給其餘資料來進行使用,是以本案之存儲管理方法及存儲管理裝置得以有效率地進行存儲空間之分配,因此得以避免浪費存儲空間。The storage management method and storage management device of this case further divide a logical block into multiple sub-logical blocks. Multiple sub-logical blocks within a logical block are then used to store smaller data sets. Therefore, if there are free sub-logical blocks within the same logical block, the free sub-logical blocks will be allocated to the remaining data for use. Therefore, the storage management method and storage management device of this case can efficiently allocate storage space, thereby avoiding storage space waste.
有關本案的特徵、實作與功效,茲配合圖式作較佳實施例詳細說明如下。The features, implementation, and effects of this invention are described in detail below with reference to the drawings and preferred embodiments.
圖1為根據一些本案實施例繪製一種存儲管理裝置100、存儲設備400以及記憶體500的示意圖。存儲管理裝置100連接存儲設備400以及記憶體500,存儲管理裝置100包含處理器115。存儲設備400可以是與非快閃記憶體(NAND flash memory),記憶體500可以是動態隨機存取記憶體(Dynamic Random Access Memory,DRAM)。記憶體500中存儲複數個程序指令及/或程式碼,存儲管理裝置100藉由執行這些程式指令及/或程式碼來實現其功能。在一些實施例中,存儲管理裝置100可為一控制晶片。FIG1 is a schematic diagram illustrating a storage management device 100, a storage device 400, and a memory 500 according to some embodiments of the present invention. The storage management device 100 is connected to the storage device 400 and the memory 500 and includes a processor 115. The storage device 400 may be a NAND flash memory, and the memory 500 may be a dynamic random access memory (DRAM). The memory 500 stores a plurality of program instructions and/or program codes, and the storage management device 100 implements its functions by executing these program instructions and/or program codes. In some embodiments, the storage management device 100 may be a control chip.
下面結合圖2對存儲管理裝置100之操作進行詳細說明,圖2為根據本案一些實施例繪製一種存儲管理方法200的流程示意圖。存儲管理方法200藉由文件系統存取存儲設備400,存儲設備400包括複數個區塊(block),複數個區塊的每一區塊包括複數個存儲單元(page),存儲單元(page)是對存儲存儲設備400進行讀或寫時的基本操作單位,區塊(block)是對存儲設備400進行擦除的基本操作單位。請參閱圖3,文件系統中包括映射於複數個區塊的複數個邏輯塊i、i+1,複數個邏輯塊i、i+1的每一邏輯塊具有一個邏輯塊號(block number, BN)。The following describes the operation of the storage management device 100 in detail with reference to FIG2 . FIG2 is a flowchart illustrating a storage management method 200 according to some embodiments of the present invention. The storage management method 200 accesses a storage device 400 via a file system. The storage device 400 includes a plurality of blocks, each of which includes a plurality of pages. A page is the basic unit of operation for reading from or writing to the storage device 400, while a block is the basic unit of operation for erasing the storage device 400. Referring to Figure 3, the file system includes a plurality of logical blocks i and i+1 mapped to a plurality of blocks. Each of the plurality of logical blocks i and i+1 has a logical block number (BN).
步驟210,接收到存儲請求以存儲第一類型的第一資料,將複數個邏輯塊(block)中的一第一邏輯塊劃分為複數個子邏輯塊(subblock),並記錄用於標記該些子邏輯塊的複數個子邏輯塊號 (subblock number, SN)。請參閱圖3,處理器115可根據預先設定的子邏輯塊的大小(subblock size)將複數個邏輯塊i、i+1中的一空閒的邏輯塊i劃分為複數個子邏輯塊0~N-1,每一子邏輯塊對應於預設數量的存儲單元(例如一個)。當一邏輯塊被劃分爲複數個子邏輯塊時,處理器115還記錄用於標記每一子邏輯塊的使用情況的複數個使用標記,例如通過第一使用標記表明該子邏輯塊當前處於空閒狀態,第二使用標記表明該子邏輯塊當前處於佔用狀態。可以理解的,每一邏輯塊也記錄有相對應的使用標記。如此,根據邏輯塊或子邏輯塊的當前使用情況更新該邏輯塊或子邏輯塊的使用標記;查詢使用標記可獲知邏輯塊或子邏輯塊的當前使用情況。In step 210, a storage request is received to store first data of a first type, a first logic block among a plurality of logic blocks is divided into a plurality of sub-logic blocks, and a plurality of sub-logic block numbers (SN) are recorded to identify the sub-logic blocks. 3 , the processor 115 may divide an idle logic block i among a plurality of logic blocks i, i+1 into a plurality of sub-logic blocks 0 to N-1 according to a preset sub-block size, where each sub-logic block corresponds to a preset number of storage units (e.g., one). When a logic block is divided into multiple sub-logic blocks, the processor 115 also records multiple usage flags to indicate the usage status of each sub-logic block. For example, a first usage flag may indicate that the sub-logic block is currently idle, while a second usage flag may indicate that the sub-logic block is currently occupied. It is understood that each logic block also records a corresponding usage flag. In this way, the usage flag of the logic block or sub-logic block is updated according to the current usage of the logic block or sub-logic block; the current usage of the logic block or sub-logic block can be obtained by querying the usage flag.
步驟220,分配複數個子邏輯塊中的第一子邏輯塊予第一資料。請參閱圖4,處理器115根據資料A的大小將邏輯塊i的子邏輯塊0以及子邏輯塊1分配給第一資料A(將於後結合圖6詳述)。如此,第一資料A可存儲至子邏輯塊0以及子邏輯塊1相對應的存儲單元。在一些實施例中,第一資料A可為文件,例如littlefs文件系統中的文件。進一步地,在第一子邏輯塊分配給第一資料時,處理器115根據該分配更新第一子邏輯塊的使用標記例如將第一使用標記更新為第二使用標記。In step 220, a first sub-logical block among the plurality of sub-logical blocks is allocated to the first data. Referring to FIG. 4 , processor 115 allocates sub-logical block 0 and sub-logical block 1 of logical block i to the first data A based on the size of the data A (described in detail later in conjunction with FIG. 6 ). In this manner, the first data A is stored in the storage units corresponding to sub-logical block 0 and sub-logical block 1. In some embodiments, the first data A may be a file, such as a file in the littlefs file system. Furthermore, when the first sub-logic block is allocated to the first data, the processor 115 updates the usage flag of the first sub-logic block according to the allocation, for example, updating the first usage flag to the second usage flag.
步驟230,生成映射於第一子邏輯塊的第一邏輯識別碼以記錄第一類型對應為第一值的狀態標記、第一子邏輯塊的子邏輯塊號以及第一邏輯塊的邏輯塊號於該第一邏輯識別碼。在本實施例中,該邏輯識別碼佔預設位元數,其中的第一位元數用於記錄對應邏輯塊或子邏輯塊的狀態標記、第二位元數用於記錄子邏輯塊號以及第三位元數用於記錄該邏輯塊號,第一位元數、第二位元數和第三位元數之和等於該預設位元數。請參閱圖5,在一實施例中,如圖左上角所示,該預設位元數為32位元,即通過32位元記錄一邏輯識別碼,邏輯識別碼的Rx段用以記錄邏輯塊/子邏輯塊的狀態標記 ,邏輯識別碼的Ry段用以記錄子邏輯塊號,邏輯識別碼的Rz段用以記錄邏輯塊號。本案可透過上述邏輯識別碼以詳細記錄錄邏輯塊/子邏輯塊的狀態、子邏輯塊與邏輯塊之關係,進而有效率地進行存儲空間之分配以及後續寫入、讀取、擦除等等操作。In step 230, a first logic identification code is generated, mapped to the first sub-logic block, to record a status flag of the first type corresponding to the first value, a sub-logic block number of the first sub-logic block, and the logic block number of the first logic block in the first logic identification code. In this embodiment, the logic identification code occupies a preset number of bits, wherein the first bit is used to record the status flag corresponding to the logic block or sub-logic block, the second bit is used to record the sub-logic block number, and the third bit is used to record the logic block number. The sum of the first bit, the second bit, and the third bit is equal to the preset number of bits. Referring to FIG. 5 , in one embodiment, as shown in the upper left corner of the figure, the default bit count is 32 bits, meaning a logic identification code is recorded using 32 bits. The Rx segment of the logic identification code is used to record the status flag of the logic block/sub-logic block, the Ry segment of the logic identification code is used to record the sub-logic block number, and the Rz segment of the logic identification code is used to record the logic block number. This solution uses the aforementioned logical identification code to record in detail the status of logical blocks/sub-logical blocks, as well as the relationship between sub-logical blocks and logical blocks, thereby efficiently allocating storage space and performing subsequent write, read, and erase operations.
在一實施例中,對於該邏輯塊中未存入資料的其他子邏輯塊,處理器115也可生成與其對應的多個邏輯識別碼,該些邏輯識別碼的Rx段記錄狀態標記為預設標記如FREE。處理器115還將本文件系統的所有邏輯識別碼記錄在一表單中予以管理。In one embodiment, for other sub-logical blocks in the logical block that do not store data, the processor 115 may also generate multiple logical identification codes corresponding thereto. The Rx segment record status flags of these logical identification codes are marked as a default flag, such as FREE. The processor 115 also records all logical identification codes of the file system in a table for management.
步驟240,將第一資料存儲至第一邏輯識別碼對應的子邏輯塊。另外,在第一資料存入該子邏輯塊後,還據此更新該子邏輯塊的使用標記。可理解的是,本案中將資料存入邏輯塊或子邏輯塊係將資料存入該邏輯塊相對應的區塊中或子邏輯塊相對應的存儲單元中。In step 240, the first data is stored in the sub-logical block corresponding to the first logical identification code. Furthermore, after the first data is stored in the sub-logical block, the usage flag of the sub-logical block is updated accordingly. It is understood that, in this case, storing the data in a logical block or sub-logical block means storing the data in the corresponding block of the logical block or in the corresponding storage unit of the sub-logical block.
本文件系統會給每一邏輯塊或子邏輯塊配置一對應的邏輯識別碼,並可根據邏輯識別碼獲取到邏輯塊或子邏輯塊的相關資訊。以下表1爲一示例説明本案的邏輯塊或子邏輯塊的狀態與邏輯識別碼中的狀態標記的對應關係,故此通過邏輯識別碼中的狀態標記可獲知邏輯塊或子邏輯塊的狀態。This document system assigns a corresponding logical identifier to each logic block or sub-logic block, and uses the logical identifier to retrieve relevant information about the logic block or sub-logic block. Table 1 below shows an example of the correspondence between the status of a logic block or sub-logic block and the status flags in the logic identifier. Therefore, the status of a logic block or sub-logic block can be determined by the status flags in the logic identifier.
表1為邏輯識別碼中資料類型的標記及其含義説明表。
在一些實施例中,為了讓本案的文件系統與littlefs文件系統具有一定的繼承性以便直接使用littlefs所提供的某些函數,本案可將預設位元數設置為32位元。如此,本案可應用littlefs文件系統的存儲結構,僅需調整littlefs存儲結構所使用的用於記錄邏輯識別碼的uint32_t類型之字段所代表的意義。以圖5所示內容為例,Rx段、Ry段以及Rz段所佔用的位元數分別為Bx、By以及Bz,Bx、By以及Bz只需滿足以下條件即可實現上述調整:In some embodiments, in order to make the file system of this case have a certain degree of inheritance with the littlefs file system so as to directly use certain functions provided by littlefs, this case can set the default bit number to 32 bits. In this way, this case can apply the storage structure of the littlefs file system, and only needs to adjust the meaning of the uint32_t type field used to record the logical identification code used by the littlefs storage structure. Taking the content shown in Figure 5 as an example, the number of bits occupied by the Rx segment, Ry segment, and Rz segment are Bx, By, and Bz respectively. Bx, By, and Bz only need to meet the following conditions to achieve the above adjustment:
…條件1 ...Condition 1
…條件2 ...Condition 2
…條件3 ...Condition 3
…條件4 ...Condition 4
假設Bx為0、By為0且Bz為32時,則本案的存儲結構相當於littlefs的存儲結構,換言之,littlefs存儲結構的全部32位元均用以表示邏輯識別碼(block id)的值,其尋址空間為 。 Assuming Bx is 0, By is 0 and Bz is 32, the storage structure of this case is equivalent to the storage structure of littlefs. In other words, all 32 bits of the littlefs storage structure are used to represent the value of the logical identification code (block id), and its address space is .
請參閱條件4,一旦確定Rx段以及Ry段分別佔用的位元數後,Rz段佔用的位元數亦隨之確定。本案不以上述實施例為限,其僅用以例示性地說明本案的實現方式之一,在其餘實施例中,本案亦可使用其它合適的邏輯識別碼之位元配置方式,端視實際需求而定。Please refer to condition 4. Once the number of bits occupied by the Rx and Ry segments is determined, the number of bits occupied by the Rz segment is also determined accordingly. This invention is not limited to the above embodiment; it is merely an example of one implementation method of this invention. In other embodiments, this invention may also use other appropriate logical identification code bit configurations, depending on actual needs.
請參見圖5中的邏輯識別碼1,假設邏輯塊i的子邏輯塊N-2中資料類型為文件(由於本案的文件系統會採用CTZ skip-list 數據結構記錄該文件的訊息,故將其簡稱為CTZ type的文件資料),處理器115可根據邏輯塊i、子邏輯塊N-2以及子邏輯塊N-2中的資料類型生成邏輯識別碼1並記錄狀態標記0xB(表徵CTZ type的文件資料)、子邏輯塊N-2的子邏輯塊號N-2以及邏輯塊i的邏輯塊號i於邏輯識別碼1。Please refer to the logical identification code 1 in Figure 5. Assuming that the data type in the sub-logical block N-2 of the logical block i is a file (because the file system in this case uses the CTZ skip-list data structure to record the information of the file, it is simply referred to as CTZ type file data), the processor 115 can generate a logical identification code 1 based on the logical block i, the sub-logical block N-2 and the data type in the sub-logical block N-2 and record the status flag 0xB (indicating CTZ type file data), the sub-logical block number N-2 of the sub-logical block N-2 and the logical block number i of the logical block i in the logical identification code 1.
子邏輯塊號表示一子邏輯塊在其對應的邏輯塊中的一相對位置,其對應到該邏輯塊所映射的區塊中的一個或多個存儲單元,換句話說,根據該子邏輯塊以及其對應的邏輯塊與區塊之間的地址映射關係可尋址(address)到與子邏輯塊號相對應的存儲單元。A sub-logical block number represents the relative position of a sub-logical block within its corresponding logical block, and corresponds to one or more storage units in the block to which the logical block is mapped. In other words, the storage unit corresponding to the sub-logical block number can be addressed based on the address mapping relationship between the sub-logical block, its corresponding logical block, and the block.
請參閱圖4,若邏輯塊i的子邏輯塊0、1分配給資料A(為CTZ type文件),處理器115可據此分別生成與子邏輯塊0相對應的第一邏輯識別碼和與子邏輯塊1相對應的第二邏輯識別碼以記錄狀態標記0xB、子邏輯塊0的子邏輯塊號0以及邏輯塊i的邏輯塊號i於第一邏輯識別碼,以及記錄狀態標記0xB、子邏輯塊1的子邏輯塊號1以及邏輯塊i的邏輯塊號i於第二邏輯識別碼。若將邏輯塊i的子邏輯塊2分配給資料B (為CTZ type文件),處理器115可據此生成與子邏輯塊2相對應的第三邏輯識別碼以記錄狀態標記0xB、子邏輯塊2的子邏輯塊號2以及邏輯塊i的邏輯塊號i於第三邏輯識別碼。資料A、資料B存入子邏輯塊0、1、2後,處理器115更新子邏輯塊0、1、2的使用標記。Refer to Figure 4. If sub-logic blocks 0 and 1 of logic block i are assigned to data A (CTZ type file), the processor 115 may accordingly generate a first logic identification code corresponding to sub-logic block 0 and a second logic identification code corresponding to sub-logic block 1, thereby recording the status mark 0xB, the sub-logic block number 0 of sub-logic block 0, and the logic block number i of logic block i in the first logic identification code, and recording the status mark 0xB, the sub-logic block number 1 of sub-logic block 1, and the logic block number i of logic block i in the second logic identification code. If sub-logical block 2 of logic block i is assigned to data B (a CTZ type file), processor 115 generates a third logic identifier corresponding to sub-logical block 2. This identifier records the status flag 0xB, sub-logical block number 2 of sub-logical block 2, and logic block number i of logic block i. After data A and data B are stored in sub-logical blocks 0, 1, and 2, processor 115 updates the usage flags of sub-logical blocks 0, 1, and 2.
請參閱圖5中的邏輯識別碼2。假設一待存儲資料的類型為目錄,本案可根據資料的類型為目錄將複數個邏輯塊i~i+2中的邏輯塊i+2整個分配給上述資料,並據此生成一邏輯識別碼(如邏輯識別碼2)以記錄狀態標記0xC(對應metadata,由於本文件系統會採用元數據(metadata)記錄目錄資料)、具有默認值的子邏輯塊號以及邏輯塊i+2的邏輯塊號i+2於邏輯識別碼2。需説明的是,對於目錄資料,本文件系統係使用一個或多個元數據記錄目錄的相關資訊(例如該目錄下的文檔和子目錄等資訊),本案會將一個邏輯塊整個分配給一個元數據以將目錄資料存儲至該邏輯塊相對應的區塊中,因此,邏輯識別碼2中的子邏輯塊號僅需記錄默認值(例如FULL)。See logical identifier 2 in Figure 5. Assuming the data to be stored is a directory, this scenario allocates logical block i+2 from multiple logical blocks i to i+2 to the data based on the directory type. Based on this, a logical identifier (e.g., logical identifier 2) is generated to record the status flag 0xC (corresponding to metadata, since this file system uses metadata to record directory data), the sub-logical block number with the default value, and the logical block number i+2 of logical block i+2 in logical identifier 2. It should be noted that for directory data, this file system uses one or more metadata to record directory-related information (such as information about the documents and subdirectories within the directory). In this case, an entire logical block is assigned to a metadata to store the directory data in the block corresponding to the logical block. Therefore, the sub-logical block number in logical identifier 2 only needs to record the default value (such as FULL).
在一些實施例中,當資料失效例如一子邏輯塊內的資料失效,處理器115據此更新存儲該資料的邏輯塊或子邏輯塊對應的邏輯識別碼以在更新後的邏輯識別碼中記錄資料已失效的資訊。舉例來説,處理器115可將邏輯識別碼的Rx段的狀態標記更新為預設的狀態標記如0xD 或0xE(對應ABANDAN或GC)。如此,當在邏輯識別碼中Rx段識別到該預設的狀態標記,若該邏輯識別碼對應一子邏輯塊,則對該子邏輯塊不可進行讀取、寫入操作;若該邏輯識別碼對應一邏輯塊,則對該邏輯塊只可進行擦除操作。In some embodiments, when data fails, such as data within a sub-logical block, the processor 115 updates the logical identifier corresponding to the logical block or sub-logical block storing the data, recording the data failure in the updated logical identifier. For example, the processor 115 may update the status flag of the Rx segment of the logical identifier to a preset status flag, such as 0xD or 0xE (corresponding to ABANDAN or GC). Thus, when the Rx segment in the logic identification code recognizes the preset status flag, if the logic identification code corresponds to a sub-logic block, then the sub-logic block cannot be read or written; if the logic identification code corresponds to a logic block, then only the erase operation can be performed on the logic block.
如上所述,本案可透過邏輯識別碼以詳細記錄資料之存儲狀態、子邏輯塊與邏輯塊之關係,本案的新邏輯識別碼十分利於資料之讀取、寫入以及擦除等等相關操作。As mentioned above, this solution uses a logical identifier to record in detail the data storage status and the relationship between sub-logical blocks and logical blocks. This new logical identifier is very convenient for data reading, writing, and erasing operations.
圖6為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的分配流程600示意圖。需說明的是,圖6為一實施例中步驟220的詳細流程圖。具體包括,步驟610,當接收到存儲請求以將資料寫入存儲設備時,根據該存儲請求生成一分配命令以分配一邏輯塊或一子邏輯塊於該資料。該存儲請求是響應用戶操作而生成的,該分配命令是根據該存儲請求而生成的。另外,根據一個存儲請求可生成的一個或多個分配命令,取決於存儲請求要寫入存儲設備的資料的大小。承接圖4,資料A需佔用兩個子邏輯塊0、1,根據存儲資料A的存儲請求會生成兩個分配命令,響應每一分配命令將一個子邏輯塊分配給資料A。即每一分配命令只分配一個子邏輯塊或一個邏輯塊(取決於資料類型)給資料。Figure 6 is a schematic diagram illustrating a logical block and sub-logical block allocation process 600 according to some embodiments of the present invention. It should be noted that Figure 6 is a detailed flowchart of step 220 in one embodiment. Specifically, step 610 includes: upon receiving a storage request to write data to a storage device, generating an allocation command based on the storage request to allocate a logical block or a sub-logical block to the data. The storage request is generated in response to a user operation, and the allocation command is generated based on the storage request. Furthermore, the number of allocation commands generated based on a storage request depends on the size of the data to be written to the storage device. Continuing with Figure 4, data A requires two sub-logical blocks, 0 and 1. A storage request to store data A generates two allocation commands, with one sub-logical block allocated to data A in response to each allocation command. In other words, each allocation command allocates only one sub-logical block or one logical block (depending on the data type) to the data.
步驟611,識別資料之類型。具體的,該存儲請求中包括有待存儲資料的資訊例如類型、大小等,根據該資料的資訊可識別出其類型。若該資料之類型為目錄,則進入步驟612;若該資料之類型為文件,則進入步驟620。步驟612,搜尋可用的空閒邏輯塊,例如已擦除的邏輯塊。具體的,處理器115可根據邏輯識別碼的狀態標記為預設的狀態標記(例如0xA)或邏輯塊的使用標記為第一使用標記搜尋到空閒邏輯塊。若搜尋到,則進入步驟613;若未搜尋到,則進入步驟615。步驟613,取得空閒邏輯塊之邏輯識別碼如BLOCK_ID(0xA, 0, X)。步驟614,根據該資料的類型更新該邏輯識別碼以生成一更新後的邏輯識別碼並返回該更新後的邏輯識別碼如BLOCK_ID(0xC , Full, X),藉以將空閒邏輯塊X整個分配給資料,更新後的邏輯識別碼中記錄有與資料類型(metadata)相對應的狀態標記(0xC)、具有默認值的子邏輯塊號如Full以及邏輯塊號如X。步驟615,返回一預設信號例如無響應報錯信號ERR_NOSPC,表示無法分配邏輯塊給資料。Step 611, identify the type of data. Specifically, the storage request includes information about the data to be stored, such as type, size, etc., and the type of the data can be identified based on the information of the data. If the type of the data is a directory, proceed to step 612; if the type of the data is a file, proceed to step 620. Step 612, search for available free logical blocks, such as erased logical blocks. Specifically, the processor 115 can search for free logical blocks based on the status mark of the logical identification code being a preset status mark (e.g., 0xA) or the usage mark of the logical block being the first usage mark. If the search is successful, proceed to step 613; if not, proceed to step 615. In step 613, obtain the logic identification code of the free logic block, such as BLOCK_ID (0xA, 0, X). In step 614, the logical identifier is updated based on the data type to generate an updated logical identifier, such as BLOCK_ID(0xC, Full, X). This updated logical identifier allocates the entire free logical block X to the data. The updated logical identifier includes a status flag (0xC) corresponding to the data type (metadata), a sub-logical block number with a default value, such as Full, and a logical block number, such as X. In step 615, a default signal, such as the no-response error signal ERR_NOSPC, is returned, indicating that the logical block could not be allocated to the data.
步驟620,搜尋空閒子邏輯塊。步驟620之詳細內容可參見步驟612。若搜尋到,則進入步驟621;若未搜尋到,則進入步驟630。步驟621,生成該子邏輯塊對應的邏輯識別碼並返回該邏輯識別碼。在一實施例中,可根據該資料的類型更新該子邏輯塊已有的邏輯識別碼中的狀態標記以生成新的邏輯識別碼並將其返回。舉例來說,該子邏輯塊的邏輯識別碼為BLOCK_ID(FREE, Y2, Y1),並根據該資料的類型為文件將該邏輯識別碼更新為BLOCK_ID(CTZ, Y2, Y1)並將其返回,藉以將邏輯塊Y1的子邏輯塊Y2分配給資料。在另一實施例中,可根據該資料的類型、該子邏輯塊的塊號Y2以及其對應的邏輯塊的塊號Y1新生成該子邏輯塊的邏輯識別碼BLOCK_ID(CTZ, Y2, Y1)。之後,用該邏輯識別碼BLOCK_ID(CTZ, Y2, Y1)替換該子邏輯塊的原先的邏輯識別碼BLOCK_ID(FREE, Y2, Y1)。In step 620, a free sub-logic block is searched. See step 612 for details of step 620. If found, the process proceeds to step 621; if not, the process proceeds to step 630. In step 621, a logic identifier corresponding to the sub-logic block is generated and returned. In one embodiment, the status flag in the existing logic identifier of the sub-logic block is updated based on the data type to generate a new logic identifier, which is then returned. For example, the logical identification code of the sub-logical block is BLOCK_ID(FREE, Y2, Y1). Based on the data type, the logical identification code is updated to BLOCK_ID(CTZ, Y2, Y1) for the file and returned, thereby assigning the sub-logical block Y2 of logical block Y1 to the data. In another embodiment, the logical identification code BLOCK_ID(CTZ, Y2, Y1) of the sub-logical block can be newly generated based on the data type, the block number Y2 of the sub-logical block, and the block number Y1 of the corresponding logical block. Then, replace the original logic code BLOCK_ID(FREE, Y2, Y1) of the sub-logic block with the logic code BLOCK_ID(CTZ, Y2, Y1).
步驟630,搜尋可用的空閒邏輯塊,例如已擦除的空閒邏輯塊。步驟630之詳細內容可參見步驟612之詳細內容。若搜尋到,則進入步驟631;若未搜尋到,則進入步驟633。步驟631,取得空閒邏輯塊之邏輯塊號Z1,將邏輯塊劃分為複數個子邏輯塊,且分配複數個子邏輯塊中的一子邏輯塊給資料,並取得該子邏輯塊的子邏輯塊號Z2。步驟632,根據該資料的類型、邏輯塊號Z1以及子邏輯塊號Z2生成一邏輯識別碼如BLOCK_ID(CTZ, Z2, Z1),並返回該邏輯識別碼,藉以將邏輯塊Z1的子邏輯塊Z2分配給資料。步驟633,返回一預設信號例如無響應報錯信號ERR_NOSPC,表示無法分配邏輯塊給資料。In step 630, a free available logical block is searched, such as an erased free logical block. For details on step 630, see step 612. If a free logical block is found, the process proceeds to step 631; if not, the process proceeds to step 633. In step 631, the logical block number Z1 of the free logical block is obtained, the logical block is divided into a plurality of sub-logical blocks, one of the plurality of sub-logical blocks is allocated to the data, and the sub-logical block number Z2 of the sub-logical block is obtained. In step 632, a logical identification code (e.g., BLOCK_ID(CTZ, Z2, Z1)) is generated based on the data type, logical block number Z1, and sub-logical block number Z2. This logical identification code is then returned to allocate sub-logical block Z2 of logical block Z1 to the data. In step 633, a default signal (e.g., ERR_NOSPC) is returned to indicate that a logical block could not be allocated to the data.
另外,在步驟614、621、632將一邏輯塊或一子邏輯塊分配給資料時,處理器115會對應記錄或更新該邏輯塊或子邏輯塊的使用標記。In addition, when a logic block or a sub-logic block is allocated to data in steps 614, 621, and 632, the processor 115 will correspondingly record or update the usage flag of the logic block or sub-logic block.
圖7為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的讀取流程700示意圖,包括:步驟710,接收到一讀取請求以讀取資料,該讀取請求包括一邏輯識別碼。在另一實施例中,該讀取請求還包括一地址偏移量(offset)及要讀取的資料量(size)等參數。步驟711,識別邏輯識別碼中的狀態標記,並根據該狀態標記確定所要讀取的資料是目錄或文件執行相對應的讀取操作。具體的,若所要讀取的資料是文件(如在邏輯識別碼中識別到CTZ對應的狀態標記),則執行步驟720; 若所要讀取的資料是目錄(如在邏輯識別碼中識別到metadata對應的狀態標記),則執行步驟721;否則(即所要讀取的資料類型即非文件也非目錄,如在邏輯識別碼中識別到GC對應的狀態標記),則執行步驟722。步驟720,根據邏輯識別碼中的邏輯塊號及子邏輯塊號確定所要讀取資料的地址以讀取資料。具體的,處理器115根據邏輯塊號、子邏輯塊號及讀取請求中的地址偏移量確定一起始地址。更進地,處理器115更根據讀取請求中的資料量確定一結束地址。實作時,處理器115根據識別出的邏輯塊號(block number)、子邏輯塊號(subblock number)、每一子邏輯塊的大小(subblock siz)、地址偏移量(offset)及資料量(size)通過調用讀取函數:read(block number, subblock number*subblock size + offset, size)以讀取資料。FIG7 is a schematic diagram illustrating a logical block and sub-logical block read process 700 according to some embodiments of the present invention, including: Step 710: Receiving a read request to read data, the read request including a logical identifier. In another embodiment, the read request also includes parameters such as an address offset and the size of the data to be read. Step 711: Identifying a status flag in the logical identifier and, based on the status flag, determining whether the data to be read is a directory or a file, performing a corresponding read operation. Specifically, if the data to be read is a file (e.g., a status flag corresponding to CTZ is identified in the logical identifier), then step 720 is executed; if the data to be read is a directory (e.g., a status flag corresponding to metadata is identified in the logical identifier), then step 721 is executed; otherwise (i.e., the data type to be read is neither a file nor a directory, e.g., a status flag corresponding to GC is identified in the logical identifier), then step 722 is executed. In step 720, the address of the data to be read is determined based on the logical block number and sub-logical block number in the logical identification code to read the data. Specifically, the processor 115 determines a starting address based on the logical block number, sub-logical block number, and the address offset in the read request. Furthermore, the processor 115 determines an ending address based on the amount of data in the read request. During implementation, the processor 115 reads data by calling the read function: read(block number, subblock number*subblock size + offset, size) based on the identified logical block number (block number), subblock number (subblock number), size of each subblock (subblock siz), address offset (offset), and data size (size).
步驟721,根據邏輯識別碼中的邏輯塊號確定所要讀取資料的地址以讀取資料。當讀取請求中有地址偏移量和資料量時,還可根據該地址偏移量確定該讀取資料的起始地址,根據資料量確定一結束地址。具體實現時,根據識別出的邏輯塊號(block number)、該地址偏移量(offset)及資料量(size)通過調用讀取函數:read(block number , offset, size)以讀取資料。步驟722,返回一預設的讀取報錯信號例如無有效資料信號ERR_INVAL,表示根據讀取請求無法讀取到資料。In step 721, the address of the data to be read is determined based on the logical block number in the logical identification code to read the data. If the read request includes an address offset and data size, the starting address of the data to be read can also be determined based on the address offset, and the ending address can be determined based on the data size. In a specific implementation, the data is read by calling the read function: read(block number, offset, size) based on the identified logical block number (block number), the address offset (offset), and the data size (size). In step 722, a preset read error signal, such as the no valid data signal ERR_INVAL, is returned, indicating that the data could not be read according to the read request.
圖8為根據本案一些實施例繪製一種對邏輯塊與子邏輯塊的執行寫入流程800示意圖。需說明的是,圖8為一實施例中步驟240的詳細流程圖。FIG8 is a schematic diagram illustrating a write process 800 for logic blocks and sub-logic blocks according to some embodiments of the present invention. It should be noted that FIG8 is a detailed flow chart of step 240 in one embodiment.
步驟810,獲取到一寫入命令以寫入資料,該寫入命令包括一邏輯識別碼。具體的,處理器115在接收到步驟614、621、631其中之一返回的邏輯識別碼便生成一對應的寫入命令。可理解的,一旦寫入命令生成便可獲取到。可選的,該寫入命令更包括地址偏移量(offset)、要寫入的資料量(size)等參數。步驟811,識別寫入命令中邏輯識別碼中的狀態標記,並據此確定該寫入資料是目錄或文件而執行相對應的寫入操作。具體的,若寫入資料是文件,則執行步驟820; 若寫入資料是目錄,則執行步驟821; 否則,即寫入資料即非目錄也非目錄,則執行步驟822。步驟820, 根據邏輯識別碼識中的邏輯塊號及子邏輯塊號確定寫入地址。可選的,還根據寫入命令中的位址偏移量確定寫入起始地址,以及根據寫入命令中的資料量確定寫入結束地址。實作時,可根據識別出的邏輯塊號 (block number)、子邏輯塊號(subblock number)、每一子邏輯塊的大小(subblock siz)、地址偏移量(offset)及資料量(size)通過調用寫入函數:prog(block number , subblock number *subblock size + offset, size)以將資料寫入對應的子邏輯塊。In step 810, a write command is obtained to write data. The write command includes a logical identifier. Specifically, upon receiving the logical identifier returned by one of steps 614, 621, and 631, the processor 115 generates a corresponding write command. It is understandable that the write command can be obtained once it is generated. Optionally, the write command further includes parameters such as an address offset and the amount of data to be written. In step 811, a status flag in the logical identifier in the write command is identified, and accordingly, the status flag is determined to determine whether the written data is a directory or a file, and the corresponding write operation is performed. Specifically, if the data being written is a file, step 820 is executed; if the data being written is a directory, step 821 is executed; otherwise, if the data being written is neither a directory nor a subdirectory, step 822 is executed. In step 820, the write address is determined based on the logical block number and sub-logical block number identified in the logical identification code. Optionally, the write start address is determined based on the address offset in the write command, and the write end address is determined based on the data size in the write command. During implementation, data can be written to the corresponding sub-logical block by calling the write function: prog(block number, subblock number *subblock size + offset, size) based on the identified logical block number (block number), sub-logical block number (subblock number), size of each sub-logical block (subblock siz), address offset (offset), and data size (size).
步驟821,根據邏輯識別碼中的邏輯塊號確定寫入地址以寫入資料。當寫入命令中有地址偏移量時,還可根據該地址偏移量確定寫入起始地址,以及根據寫入命令中的資料量確定寫入結束地址。實作時,可根據識別出的邏輯塊號 (block number)、地址偏移量(offset)及資料量(size)通過調用寫入函數:prog(block number , offset, size)以將資料寫入對應的邏輯塊。步驟822,返回一預設的寫入報錯信號,表示根據寫入命令無法將資料寫入對應的邏輯塊或其子邏輯塊中。In step 821, a write address is determined based on the logical block number in the logical identification code to write the data. If the write command includes an address offset, the write start address can also be determined based on the address offset, and the write end address can be determined based on the data size in the write command. In implementation, the data can be written to the corresponding logical block by calling the write function: prog(block number, offset, size) based on the identified logical block number (block number), address offset (offset), and data size (size). In step 822, a preset write error signal is returned, indicating that the data could not be written to the corresponding logical block or its sub-logical blocks according to the write command.
處理器115在完成資料寫入後更新對應的邏輯識別碼例如更新邏輯識別碼中的狀態標記及更新其對應邏輯塊或子邏輯塊的使用標記。After completing the data writing, the processor 115 updates the corresponding logic identification code, for example, updates the status flag in the logic identification code and updates the usage flag of the corresponding logic block or sub-logic block.
圖9為根據本案一些實施例繪製一種邏輯塊的擦除流程900示意圖。如圖所示,步驟910,接收到一擦除請求以擦除一資料。該擦除請求包括一邏輯識別碼。步驟911,識別邏輯識別碼中的狀態標記,並據此確定所請求擦除的資料是目錄或文件執行相對應的擦除操作。具體的,若資料是文件,則執行步驟912; 若資料是目錄,則執行步驟920;否則,即資料即非文件也非目錄(如在邏輯識別碼中識別到FREE對應的狀態標記),則執行步驟930。步驟912,判斷該邏輯識別碼對應的邏輯塊中是否有有效資料。具體的,確定該邏輯識別碼中邏輯塊號,找出包含有該邏輯塊號的所有邏輯識別碼,並根據該所有邏輯識別碼的對應狀態標記以判斷該邏輯塊中是否有一有效資料。倘若其中一邏輯識別碼的狀態標記為預設值如CTZ,則判斷該邏輯塊中有有效資料。若是,則進入步驟913,返回擦除報錯信號以告知不進行擦除操作。即該邏輯識別碼所在的邏輯塊中有其餘子邏輯塊存儲了有效資料,則不能對此邏輯塊進行擦除。FIG9 is a schematic diagram of an erasure process 900 of a logical block according to some embodiments of the present invention. As shown in the figure, in step 910, an erase request is received to erase a data. The erase request includes a logical identification code. In step 911, a status mark in the logical identification code is identified, and accordingly, it is determined whether the data requested to be erased is a directory or a file and a corresponding erase operation is performed. Specifically, if the data is a file, step 912 is executed; if the data is a directory, step 920 is executed; otherwise, that is, the data is neither a file nor a directory (such as a status mark corresponding to FREE is identified in the logical identification code), step 930 is executed. In step 912, it is determined whether the logical block corresponding to the logical identification code contains valid data. Specifically, the logical block number in the logical identification code is determined, all logical identification codes containing the logical block number are found, and the corresponding status flags of all logical identification codes are used to determine whether the logical block contains valid data. If the status flag of one of the logical identification codes is a default value, such as CTZ, then the logical block is determined to contain valid data. If so, the process proceeds to step 913, where an erase error signal is returned to indicate that the erase operation will not be performed. That is, if the logic block where the logic identification code is located has other sub-logic blocks storing valid data, this logic block cannot be erased.
步驟920,對該邏輯識別碼對應的邏輯塊執行擦除操作。具體的,可從擦除請求包括的邏輯識別碼中獲取邏輯塊號並調用擦除接口:erase(block number)以對該邏輯塊進行整個擦除,即對該邏輯塊相對應的區塊進行擦除操作。步驟930,返回擦除報錯信號以表示無法執行擦除操作。可以理解的,步驟913、930返回的擦除報錯信號可相同也可不同。In step 920, an erase operation is performed on the logical block corresponding to the logical identification code. Specifically, the logical block number can be obtained from the logical identification code included in the erase request and the erase interface: erase(block number) is called to erase the entire logical block, that is, to erase the blocks corresponding to the logical block. In step 930, an erase error signal is returned to indicate that the erase operation could not be performed. It is understood that the erase error signals returned in steps 913 and 930 can be the same or different.
圖10為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的示意圖。如圖所示,本案可對子邏輯塊(如虛擬塊(subblock))的大小(即subblock size)進行配置,子邏輯塊的大小(subblock size)可為寫入頁面大小(program page size)以及讀取頁面大小(read page size)的整數倍,且能整除邏輯塊大小(如擦除邏輯塊大小(erase block size))。子邏輯塊的大小(subblock size)會被記錄在本案文件系統的配置文檔中。Figure 10 is a schematic diagram illustrating a logical block and sub-logical block according to some embodiments of the present invention. As shown, the present invention allows for configuring the size (i.e., subblock size) of a sub-logical block (e.g., a virtual block). The subblock size can be an integer multiple of the program page size and the read page size, and can be an integer multiple of the logical block size (e.g., the erase block size). The subblock size is recorded in the configuration file of the present invention's file system.
需說明的是,本案不以圖1至圖10所示之實施例為限,其僅用以例示性地繪示本案的實現方式之一,以使本案的技術易於理解,本案之專利範圍當以發明申請專利範圍為準。本領域技術人員在不脫離本案之精神的狀況下,對本案之實施例所進行的修改與潤飾依舊落入本案之發明申請專利範圍。It should be noted that this application is not limited to the embodiments shown in Figures 1 through 10 . These are merely illustrative examples of one embodiment of this application to facilitate understanding of the technology. The scope of this application's patents shall be based on the scope of the invention application. Modifications and enhancements to the embodiments of this application made by skilled artisans without departing from the spirit of this application shall still fall within the scope of this invention application.
綜上所述,本案之存儲管理方法及存儲管理裝置將邏輯塊進一步劃分為複數個子邏輯塊,再以邏輯塊中的多個子邏輯塊來分別存儲資料量較小的多筆資料,因此,若同一個邏輯塊尚有空閒的子邏輯塊,上述空閒的子邏輯塊將被分配給其餘資料來進行使用,是以本案之存儲管理方法及存儲管理裝置得以高效率地進行存儲空間之分配,因此得以避免浪費存儲空間。In summary, the storage management method and storage management device of this case further divide the logical block into multiple sub-logical blocks, and then use multiple sub-logical blocks within the logical block to store multiple smaller data items. Therefore, if the same logical block still has free sub-logical blocks, the free sub-logical blocks will be allocated to the remaining data for use. Therefore, the storage management method and storage management device of this case can efficiently allocate storage space, thereby avoiding wasted storage space.
此外,本案之存儲管理方法及存儲管理裝置進一步配置了邏輯識別碼,本案可透過上述邏輯識別碼以詳細記錄邏輯塊或子邏輯塊的狀態、子邏輯塊與邏輯塊之關係,進而高效率地進行存儲空間之分配以及後續寫入、讀取、擦除等操作。邏輯識別碼In addition, the storage management method and storage management device of this case are further configured with a logical identification code. This case can use the above logical identification code to record the status of the logical block or sub-logical block, the relationship between the sub-logical block and the logical block in detail, and then efficiently allocate storage space and perform subsequent write, read, erase and other operations. Logical identification code
雖然本案之實施例如上所述,然而該些實施例並非用來限定本案,本技術領域具有通常知識者可依據本案之明示或隱含之內容對本案之技術特徵施以變化,凡此種種變化均可能屬於本案所尋求之專利保護範疇,換言之,本案之專利保護範圍須視本說明書之申請專利範圍所界定者為準。Although the embodiments of this case are described above, these embodiments are not intended to limit this case. Those skilled in the art may modify the technical features of this case based on the explicit or implicit content of this case. All such modifications may fall within the scope of patent protection sought in this case. In other words, the scope of patent protection for this case shall be determined by the scope of the patent application in this specification.
100: 存儲管理裝置 115: 處理器 200: 方法 210~240: 步驟 400: 存儲設備 500: 記憶體 600: 方法 610~633: 步驟 700: 方法 710~722: 步驟 800: 方法 810~822: 步驟 900: 方法 910~930: 步驟 Rx: 邏輯識別碼的區段 Ry:邏輯識別碼的區段 Rz:邏輯識別碼的區段 100: Storage management device 115: Processor 200: Method 210-240: Steps 400: Storage device 500: Memory 600: Method 610-633: Steps 700: Method 710-722: Steps 800: Method 810-822: Steps 900: Method 910-930: Steps Rx: Logical identification code segment Ry: Logical identification code segment Rz: Logical identification code segment
圖1為根據一些本案實施例繪製一種存儲管理裝置以及記憶體的示意圖; 圖2為根據本案一些實施例繪製一種存儲管理方法的流程示意圖; 圖3為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的關係示意圖; 圖4為根據本案一些實施例繪製一種子邏輯塊與資料之分配關係示意圖; 圖5為根據本案一些實施例繪製一種邏輯塊、子邏輯塊與邏輯識別碼的示意圖; 圖6為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的分配流程示意圖; 圖7為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的讀取流程示意圖; 圖8為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的寫入流程示意圖; 圖9為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的擦除流程示意圖;以及 圖10為根據本案一些實施例繪製一種邏輯塊與子邏輯塊的示意圖。 Figure 1 is a schematic diagram of a storage management device and memory according to some embodiments of the present invention; Figure 2 is a schematic diagram of a storage management method according to some embodiments of the present invention; Figure 3 is a schematic diagram of the relationship between a logic block and a sub-logic block according to some embodiments of the present invention; Figure 4 is a schematic diagram of the relationship between a sub-logic block and data allocation according to some embodiments of the present invention; Figure 5 is a schematic diagram of a logic block, a sub-logic block, and a logic identification code according to some embodiments of the present invention; Figure 6 is a schematic diagram of the allocation process of a logic block and a sub-logic block according to some embodiments of the present invention; Figure 7 is a schematic diagram illustrating a read process for a logic block and a sub-logic block according to some embodiments of the present invention; Figure 8 is a schematic diagram illustrating a write process for a logic block and a sub-logic block according to some embodiments of the present invention; Figure 9 is a schematic diagram illustrating an erase process for a logic block and a sub-logic block according to some embodiments of the present invention; and Figure 10 is a schematic diagram illustrating a logic block and a sub-logic block according to some embodiments of the present invention.
200:方法 200:Method
210~240:步驟 210~240: Steps
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113137461A TWI894007B (en) | 2024-09-30 | 2024-09-30 | Storage management method and storage management device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113137461A TWI894007B (en) | 2024-09-30 | 2024-09-30 | Storage management method and storage management device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| TWI894007B true TWI894007B (en) | 2025-08-11 |
Family
ID=97524209
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW113137461A TWI894007B (en) | 2024-09-30 | 2024-09-30 | Storage management method and storage management device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI894007B (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TW200601043A (en) * | 2003-12-30 | 2006-01-01 | Sandisk Corp | Non-volatile memory and method with non-sequential update block management |
| TW201537577A (en) * | 2014-03-31 | 2015-10-01 | Phison Electronics Corp | Data writing method, memory control circuit unit and memory storage apparatus |
| CN112181300A (en) * | 2020-09-25 | 2021-01-05 | 杭州宏杉科技股份有限公司 | Data processing method and distributed storage cluster |
| CN113032290A (en) * | 2021-03-19 | 2021-06-25 | 维沃移动通信有限公司 | Flash memory configuration method and device, electronic equipment and storage medium |
-
2024
- 2024-09-30 TW TW113137461A patent/TWI894007B/en active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TW200601043A (en) * | 2003-12-30 | 2006-01-01 | Sandisk Corp | Non-volatile memory and method with non-sequential update block management |
| TW201537577A (en) * | 2014-03-31 | 2015-10-01 | Phison Electronics Corp | Data writing method, memory control circuit unit and memory storage apparatus |
| CN112181300A (en) * | 2020-09-25 | 2021-01-05 | 杭州宏杉科技股份有限公司 | Data processing method and distributed storage cluster |
| CN113032290A (en) * | 2021-03-19 | 2021-06-25 | 维沃移动通信有限公司 | Flash memory configuration method and device, electronic equipment and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10657047B2 (en) | Data storage device and method of performing partial garbage collection | |
| US7861028B2 (en) | System and method for configuration and management of flash memory | |
| JP4611024B2 (en) | Method and apparatus for grouping pages in a block | |
| US7610434B2 (en) | File recording apparatus | |
| US8041884B2 (en) | Controller for non-volatile memories and methods of operating the memory controller | |
| US9684568B2 (en) | Data storage device and flash memory control method | |
| US7962687B2 (en) | Flash memory allocation for improved performance and endurance | |
| JP4991320B2 (en) | Host device and memory system | |
| US8370602B2 (en) | Method for memory space management | |
| JP7381678B2 (en) | memory system | |
| JP7392080B2 (en) | memory system | |
| JP2005502124A (en) | Flash management system for large page sizes | |
| EP3752905B1 (en) | Append only streams for storing data on a solid state device | |
| JP2009244962A (en) | Memory system | |
| JP4551328B2 (en) | Data area management method in information recording medium, and information processing apparatus using data area management method | |
| WO2024192888A1 (en) | Cxl memory module, memory data replacement method, and computer system | |
| US7516266B2 (en) | System and method capable of sequentially writing data to a flash memory | |
| US20180232154A1 (en) | Append Only Streams For Storing Data On A Solid State Device | |
| US11614876B2 (en) | Memory device and method for accessing memory device with namespace management | |
| TWI894007B (en) | Storage management method and storage management device | |
| CN111625477B (en) | Processing method and device for read request for accessing erase block | |
| CN111831589B (en) | Method and device for improving IO command processing parallelism | |
| CN119200998A (en) | Storage management method and storage management device | |
| CN114610228A (en) | File management system and file management method and device thereof | |
| CN118821245B (en) | Write protection mapping method, device, computer readable storage medium and electronic device |