CN107861687A - The method that the step-by-step storage of ammeter electricity decimal is realized in FLASH memory - Google Patents
The method that the step-by-step storage of ammeter electricity decimal is realized in FLASH memory Download PDFInfo
- Publication number
- CN107861687A CN107861687A CN201710957694.1A CN201710957694A CN107861687A CN 107861687 A CN107861687 A CN 107861687A CN 201710957694 A CN201710957694 A CN 201710957694A CN 107861687 A CN107861687 A CN 107861687A
- Authority
- CN
- China
- Prior art keywords
- decimal
- piece
- electricity
- data
- write
- 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
Links
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/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0608—Saving storage space on storage systems
-
- 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/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
-
- 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
-
- 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/064—Management of blocks
-
- 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/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/065—Replication mechanisms
-
- 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/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- 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)
- Read Only Memory (AREA)
Abstract
The invention discloses a kind of method for the step-by-step storage that ammeter electricity decimal is realized in FLASH memory, comprise the following steps:All memory spaces of electricity decimal are divided into M pages, every page has I blocks, shares N blocks, wherein, N=M × I;Each piece is 99 positions, and the decimal 0.01 to 0.99 of electricity is respectively allocated into above-mentioned 99 positions;Stored from the first BOB(beginning of block), often increase by 0.01 degree is sequentially written in 1 by from a high position to low level, writes full 99 and writes first piece;Change to second piece after being write when first piece, second piece write after change to the 3rd piece, first piece is changed to after writing nth block and continues to write.The present invention has the advantages that:Memory space is saved, ensure that accumulative precision;Wipe and write by the way of paging piecemeal, overcome the shortcomings that just being write after FLASH need to be wiped, while data backup can be carried out, improve reliability.
Description
Technical field
The present invention relates to electrical energy meter electricity energy decimal technical field of memory, electricity decimal 0.01 is ensure that more particularly, to one kind
Degree accumulative precision, save memory space, at the same have data backup act on ammeter electricity is realized in FLASH memory
The method of the step-by-step storage of decimal.
Background technology
Producer is all that decimal is stored in EEPROM by byte mostly at present, but due to ammeter service life 10 years and
The reason for 0.01 degree of storage precision, generally require to distribute very big memory space, thus need using Large Copacity
EEPROM, so as to increase product cost.Also it is that electricity decimal is stored in FLASH by byte to have indivedual producers, because FLASH is deposited
The reservoir life-span is relatively low and the reason for whole page is erasable, can not also be reduced the purpose of memory space.
The content of the invention
The present invention ensures the memory space of the accumulative precision storage needs of 0.01 degree of electricity decimal in order to overcome in the prior art
Big deficiency, it is proposed that a kind of accumulative precision that ensure that 0.01 degree of electricity decimal, save memory space, while there are data
The method of the step-by-step that ammeter electricity decimal is realized in the FLASH memory storage of backup effect.
To achieve these goals, present invention employs following technical scheme:
A kind of method for the step-by-step storage that ammeter electricity decimal is realized in FLASH memory, comprises the following steps:
All memory spaces of electricity decimal are divided into M pages by (1-1), and every page has I blocks, share N blocks, wherein, N=M ×
I;
Each piece of (1-2) is 99 positions, the decimal 0.01 to 0.99 of electricity is respectively allocated into above-mentioned 99 positions;
(1-3) stores from the first BOB(beginning of block), and often increase by 0.01 degree is sequentially written in 1 by from a high position to low level, writes full 99
Write first piece;
(1-4) changes to second piece after being write when first piece, second piece write after change to the 3rd piece, after writing nth block
It is transferred to (1-3).
The present invention distributes position come storing electricity decimal by being every 0.01 degree, and is entered by way of paging piecemeal
Row write enters and wiped, and saves space, ensure that 0.01 degree of accumulative precision.
Preferably, also comprise the following steps:
(2-1) wipes the second page data when writing the I block of first page, when writing the I block of second page, erasing
3rd page data, when writing the M pages of I block, the first page data is wiped, is transferred to (1-3) after the M pages of I block writes.
Preferably, also comprise the following steps:
(3-1) carries out data check and recovery when electricity decimal occurs abnormal.
Preferably, data check comprises the following steps that with what is recovered:
(4-1) carries out forward lookup, is searched for since the 1st, untill searching certain position as 0, obtains the position that value is 1
Number be N1;
(4-2) carries out reverse search, is searched for since the 99th, and untill searching certain position as 1, it is 0 to obtain value
The number of position is N2;
(4-3) is if during N1+N2=99, it is believed that data are effective, recover data record;If N1+N2 ≠ 99, think several
According to invalid, electricity decimal is set to 0.
Preferably, when carrying out electric quantity data write-in, byte offsets Y, position offset Z are calculated according to current decimal X
It is as follows with presently written byte data L, calculation formula:
Y=(X × 100-1) ÷ 8, round in Y-direction;
Z=(X × 100) %8;
If Z=0, hexadecimal number 0x80 is moved to right 7 as presently written byte data L;
If Z ≠ 0, hexadecimal number 0x80 is moved to right into (Z-1) position as presently written byte data L.
Therefore, the present invention has the advantages that:(1) carry out storing electricity decimal for one position of every 0.01 degree distribution, save
Memory space has been saved, ensure that accumulative precision;(2) wipe and write by the way of paging piecemeal, overcoming FLASH needs to wipe
The shortcomings that just writing afterwards, while data backup can be carried out;(3) verification data is being combined just by forward lookup and reverse search
True property, improves reliability.
Brief description of the drawings
Fig. 1 is the memory space of all electricity decimals of the present invention;
Fig. 2 is the memory space of one piece of electricity decimal of the present invention;
Fig. 3 is a kind of flow chart of embodiments of the invention.
Embodiment
The present invention is described further with embodiment below in conjunction with the accompanying drawings:
Embodiment as shown in Figure 1, Figure 2 and Figure 3 is a kind of step-by-step that ammeter electricity decimal is realized in FLASH memory
The method of storage, comprises the following steps:
Step 100, paging piecemeal is carried out to all memory spaces of electricity decimal
As shown in figure 1, all memory spaces of electricity decimal are divided into page 8, every page has 16 pieces, shares 128 pieces, its
In, N=M × I=8 × 16=128;
Step 200, the memory space of one piece of electricity decimal is distributed
As shown in Fig. 2 each piece is 99 positions, the decimal 0.01 to 0.99 of electricity is respectively allocated to above-mentioned 99 positions;
Step 300, the storage and erasing of electricity decimal
Step 301, stored from the first BOB(beginning of block), often increase by 0.01 degree is sequentially written in 1 by from a high position to low level, writes full 99
Position writes first piece;
Step 302, second piece that first page is changed to after writing for first piece of first page, after second piece of first page writes
Change to first page the 3rd piece, when writing the 16th piece of first page, the second page data is wiped, the 16th piece when first page writes
Change to second page afterwards first piece, when writing the 16th piece of page 8, the first page data is wiped, the 16th piece when page 8 is write
Step 301 is transferred to after complete.
If occurring exception when electricity decimal is 0.34, data check is carried out, is comprised the following steps that:
Forward lookup is carried out, is searched for since the 1st, untill searching certain position as 0, obtains for the position that value is 1
Number is 34;
Reverse search is carried out, is searched for since the 99th, untill searching certain position as 1, obtains for the position that value is 0
Number is 65;
N1+N2=34+65=99, data are effective, recover data record.
When carrying out electric quantity data write-in, according to current decimal 0.34 calculating byte offsets Y, position offset Z and currently
The byte data L of write-in, calculation formula are as follows:
If Z=0, hexadecimal number 0x80 is moved to right 7 as presently written byte data L;
If Z ≠ 0, hexadecimal number 0x80 is moved to right into (Z-1) position as presently written byte data L.
Y=(X × 100-1) ÷ 8=(0.34 × 100-1) ÷ 8=5, round in Y-direction, byte offsets 5;
Z=(X × 100) %8=(0.34 × 100) %8=2, Z ≠ 0, (Z-1)=2-1 is moved to right by hexadecimal number 0x80
=1 is 01000000 as presently written byte data L, presently written byte data L.
It should be understood that the present embodiment is only illustrative of the invention and is not intended to limit the scope of the invention.In addition, it is to be understood that
After having read the content of the invention lectured, those skilled in the art can make various changes or modifications to the present invention, these etc.
Valency form equally falls within the application appended claims limited range.
Claims (5)
- A kind of 1. method for the step-by-step storage that ammeter electricity decimal is realized in FLASH memory, it is characterised in that including as follows Step:All memory spaces of electricity decimal are divided into M pages by (1-1), and every page has I blocks, share N blocks, wherein, N=M × I;Each piece of (1-2) is 99 positions, the decimal 0.01 to 0.99 of electricity is respectively allocated into above-mentioned 99 positions;(1-3) stores from the first BOB(beginning of block), and often increase by 0.01 degree is sequentially written in 1 by from a high position to low level, writes full 99 and writes Complete first piece;(1-4) changes to second piece after being write when first piece, second piece write after change to the 3rd piece, be transferred to after writing nth block (1-3)。
- 2. the method for the step-by-step storage according to claim 1 that ammeter electricity decimal is realized in FLASH memory, it is special Sign is, also comprises the following steps:(2-1) wipes the second page data when writing the I block of first page, when writing the I block of second page, erasing the 3rd Page data, when writing the M pages of I block, the first page data is wiped, is transferred to (1-3) after the M pages of I block writes.
- 3. the method for the step-by-step storage according to claim 1 that ammeter electricity decimal is realized in FLASH memory, it is special Sign is, also comprises the following steps:(3-1) carries out data check and recovery when electricity decimal occurs abnormal.
- 4. the method for the step-by-step storage according to claim 3 that ammeter electricity decimal is realized in FLASH memory, it is special Sign is that data check comprises the following steps that with what is recovered:(4-1) carries out forward lookup, is searched for since the 1st, untill searching certain position as 0, obtains for the position that value is 1 Number is N1;(4-2) carries out reverse search, is searched for since the 99th, untill searching certain position as 1, obtains the position that value is 0 Number is N2;(4-3) is if during N1+N2=99, it is believed that data are effective, recover data record;If N1+N2 ≠ 99, think data without Effect, 0 is set to by electricity decimal.
- 5. the method for the step-by-step storage according to claim 1 that ammeter electricity decimal is realized in FLASH memory, it is special Sign is, when carrying out electric quantity data write-in, byte offsets Y, position offset Z and presently written are calculated according to current decimal X Byte data L, calculation formula is as follows:Y=(X × 100-1) ÷ 8, round in Y-direction;Z=(X × 100) %8;If Z=0, hexadecimal number 0x80 is moved to right 7 as presently written byte data L;If Z ≠ 0, hexadecimal number 0x80 is moved to right into (Z-1) position as presently written byte data L.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710957694.1A CN107861687B (en) | 2017-10-13 | 2017-10-13 | Method for realizing bit-by-bit storage of electric quantity decimal of electric meter on FLASH memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710957694.1A CN107861687B (en) | 2017-10-13 | 2017-10-13 | Method for realizing bit-by-bit storage of electric quantity decimal of electric meter on FLASH memory |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107861687A true CN107861687A (en) | 2018-03-30 |
CN107861687B CN107861687B (en) | 2020-09-11 |
Family
ID=61698473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710957694.1A Active CN107861687B (en) | 2017-10-13 | 2017-10-13 | Method for realizing bit-by-bit storage of electric quantity decimal of electric meter on FLASH memory |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107861687B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109308171A (en) * | 2018-09-19 | 2019-02-05 | 华立科技股份有限公司 | Improve the date storage method and system of nonvolatile storage service life |
CN109541298A (en) * | 2018-11-29 | 2019-03-29 | 宁波三星智能电气有限公司 | A kind of electric energy meter metering method |
CN109976676A (en) * | 2019-04-02 | 2019-07-05 | 苏州和欣致远节能科技有限公司 | A method of it promoting cumulative amount and number is written |
CN112882654A (en) * | 2021-01-27 | 2021-06-01 | 深圳市森世泰科技有限公司 | Method, device, storage medium and computer equipment for prolonging EEPROM write life |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101184155A (en) * | 2007-12-18 | 2008-05-21 | 中国电子科技集团公司第五十四研究所 | Method for storing station name of security receiving chip |
CN101419841A (en) * | 2008-12-09 | 2009-04-29 | 苏州大学 | Erasing and writing method for FLASH memory |
US20100030979A1 (en) * | 2008-08-04 | 2010-02-04 | Phison Electronics Corp. | Data management method, and storage apparatus and controller thereof |
CN102339254A (en) * | 2011-06-17 | 2012-02-01 | 杭州炬华科技股份有限公司 | Flash data storage method for intelligent electric energy meter |
CN103487619A (en) * | 2013-07-16 | 2014-01-01 | 深圳市航天泰瑞捷电子有限公司 | Electric energy data storage method |
-
2017
- 2017-10-13 CN CN201710957694.1A patent/CN107861687B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101184155A (en) * | 2007-12-18 | 2008-05-21 | 中国电子科技集团公司第五十四研究所 | Method for storing station name of security receiving chip |
US20100030979A1 (en) * | 2008-08-04 | 2010-02-04 | Phison Electronics Corp. | Data management method, and storage apparatus and controller thereof |
CN101419841A (en) * | 2008-12-09 | 2009-04-29 | 苏州大学 | Erasing and writing method for FLASH memory |
CN102339254A (en) * | 2011-06-17 | 2012-02-01 | 杭州炬华科技股份有限公司 | Flash data storage method for intelligent electric energy meter |
CN103487619A (en) * | 2013-07-16 | 2014-01-01 | 深圳市航天泰瑞捷电子有限公司 | Electric energy data storage method |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109308171A (en) * | 2018-09-19 | 2019-02-05 | 华立科技股份有限公司 | Improve the date storage method and system of nonvolatile storage service life |
CN109308171B (en) * | 2018-09-19 | 2021-08-24 | 华立科技股份有限公司 | Data storage method and system for prolonging service life of nonvolatile memory |
CN109541298A (en) * | 2018-11-29 | 2019-03-29 | 宁波三星智能电气有限公司 | A kind of electric energy meter metering method |
CN109541298B (en) * | 2018-11-29 | 2020-11-03 | 宁波三星智能电气有限公司 | Electric energy meter metering method |
CN109976676A (en) * | 2019-04-02 | 2019-07-05 | 苏州和欣致远节能科技有限公司 | A method of it promoting cumulative amount and number is written |
CN109976676B (en) * | 2019-04-02 | 2022-04-05 | 苏州和欣致远节能科技有限公司 | Method for increasing cumulative number of write-in times |
CN112882654A (en) * | 2021-01-27 | 2021-06-01 | 深圳市森世泰科技有限公司 | Method, device, storage medium and computer equipment for prolonging EEPROM write life |
Also Published As
Publication number | Publication date |
---|---|
CN107861687B (en) | 2020-09-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107861687A (en) | The method that the step-by-step storage of ammeter electricity decimal is realized in FLASH memory | |
CN102656567B (en) | Data management in solid state storage devices | |
CN103797541B (en) | Storage arrangement and the collocation method for storage arrangement | |
CN101515276B (en) | Method for write operation of file data, and recovery method and recovery system for file data | |
CN102135942B (en) | Method for realizing wear-leveling in storage equipment as well as the storage equipment | |
CN101419841B (en) | Erasing method for FLASH memory | |
CN102841851B (en) | Flash memory management method and flash memory device | |
CN102779096B (en) | Page, block and face-based three-dimensional flash memory address mapping method | |
CN101446921B (en) | Dynamic storage method of Flash memory | |
CN101526927B (en) | Data processing method and data processing device of Flash file system | |
CN102081577A (en) | Data storage structure of Flash memory and data manipulation mode thereof | |
CN103299283A (en) | Memory address translation | |
CN104102585A (en) | Mapping information recording method, memory controller and memory storage device | |
CN101099125A (en) | Cluster auto-alignment | |
CN102341793A (en) | Memory block selection | |
CN103996412A (en) | Power-fail protection method applied to intelligent-card nonvolatile memories | |
KR20010031230A (en) | Access control for a memory having a limited erasure frequency | |
CN102866956A (en) | System and method for data real-time tracking and storage based on solid-state storage medium | |
US20190340134A1 (en) | Configurable memory system and method of configuring and using such memory system | |
CN104750565A (en) | NAND bad block processing method and NAND flash memory device | |
EP2080099A1 (en) | Memory indexing system and process | |
CN101656106A (en) | Method for writing data into EEPROM and device thereof | |
CN109992202A (en) | Data storage device, its operating method and the data processing system including it | |
CN109101437A (en) | A kind of date storage method and terminal | |
CN103295632A (en) | Method for preventing accidental power failure from causing linear accumulated data mutation |
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 |