TW200426584A - Method and system for storing data - Google Patents

Method and system for storing data Download PDF

Info

Publication number
TW200426584A
TW200426584A TW92114565A TW92114565A TW200426584A TW 200426584 A TW200426584 A TW 200426584A TW 92114565 A TW92114565 A TW 92114565A TW 92114565 A TW92114565 A TW 92114565A TW 200426584 A TW200426584 A TW 200426584A
Authority
TW
Taiwan
Prior art keywords
block
memory
file
memory block
storage
Prior art date
Application number
TW92114565A
Other languages
Chinese (zh)
Other versions
TWI248570B (en
Inventor
Chi-Chih Cheng
Original Assignee
Accton Technology Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Accton Technology Corp filed Critical Accton Technology Corp
Priority to TW92114565A priority Critical patent/TWI248570B/en
Publication of TW200426584A publication Critical patent/TW200426584A/en
Application granted granted Critical
Publication of TWI248570B publication Critical patent/TWI248570B/en

Links

Abstract

A method and system for storing a file in a block-storage-based memory. The method includes following steps: comparing the size of said file with each of said blocks of said memory available for memory storage for selecting a best-fit block; storing a fitted segment of said file into said best-fit block; and truncating said fitted segment of said file and repeating said comparing step and said storing step if a remainder of said file remains after said truncating until the entirety of said file has being stored in said memory.

Description

200426584 五、發明說明(1) ----—___ 發明所屬之技術領域 本發明提供—種資料 將一檔案分割成複數個資7子之方法及系統,尤指一種可 統。 貝料單元以儲存該檔案的方法及系 先前技術 在電腦系統的各個元件中 (Storage Device )向來為 言,儲存體可分為兩大類別^ Storage Device )及非揮發性 Storage Device )。所謂 ^發 存的資料會隨著時間而逐漸^ 源供應切斷,則儲存於其中= 在於存取速度快’例如動態隨 Random Access Memory, DRAM 地,所謂非揮發性儲存體即該 會隨著時間而流失,同時該資 狀況下繼續存在於該儲存體中 要社電源供應即使切斷的情況 佔有十分重要的角色,然而其 來說非常緩慢,例如快閃記憶 ’用來儲存資料的儲存體 常重要的一個領域。一般市 即揮發性儲存體(V ο 1 a t i 1 ( 儲存體(Non-Volatile 性儲存體即該儲存體内所傷 失’且如果將該儲存體之電 資料將完全消失,而其好處 機存取記憶體(D y n a m i c )即屬於此類元件;相反 儲存體内所儲存的資料並不 料也可以於切斷電源供應的 ’故非揮發性儲存體於有需 下仍保有資料内容的應用中 缺點為存取速度相對於])Ram 體(Flash Memory),硬碟200426584 V. Description of the invention (1) --------___ The technical field to which the invention belongs The present invention provides a kind of information A method and system for dividing a file into a plurality of assets, especially a kind of system. The storage unit uses the method and system for storing the file. The prior art In the various components of the computer system (Storage Device), the storage can be divided into two categories ^ Storage Device) and non-volatile Storage Device). The so-called data will be gradually developed over time. The source supply is cut off, and it is stored in it = because the access speed is fast '. For example, the dynamics follow Random Access Memory, DRAM. The so-called non-volatile storage should follow Time goes by, and at the same time, the power supply of the company still plays a very important role even if the power supply is cut off, but it is very slow. For example, flash memory is used to store data. Often important. The general city is volatile storage (V ο 1 ati 1 (storage) (Non-Volatile storage is lost in the storage ') and if the electrical data of the storage will completely disappear, its benefits are stored Memory (Dynamic) belongs to this kind of component; on the contrary, the data stored in the storage is unexpected and can also be used to cut off the power supply. Therefore, the non-volatile storage has the disadvantage of retaining the data content when needed. For access speed relative to]) Ram body (Flash Memory), hard disk

a 货昍說明(2) 二:軟碟機等元件均屬於此類元件 ::機::…,碟機針對大量儲存空A非揮發性儲 叙渠祛便利於攜帶的特性,快閃纪 而要之特性,及 較小的體積及較快的存取速度:::具備有相對來說 J線器Hub)等產品〜非揮路 謂區憶;f 一種具備區塊寫入特性的儲存…所 兄冩入,忍即於該儲存體中的 仔衣置,所 長度的區& (其可能有數種不同子『間為複數個固定 寫入該儲存體的時候,必須以 ' p而當-檔案被 *,此種儲存特性造成了 分割以及儲 :使該區塊中仍然存在沒有被利二 再用作其他儲存用途,這是此類儲存 ,、將热次 存位址連續存入的方式,舉例來:;夫=取對Γ儲 習知技術之快閃圮情髀〗n戗.^ 明參π圖一,圖一乃 閃—min 4 匕體儲存一構案20之示意圖,其中快 9n二心也韦邛份區塊已被利用於儲存資料,現欲將柃安 2 0仔入快閃記憔髀〗η φ眭,日丨丨△⑶ 丁貝丨丁 兄从对仏木 位址之了一 Η ; r 1 〇 則自快閃記憶體10中實際儲存 料單元Mi# ^塊起,依序將檔案20被分割後之資 ' 、只存入快閃記憶體1 0之區塊1 2中,直到檔宰2 0 全:被V,止:請注意樓案2。最後存入之-70 a ;般檔案之大小並非為一固定值,故去;^幸 20依照所使用快閃記憶體1〇之區塊12的大小進行分害Γ時 1200426584 五、發明說明(3)其最後被分割剩餘^ > 與其所欲存入束貧料單元…之大小’通常不會 由於快閃記情體二ί f大小相符…亦即於此一狀况下’ 存空間為閒置“入特性區塊12b中必定有部份儲 …、法用於任何資料之儲存。 想 快 方 廠 用 憶 本 記 空 之 不 塊 案 因 置 然而 之處: 閃記憶 式雖然 牌或不 塊之數 不同種 體重新 ,習知 憶體「 間的浪 後,由 連續的 分割成 之大小 為連續 空間卻 :又習 儲存區 前述 習知 體之 直接 同型 量及 類之 進行 技術 間隙 費, 於連 情形 數個 較此 儲存 因不 知技 塊選 習知技術之快 技術之快閃記 各個區塊的實 ’但是卻時常 號的快閃記憶 位址配置均不 快閃記憶體時 管理程式之修 之快閃記憶體 (Fragmentat 閃記憶 憶體於 際儲存 造成其 體其儲 相同, ,必須 改,這 的連續 ion )丨 所谓間隙,即一快閃 續之寫入及刪除的動 愈來愈頻繁,亦即其 區段而不呈連續狀態 區段内區塊之大小總 空間不足而導致儲存 連續而無法儲存的情 術之快閃記憶體乃依 取法則,這會造成區 體卻有以下數個不盡理 讀取及寫入時,均以該 位址為索引’ k種存取 可移植性差’由於不同 存空間大小及其中各個 所以當一電腦系統欲使 針對每一類型之快閃記 會增加軟體維護的成 存入特性,會由於快閃 的存在,而造成儲存 記憶體於使用一段時間 作,造成其閒置區塊間 閒置區塊會被已利用區 ,此時縱使一欲儲存檔 合為小時’則該檔案將 失敗,此一擁有足夠門 形,乃儲存空間的浪$ 連續存入之原則,^ 塊不合理之使用,〜 从圖a Description of goods (2) 2: The floppy disk drive and other components belong to this type of component :: machine :: ..., the disk drive is convenient for carrying large quantities of empty A non-volatile storage channels. Features, and smaller size and faster access speed ::: Equipped with products such as J-line devices (Hubs) ~ non-swaying circuit area memory; f a storage with block write characteristics ... Enter, and endure the area in the storage, the length of the area & (It may have several different sub- "When a fixed number of writes to the storage, you must use 'p and when-the file It is *, this storage characteristic causes division and storage: so that the block still exists in the block and is not used for other storage purposes. This is the type of storage and the continuous storage of hot secondary storage addresses. For example: Husband = take the flash of 习 storage of the known technology 圮 n 戗. ^ Refer to Figure π, Figure 1 is a schematic diagram of Flash-min 4 dagger body storage of a case 20, which is 9n faster The Yewei block has already been used to store data, and now I want to add Luan 20 Aberdeen to the flash memory. 〖Η φ 眭Day 丨 丨 △ ⑶ Dingbei 丨 Dingxiong took a look at the address of the cypress; r 1 〇 starts from the actual storage unit Mi # ^ block in the flash memory 10, and then divides the file 20 in order The capital ', only stored in block 12 of flash memory 10, until file 2 0. All: be V, only: please pay attention to case 2. The last deposit is -70 a; the size of the general file It ’s not a fixed value, so go ahead; ^ Fortunately, 20 is divided according to the size of block 12 of the flash memory 10 used. Γ 1200426584 V. Description of the invention (3) It is finally divided and remaining ^ > The size of the deposited lean material unit ... usually does not match the size of the flash memory type II, f .... that is, in this situation, the storage space is idle, and there must be some storage in the characteristic block 12b ... The method is used for the storage of any data. I want to quickly use the memory to remember the non-block case. The flash memory type although the card or non-block number of different species is renewed. After the waves, the size of the continuous division into continuous space is: The same type and similar amount of technical clearance fees are used. In the case of several, the flash memory of each block is stored because of the fast technology of the unknown block selection technology. But the flash memory address configuration of the usual number is all When the flash memory is not flashed, the flash memory of the management program is repaired (Fragmentat flash memory is stored in the same memory and its storage is the same, and must be changed, this continuous ion) 丨 The so-called gap, which is a flash write The deletion and deletion are more and more frequent, that is, the total size of the blocks in the segment is not in a continuous state. The flash memory for the continuous and unstorable emotions is stored according to the law, which will cause The area has the following several random reads and writes, all using this address as an index 'k kinds of access portability is poor' due to different memory space size and each of them, when a computer system wants to make A type of flash memory will increase the storage characteristics of software maintenance. Due to the existence of flash memory, the storage memory will be used for a period of time, resulting in its free area. Unused blocks will be used. At this time, even if a file to be stored is an hour, the file will fail. This one has a sufficient gate shape, which is the principle of continuous storage of $. The block is not reasonable. The use, ~ from the figure

200426584 五、發明說明(4) 一中之習知技術的該快閃記憶體為例,其 元22a為一串非常短之資料,而剛好其由連綠若結束資料單 置之區塊1 2b為一十分大之區塊,這將造續存入原則配 結束資料單元22a後,留下一部份非常大之區塊12b於儲存 區塊寫入特性而無法被利用,形成浪費;田閒置空間卻因 技術之快閃記憶體均自該快閃記憶體之起$後’由於習知 閒置之連續區塊進行資料的儲存,這會造二1立址開始尋找 塊的寫入次數累積較其他區塊為多,而^成部份特定之區 每一區塊,其均有一最大保證有效寫次婁^ 、門°己體中之 寫入次數達到此一值後,其發生故障值,若一區塊之 如果一快閃記憶體中部份特定區塊或率將大增,所以 而無法將總寫入次數平岣分配至各=F、他區塊先達到此值 該快閃記憶體整體壽命之縮短,;:^的話,這將造成 而增加使用者之成本。 發明内容 結構的檔案系統用來對一且右F地禋八有一層夂之資料 資料的方法,以解決上述習〜:門寫入特性之儲存體儲存 貝 ιw快閃記憶體技術的問題。 資料儲存的方法,其伤用氺 該記憶體包含有複數個體口槽案儲:於-記憶體 ,隐體中時必須以該區塊,且當該檔案储存200426584 V. Description of the invention (4) The flash memory of the conventional technology in Example 1 is an example. Its element 22a is a series of very short data, and it just happens to be a block 1 2b that is set by the data end of Lianruo Ruo. This is a very large block, which will continue to be stored in the principle allocation end data unit 22a, leaving a part of the very large block 12b in the storage block to write characteristics that cannot be used, resulting in waste; The free space is due to the fact that the flash memory of the technology starts from the flash memory. 'Because it is known that idle continuous blocks are used to store data, this will cause the number of writes to start looking for blocks. There are many other blocks, and each block in a specific area has a maximum guaranteed effective write times. After the number of writes in the body reaches this value, the fault value occurs. If a block has a specific block or rate in a flash memory, it cannot increase the total number of writes to each = F. The flash memory first reaches this value. The flash memory The overall life of the body is shortened;; ^, this will cause increased costs for users. SUMMARY OF THE INVENTION A structured file system is a method for arranging a layer of data on the right and the right, to solve the problem of the above-mentioned practice: the gate storage characteristic of the flash memory technology. The method of data storage, which is harmful. The memory contains a plurality of individual case files: in -memory, the block must be used in the hidden body, and when the file is stored

中,緣…-哎β ,禝數個 〜丨心肪 該記憶體中時必須以該等塊J當該檔案储存 要包含下列步驟:比較該;宰己區塊為單位’該方法主 要 &案與^憶體中每—記憶體區 於該In the margin ...-Hey β, several of them must be in the memory when the block J is used. When the file is stored, the following steps should be included: compare the; block the block as a unit. The method is mainly & Case and memory of each-memory area in the

200426584 五、發明說明(5) 塊閒置儲存空間之大小,以自該等具閒置儲存空間之記憶 體區塊中選取一最適記憶體區塊;儲存該檔案中對應於該 最適記憶體區塊之儲存空間的資料單元至該最適記憶體區 塊中;以及若儲存該資料單元後該檔案中仍有剩餘之待儲 存資料單元,則重覆上述步驟,直到該檔案完全被儲存於 該記憶體中為止。 本發明係利用一最佳化之閒置記憶體配置的方法以及 一二層次資料結構的設計,來使一檔案系統於儲存檔案時 對一具備區塊寫入特性的儲存裝置進行更有效率的儲存空 間配置,以達到更合理使用儲存資源的目的。 實施方式 請參照圖二,圖二中顯示本發明之系統3 0方塊圖。本 發明係於具區塊寫入特性之記憶體38之驅動模組上建立一 具有二層次之資料結構的檔案系統32,依最佳配置演算法 將一檔案儲存於該記憶體38中。該記憶體38包含有複數個 記憶體區塊46,且當該檔案儲存於記憶體38中時必須以記 憶體區塊4 6為單位,其中該檔案系統3 2主要係依照以下步 驟存取記憶體3 8 :比較該檔案與記憶體3 8中具有閒置儲存 空間之每一記憶體區塊46之大小,以自該記憶體區塊46中 選取一最適記憶體區塊;儲存該檔案對應於該最適記憶體200426584 V. Description of the invention (5) The size of the free storage space to select an optimal memory block from the memory blocks with the free storage space; the file corresponding to the optimal memory block is stored in the file The data unit of the storage space is stored in the optimal memory block; and if there are remaining data units to be stored in the file after the data unit is stored, the above steps are repeated until the file is completely stored in the memory. . The present invention uses an optimized method of idle memory configuration and the design of a two-level data structure to enable a file system to more efficiently store a storage device with block write characteristics when storing files. Space allocation to achieve a more rational use of storage resources. Embodiment Please refer to FIG. 2, which shows a block diagram of a system 30 of the present invention. A file system 32 having a two-level data structure is established on a drive module of a memory 38 having a block write characteristic, and a file is stored in the memory 38 according to an optimal allocation algorithm. The memory 38 includes a plurality of memory blocks 46, and when the file is stored in the memory 38, the memory block 46 must be used as a unit. The file system 3 2 mainly accesses the memory according to the following steps. Bank 38: comparing the size of the file with each memory block 46 in the memory 38 with free storage space to select an optimal memory block from the memory block 46; storing the file corresponds to The optimal memory

200426584200426584

:塊=儲存空間的資料單元至該最適記憶體區塊中;以及 %儲子π亥貝料單元後該檔案中仍有剩餘之待儲存資料單 2 i則重覆上述步驟,直到該檔案完全被儲存於該記憶體 38中為止。 4茶照圖三’圖三中顯示本發明之一實施例的系統方 ^圖。於圖三中’係用來儲存一檔案至記憶體38,該記憶 則為一具備區塊寫入特性之儲存裝置,故包含有複數 ,义丨思體區塊4 6 (其可能有數種不同的大小),用來儲存 二仏案t分割後所產生的資料單元’而該記憶體亦包含有 組(Driver)(未顯示於圖三中),其則用來依 —j ^統32所包含之資訊對記憶體38之記憶體區塊46進 =資作;而該槽案系統32則包含有二 檔案層(/十厂構·一儲存體層(Storage Layer ) 42及一 置邏^運」e Uyer ) 44 ’其中儲存體層42係提供最佳配 憶體38區ίΐίΪί出之閒置區塊管理原則選擇最適之記 體38之起始、=:案,亚記錄資料區塊48實際對應到記憶 案,用來3 置及大小;檔案層44則對應於該擋 48。於圖案之各個資料單元所選取之資料區塊 入特性記憶體之=係可使用於各種内含具區塊寫 示卡等;而該且:1宜 ,例如網路集線器、圖形顯 憶體,但是苴他且右f入特性之記憶體38通常為一快閃記 蓋範圍。/、 /、有相同特性之記憶體亦屬於本發明的涵: Block = data unit of storage space to the optimal memory block; and %% of the remaining data in the file after storage of the π 贝 亥 shell material unit 2 i repeat the above steps until the file is completely Until stored in the memory 38. FIG. 3 is a system diagram of an embodiment of the present invention. In Figure 3, 'is used to store a file to the memory 38. The memory is a storage device with a block write feature, so it contains a complex number, meaning the block 4 6 (which may have several different Size), used to store the data unit generated after the t-division of the second case ', and the memory also contains a driver (not shown in Figure 3), which is used according to —j ^ 系 32 所The information contained is input to the memory block 46 of the memory 38, and the slot system 32 includes two file layers (/ ten factories, a storage layer 42 and a logic layer). ”E Uyer) 44 'The storage layer 42 is used to provide the optimal memory body 38. The idle block management principle is to select the most suitable record 38. The beginning, =: case, sub-record data block 48 actually corresponds to The memory case is used for 3 positions and sizes; the file layer 44 corresponds to the block 48. The data block selected in each data unit of the pattern is stored in the characteristic memory = can be used for various embedded graphics cards with blocks, etc .; and: 1 is suitable, such as a network hub, a graphics memory, However, the memory 38, which is unique and right-handed, usually has a flash cover range. /, /, Memory with the same characteristics also belongs to the meaning of the present invention

200426584200426584

圖三中 會依據最佳 的記憶體區 該檔案之記 9及6之記憶 錄實際對應 同時將該檔 層4 4中。如 地,當欲自 依據記錄於 塊4 8,來控 記憶體3 8的 序合併以還 動作;而當 3 2會依據記 料區塊4 8, 4 8之記憶體 檔案層4 4中 檔案之刪除 寫入記憶 選取適合 檔案,檔 體區塊46 於儲存體 區塊之起 料區塊4 8 完成該檔 取出該檔 資訊選取 對相對應 進行讀取 上所述, 中將該槽 中之資訊 模組對相 塊4 6進行 以清除。 配置演算法來 塊46來儲存該 憶體3 8的記憶 體區塊46,並 到該些記憶體 案所儲存的資 上所述,即可 °己體3 8中讀 檔案層44中之 制違驅動模組 記憶體區塊46 原該檔案。如 欲自記憶體3 8 錄於檔案層44 來控制該驅動 3 8的記憶體區 之相關資訊予 動作。 月豆體38時,檔案系 _ 統32 儲存該檔案之記憶體38 案系統32選取用於铸存 ,依序為第4、5、1()^ 層42之資料區塊48中紀 始、結束位置及大小, 號碼及屬性紀錄於槽案 案之寫入動作;同樣、 案時,該檔案系統32會 儲存體層4 2中的資料^ 於被選取資料區塊48之 ’並將該資料單元依順 即可完成該槽案之讀取 案刪除時,該檔案系統 選取儲存體層42中的資 對應於被選取資料區塊 刪除’然後再將記錄於 如上所述,即可完成該 统另t含1: ϋ:下’儲存-檔案至記憶體38中日寺,電腦系 儲存體層 叹、案層44 )内的所有相關貧訊均儲存於該揮In Figure 3, according to the best memory area, the actual correspondence of the records 9 and 6 of the file will be stored in the file 4 and 4 at the same time. For example, when you want to control the sequence of memory 38 to merge according to the records in block 48, and when you want to do it, you will use the files in memory file layer 4 4 of block 4 8 and 4 8 to record. To delete the write memory, select the appropriate file. The file block 46 is in the starting block 4 of the storage block. 4 8 Complete the file. Take out the file information. Select the corresponding file for reading. The information module clears phase blocks 4 6. Configure the algorithm to block 46 to store the memory block 46 of the memory 38, and to the information stored in the memory cases, you can read the system in the file layer 44 of the body 38. Illegal drive module memory block 46 originally the file. If you want to record from the memory 38 in the file layer 44 to control the relevant information of the memory area of the driver 38, you can act. At 38 o'clock, the file system _ System 32 stores the memory 38. The file system 32 is selected for casting, and it is the data block 48 in the data block 48 of the fourth, fifth, and 1 () ^ layers in order, The end position and size, number and attribute are recorded in the writing of the slot case; similarly, at the time of the case, the file system 32 will store the data in the body layer 42 ^ in the selected data block 48 'and the data unit Follow the instructions to complete the deletion of the reading of the slot. When the file system selects the data in the storage layer 42 corresponding to the selected data block and delete it, and then record it as described above, you can complete the system Contains 1: ϋ: Under 'Save-File to Memory 38 Zhongri Temple, computer system storage layer, case layer 44) All relevant poor information is stored in the computer

五、發明說明(8) 發性記憶體中供處理器使用,以確保 當電腦系統於失去電源供廡Γ μ丄、轨仃速度。然而, 於該揮發性記憶體中之資;:不復Q::)之後,所有儲存 :重新啟動時,會對記憶體38做“掃描:二當電腦系統 ㈣:1 二:广亥揮發性記憶體中重新建立標率層42 及儲仔體層42的相關管理資訊,1 佝朱層^ 為-動態隨機存取記憶體(D陶中=二生記憶體通常 可以為一快閃記憶體,請參 =§亥非揮發性記憶體 明之記憶體38中之各個記憶體::’::中為-使用本發 使用之非揮發性記憶體的一每如6作為初始掃描解讀所 46中之一部份儲存空間用來:二,其中每一記憶體區塊 下一記憶體區塊46等 ,^相關於該檔案以及指向其 中顯示接地之記恃 二°平描解讀資訊5 0 ,而於圖四 區塊。由於儲存i體示其為儲存該播案之結束 訊5 0並不會於失 =D己憶體中,初始掃描解讀資 啟電腦系統時,消失不見,則於下-次開 將該貧料結構資訊建立於一:始掃描解讀資訊5〇重新 本發明之較佳實施例,1他^ ,屺憶體上。以上所述乃 為本發明之所涵蓋範圍:、他可達到相同目的之不同應用亦 特定::f發明之檔案系統32儲存H * 特疋方法來選取最適儲 2存檔案時,係依據某 係一取佳配置演算法且1Γ ^之圮憶體區塊4 6,該方 請參照圖五、圖六及圖7:^系包含於儲存體層42中 __ /、為該演算法之一實施例, 200426584 五、發明說明(9) 一 中包含有一區塊配置演算法6〇 ( 取演算法70 (如圖六) —取適區塊遠 七)。圖七:之Ξ置閒置區塊序列80 (如圖 存*門L二Π,鬼序列8°係記憶體38中具有閒置儲 仔玉間之圮'體區塊46,依據先進先出(First-In-V. Description of the invention (8) The processor is used in the memory to ensure the speed when the computer system loses power supply. However, after the storage of the volatile memory :: no longer Q: :), when all storage: restarts, the memory 38 will be "scanned: two when the computer system": one two: Guanghai volatile Re-establish the relevant management information of the scale layer 42 and the storage body layer 42 in the memory, 1 佝 Zhu layer ^ is-dynamic random access memory (D Taozhong = secondary memory can usually be a flash memory, Please refer to each of the non-volatile memories in the memory 38 :: ':: Medium-Use the non-volatile memory used by the hair as 6 as the initial scan to interpret the 46 A part of the storage space is used: two, each of which is next to the memory block 46, etc., ^ is related to the file and points to the note in which the ground is displayed. 2 ° Plane interpretation information 5 0, and The block in Figure 4. Because the storage i indicates that it is the end message of the storage of the case, 50 will not be lost in the memory of D = D. When the initial scan of the Ziqi computer system disappears, the next time On the basis of this lean material structure information: the beginning of scanning and interpretation of information 50 re-comparison of the present invention The embodiment is described in detail on the subject. The above is the scope of the present invention: different applications for which the same purpose can be achieved are also specific: the file system of the invention 32 stores the H * special method to When selecting the most suitable storage file for 2 files, it is based on the best allocation algorithm of a certain system and 1Γ ^ of the memory block 4 6. For details, please refer to Figure V, Figure 6 and Figure 7: ^ is included in the storage layer 42 __ /, is an example of the algorithm, 200426584 V. Description of the invention (9) One contains a block configuration algorithm 60 (play algorithm 70 (see Figure 6)-take the appropriate block far seven ). Figure 7: The sequence of unused idle blocks 80 (as shown in Figure * Gate L 2 Π, the ghost sequence 8 ° is a memory block 46 with unused Chuzi Yuma's block 46, according to FIFO (First-In-

First^ Out’ FIFO )的原則,依序排列資料區塊之序列, 亦即最近進入閒置狀悲的一記憶體區塊4 6 &將排列於閒置 區塊序列80之最後順位(即於圖七中顯示接地之記憶體區 塊4 6a,其係為閒置區塊序列8〇之結束區塊而圖四中 之區塊配置演算法6 〇係包含下列步驟: 步驟61 步驟62 步驟6 3 開始區塊配置演算法6〇 ; 將該檔案之大小設為一剩餘值; 檢查該剩餘值是否大於零。若是,則執行步驟 6 4 ’若否,則執行步驟6 6 ; 步驟6 4 執行該最適區塊選取演算法7〇以選取一最適記 憶體區塊; 步驟6 5 步驟66 儲存该檔案於該最適記憶體區塊,同時將該標案 之大小減去该乘適5己憶體區塊之大小,並更新閒 置區塊序列8 0。繼續執行步驟6 2 ; 結束區塊配置演算法60。 亦即欲儲存1案肖’則進人區塊配置演算法60之r 序,首先檢查該檔案是否有待儲存之資料單元,如狂 則依據最適區塊選取演算法7〇選取—最適記憶體區塊,* 將該檔案儲存於該最適記憶體區塊,i更新閒置並 80,儲存後,如果該檔案中仍有待儲存之資料單元广==First ^ Out 'FIFO) principle, the sequence of data blocks is arranged in order, that is, the memory block 4 6 that has recently entered the idle state of sadness will be arranged in the last order of the idle block sequence 80 (that is, as shown in the figure) VII shows the grounded memory block 4 6a, which is the end block of the idle block sequence 80 and the block allocation algorithm 6 in Figure 4 contains the following steps: Step 61 Step 62 Step 6 3 Start Block allocation algorithm 60. Set the size of the file to a residual value; check if the residual value is greater than zero. If yes, go to step 6 4 'If no, go to step 6 6; step 6 4 execute the optimal Block selection algorithm 70 to select an optimal memory block; Step 6 5 Step 66 Save the file in the optimal memory block, and subtract the multiplied 5 memory block from the size of the project. And update the idle block sequence 80. Continue to step 6 2; End the block allocation algorithm 60. That is, if you want to save 1 case, enter the r sequence of the block allocation algorithm 60. First check the Whether the file is a data unit to be stored, such as mad According to the optimal block selection algorithm 70, the optimal memory block is selected. * The file is stored in the optimal memory block, i is updated and idle and 80. After storage, if there are still data units to be stored in the file, ==

200426584 五、發明說明(ίο) 覆前述步驟直到整個檔案被儲存至儲存體3 8中為止。圖六 中之最適區塊選取演算法70係將該檔案之大小逐一與閒置 區塊序列8 0中之閒置記憶體區塊4 6進行比較,其包含下列 步驟: 步驟7 1 :開始最適區塊選取演算法7 0 ; 步驟72 :設定最適記憶體區塊大小之初始值,並將閒置區 塊序列8 0中最早進入閒置狀態之區塊設為目前區 塊; 步驟73 :檢查該目前區塊是否為一結束區塊。若是,則執 行步驟79,若否,則執行步驟74 ; 步驟74 :檢查該目前區塊之大小是否大於或等於該剩餘 值。若是,則執行步驟7 5,若否,則執行步驟 76 ; 步驟75 :檢查該目前最適記憶體區塊之大小是否小於該剩 餘值或大於該目前區塊之大小。若是,則執行步 驟7 7,若否,則執行步驟7 8 ; 步驟7 6 :檢查該目前最適記憶體區塊之大小是否小於該目 前區塊之大小。若是,則執行步驟7 7,若否,則 執行步驟7 8 ; 步驟77 :將該目前區塊設為一新的最適記憶體區塊; 步驟7 8 :閒置區塊序列8 0中下一個閒置區塊成為一新的目 前區塊。繼續執行步驟7 3 ; 步驟7 9 :結束最適區塊選取演算法7 0。 亦即若至少一閒置記憶體區塊4 6之長度大於或等於該200426584 V. Description of the Invention (ίο) Repeat the previous steps until the entire file is stored in storage 38. The optimal block selection algorithm 70 in FIG. 6 compares the file size one by one with the free memory block 46 in the free block sequence 80, which includes the following steps: Step 7 1: Start the optimal block Select algorithm 70; step 72: set the initial value of the optimal memory block size, and set the earliest block in the idle block sequence 80 to enter the current block as the current block; step 73: check the current block Whether it is an end block. If yes, go to step 79; if not, go to step 74; Step 74: check whether the size of the current block is greater than or equal to the remaining value. If yes, go to step 75; if no, go to step 76; step 75: check whether the size of the current optimal memory block is smaller than the remaining value or larger than the current block size. If yes, go to step 7 7; if not, go to step 7 8; step 76: check whether the size of the current optimal memory block is smaller than the size of the current block. If yes, go to step 7 7; if not, go to step 7 8; step 77: set the current block as a new optimal memory block; step 78: the next idle block in the idle block sequence 80 The block becomes a new current block. Continue to step 7 3; step 7 9: end the optimal block selection algorithm 70. That is, if the length of at least one free memory block 46 is greater than or equal to the length

五、發明說明 檔案之長度,則於該些記^ 置最久者來儲存該檔案;若爷:4 6中4取長度最小,閒 大且間置最久者來儲存該樓案中選取長度最 所述乃該特定法則之較佳實施例:盆:ζ,單元。以上 不同應用亦為本發明之所涵蓋範圍/。、 了達到相同目的之 也就是說,本發明之方法係包含 案與該記憶體中每-記憶體區塊閒置儲::'::比較該槽 自該等具閒置儲存空間之記憶體 =間=小’以 區塊;儲存該檔案對應於該最適記情敢適記憶體 資料單元至該最適記憶體區塊中;儲,空間的 後該檔案中仍有剩餘之待儲存資料單元褚存该貪料單元 驟’直到該播案完全被儲存於該記憶體中=覆上述步 、、相較於習知之儲存技術直接以實際儲 以連續區塊配置方式來儲存資料的特性,&…=弓丨並 可移植性佳、非連續區塊配置方式增加 =明具有軟體 使用最適區塊選取演算法避免不合理配置I體使用彈性、 先進先出之閒置區塊管理法則延長整體=j浪費、以及 點。 储杯體之壽命等優 以上所述僅為本發明之較佳實施例, 乂 專利範圍所做之均等變化與修飾,皆廇、麗依本么明申請 w蜀本發明專利之涵 200426584 五、發明說明(12) 蓋範圍。5. The length of the file of the invention description, the oldest one should be stored in those records; if the master: 4 of 4 is the smallest, the longest and the oldest one is used to store the selected length in the case. The most described is the preferred embodiment of this specific rule: basin: ζ, unit. The above different applications are also covered by the present invention. In order to achieve the same purpose, that is to say, the method of the present invention includes the case and each of the memory blocks in the memory idle storage :: ':: Compare the slot from the memory with idle storage space = time = Small 'in blocks; storing the file corresponds to the most suitable memory data unit to the most suitable memory block; after storing, there is still a remaining data unit to be stored in the file. Corruption unit until the broadcast is completely stored in the memory = the above steps, compared with the conventional storage technology, the characteristics of directly storing data in a continuous block configuration way, & ... = It has good portability and increased non-continuous block allocation methods = it has software that uses the most suitable block selection algorithm to avoid unreasonable configuration. I use flexible, first-in-first-out idle block management rules to extend the whole = j waste, Well point. The life and other advantages of the cup body are only the preferred embodiments of the present invention. The equivalent changes and modifications made in the scope of the patent are all applied for by the present invention patent. 200426584 V. Description of the invention (12) Cover range.

1I1II 200426584 圖式簡單說明 圖一為習知技術之快閃記憶體儲存一檔案的示意圖。 圖二為本發明之系統方塊圖。 圖三為本發明之一實施例的系統方塊圖。 圖四為初始掃描解讀之示意圖。 圖五為區塊配置演算法流程圖。 圖六為最適區塊選取演算法流程圖。 圖七為閒置區塊序列的示意圖。 圖式之符號說明 12 、 12a 、 12b 區塊 22、22a資料單元 3 2檔案系統 4 2儲存體層 46、46a記憶體區塊 5 0初始掃描解讀資料 7 0最適區塊選取演算法 1 0快閃記憶體 2 0檔案 3 0本發明系統架構 3 8記憶體 44檔案層 48資料區塊 6 0區塊配置演算法 8 0閒置區塊序列1I1II 200426584 Brief Description of Drawings Figure 1 is a schematic diagram of storing a file in the flash memory of the conventional technology. Figure 2 is a system block diagram of the present invention. FIG. 3 is a system block diagram of an embodiment of the present invention. Figure 4 is a schematic diagram of the initial scan interpretation. Figure 5 is a block configuration algorithm flowchart. Figure 6 shows the flowchart of the optimal block selection algorithm. Figure 7 is a schematic diagram of an idle block sequence. Symbol description of the figure 12, 12a, 12b Block 22, 22a Data unit 3 2 File system 4 2 Storage layer 46, 46a Memory block 5 0 Initial scan interpretation data 7 0 Optimal block selection algorithm 1 0 Flash Memory 2 0 File 3 0 System architecture of the invention 3 8 Memory 44 File layer 48 Data block 6 0 Block allocation algorithm 8 0 Idle block sequence

Claims (1)

200426584 六、申請專利範圍 1. 一種資料儲存的方法,其係用來將一檔案儲存於一具有 區塊寫入特性之記憶體中,該方法包含下列步驟: 比較該檔案與該記憶體中每一記憶體區塊閒置儲存空 間之大小,以自該等具閒置儲存空間之記憶體區塊中選取 一最適記憶體區塊; 儲存該檔案對應於該最適記憶體區塊之儲存空間的資 料單元至該最適記憶體區塊中;以及 若儲存該資料單元後該檔案♦中仍有剩餘之待儲存資料 單元,則重覆上述步驟,直到該檔案完全被儲存於該記憶 體中為止。 2. 如申請專利範圍第1項所述之方法,其中最適記憶體區 塊的選取包含下列步驟: 設定最適記憶體區塊大小之初始值; 依據先進先出之順序從該記憶體區塊中選取一具有閒 置儲存空間之記憶體區塊; 比較該被選取之記憶體區塊、目前最適記憶體區塊及 該檔案之大小,當該被選取之記憶體區塊大於或等於該檔 案,且目前最適之記憶體區塊小於該檔案或大於該被選取 之記憶體區塊時,則該被選取之記憶體區塊取代目前最適 記憶體區塊成為新的最適記憶體區塊,及 重複前述選取及比較步驟,直到該記憶體區塊中每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止0200426584 VI. Scope of Patent Application 1. A method for storing data, which is used to store a file in a memory with a block write feature. The method includes the following steps: Compare the file with each memory in the memory. The size of the free storage space of a memory block to select an optimal memory block from the memory blocks with the free storage space; a data unit storing the file corresponding to the storage space of the optimal memory block To the optimal memory block; and if there are remaining data units to be stored in the file after the data unit is stored, repeat the above steps until the file is completely stored in the memory. 2. The method as described in item 1 of the scope of patent application, wherein the selection of the optimal memory block includes the following steps: setting the initial value of the optimal memory block size; from the memory block according to the FIFO order Select a memory block with free storage space; compare the size of the selected memory block, the current optimal memory block, and the file. When the selected memory block is greater than or equal to the file, and When the current optimal memory block is smaller than the file or larger than the selected memory block, the selected memory block replaces the current optimal memory block to become the new optimal memory block, and the foregoing is repeated. Selection and comparison steps, until each memory block with free storage space in the memory block is completely selected and compared 0 200426584 六、申請專利範圍 區 體 意 記 適 最 中 其 法 方 之 述 所 項 IX 第 圍 範 利 專 請 申 如 3 值 始 初 之 T/J 大 ••塊 驟區 步體 列憶 下記 含適 包最 取定 選設 的 塊 閒 有 具 - 取 選 中 塊 區 體 憶 記 該 從; 序塊 順區 之體 出憶 先記 進之 先間 據空 依存 儲 置 被 亥 =° 較 比 大 之 案 檔 該 及且 塊, 區案 體檔 憶該 記於 適小 最塊 前區 目體 、 憶 塊記 區之 體取 憶選 記被 之該 取當 選 , 則的 ,新 時為 塊成 區塊 體區 憶體 記憶 之記 取適 選最 被前 該目 於代 小取 塊塊 區區及 體體; ¾¾塊 記記區 之之體 適取憶 最選記 前被適 目該最 每為 中後 塊較 區比 體並 憶取 記選 該被 到全 直完 ,塊 驟區 步體 較憶 比記 及之 取間 選空 述存 前儲 複置 重閒 有 具 止 4.如申請專利範圍第1項所述之方法,其令該記憶體為一 快閃記憶體(F 1 a s h M e m 〇 r y )。 5. —種資料儲许系統,包含: 一記憶體,其具有區塊寫入特性;及 一檔案系統,建立於該記憶體之驅動模組上,提供一區塊 配置演算法,於一檔案儲存於該記憶體時,進行更有效率 的儲存空間配置。200426584 VI. The scope of the patent application area is the most appropriate for the French party's description of item IX. Fan Li specially requested to apply for a T / J of the initial value of the value of 3. • Block step area. The package with the most selected block is free-take the selected block area to remember the slave; the sequence block of the block area will be remembered first, and the previous data will be stored according to the storage space. The file should be divided into blocks, the file of the district file should be recorded in the most small block of the previous area, and the block of the block should be selected. If it is selected, it will be divided into blocks. The memory of the body area is suitable for the memory area and the body is selected in the first generation of the block; the body of the memory area is suitable for the body and the body is located in the middle and the rear area. Comparing the area and remembering the selection should be completed to the end, the block step step is more detailed than the memory and the selection is empty and stored before storage and resetting. 4. If the scope of patent application is the first The method described in item 1, which makes the memory a flash memory (F 1 a s h Me m O r y). 5. A data storage system including: a memory, which has a block write feature; and a file system, which is built on the drive module of the memory and provides a block configuration algorithm in a file When storing in the memory, more efficient storage space allocation is performed. 200426584 六、申請專利範圍 6.如申請專利範圍第5項所述之系統,其中該樓案系統包 含一儲存體層及一槽案層,該儲存體層包含有複數個資料 區塊,每一資料區塊係對應於該記憶體之一記憶體區塊, 並記錄實際對應到該記憶體區塊之起始、結束位置及大 小,該檔案層用來記錄該檔案之各個資料單元所選取之資 料區塊。 統 系 之 述 所 項 每 中 :體 驟憶 步記 第列該 圍下與 範含案 利包檔 專要該 請主較 申,比 如法 Γ算 寅 、、/ 置 己 塊 區 該 中 其 空 存 儲 置 閒 塊 區 體 意 己 取 選 中 塊 區 體 憶 記 之 間 空 存 儲 置 閒 具 等 該 自 以 、 t J 大 之 間 塊 區 體 意 己 適 最 資 的 間 空 存 儲 之 塊 區 體及 憶以 記·, 適中 最塊該 該區後 於體元 應憶S早 對記料 案適資 檔最該 亥 J予 =口=口 7^» 存至儲 儲元若 單 料 料 資 存 儲 待 之 餘 剩 有 仍 中 案 檔 憶 記 該 於 存 儲 被 全 完 案 檔 該 到 直 驟 步 述 上 覆 重。 則止 ,為 元中 單體 區 體 意 記 適 最 中 其 統 之 述 所 項: 7 I 第步 圍列 範下 利含 專包 請取 申選 如的 •塊 8 i 閒 有 具 一 取 選 中 •,塊 值區 始體 初憶 之記 小該 大從 塊序 區順 體之 憶出 記先 適進 最先 定據 設依 塊 區 •,體 塊憶 區記 體之 憶取 記選 之被 間該 空較 存比 儲 置 及 塊 區 體 意 己 ή=σ 適 最 前200426584 6. Scope of patent application 6. The system described in item 5 of the scope of patent application, wherein the building case system includes a storage layer and a trough case layer, and the storage layer contains a plurality of data blocks, each data area The block corresponds to a memory block of the memory, and records the actual start, end position, and size of the memory block. The file layer is used to record the data area selected by each data unit of the file. Piece. Each of the items in the description of the system: the steps in the memory, the steps below, and the Fan Han case package should specifically ask the owner to apply, such as the method Γ calculation Yin, / / own block should be empty The storage space of the idle block is taken from the empty storage space of the selected block memory, such as the block space between the self-contained, t J large block, and the most suitable empty storage block and Remember to remember · After the most appropriate part of the area, the body element should remember S as early as possible to the record file, and the file should be saved to the storage and storage yuan. If the single material is stored, The remaining files are still in the archives, remembering that the archives that have been completely stored in the archives should be repeated as described above. The only stop is the description of the most appropriate and comprehensive description of the individual minds in the Yuanzhong single area: 7 I Steps are listed below. Includes exclusive packages. Please select the application. • Block 8 i One is available. In the middle of the block, the initial memory of the block-valued area is smaller. The large-scale memory is selected from the sequential sequence of the block-ordered area. The ratio of storage to storage and storage of the space and the price of the block is equal to σ. 200426584 六、申請專利範圍 該檔案之大小,當該被選取之記憶體區塊大於或等於該檔 案,且目前最適之記憶體區塊小於該檔案或大於該被選取 之記憶體區塊時,則該被選取之記憶體區塊取代目前最適 記憶體區塊成為新的最適記憶體區塊;及 重複前述選取及比較步驟,直到該記憶體區塊中每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止。 9. 如申請專利範圍第7項所述之系統,其中最適記憶體 區塊的選取包含下列步驟: 設定最適記憶體區塊大小之初始值; 依據先進先出之順序從該記憶體區塊中選取一具有閒置儲 存空間之記憶體區塊; 比較該被選取之記憶體區塊、目前最適記憶體區塊及該檔 案之大小,當該被選取之記憶體區塊小於該檔案,且目前 最適之記憶體區塊小於該被選取之記憶體區塊時,則該被 選取之記憶體區塊取代目前最適記憶體區塊成為新的最適 記憶體區塊;及 重複前述選取及比較步驟,直到該記憶體區塊中每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止。 10. 如申請專利範圍第5項所述之系統,其中該具有區塊 寫入特性之記憶體為一快閃記憶體。200426584 6. The scope of the patent application. The size of the file. When the selected memory block is greater than or equal to the file, and the current optimal memory block is smaller than the file or larger than the selected memory block, then The selected memory block replaces the current optimal memory block to become the new optimal memory block; and repeats the foregoing selection and comparison steps until each of the memory blocks in the memory block has free storage space After being completely selected and compared. 9. The system described in item 7 of the scope of patent application, wherein the selection of the optimal memory block includes the following steps: setting the initial value of the optimal memory block size; and selecting from the memory block according to the FIFO order Select a memory block with free storage space; compare the size of the selected memory block, the current optimal memory block, and the file. When the selected memory block is smaller than the file, and is currently the most suitable When the memory block is smaller than the selected memory block, the selected memory block replaces the current optimal memory block to become the new optimal memory block; and the foregoing selection and comparison steps are repeated until Each memory block in the memory block with free storage space is completely selected and compared. 10. The system described in item 5 of the scope of patent application, wherein the memory having the block write characteristic is a flash memory. 200426584 六、申請專利範圍 ill200426584 6. Scope of patent application ill
TW92114565A 2003-05-29 2003-05-29 Method and system for storing data TWI248570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW92114565A TWI248570B (en) 2003-05-29 2003-05-29 Method and system for storing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW92114565A TWI248570B (en) 2003-05-29 2003-05-29 Method and system for storing data

Publications (2)

Publication Number Publication Date
TW200426584A true TW200426584A (en) 2004-12-01
TWI248570B TWI248570B (en) 2006-02-01

Family

ID=37429147

Family Applications (1)

Application Number Title Priority Date Filing Date
TW92114565A TWI248570B (en) 2003-05-29 2003-05-29 Method and system for storing data

Country Status (1)

Country Link
TW (1) TWI248570B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI514138B (en) * 2011-02-02 2015-12-21 Micron Technology Inc Read/write apparatus and method for accessing at least one non-volatile memory device in read/write operations

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7903486B2 (en) * 2007-11-19 2011-03-08 Sandforce, Inc. System, method, and computer program product for increasing a lifetime of a plurality of blocks of memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI514138B (en) * 2011-02-02 2015-12-21 Micron Technology Inc Read/write apparatus and method for accessing at least one non-volatile memory device in read/write operations

Also Published As

Publication number Publication date
TWI248570B (en) 2006-02-01

Similar Documents

Publication Publication Date Title
CN102929786B (en) The volatile memory of non-volatile memory device set represents
JP2021521556A (en) Data backup methods and their computer programs and computing devices
CN107609198A (en) One kind recommends method, apparatus and computer-readable recording medium
US10853364B2 (en) Direct table association in in-memory databases
JP2017521762A (en) Storage apparatus, program, and information processing method
JP2006209760A (en) Digital media transfer based on user behavior
JP2010501942A5 (en)
CN102810092B (en) data read-write method and system
CN110109873B (en) File management method for message queue
US20100211621A1 (en) Web-based organization of online advertising content
CN111104063A (en) Data storage method and device, electronic equipment and storage medium
CN109710587A (en) Data hierarchy method, system, equipment and medium based on Ceph
TW200921385A (en) Storage system for improving efficiency in accessing flash memory and method for the same
TW200535610A (en) System and method capable of sequentially writing a flash memory
CN104615383A (en) Software operation method and device based on virtual disk
US11429311B1 (en) Method and system for managing requests in a distributed system
CN113901395A (en) Data processing method, data processing device, computer equipment and storage medium
CN106020726B (en) Method, equipment and the storage device of metadata is written
TW200426584A (en) Method and system for storing data
CN104133970A (en) Data space management method and device
TWI413984B (en) Flash memory apparatus and updating method
CN105095290B (en) A kind of data layout method of distributed memory system
CN112800057B (en) Fingerprint table management method and device
US20110153674A1 (en) Data storage including storing of page identity and logical relationships between pages
JP4213430B2 (en) File system integrity guarantee method, computer system capable of realizing integrity guaranteeable file system, file system

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees