CN109558080A - A kind of NandFlash data managing method of electric power acquisition equipment - Google Patents

A kind of NandFlash data managing method of electric power acquisition equipment Download PDF

Info

Publication number
CN109558080A
CN109558080A CN201811382073.6A CN201811382073A CN109558080A CN 109558080 A CN109558080 A CN 109558080A CN 201811382073 A CN201811382073 A CN 201811382073A CN 109558080 A CN109558080 A CN 109558080A
Authority
CN
China
Prior art keywords
data
minimum
nandflash
cell block
electric power
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.)
Granted
Application number
CN201811382073.6A
Other languages
Chinese (zh)
Other versions
CN109558080B (en
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.)
Ningbo Sanxing Medical and Electric Co Ltd
Original Assignee
Ningbo Sanxing Medical and Electric Co Ltd
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 Ningbo Sanxing Medical and Electric Co Ltd filed Critical Ningbo Sanxing Medical and Electric Co Ltd
Priority to CN201811382073.6A priority Critical patent/CN109558080B/en
Publication of CN109558080A publication Critical patent/CN109558080A/en
Application granted granted Critical
Publication of CN109558080B publication Critical patent/CN109558080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems

Abstract

The present invention relates to a kind of NandFlash data managing methods of electric power acquisition equipment, by in electric power acquisition equipment NandFlash search physical areas and choose the erasing cell block with minimum byte and be managed, choosing has the erasing unit of minimum byte as minimum erasing cell block, after minimum erasing cell block is divided into N number of minimum unit, obtain first writable unit, and the data in data buffer area are saved in first writable unit, when the offset of first writable unit is N-1, then wipe the data in each minimum writing unit in minimum erasing cell block, and restart to be written from first minimum writing unit in minimum erasing cell block data cached, reach to each minimum writing unit around tail processing, to vacate more memory spaces , avoid previous data from occupying the space of minimum erasing cell block, thus not only NandFlash space utilization rate can be improved to avoid continually storing data into NandFlash.

Description

A kind of NandFlash data managing method of electric power acquisition equipment
Technical field
The present invention relates to the NandFlash data pipes of electric power acquisition apparatus field more particularly to a kind of electric power acquisition equipment Reason method.
Background technique
As the increasingly extensive property, the complexity of field application and huge data volume of electric power acquisition equipment application are frequent Storage needs, and Flash life problems become the key index for influencing the product life cycle.
Electric power acquisition equipment in the process of running, needs to save some data according to the high-frequency period of second grade.However, by Generally use NandFlash as main memory in existing electric power acquisition equipment, once excessively continually storing data will by NandFlash Serious shortening NandFlash service life can be brought.In addition, since the hardware of existing electric power acquisition equipment is in KB grades small Under dis environment, the load-balancing technique using usual caching mass data will be unable to;Even if electric power acquisition equipment is for preservation Data do abrasion equilibrium using NFTL technology, be still unable to satisfy extend electric power acquisition equipment in NandFlash service life week The purpose of phase.
Summary of the invention
The technical problem to be solved by the present invention is to provide a kind of electric power acquisition equipment for the above-mentioned prior art NandFlash data managing method.
The technical scheme of the invention to solve the technical problem is: a kind of NandFlash of electric power acquisition equipment Data managing method, which comprises the steps of:
Step 1, it is searched in the physical areas NandFlash of electric power acquisition equipment and chooses the erasing unit with minimum byte Block, the label erasing cell block with minimum byte is as minimum erasing cell block;
Step 2, the minimum erasing cell block is divided into N number of minimum writing unit;Wherein, N >=1;
Step 3, the data buffer area of the first preset byte is established in the physical areas NandFlash;Wherein, the data are slow Area is deposited to be made of Magic number, write-in number, data length, valid data area and ECC check code;
Step 4, the electric power acquisition equipment is powering on and after program initialization, does carry operation;Wherein, it is entangled by ECC The method of miscounting reads the data in each minimum writing unit, and when any data read is full 0 xFF, then it is assumed that this Minimum writing unit belonging to one data is first writable unit;Otherwise, by each most small letter in minimum erasing cell block Enter the data erasing in unit, and will number near preceding one minimum writing unit as first writable unit;
Step 5, the data for needing to do period preservation are copied in the data buffer area in the physical areas NandFlash Valid data area;
Step 6, it calculates the data length being written in valid data area described in step 5, count the data buffer area quilt Total write-in number of data is written and generates the ECC check code of preceding second preset byte of the data buffer area;
Step 7, the data in the data buffer area are written to described first according to default time-write interval can In writing unit;
Step 8, when the offset of first writable unit is N, then by the minimum erasing cell block it is each most Data erasing in small writing unit, and restart to write from first minimum writing unit in minimum erasing cell block Enter data cached;Otherwise, it directly is written to first writable unit by data cached, while calculates next writable list The number of member;
It step 9, then will be in the valid data area in the data buffer area when needing to obtain newest storing data Reading data comes out;Otherwise, it is transferred to step 7.
With improvement, in the NandFlash data managing method of electric power acquisition equipment, the electric power acquisition equipment is being detected To when power down occurs, the reserve battery in the electric power acquisition equipment starts power supply, and by the electric power acquisition equipment by the number It is written in corresponding minimum writing unit according to the latest data in buffer area.
Still further, the electric power acquisition equipment is detecting reserve battery not enough power supply and is sending the disconnection standby electricity Before the order of power supply is continued in pond, which executes the storage work to each data in the physical areas NandFlash Make.
Further, in the NandFlash data managing method of electric power acquisition equipment, the default time-write interval For 30s.
Further, in the NandFlash data managing method of electric power acquisition equipment, the minimum erasing cell block is 128K。
Further, in the NandFlash data managing method of electric power acquisition equipment, in the minimum erasing cell block Each writing unit be 512 bytes.
Further, in the NandFlash data managing method of electric power acquisition equipment, described first in step 3 is pre- If byte is 512 bytes.
Further, in the NandFlash data managing method of electric power acquisition equipment, described second in step 6 is pre- If byte is 512 bytes.
With improvement, in the NandFlash data managing method of electric power acquisition equipment, when used minimum erasing unit When block is damaged, then using next erasing cell block in the physical areas NandFlash, and by the electric power acquisition equipment Latest data in the data buffer area is written in the minimum writing unit in corresponding next erasing cell block.
Further, the ECC error correction in the NandFlash data managing method of electric power acquisition equipment, in the step 4 Using 1bit error correction.
Compared with the prior art, the advantages of the present invention are as follows: the present invention passes through the NandFlash object in electric power acquisition equipment The erasing cell block with minimum byte is searched and is chosen in reason area, and there is the erasing unit of minimum byte to wipe as minimum this Except cell block, after minimum erasing cell block is divided into N number of minimum writing unit, first writable unit is obtained, and will Data in data buffer area are saved in first writable unit, once the offset of first writable unit is N-1 When, then wipe the data in each minimum writing unit in minimum erasing cell block, and wipe from minimum in cell block the Restart to be written data cached at one minimum writing unit, reaches to each minimum writing unit around tail processing, thus More memory spaces are vacateed in NandFlash, avoid previous data from occupying the space of minimum erasing cell block, thus not only It can be to avoid continually storing data into NandFlash, but also the space utilization rate in the area NandFlash can be improved.
Detailed description of the invention
Fig. 1 is the NandFlash data managing method flow diagram of electric power acquisition equipment in the embodiment of the present invention.
Specific embodiment
The present invention will be described in further detail below with reference to the embodiments of the drawings.
As shown in Figure 1, in the present embodiment electric power acquisition equipment NandFlash data managing method, include the following steps:
Step 1, it is searched in the physical areas NandFlash of electric power acquisition equipment and chooses the erasing unit with minimum byte Block marks this to have the erasing cell block of minimum byte as minimum erasing cell block;
Step 2, minimum erasing cell block is divided into N number of minimum writing unit;Wherein, N >=1;Being somebody's turn to do in the present embodiment Minimum erasing cell block is 128K, and each writing unit in minimum erasing cell block is 512 bytes;Each minimum writing unit All in accordance with being sequentially numbered, for example, No. 1 minimum writing unit, No. 2 minimum writing units ..., No. N minimum writing unit;
Step 3, the data buffer area of the first preset byte is established in the physical areas NandFlash;Wherein, data buffer area It is made of Magic number, write-in number, data length, valid data area and ECC check code;The first preset byte herein is 512 Byte;
Step 4, electric power acquisition equipment is powering on and after program initialization, does carry operation;Wherein, it is calculated by ECC error correction Method reads the data in each minimum writing unit, and when any data read is full 0 xFF, then it is assumed that any number It is first writable unit according to affiliated minimum writing unit;Otherwise, each minimum write-in in minimum erasing cell block is single Data erasing in member, and will number near preceding one minimum writing unit as first writable unit;In the implementation In example, ECC error correction here uses 1bit error correction;
Step 5, it will need to do having in the data buffer area that the data that the period saves copy in the physical areas NandFlash Imitate data field;
Step 6, it calculates and is written to data length in step 5 in valid data area, count the data buffer area and be written into Total write-in number of data and generate the data buffer area preceding second preset byte ECC check code;Wherein, the present embodiment In the second preset byte be 512 bytes.
Step 7, that the data in data buffer area are written to above-mentioned first according to default time-write interval is writeable Enter in unit;For example, default time-write interval here is 30s, i.e., it will be in data buffer area with the time-write interval of 30s Data be written in first writable unit;
Step 8, when the number of first writable unit is N, then by minimum erasing cell block it is each most Data erasing in small writing unit, to vacate data space, and wiping the number in cell block from the minimum is 1 Restart to be written data cached at minimum writing unit, reaches to each minimum writing unit around tail processing;When this first When the number of writable unit is not N, it directly is written to first writable unit by data cached, while calculating next The number of writable unit;
Wherein, it is described as follows for the numbering of next writable unit described herein, it is assumed that by as first The number of the minimum writing unit of a writable unit is No. T, and minimum erasing cell block is divided into 5 minimum writing units, i.e. N =5;Such as No. T (T < 5) minimum writing unit is written into data, the number of next (or next) writable unit is T+1;
Once No. T (T=5) minimum writing unit is written into data, then next (or next) writable most small letter Entering element number is 1, because number numerical value at this time has been more than the maximum volume of the minimum writing unit in minimum erasing cell block Number, then just the data that the minimum is wiped in cell block in No. 1 minimum writing unit to No. 5 minimum writing units are all wiped Fall, restarts to be written;
Step 9, when needing to obtain newest storing data, then by the data in the valid data area in data buffer area It reads out;Otherwise, it is transferred to step 7.
As an improvement, in the NandFlash data managing method of the present embodiment, once electric power acquisition equipment is detecting When power down occurs, the reserve battery in the electric power acquisition equipment starts power supply, and by the electric power acquisition equipment by data buffer area Interior latest data is written in corresponding minimum writing unit.
Certainly, it powers when being mainly used for emergency due to the electricity of reserve battery to electric power acquisition equipment, so, in order to standby Data are saved when with battery not enough power supply in time, the present embodiment also takes electric power acquisition equipment and detecting reserve battery electricity Amount is insufficient and sends before disconnecting the order that the reserve battery continues power supply, which executes to stating NandFlash The emergency of the storage work of each data saves measure in physical areas.
It should be noted that by electric power acquisition equipment NandFlash search physical areas and choose have most small character The erasing cell block of section, and there is the erasing unit of minimum byte to wipe cell block as minimum this, it is wiped by the minimum After cell block is divided into N number of minimum writing unit, first writable unit is obtained, and the data in data buffer area are saved in First writable unit is then wiped in minimum erasing cell block when the offset of first writable unit is N-1 Each minimum writing unit in data, and restart from first minimum writing unit in minimum erasing cell block It is written data cached, reaches to each minimum writing unit around tail processing, so that it is empty to vacate more storages in NandFlash Between, avoid previous data from occupying the space of minimum erasing cell block, it thus not only can be to avoid continually storing data into In NandFlash, but also the space utilization rate in the area NandFlash can be improved.
Certainly, in the NandFlash data managing method of the electric power acquisition equipment of the present embodiment, electric power acquisition equipment tool There is bad block management mechanism, i.e., when used minimum erasing cell block is damaged, then using in the physical areas NandFlash Next erasing cell block, and the latest data in the data buffer area is written to corresponding be somebody's turn to do by the electric power acquisition equipment In minimum writing unit in next erasing cell block.

Claims (10)

1. a kind of NandFlash data managing method of electric power acquisition equipment, which comprises the steps of:
Step 1, the erasing cell block with minimum byte is searched and chooses in the physical areas NandFlash of electric power acquisition equipment, This is marked to have the erasing cell block of minimum byte as minimum erasing cell block;
Step 2, the minimum erasing cell block is divided into N number of minimum writing unit;Wherein, N >=1;
Step 3, the data buffer area of the first preset byte is established in the physical areas NandFlash;Wherein, the data buffer area It is made of Magic number, write-in number, data length, valid data area and ECC check code;
Step 4, the electric power acquisition equipment is powering on and after program initialization, does carry operation;Wherein, it is calculated by ECC error correction Method reads the data in each minimum writing unit, and when any data read is full 0 xFF, then it is assumed that any data institute The minimum writing unit of category is first writable unit;It otherwise, will be in each minimum writing unit in minimum erasing cell block Data erasing, and will number near preceding one minimum writing unit as first writable unit;
Step 5, the data for needing to do period preservation are copied into having in the data buffer area in the physical areas NandFlash Imitate data field;
Step 6, data length, the statistical data buffer area being written in valid data area described in step 5 are calculated and is written into number According to total write-in number and generate the ECC check code of the second preset byte before the data buffer area;
Step 7, the data in data buffer area are written to first writable unit according to default time-write interval It is interior;
Step 8, when the offset of first writable unit is N, then each minimum write-in in minimum erasing cell block is single Data erasing in member, and restart write-in caching number from first minimum writing unit in minimum erasing cell block According to;Otherwise, it directly is written to first writable unit by data cached, while calculates the volume of next writable unit Number;
Step 9, when needing to obtain newest storing data, then by the reading data in the valid data area in data buffer area Out;Otherwise, it is transferred to step 7.
2. NandFlash data managing method according to claim 1, which is characterized in that the electric power acquisition equipment is being examined It measures when power down occurs, the reserve battery in the electric power acquisition equipment starts power supply, and by electric power acquisition equipment by data buffer storage Latest data in area is written in corresponding minimum writing unit.
3. NandFlash data managing method according to claim 1, which is characterized in that the default time-write interval For 30s.
4. NandFlash data managing method according to claim 1, which is characterized in that the minimum wipes cell block and is 128K。
5. NandFlash data managing method according to claim 4, which is characterized in that in the minimum erasing cell block Each writing unit be 512 bytes.
6. NandFlash data managing method according to claim 5, which is characterized in that described first in step 3 is default Byte is 512 bytes.
7. NandFlash data managing method according to claim 1, which is characterized in that described second in step 6 is default Byte is 512 bytes.
8. NandFlash data managing method according to claim 1, which is characterized in that when used minimum erasing is single When first block is damaged, then using next erasing cell block in the physical areas NandFlash, and set by the electric power acquisition The standby minimum writing unit being written to the latest data in the data buffer area in corresponding next erasing cell block In.
9. NandFlash data managing method according to claim 8, which is characterized in that the ECC error correction in the step 4 Using 1bit error correction.
10. NandFlash data managing method according to claim 2, which is characterized in that the electric power acquisition equipment is being examined It measures reserve battery not enough power supply and sends before disconnecting the order that the reserve battery continues power supply, which executes Storage work to each data in the physical areas NandFlash.
CN201811382073.6A 2018-11-20 2018-11-20 NandFlash data management method of power acquisition equipment Active CN109558080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811382073.6A CN109558080B (en) 2018-11-20 2018-11-20 NandFlash data management method of power acquisition equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811382073.6A CN109558080B (en) 2018-11-20 2018-11-20 NandFlash data management method of power acquisition equipment

Publications (2)

Publication Number Publication Date
CN109558080A true CN109558080A (en) 2019-04-02
CN109558080B CN109558080B (en) 2022-04-22

Family

ID=65866601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811382073.6A Active CN109558080B (en) 2018-11-20 2018-11-20 NandFlash data management method of power acquisition equipment

Country Status (1)

Country Link
CN (1) CN109558080B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110736873A (en) * 2019-10-29 2020-01-31 宁波三星医疗电气股份有限公司 clock repairing method, power terminal and power system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858703A (en) * 2005-10-13 2006-11-08 华为技术有限公司 Starting method of device
CN103838526A (en) * 2014-03-31 2014-06-04 广州华欣电子科技有限公司 Method and device for writing data in memory chip
CN104063186A (en) * 2014-06-30 2014-09-24 成都万维图新信息技术有限公司 Data access method of electronic equipment
US20150347025A1 (en) * 2014-05-27 2015-12-03 Kabushiki Kaisha Toshiba Host-controlled garbage collection
CN106354662A (en) * 2015-07-17 2017-01-25 陕西千山航空电子有限责任公司 NAND FLASH data storage method
CN107608906A (en) * 2017-09-26 2018-01-19 北京智芯微电子科技有限公司 The method for reducing in-chip FLASH erasing times

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858703A (en) * 2005-10-13 2006-11-08 华为技术有限公司 Starting method of device
CN103838526A (en) * 2014-03-31 2014-06-04 广州华欣电子科技有限公司 Method and device for writing data in memory chip
US20150347025A1 (en) * 2014-05-27 2015-12-03 Kabushiki Kaisha Toshiba Host-controlled garbage collection
CN104063186A (en) * 2014-06-30 2014-09-24 成都万维图新信息技术有限公司 Data access method of electronic equipment
CN106354662A (en) * 2015-07-17 2017-01-25 陕西千山航空电子有限责任公司 NAND FLASH data storage method
CN107608906A (en) * 2017-09-26 2018-01-19 北京智芯微电子科技有限公司 The method for reducing in-chip FLASH erasing times

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110736873A (en) * 2019-10-29 2020-01-31 宁波三星医疗电气股份有限公司 clock repairing method, power terminal and power system

Also Published As

Publication number Publication date
CN109558080B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
CN102081577B (en) Data storage structure of Flash memory and data manipulation mode thereof
US9355028B2 (en) Data-storage device and flash memory control method
CN100576342C (en) A kind of high-capacity FLASH solid memory controller
CN106776376B (en) Buffer storage supervisory method, memorizer control circuit unit and storage device
US7934130B2 (en) System and method for managing non-volatile memory based on health
CN104834608A (en) Cache replacement method under heterogeneous memory environment
CN104220991A (en) Architecture to allow efficient storage of data on nand flash memory
CN107992430A (en) Management method, device and the computer-readable recording medium of flash chip
CN106407224A (en) Method and device for file compaction in KV (Key-Value)-Store system
CN106020735A (en) Data storage method and device
CN108710583A (en) Management method, device, computer equipment and the medium in SSD write buffers area
CN109213690A (en) A kind of method for reconstructing and relevant apparatus of L2P table
CN202472635U (en) Flash memory wear leveling device
CN102929794A (en) Storage method for electrically erasable programmable read only memory (EEPROM)
CN109445987A (en) A kind of SSD powered-off fault restoration methods and its system based on block growth record
CN104166627B (en) A kind of SCM Based NAND FLASH write operation methods
CN104881366A (en) Heal Leveling Method And System
CN109669889B (en) Light Nor Flash control method and device
CN109558080A (en) A kind of NandFlash data managing method of electric power acquisition equipment
CN103020077A (en) Method for managing memory of real-time database of power system
CN114089915B (en) File additional writing operation method and device based on FLASH memory
US11079956B2 (en) Storage system and storage control method
US20100161937A1 (en) Memory system and computer system
CN101794255B (en) Paperless recorder and method for storing data of same
CN109324929A (en) A kind of snapshot creation method, device, equipment and readable storage medium storing program for executing

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
GR01 Patent grant
GR01 Patent grant