CN111290716A - Abrasion balance processing method based on Norflash - Google Patents
Abrasion balance processing method based on Norflash Download PDFInfo
- Publication number
- CN111290716A CN111290716A CN202010146991.XA CN202010146991A CN111290716A CN 111290716 A CN111290716 A CN 111290716A CN 202010146991 A CN202010146991 A CN 202010146991A CN 111290716 A CN111290716 A CN 111290716A
- Authority
- CN
- China
- Prior art keywords
- sector
- erasing
- norflash
- dmax
- cmin
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 7
- 238000005299 abrasion Methods 0.000 title description 2
- 238000000034 method Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002028 premature Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The invention relates to a wear-leveling processing method based on Norflash, which comprises the steps of taking a certain section of area at the front part or the rear part of a sector to record the erasing times of the sector; when a new sector needs to be used, the current sector erasing frequency condition of the system is scanned, the deviation value of the system erasing is compared with a set threshold value, and an idle sector is selected. The erasing times of the sector are recorded by taking a certain section of area at the front part or the rear part of the sector. Thus, the number of erasures per sector is accurately recorded. And records the information in the memory every time the system is started. This allows the erasure information of all sectors to be retrieved quickly.
Description
Technical Field
The invention relates to the field of embedded data storage, in particular to a wear balance processing method based on Norflash.
Background
Based on cost consideration, most of the existing embedded systems adopt a single-chip Norflash storage medium to store programs and data, and the commonly adopted Norflash space is very small and is between dozens of K and several M.
Norflash contains multiple sectors, each of which can be programmed separately and multiple times, as long as each write can write a 1 to a 0. For example, 0xff can be written as 0xfe, and 0xfe can be rewritten as 0xfc, but if 0 needs to be written as 1, for example, 0xfe needs to be written as 0xff, the entire sector needs to be erased and rewritten.
The lifetime of each sector of the Norflash is calculated separately, and generally has 10W erasing times.
To avoid over-speeding the premature end of life for some sectors, wear leveling algorithms are typically used to ensure a balanced life for all sectors.
In order to achieve wear leveling, it is common practice to mark a part of the functional area in the flash for recording the number of erasures per sector, for example, fig. 1, where 1, 2, and 3 … … in fig. 1 are sector numbers.
When the system needs to write the recorded data in the idle sector, the recorded sector life information needs to be inquired, and a proper sector is selected from the sector life information.
This approach has significant disadvantages:
(1) these functional areas themselves also have lifetime problems, and to support these large erase recording requirements, a large number of functional areas are required, which results in a relatively large waste of space.
(2) Under different usage scenarios, the lifetime between functional areas is not practically balanced, e.g. the area used for recording the lifetime may be shorter than the lifetime of the data area.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a wear leveling method based on Norflash, which can allocate the lifetime of each sector based on wear leveling, and maximally achieve wear leveling between sectors.
The invention is realized by adopting the following scheme: a wear balance processing method based on Norflash,
before each sector of the Norflash is used, recording the erasing times of each sector to the front part or the rear part of the corresponding sector respectively; when a new sector needs to be used, the current situation of the erasing times of all sectors is scanned, the deviation value of the sector erasing is compared with a set threshold value, and an idle sector is selected.
Furthermore, the erasing times corresponding to each sector of the embedded system are respectively C1、C2... Cn, where n is the sector number; cmax represents the maximum number of erasures in the system, Cmin represents the minimum number of erasures in the system, the deviation value of the erasure number of the sector is D, and D = Cmax-Cmin; setting a maximum deviation value Dmax of the system erasing times, wherein the range of Dmax is 1 to 1 thousandth of the erasing life of the sector; i.e. only allowing the maximum erase times deviation value Cmax-Cmin in the system<=Dmax;
When a system needs a new sector, judging the D value of the current system, and when D is less than a set threshold value Dmax, randomly distributing a sector from the system; when D > = the set threshold value Dmax, the sector corresponding to the Cmin is allocated to the system for use; if the searched sector content is empty, the sector content is used for the system; if the sector has valid data, the valid data is transferred to other sectors and then is used by the system.
Compared with the prior art, the invention has the following beneficial effects:
(1) the invention takes a certain section of area at the front or the back of the sector to record the erasing times of the sector. Thus, the number of erasures per sector is accurately recorded. And records the information in the memory every time the system is started. This allows the erasure information of all sectors to be retrieved quickly.
(2) When D is less than Dmax, the invention can randomly acquire an available sector, reduce the sector with the minimum erasing frequency positioned each time, and greatly improve the efficiency of inquiring the running of the embedded system, namely the system does not need to spend a large amount of time to search for a proper available sector.
Drawings
Fig. 1 is a diagram illustrating the sector record erase count according to the prior art.
FIG. 2 is a diagram illustrating the recording of erase counts at the back of a sector during sector division according to an embodiment of the present invention.
Fig. 3 is a diagram illustrating the recording of the number of times of erasing in the front of a sector when the sector is divided according to an embodiment of the present invention.
Detailed Description
The invention is further explained below with reference to the drawings and the embodiments.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiment provides a wear leveling processing method based on Norflash, before each sector of the Norflash is used, the erasing times of each sector are respectively recorded in the front part or the rear part of the corresponding sector; when a new sector needs to be used, the current situation of the erasing times of all sectors is scanned, the deviation value of the sector erasing is compared with a set threshold value, and an idle sector is selected.
In this embodiment, the erase times corresponding to each sector of the embedded system are respectively set to C1、C2... Cn, where n is the sector number; assuming that Cmax represents the maximum value of the number of times of erasing in the embedded system, Cmin represents the minimum value of the number of times of erasing in the embedded system, and assuming that the sector erase deviation value of the embedded system is D, D = Cmax-Cmin; setting a maximum deviation value Dmax of the system erasing times according to requirements, namely only allowing the maximum erasing times Cmax-Cmin in the system<= Dmax; typically, Dmax is 1/100-1/1000 for the erase lifetime of the sector to achieve the best performance and lifetime overhead. For example, if the erase lifetime of a sector is 10 ten thousand times, Dmax may be between 100 and 1000.
When a system needs a new sector, judging the D value of the current system, and when D is less than a set threshold value Dmax, randomly distributing a sector from the system; when D > = the set threshold value Dmax, the sector corresponding to the Cmin is allocated to the system for use; if the searched sector content is empty, the sector content is used for the system; if the sector has valid data, the valid data is transferred to other sectors and then is used by the system.
The method of the embodiment is to record the erasing times in the front or rear part of the sector by utilizing the characteristic of multiple times of programming of Norflash, and the erasing information of the sectors follows the sector. The aim is to avoid Cmax-Cmin > Dmax. The advantages of such a process are: under the condition of wear balance, the service life of each sector is allocated, and the wear balance among the sectors is realized to the maximum extent.
As shown in fig. 2 and 3, C1 represents the number of times the sector is erased. The erasing times of the sector are recorded by taking a certain section of area at the front part or the rear part of the sector. Thus, the number of erasures per sector is accurately recorded.
And records the information in the memory every time the system is started. This allows the erasure information of all sectors to be retrieved quickly.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.
Claims (2)
1. A wear balance processing method based on Norflash is characterized in that:
before each sector of the Norflash is used, recording the erasing times of each sector to the front part or the rear part of the corresponding sector respectively; when a new sector needs to be used, the current situation of the erasing times of all sectors is scanned, the deviation value of the sector erasing is compared with a set threshold value, and an idle sector is selected.
2. The Norflash-based wear leveling method as claimed in claim 1, wherein:
making the erasing times corresponding to each sector of the embedded system respectively be C1、C2... Cn, where n is the sector number; cmax represents the maximum number of erasures in the system, Cmin represents the minimum number of erasures in the system, the deviation value of the erasure number of the sector is D, and D = Cmax-Cmin; setting a maximum deviation value Dmax of the system erasing times, wherein the range of Dmax is 1 to 1 thousandth of the erasing life of the sector; i.e. only allowing the maximum erase times deviation value Cmax-Cmin in the system<=Dmax;
When a system needs a new sector, judging the D value of the current system, and when D is less than a set threshold value Dmax, randomly distributing a sector from the system; when D > = the set threshold value Dmax, the sector corresponding to the Cmin is allocated to the system for use; if the searched sector content is empty, the sector content is used for the system; if the sector has valid data, the valid data is transferred to other sectors and then is used by the system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010146991.XA CN111290716A (en) | 2020-03-05 | 2020-03-05 | Abrasion balance processing method based on Norflash |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010146991.XA CN111290716A (en) | 2020-03-05 | 2020-03-05 | Abrasion balance processing method based on Norflash |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111290716A true CN111290716A (en) | 2020-06-16 |
Family
ID=71031059
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010146991.XA Pending CN111290716A (en) | 2020-03-05 | 2020-03-05 | Abrasion balance processing method based on Norflash |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111290716A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1652089A (en) * | 2004-02-06 | 2005-08-10 | 三星电子株式会社 | Method of remapping flash memory |
US20070255889A1 (en) * | 2006-03-22 | 2007-11-01 | Yoav Yogev | Non-volatile memory device and method of operating the device |
US20090292839A1 (en) * | 2008-05-22 | 2009-11-26 | Sang-Jin Oh | Semiconductor memory device, memory system and data recovery methods thereof |
CN107908364A (en) * | 2017-11-13 | 2018-04-13 | 中国电子科技集团公司第三十研究所 | A kind of embedded file system based on norflash |
-
2020
- 2020-03-05 CN CN202010146991.XA patent/CN111290716A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1652089A (en) * | 2004-02-06 | 2005-08-10 | 三星电子株式会社 | Method of remapping flash memory |
US20070255889A1 (en) * | 2006-03-22 | 2007-11-01 | Yoav Yogev | Non-volatile memory device and method of operating the device |
US20090292839A1 (en) * | 2008-05-22 | 2009-11-26 | Sang-Jin Oh | Semiconductor memory device, memory system and data recovery methods thereof |
CN107908364A (en) * | 2017-11-13 | 2018-04-13 | 中国电子科技集团公司第三十研究所 | A kind of embedded file system based on norflash |
Non-Patent Citations (1)
Title |
---|
罗智、沈晨蕾、高璐、张素辉: "NAND Flash损耗均衡算法研究", 《全国抗恶劣环境计算机第二十届学术年会论文集》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100914089B1 (en) | Maintaining erase counts in non-volatile storage systems | |
US9274944B2 (en) | Wear leveling | |
KR100910680B1 (en) | Method and apparatus for managing an erase count block | |
US7552272B2 (en) | Automated wear leveling in non-volatile storage systems | |
KR101110901B1 (en) | Wear leveling in non-volatile storage systems | |
US6675281B1 (en) | Distributed mapping scheme for mass storage system | |
US7035967B2 (en) | Maintaining an average erase count in a non-volatile storage system | |
EP1228510B1 (en) | Space management for managing high capacity nonvolatile memory | |
US6772274B1 (en) | Flash memory system and method implementing LBA to PBA correlation within flash memory array | |
JP4399029B2 (en) | System data control method and architecture with automatic wear leveling in semiconductor non-volatile mass storage memory | |
US7882300B2 (en) | Apparatus and method for managing nonvolatile memory | |
KR100906519B1 (en) | Unusable block management within a non-volatile memory system | |
CN100487672C (en) | Method and apparatus for splitting a logical block | |
TW200905685A (en) | Memory apparatus, and method of averagely using blocks of a flash memory | |
KR20050084879A (en) | Tracking the least frequently erased blocks in non-volatile memory systems | |
KR20050059314A (en) | Tracking the most frequently erased blocks in non-volatile storage systems | |
JP2012190532A (en) | Method, device and storage device | |
CN111290716A (en) | Abrasion balance processing method based on Norflash | |
CN110633056A (en) | Page management method and storage device of Flash chip on operating system level | |
CN112162936B (en) | Method and system for dynamically enhancing FLASH erasing times | |
CN102637146B (en) | Method for managing blocks, memory device and controller thereof | |
CN116450052A (en) | Method and system for writing on-chip system file data based on erasing times count | |
CN1533575A (en) | Method for correcting data on storage card during chip card transaction | |
CN113485974A (en) | Method and device for using YAFFS (flash architecture) for NOR flash memory | |
JP2000057061A (en) | Storage device using flash memory and its control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200616 |