[go: up one dir, main page]

TWI248570B - Method and system for storing data - Google Patents

Method and system for storing data Download PDF

Info

Publication number
TWI248570B
TWI248570B TW92114565A TW92114565A TWI248570B TW I248570 B TWI248570 B TW I248570B TW 92114565 A TW92114565 A TW 92114565A TW 92114565 A TW92114565 A TW 92114565A TW I248570 B TWI248570 B TW I248570B
Authority
TW
Taiwan
Prior art keywords
memory block
block
memory
file
optimal
Prior art date
Application number
TW92114565A
Other languages
Chinese (zh)
Other versions
TW200426584A (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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Memory System (AREA)

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

1248570 五、發明說明(1) 【發明所屬之技術領域 將 統 本發明提供一種資料儲存 一播案分割成複數個資料單 之方法及系統, 凡以儲存該擋案 尤指一種可W 的方法及系、 【先前技術】 在電腦系統的各個元件中, m_ge Devlce)向來為非常重儲” 言’儲存體可分為兩大類別’即揮發性儲存體^ϋ而 s::,Γνι')及非!!發性儲存體(N〇n-v〇iatiie e 存的τ料會e:e時間 :供應㈣’則儲存於其中的資料將儲 在?子取速度快’例如動態隨機存取記憶體(Dynamic Rand⑽Access Memory,DRAM)即屬於此類元件;相反 ^ 謂非揮發性儲存體即該儲存體内所儲存的資料並不 二隨著時,而流失’同時該資料也可以於切斷電源供應的 狀=下繼續存在於該儲存體中,故非揮發性儲存體於有需 要在電源供應即使切斷的情況下仍保有資料内容的應用中 化有十分重要的角色,然而其缺點為存取速度相對於DRAM ^說非常緩慢,例如快閃記憶體(Flash Mem〇ry ),硬碟 機及軟碟機等兀件均屬於此類元件。而同樣是非揮發性儲1248570 V. INSTRUCTIONS (1) [Technical Fields of the Invention] The present invention provides a method and system for dividing a data storage and broadcasting into a plurality of data sheets, and a method for storing the file, in particular, Department, [Prior Art] In the various components of the computer system, m_ge Devlce) has always been a very heavy storage. The words 'storage' can be divided into two major categories 'that is, volatile storage ^ ϋ :::, Γ νι') and Non!! Hair storage (N〇nv〇iatiie e stored τ material will e:e time: supply (four)' then the data stored in it will be stored in the fast speed of the sample, such as dynamic random access memory ( Dynamic Rand (10) Access Memory (DRAM) belongs to this type of component; on the contrary, non-volatile storage means that the data stored in the storage body does not disappear with time, and the data can also be cut off from the power supply. The shape=down continues to exist in the storage body, so the non-volatile storage body plays an important role in the application of retaining the data content even if the power supply is cut off, but the disadvantage is the access speed. relatively It is very slow in DRAM ^, such as flash memory (Flash Mem〇ry), hard disk drives and floppy disk drives, etc. These are also non-volatile storage.

1248570 五、發明說明(2) 存體,相較於如硬碟機針對大量儲存命 軟碟機便利於攜帶的特性,快閃記憶^ Y】要之特性,及 較小的體積及較快的存取速度,故其^ ;二^ $有相對來說 :線器(Switch Hub)等產品中對非揮路 快閃§己憶體為一種具備區塊寫入 謂區塊寫入’意即於該儲存體中存二:”置,所 長度的^ (其可能有數種不同的數個固定 寫入該儲存體的時候,必須以區塊π而::檔案被 存’此種儲存特性造成了若一區塊已::η ?以及儲 區塊中仍然存在沒有被利用儲 再用作苴他铋产m X j城仔工間,其將無法 於習知技術中子:ΐ,這是此類儲存裴置先天上的限制。 存位址連續存丄m之資料儲存,乃採取對實際儲 習知技:::二的方式,舉例來說,,參照圖-,圖-乃 议何之快閃記憶體1 〇儲存一梓安立 甘士丨二 閃記憶體10有邻A F治p、士 =祂木20之不思圖,其中快 2〇存入快閃#味77區鬼已被利用於儲存資料,現欲將檔案 位址之4 一 ^仫體1 0中時,則自快閃記憶體1 〇中實際儲存 料單元2?、查1 5區塊12a起,依序將檔案20被分割後之資 全部被。、只存入快閃§己憶體1 〇之區塊1 2中,直到檔案2 0 元2 2 a,由為止。睛注思檔案2 0最後存入之一結束資料單 2〇依『m你於一般檔案之大小並非為一固定值,故當檔案 其最用快閃記憶體10之區塊12的大小進行分割時, ^ ? ^刀副剩餘的結束資料單元22a之大小,通常不會 1248570 五、發明說明(3) 與其所欲存入之區塊1 2 b大小相符,亦即於此一狀況下, 由於快閃記憶體的區塊寫入特性區塊1 2 b中必定有部份儲 存空間為閒置卻無法用於任何資料之儲存。 缺 想之處 快閃記 方式雖 廠牌或 區塊之 用不同 憶體重 本;習 記憶體 空間的 之後, 不連續 塊分割 案之大 因為連 置空間 費;又 一儲存 一中之 而前述 :習知 憶體之 然直接 不同型 數量及 種類之 新進行 知技術 「間隙 浪費, 由於連 的情形 成數個 小較此 續儲存 卻因不 習知技 區塊選 習知技 習知技術之快閃記 技術之快閃記憶體 各個區塊的實際儲 ,但是卻時常造成 號的快閃記憶體其 位址配置均不相同 快閃記憶體時,必 管理程式之修改, 之快閃記憶體的連 (Fragmentation) 憶體卻有以 於讀取及寫 存位址為索 其可移植性 儲存空間大 ,所以當一 須針對每一 這會增加軟 續存入特性 下數個不盡理 入時,均以該 引’這種抒取 差,由於不同 小及其中各個 電腦系統欲使 類型之快閃記 體維護的成 ,會由於快閃 而造成儲存 」的存在, 所謂間隙,即一快閃記憶體於使用一段時間 續之寫入 愈來愈頻 區段而不 區段内區 空間不足 連續而無 術之快閃 取法則, 術的該快 及刪除 繁,亦 呈連續 塊之大 而導致 法儲存 記憶體 這會造 閃記憶 的動作, 即其閒置 狀態,此 小總合為 儲存失敗 的情形, 乃依連續 成區塊不 體為例, 造成其 區塊會 時縱使一欲儲存檔 小時 閒置區塊間 被已利用區 ,汰匕一 乃儲存 存入之 合理之 其中若 則該檔案將 擁有足夠閒 空間的浪 原則,而無 使用,以圖 結束資料單1248570 V. Description of invention (2) Storage, compared to the characteristics of a hard disk drive that is convenient for carrying a large number of storage floppy disk drives, flash memory, and the smaller size and faster Access speed, so its ^; two ^ $ relative: in the line (Switch Hub) and other products in the non-swirl flash § 己 体 为 为 为 具备 具备 具备 具备 具备 具备 具备 具备 具备 具备Store two in the storage: "Set, the length of ^ (which may have several different numbers fixedly written to the storage, must be blocked by the block π:: file is stored" If a block has been::η? and there is still no storage in the storage block, it can be used as a 苴 铋 m X X X X , , , , , , , , , , , , , , , , , , , , , , , , , , , , , This type of storage is inherently limited. The storage of the data in the address is stored in the form of the actual storage knowledge::: two, for example, refer to the figure -, figure - is the quick Flash memory 1 〇 Storage one Anglican 丨 two flash memory 10 has an adjacent AF governance p, Shi = He Mu 20 is not thinking, which is fast 2〇 入 快 ############################################################################################### From the block 1a block 12a, the files that have been divided into 20 files are all stored in the order, and only stored in the block 1 of the flash § 忆 体 1 , , , , , , , , , , , 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案 档案Since then, the eye note file 2 0 last deposited into the end of the data sheet 2 『 "m you are not a fixed value in the size of the general file, so when the file is the most used flash memory 10 block 12 When the size is divided, the size of the remaining end data unit 22a of the ^^^ knife is usually not 1248570. 5. The invention description (3) corresponds to the size of the block 1 2 b to be stored, that is, the situation In the block write feature block of the flash memory, there must be some storage space that is idle but cannot be used for any data storage. Use different memory weights; after the memory space, the size of the discontinuous block division is because of the space fee; The first one is stored in the middle: the new knowledge technology of the different types and types of the traditionally-recognized body, "the gap is wasted, because the situation of the connection is formed several times, but the storage is not known. The actual storage of the flash memory of the flash memory technology of the technology, but the flash memory of the time is often different in the flash memory, the management program must be modified, Flash memory connection (Fragmentation) memory has a large storage space for reading and writing addresses, so when it is necessary to increase the soft-reloading characteristics for each of these, When it comes to the right time, the reason is that the difference is small. Because different small and various computer systems want to maintain the type of flash memory, the memory will be stored due to flashing. A flash memory is used for a period of time to continue to write more and more frequency segments without the space in the segment being insufficient for continuous and fast flashing rules. The continuation of the block causes the memory to store the memory, which is the idle state. This small sum is the case of storage failure. If you want to store the filed hours, the unused area is used. If the file is stored, it will be reasonable. If the file will have enough free space, the file will be closed.

1248570 五、發明說明(4) 一 元22&為一串非常短之資料,而剛好苴由連續存人;^ Pll % 置之區塊12b為一十分女之區播二…甶、、、男仔入原則配· 結束資料單元22&後,留下一背=成區塊12b於儲存 區祕仓俊 〇 邻伤非常大之閒置空間卻因 ;i2: 而無法被利用,形成浪費;最後,由於習知 閒Z之,:5己憶體均自該快閃記憶體之起始位址開始尋找 以==;_存,這會造成部份特定2 每塊為多,而於快閃記憶體中之 宫πσ r、句有一取大保證有效寫次數值,若一區換 而益法將二ίfe、?:部份特定區塊較其他區塊先達到此值 :法將總寫入次數平均分配至各個區塊的 值 快閃記憶體整體壽命之縮短,而增加使用者之:成 【發明内容】 本發明之主要目的係在於提供一且一 ;=案系統用來對一具有區塊寫入特:g之資料 科的方&,以解決上述習知快閃⑽體技術儲存 資料儲存的方法,其係.一 中/該記憶體包含有複數個記憶體區^案儲存於〜記憶體 於該記憶體中時必須以 ^巴°埗沒且當該槽案存 塊閒置儲存空間之大小,以自該等具憶體區 -~— 二間之記憶 第9頁 五、發明詋叨Cb) 體區塊中選取_最適記憶體 最適記憶體區塊之儲存空間的U =棺案中對應於該· 塊中;以及若儲存該資料單元後:c記憶體區 存資料單元,則重覆上述步後中仍有剩餘之待儲 該記憶體中為止。 λ 到s亥檔案完全被儲存於 本發明係利用_最佳化 -二層次資料結構的設計,來二二3:二:方法以及 =備區塊寫入特性的儲存裝置以時 間配置’以達到更合理使用儲存資源革的儲存空 【實施方式] 明參照圖二,圖二中一 j明係於具區塊寫入;性;系㈣方塊圖。本 八有一層次之資料結構的栌安系=駆動核組上建立一 將-擋案儲存於該記憶體3;:糸:奶,依最佳配置演算法 記憶體區塊46,且卷_ 。5亥s己憶體38包含有複數個 憶體區塊46為單位:发::儲存於記憶㈣令時必須以記 驟存取記憶體38 ΐ案系統32主要係依照以下步 :間之每-記憶體區塊與記憶體38中具有閒置儲存 k取—最適記憶體區 ^小,以自該記憶體區塊46中 區塊之儲存空間的資料丄儲仵該檔案對應於該最適記憶體 若儲存該資料單元播:兀至該最適記憶體區塊中;以及 X田案中仍有剩餘之待儲存資料單 1248570 五、發明說明(6) 兀,則重覆上述步驟,直到該檔案完全被儲存於該記憔體 38中為止。 "· 請 塊圖。 體38則 個記憶 該檔案 一驅動 據檔案 行讀取 層次之 檔案層 置邏輯 憶體38 體38之 案,用 4 8 〇於 入特性 示卡等 憶體, 蓋範圍 荃照圖三,圖三中顯示本發明之一實施例的系統方 於圖三中,係用來儲存一檔案至記憶體3 8,該記憶 為一具備區塊寫入特性之儲存裝置,故包含有複^ 體區塊46 (其可能有數種不同的大小),用來儲存 經分割後所產生的資料單元,而該記憶體亦包含有 模組(Driver )(未顯示於圖三中),其則用來依 系統32所包含之資訊對記憶體38之記憶體區塊46進 、寫入及删除的動作;而該檔案系統3 2則包含有二 資料結構·一健存體層(Storage Layer) 42及一 (Fi le Layer ) 44,其中儲存體層42係提供最佳配 運算依先進先出之閒置區塊管理原則選擇最適之記 區塊儲存檔案,並記錄資料區塊48實際對應到記憶 起始、結束位置及大小;檔案層44則對應於該檔 來記錄該檔案之各個資料單元所選取之資料區塊 圖三中所示之系統3〇係可使用於各種内含具區塊寫 記憶體之電腦相關產品,例如網路集線器、圖形顯 ;而該具區塊寫入特性之記憶體38通常為一快閃記 但是其他具有相同特性之記憶體亦屬於本發明的涵 圖三中為欲將一檔案寫入記憶體體38時,檔案系統32 第11頁 1248570 五、發明說明(?) 會依據最隹配置 的記憶體區塊來=f來選取適合儲存該檔案之記憶體38 該檔案之記愴^件该檔案,檔案系統32選取用於儲存 9及6之記“'己憶:區塊46 ’依序為第4、5、1〇、 錄實際對應到 二”存體層42之資料區塊4S中紀 同時將該槽案所;存始、結束位置及大小, 層44中。如上所述,即可!I4塊唬碼及屬性紀錄於檔案 地,當欲自記悻俨 二70成該擋案之寫入動作’·同樣 依據記錄於擋案二二=案時,該檀案系統32會 塊48 ’來控制該驅動模儲存體層42中的資料區 記憶體38的記憶體區塊46進^於被選取資料區塊48之 序合併以還原該檔案。如上^取,亚將該資料單元依順 動作;而當欲自記憶體38中將完成該槽案之讀取 32會依據記錄於檔案 =田案刪除時,該檔案系統 料議,來控制該驅動模=存體層42中的資 仏之記憶體38的記憶體區 子=於:選取資料區塊 檔案層44中之相關資訊予以 仃刪除,然後再將記錄於 檔案之刪除動作。 〒、。如上所述,即可完成該 在一般情形下,儲存一梓安 統另包含有-揮發性記憶體用^ :體3"時’電 儲存體層42及檔案層44 )内的所右=κ =育料結構( 發性記憶體中供處理器使用,以目Ζ貝訊均儲存於 當電腦系統於失去電源供應執仃速度。然 1例如關機)之後,所有1248570 V. Description of invention (4) One yuan 22 & is a very short piece of information, and just by continuous deposit; ^ Pll % Block 12b is a very female area broadcast two...甶,,, male After entering the data unit 22 & and leaving a back = block 12b in the storage area, the secret warehouse is close to the huge space of the idle space; i2: can not be used, resulting in waste; finally, Because of the knowledge of Z,: 5 recalled from the starting address of the flash memory to find ==; _ save, which will cause part of the specific 2 per block, and flash memory In the palace of πσ r, the sentence has a large guarantee to effectively write the value of the number of times, if a district is changed, the law will be two ίfe,? : Some specific blocks reach this value earlier than other blocks: the method divides the total number of writes evenly to the value of each block, shortens the overall life of the flash memory, and increases the user's: The main purpose of the invention is to provide a method for storing a data stored in a conventional flash (10) body technology by using a method for writing a block with a block: The system has a plurality of memory areas stored in the memory, and must be stored in the memory, and the size of the storage space of the slot storage space is From the memory area of the memory area, the memory of the memory area of the memory area is selected in the U = file of the optimal memory block. · In the block; and if the data unit is stored: c memory area data unit, then there is still remaining in the memory after the above step. The λ to s Archives are completely stored in the present invention using the _optimization-two-level data structure design, to 2:2:2: method and = storage block write characteristics storage device with time configuration 'to achieve More reasonable use of the storage space of the storage resource leather [Embodiment] Referring to Figure 2, Figure 2 is a block diagram written in the block; sexual; system (four) block diagram. The eight-level data structure of the 栌安系=駆动核组Create a --block stored in the memory 3;:糸: milk, according to the optimal configuration algorithm memory block 46, and volume _. The 5 s suffix 38 contains a plurality of memory blocks 46 as a unit: hair:: stored in memory (four), the memory must be accessed by the memory 38. The system 32 is mainly based on the following steps: - the memory block and the memory 38 have an idle storage k--the optimal memory area is small, and the data is stored from the storage space of the block in the memory block 46. The file corresponds to the optimal memory. If the data unit is stored: 兀 to the optimal memory block; and there is still a remaining data sheet to be stored in the X field case 1248570 V. Invention description (6) 兀, repeat the above steps until the file is completely It is stored in the body 38. "· Please block diagram. The body 38 is a memory of the file. The file is read according to the file line. The file layer of the file is set to the logical memory 38 body 38. The memory is used to enter the characteristic card, and the cover range is shown in Figure 3, Figure 3. The system shown in one embodiment of the present invention is used to store a file to the memory 3 8 in FIG. 3. The memory is a storage device having a block write characteristic, and thus includes a complex block. 46 (which may have several different sizes) for storing the data unit generated after segmentation, and the memory also includes a driver (not shown in Figure 3), which is used in accordance with the system. The information contained in 32 stores, writes, and deletes the memory block 46 of the memory 38; and the file system 32 includes two data structures, a storage layer 42 and a (Fi) Le Layer ) 44, wherein the storage layer 42 provides the best allocation operation according to the first-in-first-out idle block management principle, selects the optimal block storage file, and records the data block 48 actually corresponding to the memory start and end positions and Size; file layer 44 corresponds to the size The system 3 shown in Figure 3 of the data block selected to record the data units of the file can be used for various computer-related products including block write memory, such as network hubs and graphics; The memory 38 having the block write characteristic is usually a flash but other memory having the same characteristics belongs to the third figure of the present invention. When the file is to be written into the memory 38, the file system 32 11 pages 1248570 V. Invention description (?) The memory block suitable for storing the file is selected according to the last configured memory block = f. The file of the file is selected, and the file system 32 is selected for storage. The notes of 9 and 6 "'Remembered: Block 46' is the 4th, 5th, 1st, and the actual corresponds to the 2nd". The data block of the deposit layer 42 is also in the middle of the 4S Zhongji. , end position and size, in layer 44. As mentioned above, you can! I4 block weights and attributes are recorded in the archives. When you want to record your own files, the write action of the file is as follows: · Also based on the record in the case of the second case = the case The system 32 blocks 48' to control the memory block 46 of the data area memory 38 in the drive mode memory layer 42 to be merged in the selected data block 48 to restore the file. If the data unit is to be read from the memory 38, the reading of the slot file 32 will be controlled according to the file system when the file is deleted. The memory mode of the memory 38 of the resource in the memory layer 42 is: the relevant information in the data block file layer 44 is selected and deleted, and then the deletion operation recorded in the file is performed. Oh,. As described above, it is possible to complete the right = κ = in the general case, the storage of the 梓 另 另 挥发性 挥发性 挥发性 挥发性 挥发性 挥发性 电 电 电 电 电 电 电 电 电 电 电 电 电 电 电 电 电Feeding structure (in the memory for the processor to use, to see that the news is stored in the computer system when the power supply is lost. However, such as shutdown), all

頁 第12 1248570Page 12 1248570

五、發明說明(8) 於:揮發性記憶體中之資料將不復存在,因此 於重新啟動時,會對記憶體38做初始掃描解讀胃 …· (Parsing ),以於該揮發性記憶體中重新建立 :射f層42的相關管理資訊,其中該揮發性記;V、甬* 為一動態隨機存取記憶體(DRAM ),而該 :=雨 可以為:快閃記憶㉟,請參照圖四,圖四中為二::: 明之記憶體38中之各個記憶體區塊4 ^ 二 = 體的一實施例,•中每-記憶體區塊 下一 ^己,卜w =子工間用來儲存相關於該擋案以及指向豆 卜6ϋ丨思體區塊46等之一初妒播折吃一 八 中顯示接地之吃橋雕π "二解唄貪訊5 0,而於圖四 區塊。由於儲存;^塊46係、表示其為儲存該檔案之結束 訊50並不會非揮發性記憶體中’初始掃描解讀資 啟電腦系統時供應後就消失不見,則… 將該資料結樽資為可以利用初始掃描解讀資訊5〇重新 本發明之較立於-發揮性記憶體上 為本發明之所涵】‘圍其他可達到相同目的之不同應用亦 特定方法來選取最;案糸統3储杯一檔案日寺,係依據某一 係一最佳配置演曾 > 儲仔該檔案之記憶體區塊46,該方沒 請參照圖五、圖Γ去且該演算法係包含於儲存體層42中。 中包含有一區ϊ Γ及圖七,其為該演算法之一實施例,肩 取演算法7◦(如固己f演算法6〇 (如圖五),-最適區塊這 圃以),以及一閒置區塊序列8〇 (如圖V. INSTRUCTIONS (8): The data in the volatile memory will no longer exist. Therefore, when restarting, the initial scan of the memory 38 will be performed to interpret the stomach... (Parsing) for the volatile memory. Re-established: the relevant management information of the f-layer 42, wherein the volatile record; V, 甬* is a dynamic random access memory (DRAM), and the:= rain can be: flash memory 35, please refer to Figure 4, Figure 4 is two::: Each memory block in the memory 38 of the Ming Dynasty 4 ^ two = one embodiment of the body, • each memory block in the next ^ ^, w w = child labor Used to store the relevant circumstance and the pointing to the bean buds, such as the ϋ丨 ϋ丨 ϋ丨 46 46 46 46 46 46 46 46 46 46 46 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示 显示Figure 4 block. Because of the storage; ^ block 46, indicating that it is the end of the storage of the file 50 and will not disappear in the non-volatile memory 'initial scan interpretation of the computer system, then disappeared, then ... In order to use the initial scan to interpret the information, the invention is based on the invention, and the other applications that can achieve the same purpose are selected in the same way. The storage cup is a file of the Japanese temple, which is based on the best configuration of a certain department. The memory block 46 of the file is stored in the file. The party does not refer to Figure 5, and the algorithm is included in the storage. In the body layer 42. It contains a region Γ 图 and Figure VII, which is an embodiment of the algorithm, the shoulder-splitting algorithm 7◦ (such as the 己 f f algorithm 6〇 (Figure 5), - the most suitable block) And an idle block sequence of 8 〇 (as shown

第13頁 ^248570 五、發明說明(9) )。圖七中之閒置區嫌床 存* p卩々“冰遍「 塊序列80係記憶體38中具有閒置儲 Fire π ρ τγ_、 Ό 依據先進先出(First - In -亦即田f,的原則,依序排列資料區塊之序列, 區dt入K狀態的一記憶體區塊46a將排列於閒置 塊46a,苴将A n w ^ t 圖中顯示接地之記憶體區 ,、係為閒置區塊庠列8 0夕{士 之區揷邴I, 之結來區塊);而圖四中 匕塊配置肩异法6 0係包含下列步_ 步驟61 步驟62 步驟63 開始區塊配置演算法6〇 將該檔案之大小設為一剩餘值; 步驟64 步驟65 =查該剩餘值是否大於零。若是,則執行步驟 6 4,若否,則執行步驟6 6 ; 執行該最適區塊選取演算法7 0以選取一最適記 憶體區塊; 儲存該樓案於該最適記憶體區塊,同時將該擋舅 步驟66 =小減去該最適記憶體區塊之大小,並更茅“ 置區塊序列80。繼續執行步驟62 ; 結束區塊配置演算法60。 序,首:二Ϊ仔一檔案妗’則進入區塊配置演算法6 0之卷 則依;匕穴檔案if有待儲存之資料單元,如果有, 將該檔宰5 :乜遠取凟异法70選取-最適記憶體區塊,並 80,=:該最適記憶體區塊,並更新閒置區塊序列 覆前述步賢吉,果5亥檔案中仍有待儲存之資料單元,則重 中之最適:i到整個檔案被館存至儲存體38中為止。圖六 -適以鬼選取演算法70係將該檔案之大小逐一與閒置 1248570 五、發明說明(ίο) 區塊序列8 0中之閒置記憶體區塊4 6進行比較,其包含下列. 步驟: 步驟7 1 ··開始最適區塊選取演算法7 0 ; 步驟72 :設定最適記憶體區塊大小之初始值,並將閒置區 塊序列8 0中最早進入閒置狀態之區塊設為目前區 塊; 步驟73 :檢查該目前區塊是否為一結束區塊。若是,則執 行步驟7 9,若否,則執行步驟7 4 ; 步驟74 :檢查該目前區塊之大小是否大於或等於該剩餘 值。若是,則執行步驟7 5,若否,則執行步驟 76 ; 步驟7 5 :檢查該目前最適記憶體區塊之大小是否小於該剩 餘值或大於該目前區塊之大小。若是,則執行步 驟77,若否,則執行步驟78 ; 步驟7 6 :檢查該目前最適記憶體區塊之大小是否小於該目 前區塊之大小。若是,則執行步驟7 7,若否,則 執行步驟7 8 ; 步驟7 7 ·將該目前區塊設為一新的最適記憶體區塊, 步驟78 :閒置區塊序列80中下一個閒置區塊成為一新的目 前區塊。繼續執行步驟7 3 ; 步驟7 9 :結束最適區塊選取演算法7 0。 亦即若至少一閒置記憶體區塊4 6之長度大於或等於該 檔案之長度,則於該些記憶體區塊46中選取長度最小,閒 置最久者來儲存該檔案;若該些閒置記憶體區塊46之長度Page 13 ^248570 V. Description of invention (9)). In the idle area of Figure 7, the bed is stored. * p卩々 "Ice" "Block series 80 series memory 38 has idle storage Fire π ρ τγ_, Ό according to the principle of First-In---------- The sequence of the data blocks is sequentially arranged, and a memory block 46a of the region dt into the K state is arranged in the idle block 46a, and the memory region of the ground is displayed in the A nw ^ t map, which is an idle block.庠 8 0 { 士 士 士 士 士 士 士 士 士 士 士 士 ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; The size of the file is set to a residual value; Step 64: Step 65: Check whether the remaining value is greater than zero. If yes, execute step 6 4, if not, execute step 6 6; execute the optimal block selection algorithm 7 0 to select an optimal memory block; store the floor in the optimal memory block, and at the same time, the block step 66 = small minus the size of the optimal memory block, and more Sequence 80. Proceed to step 62; end block configuration algorithm 60. Preface, first: two Ϊ仔一档案妗' enter the block configuration algorithm 60 0 volume; 匕 档案 file if there is a data unit to be stored, if there is, the file is slaughtered 5: 乜远取凟异法70 select - the most suitable memory block, and 80, =: the optimal memory block, and update the idle block sequence to cover the above steps, the data unit to be stored in the 5 Hai file, the best of the weight: i The entire file is stored in the storage body 38. Figure 6 - Appropriate ghost selection algorithm 70 is used to compare the size of the file one by one with the idle memory block 44 in the block description 80, which contains the following. Steps: Step 7 1 ··Start the optimal block selection algorithm 70; Step 72: Set the initial value of the optimal memory block size, and set the block that is the earliest idle state in the idle block sequence 80 as the current block. Step 73: Check if the current block is an end block. If yes, go to step 7 9. If no, go to step 7 4; Step 74: Check if 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 7 5: Check if 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 77. If no, go to step 78. Step 7 6: Check if 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 no, go to step 7 8; step 7 7 · set the current block as a new optimal memory block, step 78: the next idle area in the idle block sequence 80 The block becomes a new current block. Proceed to step 7 3; Step 7 9: End the optimal block selection algorithm 70. That is, if at least one of the unused memory blocks 46 has a length greater than or equal to the length of the file, the least length is selected in the memory blocks 46, and the file is stored for the longest time; if the idle memory Length of body block 46

第15頁 1248570 五、發明說明(11) ___ 小於該檔案之長度,則於該些記 大且閒置最久者來儲存該檔案分^ ^區塊46中選取長度最· 所述乃該特定法則之較佳實施例。,里來之資料單元。以上 不同應用亦為本發明之所涵蓋範圍/。、他可達到相同目的之 :比較該檀 之大小,以 最適記憶體 儲存空間的 該資料單元 覆上述步 也就是說,本發明之方法係包 案與該記憶體中每一記憶體區塊閒 下步驟 自該等具閒置儲存空間之記憶體區塊:J空間 區塊;儲存該檔案對應於該最適記愴 > 取一 資料單元至該最適記憶體區塊中;:二塊之 後該檔案中仍有剩餘之待儲存資料單-右儲存 驟’直到該檔案完全被儲存於該記憶體中:: 址為索引並 明具有軟體 使用彈性、 浪費、以及 之哥命等優 、、相較於習知之儲存技術直接以實際 以連績區塊配置方式來儲存資料的特性, 非連續區塊配置方式增加儲存體 =用取適區塊選取演算法避免不合理配置造成 進先出之閒置區塊管理法則延長整體儲存體 點0 j上所述僅為本發明之較佳實施例,凡依本發明申請 利犯圍所做之均等變化與修飾,皆應屬本發明專 盍範圍。Page 15 1248570 V. Description of the invention (11) ___ is less than the length of the file, then the file is stored in the file block ^ ^ block 46 in the longest and idle time. Preferred embodiment. , the data unit of Lilai. The above different applications are also covered by the invention. He can achieve the same purpose: comparing the size of the sandalwood, the data unit of the optimal memory storage space is covered by the above steps, that is, the method of the present invention is packaged with each memory block in the memory. The next step is from the memory block with the idle storage space: J space block; storing the file corresponding to the optimal record> taking a data unit into the optimal memory block; There is still a remaining data list to be stored - right storage step ' until the file is completely stored in the memory:: The address is indexed and has the flexibility of using software, waste, and the fate of the software, compared to The storage technology of the prior art directly stores the characteristics of the data in the form of a succession block configuration. The storage mode is added in the non-contiguous block configuration mode. The algorithm is selected by the adaptive block selection algorithm to avoid the unreasonable configuration, causing the in-first-out idle block. The management rule extends the overall storage point 0. The above description is only a preferred embodiment of the present invention, and all the equivalent changes and modifications made according to the present invention should belong to the present invention.盍 range.

第16頁 1248570 圖式簡單說明 【圖式簡單說明】 圖 意 示 的 案 。 檔 圖 一 塊 。 存方 圖 儲 統。。程。 體。系圖圖流圖 憶圖的意程法意 記塊例示流算示 閃方施之法演的 1 快統實讀算取列 明 之系一解演選序 說 術之之描置塊塊 號 技明明掃配區區 符 知發發始塊適置 件 習本本初區最閒 元 為為為為為為為 要 一 二三四五六七 主 圖圖圖圖圖圖圖 t 1 0快閃記憶體 20檔案 3 0本發明系統架構 3 8記憶體 4 4檔案層 48資料區塊 6 0區塊配置演算法 8 0閒置區塊序列 12 、 12a 、 12b 區塊 22、22a資料單元 3 2檔案系統 4 2儲存體層 46、46a記憶體區塊 5 0初始掃描解讀資料 7 0袁適區塊選取演鼻法Page 16 1248570 Simple description of the diagram [Simple description of the diagram] The diagram shows the case. A map of the file. Save the map. . Cheng. body. The diagram of the diagram flow diagram recalls the meaning of the method of the block diagram to illustrate the flow of the calculation of the flash side of the method of the performance of the fast-acting system to calculate the list of the system of the interpretation of the sequence of the description of the block diagram number Ming Ming扫配区区知发发发块件件本本本本区最闲元为为为为为为二二三四五六七总图图图图图图1 1 flash memory 20 file 3 0 system architecture of the invention 3 8 memory 4 4 file layer 48 data block 6 0 block configuration algorithm 8 0 idle block sequence 12, 12a, 12b block 22, 22a data unit 3 2 file system 4 2 storage layer 46, 46a memory block 50 initial scan interpretation data 7 0 Yuan Shi block selection nasal method

第17頁Page 17

Claims (1)

第18頁 1248570 六、申請專利範圍 3. 如申請專利範圍第1項所述之方法,其中最適記憶體區 塊的選取包含下列步驟: 設定最適記憶體區塊大小之初始值; 依據先進先出之順序從該記憶體區塊中選取一具有閒 置儲存空間之記憶體區塊; 比較該被選取之記憶體區塊、目前最適記憶體區塊及 該檔案之大小,當該被選取之記憶體區塊小於該檔案,且 目前最適之記憶體區塊小於該被選取之記憶體區塊時,則 該被選取之記憶體區塊取代目前最適記憶體區塊成為新的 最適記憶體區塊;及 重複前述選取及比較步驟,直到該記憶體區塊中每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止。 4. 如申請專利範圍第1項所述之方法,其中該記憶體為一 快閃記憶體(F 1 a s h M e m 〇 r y )。 5. 一種資料儲存系統,包含: 一記憶體,其具有區塊寫入特性;及 一檔案系統,建立於該記憶體之驅動模組上,提供一 區塊配置演算法,於一檔案儲存於該記憶體時,進行更有 效率的儲存空間配置。Page 18 1248570 6. Patent application scope 3. The method described in claim 1, wherein the selection of the optimal memory block comprises the following steps: setting an initial value of the optimal memory block size; The sequence selects a memory block having an idle storage space from the memory block; comparing the selected memory block, the current optimal memory block, and the size of the file, when the selected memory If the block is smaller than the file, and the current optimal 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 repeating the foregoing selection and comparison steps until each memory block in the memory block having an idle storage space is completely selected and compared. 4. The method of claim 1, wherein the memory is a flash memory (F 1 a s h M e m 〇 r y ). A data storage system comprising: a memory having a block write characteristic; and a file system built on the drive module of the memory to provide a block configuration algorithm stored in a file In this memory, a more efficient storage space configuration is performed. 第19頁 1248570 六、申請專利範圍 6. 如申請專利範圍第5項所述之系統,其中該檔案系統包. 含一儲存體層及一檔案層,該儲存體層包含有複數個資料 區塊,每一資料區塊係對應於該記憶體之一記憶體區塊, 並記錄實際對應到該記憶體區塊之起始、結束位置及大 小,該檔案層用來記錄該檔案之各個資料單元所選取之資 料區塊。 7. 如申請專利範圍第5項所述之系統,其中該區塊配置演 算法,主要包含下列步驟: 比較該檔案與該記憶體中每一記憶體區塊閒置儲存空 間之大小,以自該等具閒置儲存空間之記憶體區塊中選取 一最適記憶體區塊; 儲存該檔案對應於該最適記憶體區塊之儲存空間的資 料單元至該最適記憶體區塊中;以及 若儲存該資料單元後該檔案中仍有剩餘之待儲存資料 單元,則重覆上述步驟,直到該檔案完全被儲存於該記憶 體中為止。 8. 如申請專利範圍第7項所述之系統,其中最適記憶體區 塊的選取包含下列步驟: 設定最適記憶體區塊大小之初始值, 依據先進先出之順序從該記憶體區塊中選取一具有閒 置儲存空間之記憶體區塊; 比較該被選取之記憶體區塊、目前最適記憶體區塊及Page 19 1248570 6. Patent application scope 6. The system of claim 5, wherein the file system package comprises a storage layer and a file layer, the storage layer comprising a plurality of data blocks, each A data block corresponds to a memory block of the memory, and records the start and end positions and sizes actually corresponding to the memory block, and the file layer is used to record each data unit of the file. The data block. 7. The system of claim 5, wherein the block configuration algorithm comprises the following steps: comparing the size of the file and the idle storage space of each memory block in the memory, And selecting an optimal memory block in the memory block having the idle storage space; storing the data unit corresponding to the storage space of the optimal memory block into the optimal memory block; and storing the data After the unit, there are still remaining data units to be stored in the file, and the above steps are repeated until the file is completely stored in the memory. 8. The system of claim 7, wherein the selection of the optimal memory block comprises the steps of: setting an initial value of the optimal memory block size from the memory block in a first in first out order; Selecting a memory block having an idle storage space; comparing the selected memory block, the current optimal memory block, and 第20頁 1248570 六、申請專利範圍 該檔案之大小,當該被選取之記憶體區塊大於或等於該欲 案,且目前最適之記憶體區塊小於該檔案或大於該被選取 之記憶體區塊時,則該被選取之記憶體區塊取代目前最適 記憶體區塊成為新的最適記憶體區塊,及 重複前述選取及比較步驟,直到該記憶體區塊令每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止。 9. 如申請專利範圍第7項所述之系統,其中最適記憶體區 塊的選取包含下列步驟: 設定最適記憶體區塊大小之初始值; 依據先進先出之順序從該記憶體區塊中選取一具有閒置儲 存空間之記憶體區塊; 比較該被選取之記憶體區塊、目前最適記憶體區塊及 該檔案之大小,當該被選取之記憶體區塊小於該檔案,且 目前最適之記憶體區塊小於該被選取之記憶體區塊時,則 該被選取之記憶體區塊取代目前最適記憶體區塊成為新的 最適記憶體區塊;及 重複前述選取及比較步驟,直到該記憶體區塊中每一 具有閒置儲存空間之記憶體區塊完全被選取並比較後為 止。 10. 如申請專利範圍第5項所述之系統,其中該具有區塊 寫入特性之記憶體為一快閃記憶體。Page 20 1248570 VI. Patent Application Scope The size of the file, when the selected memory block is greater than or equal to the desire, and the current optimal memory block is smaller than the file or larger than the selected memory area. In the block, 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 the memory block has each of the idle storage spaces. The memory block is completely selected and compared. 9. The system of claim 7, wherein the selection of the optimal memory block comprises the steps of: setting an initial value of the optimal memory block size; from the memory block in a first in first out order Selecting a memory block having an idle storage space; comparing the selected memory block, the current optimal memory block, and the size of the file, when the selected memory block is smaller than the file, and currently optimal When the memory block is smaller than the selected memory block, the selected memory block replaces the current optimal memory block to become a new optimal memory block; and repeats the foregoing selection and comparison steps until Each memory block in the memory block having an idle storage space is completely selected and compared. 10. The system of claim 5, wherein the memory having the block write characteristic is a flash memory. 第21頁Page 21 aa -12CT 12「 ^Ηδ_ 洚 lc^^ai^^ 1248570 娜in. m 雜 J 1念 αιφ 鷂 丨衾 ύ\\\> 酶 1衾 Φφ 酶 丨佘 αιφ cy 鵾 萚 丨念 ΰη\- 酶 丨衾 α»ι\- P* 酶 Μ 丨衾 α»Φ 鷂 萚 丨衾 α>Φ C^ 酶 (151 萚 • · hoos 1248570 32-12CT 12" ^Ηδ_ 洚lc^^ai^^ 1248570 娜in. m 杂 J 1念αιφ 鹞丨衾ύ\\\> Enzyme 1衾Φφ Enzyme 丨佘αιφ cy ΰ念ΰη-- 丨衾α»ι\- P* Μα»Φ 鹞萚丨衾α>Φ C^ enzyme (151 萚• · hoos 1248570 32 ^^$sl) sw _麥%|| i/k\k 戀 ,\ \ \ \/ H 萚 7// .\—\.\ \1/ ^s:^iJL· 立 雜>昏iiL S4V 7/// // ^at^iitA 1 V/ w々^la1:lE产 /(r^t//if \ \ / :: ¾¾¾ /z/ ///// // \Nrl/\K\ \ \ /\ J/y//////、//// l&lt鷂网洚 //A/////、/////// 7ZVK/KK/KKN/KKN ^//////////////、^^$sl) sw _麦%|| i/k\k Love, \ \ \ \/ H 萚7// .\—\.\ \1/ ^s:^iJL·立杂> faint iiL S4V 7/// // ^at^iitA 1 V/ w々^la1: lE production / (r^t//if \ \ / :: 3⁄43⁄43⁄4 /z/ ///// // \Nrl/\K\ \ \ /\ J/y//////, //// l&lt鹞网洚//A/////,////////7ZVK/KK/KKN/KKN ^// ////////////, Λ^ν/1\/1\ \ \ // 1/才 \ \ / /1/\ \i/ ΟΪΙΦ鷂网洚Λ^ν/1\/1\ \ \ // 1/才 \ \ / /1/\ \i/ ΟΪΙΦ鹞网洚 \\\ cc ρρ ΓΓ* >\NX ^/7^^//////////////// ts-f#藤网^;;^ 丨 /l/cL/y/ 卜///,/ ///, S \ \f -- ( , / / / 4/pf/////////、//////J ^p^y/y\\\\\\\\/冬 / / / / /\v\v\v\v\y \ \ \ \ \ //1' '^Ntsl»^^^^^ 丨 s^srv V \ \ \ \ \\ /1/ / //1// ι^ι^\ \_\ \ \ \ \\ X\\\/1\\\N\\\ cc ρρ ΓΓ* >\NX ^/7^^///////////////// ts-f#藤网^;;^ 丨/l/cL/y/ Bu ///, / ///, S \ \f -- ( , / / / 4/pf/////////, ///////J ^p^y/y\\\\ \\\\/冬/ / / / /\v\v\v\v\y \ \ \ \ \ //1' '^Ntsl»^^^^^ 丨s^srv V \ \ \ \ \\ /1/ / //1// ι^ι^\ \_\ \ \ \ \\ X\\\/1\\\N 46 46 46 46 46 46 46 46 46 46 ,38 -30 1248570 46 46 46 厶6 46 46 . 46. 46 46 戋 46 38- 0 s /1\ \ \ \ \ \ \/Ί/ .1/1/1/1/1/1/1/1//1/ //////////////////// $ St鷂网萚— ///、////// ////////// \\|// \ \ \ / /1/ 、//// \\ \ \ \ /J^ ^ /V //le/lt鷂阚萚46 46 46 46 46 46 46 46 46 46 , 38 -30 1248570 46 46 46 厶 6 46 46 . 46. 46 46 戋 46 38- 0 s /1\ \ \ \ \ \ \/Ί/ .1/1/ 1/1/1/1/1/1//1//////////////////////$ St鹞 network萚 — ///, ////// / ////////// \\|// \ \ \ / /1/, //// \\ \ \ \ /J^ ^ /V //le/lt鹞阚萚 7///77777777Ύ77Ύ· 、///////////// Ί^έφ酶®^7///77777777Ύ77Ύ· , ///////////// Ί^έφ酶®^ 12/¾酶网 KKkkk 勝 蒜錄XXX 124857012/3⁄4 enzyme network KKkkk wins garlic record XXX 1248570 1248570 a1248570 a 12485701248570 涵 十Culvert
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 TW200426584A (en) 2004-12-01
TWI248570B true 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
TWI474335B (en) * 2007-11-19 2015-02-21 Lsi Corp System, method, and computer program product for increasing a lifetime of a plurality of blocks of memory

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8626989B2 (en) * 2011-02-02 2014-01-07 Micron Technology, Inc. Control arrangements and methods for accessing block oriented nonvolatile memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI474335B (en) * 2007-11-19 2015-02-21 Lsi Corp System, method, and computer program product for increasing a lifetime of a plurality of blocks of memory

Also Published As

Publication number Publication date
TW200426584A (en) 2004-12-01

Similar Documents

Publication Publication Date Title
KR101157171B1 (en) A storage system for a smart card and a method of managing file creation in the storage system
US6823417B2 (en) Memory controller for memory card manages file allocation table
CN100543702C (en) Document recording device and its control method and execution method
CN103218224B (en) A kind of method improving memory space utilization rate and terminal
JP2006512643A (en) Double journaling storage method and storage medium thereof
CN105867836A (en) Storage management method and apparatus as well as stream media system
CN110221781A (en) Manufacturing method and device of disk fragments, storage medium and intelligent terminal
CN111158606B (en) Storage method, storage device, computer equipment and storage medium
CN106709014A (en) File system conversion method and apparatus
TW201220047A (en) Method for performing automatic boundary alignment and related non-volatile memory device
CN108304259B (en) Memory management method and system
US8239427B2 (en) Disk layout method for object-based storage devices
CN114153392A (en) Object storage data storage management method, device and device
TWI248570B (en) Method and system for storing data
US7350049B1 (en) Method and apparatus for managing access to a file allocation table
CN109508143B (en) Data storage method and device
CN103235761B (en) Utilize and hide the method that sector realizes USB flash disk multisystem
CN109189345B (en) Online data sorting method, device, equipment and storage medium
CN102354302B (en) A kind of method of erasing disk and device
CN112597102B (en) High-efficiency mirror image file system implementation method
JP2007080240A (en) Technique for accessing file allocation table
CN109086002A (en) Space management, device, computer installation and the storage medium of storage object
US20020191965A1 (en) Storage of data entries in digital devices and methods
CN114217741A (en) Storage method of storage device and storage device
WO2016186602A1 (en) Deletion prioritization

Legal Events

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