CN108279852A - Method for improving NORFLASH service lifes in intelligent electric energy meter - Google Patents

Method for improving NORFLASH service lifes in intelligent electric energy meter Download PDF

Info

Publication number
CN108279852A
CN108279852A CN201711446814.8A CN201711446814A CN108279852A CN 108279852 A CN108279852 A CN 108279852A CN 201711446814 A CN201711446814 A CN 201711446814A CN 108279852 A CN108279852 A CN 108279852A
Authority
CN
China
Prior art keywords
data
sector
norflash
sectors
sliding
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
CN201711446814.8A
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 Hengye Electronic Co Ltd
Original Assignee
Zhejiang Hengye Electronic 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 Zhejiang Hengye Electronic Co Ltd filed Critical Zhejiang Hengye Electronic Co Ltd
Priority to CN201711446814.8A priority Critical patent/CN108279852A/en
Publication of CN108279852A publication Critical patent/CN108279852A/en
Pending legal-status Critical Current

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • 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/0638Organizing or formatting or addressing of data
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-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)
  • Read Only Memory (AREA)

Abstract

The invention discloses a kind of methods for improving NORFLASH service lifes in intelligent electric energy meter, include the following steps:Sector divides, and sector is divided into N number of sliding sector and buffer sectors, the round numbers of N >=1;Data are written, and first sliding sector is write data into after wiping first sliding sector, erasing and the data write-in of next sliding sector are carried out after writing completely successively, until being filled with all sliding sectors;The startup of buffer sectors wipes buffer sectors before new data is written;New data is written, and writes new data into buffer sectors, until being filled with entire buffer sectors;Data are deleted, and the data in first sector are deleted;Current latest data write-in, repeats step 25 and latest data is written in sector.Present invention reduces the erasing times of sector, the time of every data write-in is saved, a traditional sector is avoided and how many data write must undergo the reading rewriting of the entire sector of this how many times and nuzzle up journey so that entire NORFLASH service lifes greatly improve.

Description

Method for improving NORFLASH service lifes in intelligent electric energy meter
Technical field
The invention belongs to technical field of power systems, and in particular to one kind carries in being realized for intelligent electric energy meter load record The method of high NORFLASH service lifes.
Background technology
In order to effectively record data in intelligent electric meter, need that corresponding storage load record is arranged in electric energy meter.Needle at present Load record storage to intelligent electric meter, national grid is " load record to the load record memory requirement of intelligent electric energy meter Memory space should at least ensure record forward and reverse active total electric energy, idle total electric energy, four-quadrant is idle and interval time be 1 point 40 days data volumes are no less than in the case of clock ".Amount of storage calculates as follows:32*24*60*40=1843200B=1.76M therefore The general NORFLASH chips for selecting 4M capacity can meet above-mentioned memory requirement.And NORFLASH write the characteristics of data be Data are wiped before writing data, and the minimum data block of its operation is 1 sector, therefore mostly use side below in the prior art Method is handled:
The data first read in original block or sector are gone to ram buffer, are then revised as new data, and state's net provides Load record data will ensure that newest N datas can be read at any time, therefore often write a data and be intended to original sector first In data reading backup in RAM, after having changed a data in RAM, wipe that sector, then amended data are read Go out to be written in RAM and go repeatedly, until the new data in entire sector is write completely.
But the above method often writes a data in this way, is just subjected to read (NORFLASH) -- changing (RAM) -- wiping (NORFLASH) -- (NORFLASH) process is write, the writeable how many data in sector must undergo this how many times and read -- changing -- Write -- it wipes, namely how many times is wiped to NORFLASH, therefore read, change, writing, wiping and do not only take up regular hour and space, it more can be right The erasing and writing life of the limit 100,000 times of NORFLASH can cause damages.
Invention content
The purpose of the present invention is to solve the above problems, provide during one kind is realized for intelligent electric energy meter load record and carry The method of high NORFLASH service lifes can be greatly decreased the number of the sectors erasing NORFLASH, improve making for NORFLASH Use the service life.
In order to reach foregoing invention purpose, the present invention uses following technical scheme:
Method for improving NORFLASH service lifes in intelligent electric energy meter, includes the following steps:
1, sector divides, and sector is divided into N number of sliding sector and buffer sectors, the round numbers of N >=1;
2, data are written, and first sliding sector is write data into after wiping first sliding sector, write it is full after successively into The erasing and data write-in of the next sliding sector of row, until being filled with all sliding sectors;
3, the startup of buffer sectors wipes buffer sectors before new data is written;
4, new data is written, and writes new data into buffer sectors, until being filled with entire buffer sectors;
5, data are deleted, and delete the data in first sector;
6, current latest data write-in repeats step 2-5 and latest data is written in sector.
Further, the step 1 further includes, and initializes NORFLASH, head pointer Head and tail pointer Tail are set to- 1, first sector of data will be written in erasing.
Further, the step 2 specifically includes, and S1, setting head pointer Head are 0, tail pointer Tail is n, the roundings of n >=1 Number;Data are not filled with also, do not recycle storage, until data write completely all sliding sectors.
Further, the step 2 further includes, S2, after data write completely all sliding sectors, and setting head pointer Head is 1, setting tail pointer Tail is the last item data MAX'sNext positionThat is MAX+1.
Further, the step 3 includes wiping and starting buffer sectors, willNew dataBuffer sectors are written to, until The data storage of buffer sectors is full, and setting head pointer Head is n, and tail pointer Tail is Head+Max.
Further, the step 6 is specifically, write-in latest data to the first sector, is often written one, accordingly end to end Pointer also moves down a position therewith.
Further, the buffer sectors are on-fixed sector, are to slide sector relative to occupied by newest MAX datas Except another sector.
Further, any one described sliding sector, the storage size of buffer sectors are identical.
Further, the data of any one sliding sector storage are load record data, the load record data For same type or different type.
Further, the data of the alternate sector storage are load record data, and the load record data are same class Type or different type.
Compared with prior art, the present invention advantageous effect is:
1. reducing the erasing times of sector, traditional data record often writes a data and is required for wiping primary entire The sectors NORFLASH, and the present invention is used for a plurality of data in the same sector of write-in, as long as wiping a NORFLASH Row;
2. saving the time of every data write-in, the time used greatly shortens the process for be written per data more Simply, the write-in of single data needs multiple steps for wiping-write by read-alter-in traditional approach, using the present invention for The write-in of arbitrary a data in the same sector of NORFLASH only needs to wipe primary, a plurality of data dependence before writing According to sequentially writing direct until writing the sector at completely entire place just, the single data write-in time used greatly shortens;
3. avoiding a traditional sector writes that how many data must undergo the reading of the entire sector of this how many times -- changing -- Write -- journey of nuzzling up so that entire NORFLASH service lifes greatly improve;
4. the newest several load record data of division Coutinuous store according to each sector, meet national grid requirement The requirement of newest several numbers load record data can be read by the load record period at any time so that memory space has obtained very well Utilization.
Description of the drawings
Fig. 1 is the main-process stream schematic diagram of the write-in sector of the load record data of the present invention.
Fig. 2 is that the NORFLASH of the present invention initializes schematic diagram.
Fig. 3 is the storage section schematic diagram data of the present invention.
Fig. 4 is that the data of the present invention are filled with space enabling buffer sectors schematic diagram.
Fig. 5 is that the buffer sectors of the present invention initialize schematic diagram.
Fig. 6 starts the cycle over record schematic diagram for the present invention's.
Fig. 7 is the schematic diagram of the embodiment of the present invention 2.
Specific implementation mode
Explanation is further described to technical scheme of the present invention below by specific embodiment.
Embodiment 1
Present embodiment discloses a kind of method for improving NORFLASH service lifes in intelligent electric energy meter, entire methods Flow chart as shown in Figure 1, including the following steps:
1. sector is divided into several sliding sectors and buffer sectors, NORFLASH is first initialized, and by head pointer Head and tail pointer Tail is set to -1, and first sector of data, data, that is, writable, the step such as Fig. 2 will be written in erasing It is shown;
2. when data also do not write full designated sector number, head pointer Head is 0 (being directed toward the first data), tail pointer Tail For n (being directed toward nth bar data), the round numbers of n >=1 when data are not filled with also, does not recycle storage, and the step is as shown in Figure 3;
3. when data write full designated sector number, head pointer Head is 1 (the first data for being directed toward current state), and tail refers to Needle Tail is next position of (current state) the last item data MAX, i.e. MAX+1, data, which have been write, at this time expires last A sector starts buffer sectors, i.e. alternate sector, buffer sectors is wiped before new data is written.The step is as shown in Figure 4;
4. data are persistently written to buffer sectors, until the data storage of buffer sectors is full, head pointer Head is that n (is directed toward The first data under current state), tail pointer Tail is Head+Max (being directed toward the last item data under current state).It should Step is as shown in Figure 5;
5. buffer sectors are recycled with first sector formation sequence, former first sector data is wiped, write-in new data to the One sector is often written one, and pointer also moves down a position therewith end to end accordingly;In this way, load record data start the cycle over Storage.The step is as shown in Figure 6.
Data write-in in above-mentioned steps 2 writes data into first sliding fan after wiping first sliding sector first Area is filled with first sliding sector;Then N number of sliding sector is wiped and is written one by one successively, until being filled with entire sliding sector.
The present embodiment solves the problems, such as that traditional single data storage just needs single to wipe entire sector, avoids and deposits every time Sector erasable serious the problem of reducing the service life repeatedly when storing up a data, using the method for " sliding sector+alternate sector ", Specifically using memory space=+ 1 sector of data occupancy sector number is opened up, there are one sectors forever when such datacycle stores Spare, after the sector is filled with can storage of the entire sector erasing without influencing normal data, while in storage data Shi Caiyong end to end move to ensure newest N items (round numbers of N >=1) data of storage by the corresponding of pointer.Especially to illustrate that The spare sector is not fixed a certain sector, be relative to another sector except sector occupied by newest N datas, Its essence is buffer sectors, are judged new and old sector with the movement of pointer end to end and relationship, often detect old sector and are remained with When newest N items (round numbers of N >=1) data, then often wiped once before carrying out write-in new data to old sector.In addition, all The sector i.e. size of the memory space of any one sliding sector and alternate sector is the same.And any one sliding sector Load record data with alternate sector can be of a sort, can also be inhomogeneous.
Embodiment 2
Concrete numerical value example explanation is lifted, referring to Fig. 7 embodiment schematic diagrams, with using the NORFLASH cores of MX25L3206EM2I Piece, it is assumed that by taking the load record of the total electric energy of the presence or absence of three-phase intelligent electric-energy meter work(as an example, 16Byte, the core are occupied per data The total memory space of piece is 4096K Bytes, is made of 1024 sectors, and the capacity of each sector is 4096Bytes, then a fan Area can store 4096/16=256 datas, and assume that state's net requires such data that should be able to store newest 512 load records, because It is 512/256=2 sector that sector is opened up needed for this.
256 new datas are such as written again after writing full 512 datas, is calculated, is then needed altogether by original technology method It is 2+256=258 times to wipe the sectors NORFLASH, and the method for using the invention uses buffer sectors, then wipes altogether The sectors NORFLASH only need 3 times, and erasing times are the 3/258=1/86 of original technology, greatly reduce NORFLASH fans The erasing times in area, to improve the service life of NORFLASH.
It is above the preferred embodiment of the present invention, protection scope of the present invention is not limited, for people in the art The deformation and improvement that member's mentality of designing according to the present invention is made, all should be considered as within protection scope of the present invention.

Claims (10)

1. the method for improving NORFLASH service lifes in intelligent electric energy meter, includes the following steps:
1, sector divides, and sector is divided into N number of sliding sector and buffer sectors, the round numbers of N >=1;
2, data are written, and write data into first sliding sector after wiping first sliding sector, are carried out down successively after writing completely One erasing for sliding sector and data write-in, until being filled with all sliding sectors;
3, the startup of buffer sectors wipes buffer sectors before new data is written;
4, new data is written, and writes new data into buffer sectors, until being filled with entire buffer sectors;
5, data are deleted, and delete the data in first sector;
6, current latest data write-in repeats step 2-5 and latest data is written in sector.
2. the method according to claim 1 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In the step 1 further includes initializing NORFLASH, head pointer Head and tail pointer Tail is set to -1, erasing will be written First sector of data.
3. the method according to claim 1 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In, the step 2 specifically includes,
S1, setting head pointer Head are 0, tail pointer Tail is n, the round numbers of n >=1;Data are not filled with also, do not recycle storage, directly Completely all sliding sectors are write to data.
4. the method according to claim 3 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists Further include in, the step 2,
S2, after data write completely all sliding sectors, setting head pointer Head is 1, and setting tail pointer Tail is the last item number According to next position, that is, MAX+1 of MAX.
5. the method according to claim 4 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In the step 3 includes wiping and starting buffer sectors, is write new data into buffer sectors, until the data of buffer sectors Storage is full, and setting head pointer Head is n, and tail pointer Tail is Head+Max.
6. according to any methods for improving NORFLASH service lifes in intelligent electric energy meter of claim 1-5, Be characterized in that, the step 6 specifically, write-in latest data is often written one to the first sector, accordingly end to end pointer also with Move down a position.
7. the method according to claim 5 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In the buffer sectors are on-fixed sector, are relative to another fan slided occupied by newest MAX datas except sector Area.
8. the method according to claim 1 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In any one described sliding sector, the storage size of buffer sectors are identical.
9. the method according to claim 1 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In, it is described any one sliding sector storage data be load record data, the load record data be same type or Different type.
10. the method according to claim 1 for improving NORFLASH service lifes in intelligent electric energy meter, feature exists In the data of the alternate sector storage are load record data, and the load record data are same type or different type.
CN201711446814.8A 2017-12-27 2017-12-27 Method for improving NORFLASH service lifes in intelligent electric energy meter Pending CN108279852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711446814.8A CN108279852A (en) 2017-12-27 2017-12-27 Method for improving NORFLASH service lifes in intelligent electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711446814.8A CN108279852A (en) 2017-12-27 2017-12-27 Method for improving NORFLASH service lifes in intelligent electric energy meter

Publications (1)

Publication Number Publication Date
CN108279852A true CN108279852A (en) 2018-07-13

Family

ID=62802487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711446814.8A Pending CN108279852A (en) 2017-12-27 2017-12-27 Method for improving NORFLASH service lifes in intelligent electric energy meter

Country Status (1)

Country Link
CN (1) CN108279852A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597580A (en) * 2018-12-03 2019-04-09 烟台东方威思顿电气有限公司 Flash operating method suitable for the storage of intelligent electric meter load curve
CN111208950A (en) * 2020-01-15 2020-05-29 山西银河电子设备厂 Method for improving NORFLASH service cycle based on single chip microcomputer
CN115470216A (en) * 2022-11-01 2022-12-13 安徽南瑞中天电力电子有限公司 FTL-based intelligent Internet of things table storage management method and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007219793A (en) * 2006-02-16 2007-08-30 Matsushita Electric Ind Co Ltd Writing method of flash memory
CN101551780A (en) * 2008-12-29 2009-10-07 深圳创维-Rgb电子有限公司 Television and data storage method and device thereof
CN102306125A (en) * 2011-08-17 2012-01-04 深圳市共进电子股份有限公司 Method for erasing and writing data of FLASH memory
CN104461917A (en) * 2014-12-05 2015-03-25 宁波新尚智能电气有限公司 Nor Flash-based regional cycle storage method
CN104598388A (en) * 2015-01-06 2015-05-06 青岛龙庆达电气有限公司 Flash-based SOE (Sequence of Event) storing and sending method
CN104794065A (en) * 2015-05-04 2015-07-22 常州工学院 Multi-group fixed length data circulation access method
US20160306552A1 (en) * 2015-04-20 2016-10-20 Nimble Storage, Inc. Low write amplification in solid state drive

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007219793A (en) * 2006-02-16 2007-08-30 Matsushita Electric Ind Co Ltd Writing method of flash memory
CN101551780A (en) * 2008-12-29 2009-10-07 深圳创维-Rgb电子有限公司 Television and data storage method and device thereof
CN102306125A (en) * 2011-08-17 2012-01-04 深圳市共进电子股份有限公司 Method for erasing and writing data of FLASH memory
CN104461917A (en) * 2014-12-05 2015-03-25 宁波新尚智能电气有限公司 Nor Flash-based regional cycle storage method
CN104598388A (en) * 2015-01-06 2015-05-06 青岛龙庆达电气有限公司 Flash-based SOE (Sequence of Event) storing and sending method
US20160306552A1 (en) * 2015-04-20 2016-10-20 Nimble Storage, Inc. Low write amplification in solid state drive
CN104794065A (en) * 2015-05-04 2015-07-22 常州工学院 Multi-group fixed length data circulation access method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109597580A (en) * 2018-12-03 2019-04-09 烟台东方威思顿电气有限公司 Flash operating method suitable for the storage of intelligent electric meter load curve
CN109597580B (en) * 2018-12-03 2021-10-29 烟台东方威思顿电气有限公司 Flash operation method suitable for intelligent electric meter load curve storage
CN111208950A (en) * 2020-01-15 2020-05-29 山西银河电子设备厂 Method for improving NORFLASH service cycle based on single chip microcomputer
CN115470216A (en) * 2022-11-01 2022-12-13 安徽南瑞中天电力电子有限公司 FTL-based intelligent Internet of things table storage management method and storage medium

Similar Documents

Publication Publication Date Title
CN106527969B (en) A kind of Nand Flash memorizer reading/writing method in a balanced way of life-span
CN104423894B (en) Data memory device and method for controlling flash memory
CN102508788B (en) SSD (solid state drive) and SSD garbage collection method and device
CN100580811C (en) Dirty block recovery method for flash memory device
CN101908368A (en) Electronic storage device and operation method thereof
CN104298606A (en) Garbage collection action control method in SSD
CN108279852A (en) Method for improving NORFLASH service lifes in intelligent electric energy meter
CN101493794A (en) Flash memory data processing method and device
CN102841851A (en) Flash memory management method and flash memory device
CN106354658B (en) A method of it reducing mapping table memory source in mixed-use developments algorithm and occupies
CN104516959A (en) Method and device for managing database logs
CN105204783B (en) A kind of solid-state disk rubbish recovering method based on data lifetime
CN103970669A (en) Method for accelerating physical-to-logic address mapping of recycling operation in solid-state equipment
CN1351350A (en) Method for partitioning memory block and identifying R/W information in flash memory
CN101324899B (en) Method for rapidly writing NAND type FLASH
CN105955669A (en) Method for improving writing performance of solid-state hard disk
CN106951193B (en) Improve the method and its system of Nand Flash storage performance
CN101819821A (en) Dynamic loss balancing method for solid state disk
CN104391804B (en) A kind of NAND flash data storage methods
CN101894077B (en) Data storage method and system
CN110489050A (en) The programmed method of data memory device and system information
CN105653466A (en) Data storage device and flash memory control method
CN105630406B (en) Using MRAM as the storage system of editor's buffer area and editor's caching method
CN108664215B (en) Data storage device and operation method thereof
CN102662849A (en) Method for managing blocks of multichannel flash memory

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