CN101369252A - Method for static data loss equalization based on NAND flash memory file system - Google Patents

Method for static data loss equalization based on NAND flash memory file system Download PDF

Info

Publication number
CN101369252A
CN101369252A CNA2008101616034A CN200810161603A CN101369252A CN 101369252 A CN101369252 A CN 101369252A CN A2008101616034 A CNA2008101616034 A CN A2008101616034A CN 200810161603 A CN200810161603 A CN 200810161603A CN 101369252 A CN101369252 A CN 101369252A
Authority
CN
China
Prior art keywords
block
erase
erase block
erasing
erasing times
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CNA2008101616034A
Other languages
Chinese (zh)
Inventor
卜佳俊
陈纯
杨智
李海霞
周笑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CNA2008101616034A priority Critical patent/CN101369252A/en
Publication of CN101369252A publication Critical patent/CN101369252A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention discloses a loss balancing method which is based on static data in an NAND flash memory file system. The method divides erase blocks of the whole NAND flash memory into four types: a free block, a clean block, a dirty block and a bad block, and forms four linked lists; the free block linked list links the erasing blocks in accordance with the erasing times from small to large, a threshold TH is set and a block from the free block linked list is selected and datum of A erasing block having the largest erasing times is copied to the free block; then the erasing operation of the A erase block is executed, then datum of B erasing block having the smallest erasing times is copied to the A erasing block; then the B erasing block is put into the dirty block linked list, frequently updated data are stored in the B erasing block after the B erasing block is erased. The invention can balance the erasing times of static data and dynamic data, and the loss balance of the whole flash memory device is obtained.

Description

Method based on static data loss equalization in the nand flash memory file system
Technical field
The present invention relates to use each embedded product of embedded file system, particularly relate to a kind of method based on static data loss equalization in the nand flash memory file system.
Background technology
Because the embedded device volume is little, thus can not use hard disk as storer, and flash memory relies on advantages such as its access speed is fast, memory capacity is big, cheap, becomes the main flow storer that extensively adopts in the embedded system.Flash memory is divided into two kinds on NOR type and NAND type according to the difference of storage matrix structure.NAND (a kind of main nonvolatile flash memory technology at present, be applicable to that high capacity elimination and the speed that writes are fast, but can only read block unit, reading slow at random) the type flash memory emphasizes to reduce the cost of every bit, higher performance, and can easily upgrade by interface as disk, be the ideal solution of high density data storage, is widely used in movable storage device, mobile media devices and the embedded device.The life-span of flash memory is limited, but the length in its life-span is by the decision of the maximum erasing times of erasable block, but the maximum erasing times of nand flash memory is approximately about 1,000,000 times.Because any one erasable block reaches going up in limited time of erasing times, whole flash memory all can't use.So, avoid under the little performance impact of trying one's best, erasable operation being evenly distributed on each erasable block owing to certain erasable block is made whole flash memory to use by excessively erasable in order to prolong the serviceable life of flash memory.This process just is called wear leveling.
The file system that can be used for NAND type flash memory at present comprises the file system of centralized indexes and the file system that designs for nand flash memory specially.The file system of centralized indexes is a file system commonly used in the magnetic disk memory, mainly comprises based on the FAT series of Windows with based on the Ext series of Linux.Because flash memory device can drive by flash memory translation layer FTL (Flash Translation Layer) and be modeled to the block device similar to disk, so such file system can directly be used on flash memory based on FTL.In flash memory, adopt the file system of centralized indexes two problems below existing: the 1. mode of the file system of centralized indexes employing " overriding " new data more, just can write and in flash memory, " override " to wipe earlier, cut off the power supply if be wiped free of the back system, may cause losing of data in data; 2. the file system index of centralized indexes separates with data and deposits, and the renewal frequency of index is far longer than the renewal frequency of data division, so can not well realize wear leveling.
Based on two top problems, so designed special file system YAFFS (Yet Another Flash File-System) at nand flash memory.Up to the present, YAFFS series is unique file system that designs at nand flash memory specially.YAFFS series has YAFFS and two versions of YAFFS2.For solve in the centralized indexes file system problem 1., adopted the notion of daily record among the YAFFS, no longer adopt the update mode of " overriding ", but adopt the mode of " forward direction writes ".At problem 2., the algorithm that YAFFS adopts a kind of many strategies to mix carries out garbage reclamation, and the greed strategy is used in respectively under the different situations with random selection strategy.The advantage of this algorithm is to can be good at having realized wear leveling to upgrading frequent data; Shortcoming is not have consideration to take the wear leveling of the static data of most of storage space.So YAFFS can not realize the wear leveling of whole flush memory device.
Therefore, if can realize the wear leveling algorithm of static data in the embedded file system, for the serviceable life that prolongs flash memory be highly significant.
Summary of the invention
The object of the present invention is to provide a kind of method based on static data loss equalization in the nand flash memory file system.
The technical scheme that the present invention solves its technical matters employing is as follows:
1) erase block with whole nand flash memory is divided into: four kinds of free blocks, clean piece, dirty, bad piece; Free block represents that the pages all above the erase block all is idle, can directly distribute; Clean piece represents that all data above the erase block are all effective; At least contain one page because the invalid data that Data Update or file delete stay on the dirty expression erase block; Bad piece comprises the bad piece that produces in intrinsic bad piece when dispatching from the factory and the use; File system has formed four kinds of chained lists with the various erase blocks of the format management of chained list: free block chained list, clean piece chained list, dirty chained list, bad piece chained list; The free block chained list links erase block according to erasing times is ascending;
2) setting threshold TH; File system reads the erasing times field Erase_Num in the additional zone field of all erase blocks in the clean piece chained list when garbage reclamation operation is triggered, therefrom find out the erase block of erasing times maximum and the erase block of erasing times minimum; It is poor then the erase block of the erase block of erasing times maximum and erasing times minimum to be done, if difference 〉=TH, just conclude that what store on the erase block of erasing times minimum is static data, the frequency that static data upgrades is very low, need move operation to static data;
3) piece with the erasing times maximum is designated as A, and the piece of erasing times minimum is designated as B; From the free block chained list, choose one, the data on the A erase block are copied on the free block; Then the A erase block is carried out erase operation, then the data above the B erase block are copied to above the A erase block; Then the B erase block is put in the dirty chained list, is used to deposit the renewal frequent data item after the B erase block is wiped.
The present invention compares with background technology, and the useful effect that has is:
The present invention is a kind of loss equalizing method that is used for realizing based on the file system static data of nand flash memory.It is by setting threshold, and identification static data piece is moved operation to the static data piece and the bigger data block of erasing times that identify then.Promptly from free block, find out earlier the erase block of erasing times maximum, static data is moved on this piece from original erase block, and original erase block wiped to be inserted into then be used for storing dynamic data in the free block.So just, can balance static data piece and the erasing times of dynamic data piece, thus the wear leveling of whole flush memory device obtained.
Description of drawings
Fig. 1 is the constitutional diagram of testing the adding static data loss equalization method that obtains.
Fig. 2 is the constitutional diagram that does not add the static data loss equalization method that experiment obtains.
Fig. 3 is the comparison diagram of both equalization methods.Figure center line A representative does not add the state of static data loss equalization method, and line B representative adds the state of static data loss equalization method.
Embodiment
The invention will be further described below in conjunction with drawings and Examples.
The present invention proposes is used for realizing that the method based on nand flash memory file system static data loss equalization is applied to use in the embedded product of embedded file system.Using of this method is to be the aims of systems plate with Blackfin531, and the embedded OS of employing is uClinux, and step is carried out as follows:
One, configuration cross compilation environment:
1. obtain the developing instrument installation kit;
2. land with root, developing instrument is installed;
3. configuration hyper terminal;
4. compiling uClinux kernel adds the support to the file system that comprises this method.
(1) in kernel, adds platform compiling information;
(2) under the fs catalogue, set up a catalogue, the associated documents of the file system at this method place are copied in the catalogue;
(3) a newly-built Makefile adds to issue orders:
(4) Kconfig and Makefile below the modification fs catalogue connect into the file system at this method place:
(5) add the nand flash memory partition information;
(6) compiling kernel.
Two, build target platform:
1, the JTAG mouth with the Blackfin531 Target Board links to each other with computer parallel port, and serial ports, netting twine and main frame connect;
2, compiling bootloader;
3, among the Visual DSP by JTAG with the burned Target Board of bootloader;
4, inciting somebody to action before by the order among the use bootloader, compiled kernel mirror image downloads to Target Board.
Three, the characteristics of the file of depositing in the current file system: most of files are some small documents, but big file has taken most storage space.According to these characteristics, deposit 3 of read-only state data files that occupy the most of space of flash memory in the file system, size is respectively: 1M, 10M, 16M; Deposit 300 small documents, its capacity is no more than 10K.Wherein the accessed probability of state data file is 20%, and the accessed probability of small documents is 80%.
Four, implementation method: the method that adopts among the FMNFS is by setting threshold, is designated as TH, discerns and move the bigger data block of static data piece and erasing times, thereby obtains the wear leveling of whole flush memory device.
For the threshold value TH that uses in the wear leveling algorithm, its meaning is the lower limit of the difference between maximum erasing times and the minimum erasing times in the valid data erase block, when difference is just moved operation to static data during greater than TH.Because static data is all bigger usually, institute's ether is frequent moves operation and can produce serious influence to the efficient of system, so TH cannot be too small.Certain value effect that the value of common TH is set as between the 200-500 is relatively good.
When garbage reclamation operation is triggered, read the erasing times field Erase_Num in the additional zone field of all erase blocks in the clean piece chained list, therefrom find out maximum erase block of erasing times and the minimum piece of erasing times.It is poor then both to be done, if during difference 〉=preset threshold, just can conclude that what store on the erase block of erasing times minimum is static data, the frequency of its renewal is very low, need move operation to it.Simultaneously, because these static datas are all bigger usually, the quantity of the erase block that it is shared is also many, and all is continuous, so the erase block of satisfied " the minimum erasing times of Erase_Num==" condition is more than 1.Therefore, in order to realize that better erasure balance need need to scan once more clean piece chained list after having moved a piece, find out the erase block of erasing times maximum.Its concrete way can be divided into following a few step:
(1) the clean piece of scanning is tabulated, and finds out the piece of erasing times maximum and erasing times minimum, and erasing times is designated as Erase_Max and Erase_Min respectively.Piece with their place is designated as A and B respectively simultaneously.
(2) Erase_Min and Erase_Max are done poor.If | Erase_Max-Erase_Min| 〉=TH, what illustrate that the B erase block deposits is static data, need move operation to it;
(3) from the free block chained list, choose one, the data on the A erase block are copied on the free block; Then the A erase block is carried out erase operation, then the data above the B erase block are copied to above the A erase block; Then the B erase block is put in the dirty chained list, is used to deposit the renewal frequent data item after it is wiped.Repeat the step of (1), (2), (3), up to " | Erase_Max-Erase_Min| 〉=TH " do not satisfy, till promptly all static datas have all been moved.
2500 erase blocks to nand flash memory constantly carry out erase operation then, obtain wear leveling situation as shown in Figure 1.Fig. 2 has shown the constitutional diagram of not considering static data loss equalization, and Fig. 3 is the comparison diagram of both equalization methods.

Claims (1)

1. method based on static data loss equalization in the nand flash memory file system is characterized in that the step of this method is as follows:
1) erase block with whole nand flash memory is divided into: four kinds of free blocks, clean piece, dirty, bad piece; Free block represents that the pages all above the erase block all is idle, can directly distribute; Clean piece represents that all data above the erase block are all effective; At least contain one page because the invalid data that Data Update or file delete stay on the dirty expression erase block; Bad piece comprises the bad piece that produces in intrinsic bad piece when dispatching from the factory and the use; File system has formed four kinds of chained lists with the various erase blocks of the format management of chained list: free block chained list, clean piece chained list, dirty chained list, bad piece chained list; The free block chained list links erase block according to erasing times is ascending;
2) setting threshold TH; File system reads the erasing times field Erase_Num in the additional zone field of all erase blocks in the clean piece chained list when garbage reclamation operation is triggered, therefrom find out the erase block of erasing times maximum and the erase block of erasing times minimum; It is poor then the erase block of the erase block of erasing times maximum and erasing times minimum to be done, if difference 〉=TH, just conclude that what store on the erase block of erasing times minimum is static data, the frequency that static data upgrades is very low, need move operation to static data;
3) piece with the erasing times maximum is designated as A, and the piece of erasing times minimum is designated as B; From the free block chained list, choose one, the data on the A erase block are copied on the free block; Then the A erase block is carried out erase operation, then the data above the B erase block are copied to above the A erase block; Then the B erase block is put in the dirty chained list, is used to deposit the renewal frequent data item after the B erase block is wiped.
CNA2008101616034A 2008-09-16 2008-09-16 Method for static data loss equalization based on NAND flash memory file system Pending CN101369252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008101616034A CN101369252A (en) 2008-09-16 2008-09-16 Method for static data loss equalization based on NAND flash memory file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008101616034A CN101369252A (en) 2008-09-16 2008-09-16 Method for static data loss equalization based on NAND flash memory file system

Publications (1)

Publication Number Publication Date
CN101369252A true CN101369252A (en) 2009-02-18

Family

ID=40413075

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008101616034A Pending CN101369252A (en) 2008-09-16 2008-09-16 Method for static data loss equalization based on NAND flash memory file system

Country Status (1)

Country Link
CN (1) CN101369252A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901190A (en) * 2009-03-19 2010-12-01 三星电子株式会社 Electronic device, apparatus and method for managing memory in the electronic device
CN102033945A (en) * 2010-12-21 2011-04-27 中兴通讯股份有限公司 Method and device for recovering garbage
CN102169462A (en) * 2011-04-27 2011-08-31 中国科学院光电技术研究所 NAND Flash-based data recording method and recording controller
CN102222047A (en) * 2011-06-16 2011-10-19 西安交通大学 Improved BET static loss equalization method
CN102222044A (en) * 2010-04-16 2011-10-19 慧荣科技股份有限公司 Data writing method of memory and data storage device
CN102543177A (en) * 2010-12-17 2012-07-04 西安奇维测控科技有限公司 Solid-state disk (SSD) static wear balance algorithm
CN101740110B (en) * 2009-12-17 2013-06-12 中兴通讯股份有限公司 Method and device for erasure balance of Nand Flash
CN103678141A (en) * 2012-09-05 2014-03-26 深圳市中兴移动通信有限公司 Management method and management system for flash memory
CN104298465A (en) * 2013-07-17 2015-01-21 光宝科技股份有限公司 Block grouping method in SSD
CN104995609A (en) * 2013-02-11 2015-10-21 英派尔科技开发有限公司 Aggregating cache eviction notifications to a directory
CN105589811A (en) * 2014-11-10 2016-05-18 慧荣科技股份有限公司 Data storage device and operating method
CN105700822A (en) * 2014-12-15 2016-06-22 柯尼卡美能达株式会社 nonvolatile memory control device and nonvolatile memory control method
CN106095344A (en) * 2016-06-27 2016-11-09 联想(北京)有限公司 A kind of data processing method and device
CN106294202A (en) * 2015-06-12 2017-01-04 联想(北京)有限公司 A kind of date storage method and device
CN106484323A (en) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 A kind of loss equalizing method of solid-state storage and system
CN106990926A (en) * 2017-06-14 2017-07-28 郑州云海信息技术有限公司 A kind of processing method of solid state hard disc abrasion equilibrium
CN108089822A (en) * 2017-12-20 2018-05-29 北京京存技术有限公司 Management method, system, equipment and the storage medium of storage chip
CN108319433A (en) * 2018-03-19 2018-07-24 艾体威尔电子技术(北京)有限公司 The memory management method of the NOR Flash of small memory microcontroller
CN110851079A (en) * 2019-10-28 2020-02-28 华中科技大学 Adaptive storage device loss balancing method and system
CN111324285A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory device
CN111324284A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory device

Cited By (33)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901190A (en) * 2009-03-19 2010-12-01 三星电子株式会社 Electronic device, apparatus and method for managing memory in the electronic device
CN101901190B (en) * 2009-03-19 2015-04-01 三星电子株式会社 Electronic device, apparatus and method for managing memory in the electronic device
CN101740110B (en) * 2009-12-17 2013-06-12 中兴通讯股份有限公司 Method and device for erasure balance of Nand Flash
CN102222044B (en) * 2010-04-16 2015-09-02 慧荣科技股份有限公司 The method for writing data of storer and data memory device
CN102222044A (en) * 2010-04-16 2011-10-19 慧荣科技股份有限公司 Data writing method of memory and data storage device
CN102543177A (en) * 2010-12-17 2012-07-04 西安奇维测控科技有限公司 Solid-state disk (SSD) static wear balance algorithm
CN102543177B (en) * 2010-12-17 2016-01-06 西安奇维测控科技有限公司 A kind of solid-state disk static wear balanced algorithm
CN102033945A (en) * 2010-12-21 2011-04-27 中兴通讯股份有限公司 Method and device for recovering garbage
CN102169462B (en) * 2011-04-27 2014-03-05 中国科学院光电技术研究所 NAND Flash-based data recording method and recording controller
CN102169462A (en) * 2011-04-27 2011-08-31 中国科学院光电技术研究所 NAND Flash-based data recording method and recording controller
CN102222047A (en) * 2011-06-16 2011-10-19 西安交通大学 Improved BET static loss equalization method
CN103678141A (en) * 2012-09-05 2014-03-26 深圳市中兴移动通信有限公司 Management method and management system for flash memory
CN103678141B (en) * 2012-09-05 2017-11-28 努比亚技术有限公司 The management method and management system of flash memory
CN104995609A (en) * 2013-02-11 2015-10-21 英派尔科技开发有限公司 Aggregating cache eviction notifications to a directory
CN104995609B (en) * 2013-02-11 2017-12-19 英派尔科技开发有限公司 The polymerization notified the cache garbage collection for being sent to catalogue
CN104298465B (en) * 2013-07-17 2017-06-20 光宝电子(广州)有限公司 Block group technology in solid state storage device
CN104298465A (en) * 2013-07-17 2015-01-21 光宝科技股份有限公司 Block grouping method in SSD
CN105589811A (en) * 2014-11-10 2016-05-18 慧荣科技股份有限公司 Data storage device and operating method
CN105589811B (en) * 2014-11-10 2019-02-01 慧荣科技股份有限公司 Data memory device and operating method
CN105700822B (en) * 2014-12-15 2019-01-04 柯尼卡美能达株式会社 Control device of non-volatile storage and control method for nonvolatile memory
CN105700822A (en) * 2014-12-15 2016-06-22 柯尼卡美能达株式会社 nonvolatile memory control device and nonvolatile memory control method
CN106294202A (en) * 2015-06-12 2017-01-04 联想(北京)有限公司 A kind of date storage method and device
CN106095344A (en) * 2016-06-27 2016-11-09 联想(北京)有限公司 A kind of data processing method and device
CN106095344B (en) * 2016-06-27 2019-11-12 深圳忆联信息系统有限公司 A kind of data processing method and device
CN106484323A (en) * 2016-09-13 2017-03-08 郑州云海信息技术有限公司 A kind of loss equalizing method of solid-state storage and system
CN106990926A (en) * 2017-06-14 2017-07-28 郑州云海信息技术有限公司 A kind of processing method of solid state hard disc abrasion equilibrium
CN108089822A (en) * 2017-12-20 2018-05-29 北京京存技术有限公司 Management method, system, equipment and the storage medium of storage chip
CN108319433A (en) * 2018-03-19 2018-07-24 艾体威尔电子技术(北京)有限公司 The memory management method of the NOR Flash of small memory microcontroller
CN108319433B (en) * 2018-03-19 2021-02-02 艾体威尔电子技术(北京)有限公司 Storage management method for NOR Flash of small-memory single chip microcomputer
CN111324285A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory device
CN111324284A (en) * 2018-12-14 2020-06-23 北京兆易创新科技股份有限公司 Memory device
CN111324284B (en) * 2018-12-14 2024-02-23 兆易创新科技集团股份有限公司 Memory device
CN110851079A (en) * 2019-10-28 2020-02-28 华中科技大学 Adaptive storage device loss balancing method and system

Similar Documents

Publication Publication Date Title
CN101369252A (en) Method for static data loss equalization based on NAND flash memory file system
US10216639B2 (en) Identification of blocks to be retained in a cache based on temperature
EP2940691B1 (en) Storage controller, storage device, storage system and method of operating the storage controller
KR101477047B1 (en) Memory system and block merge methods thereof
CN101271730B (en) Memory system with mixed density memory and its erasing and file allocation management method
CN101354681B (en) Memory system, abrasion equilibrium method and apparatus of non-volatile memory
CN102576293B (en) Data management in solid storage device and Bedding storage system
CN101169751B (en) System with flash memory device and data recovery method thereof
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
CN101727295B (en) Method for writing in and reading out data based on virtual block flash memory address mapping
EP2977906A1 (en) Nonvolatile storage device and data write method
US20140129758A1 (en) Wear leveling in flash memory devices with trim commands
CN106844583B (en) Optimization method for establishing FAT file system on NOR Flash
CN101241471A (en) Flash memory system and garbage collection method thereof
CN103294604A (en) Flash memory device and electronic device employing thereof
CN112231244B (en) SIM card file erasing and writing system and method applied to SoftSIM and readable storage medium
KR20090042035A (en) Data storage device, memory system, and computing system using nonvolatile memory device
KR20130017748A (en) Memory controller and data management method
CN102841851A (en) Flash memory management method and flash memory device
CN101673243A (en) Data storage device and method
KR20100054402A (en) Computing device with a storage, and storage managing device and method, and media recorded a file system
CN102520885B (en) Data management system for hybrid hard disk
CN101739350B (en) Memory storage device and control method thereof
KR101191650B1 (en) Apparatus and method for mapping the data address in NAND flash memory
CN110658981A (en) Method for prolonging service life of Flash

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20090218