CN106940625B - Data storage method of intelligent electric meter - Google Patents
Data storage method of intelligent electric meter Download PDFInfo
- Publication number
- CN106940625B CN106940625B CN201710154317.4A CN201710154317A CN106940625B CN 106940625 B CN106940625 B CN 106940625B CN 201710154317 A CN201710154317 A CN 201710154317A CN 106940625 B CN106940625 B CN 106940625B
- Authority
- CN
- China
- Prior art keywords
- data
- time
- data block
- storage
- block
- 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.)
- Expired - Fee Related
Links
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/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0616—Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
-
- 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/0629—Configuration or reconfiguration 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
- 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/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)
- Read Only Memory (AREA)
- Recording Measured Values (AREA)
Abstract
The invention provides a data storage method of an intelligent ammeter, which comprises the following steps: dividing the data storage time into a plurality of unit times, dividing the memory into a plurality of data blocks with the number equal to that of the unit times, and storing the data acquired in one unit time in each data block; before each data block begins to store data, clearing the data block and writing the data block into initial storage time; the collected data is stored in the data block according to the time of collection. The method ensures the order of data storage, saves the data storage space and prolongs the service life of the memory.
Description
Technical Field
The invention relates to the technical field of data storage, in particular to a data storage method of an intelligent electric meter.
Background
The intelligent electric meter is used as a front-end metering and storing device of the electricity utilization information acquisition system, plays an important role in measuring and storing electric power data, but at present, the intelligent electric meter can only store electric power values in a unit of 1 hour, so that the change of load in a span of 1 hour is ignored, the processing capacity of an electric power enterprise for coping with the load change is reduced, and the high requirement of business in an electric power system on processing time limit cannot be met.
The improved intelligent electric meter improves the original hardware microprocessing and storage capacity, adopts the technical scheme of freezing electric power and storing every minute, and obviously has more analysis and application values on the frozen data of 1 minute/time compared with the frozen data of 1 hour/time. The intelligent electric meter needs to collect the current electric power value once per minute and store the current electric power value in the memory, so that data statistics and analysis of the electricity utilization condition of a user are facilitated. The memory is required to record the latest 48-hour data, record every minute, automatically cover the outdated data, have the characteristic of power failure conservation and ensure the service life of the memory to be 20 years.
The selected memory is an EEPROM, the storage capacity is 512Kbit (512 x 1024bit), 512 memory pages are provided, the reliability of the memory is 1000000 times (one million times) of writing, according to the erasing zero clearing mechanism of the EEPROM, the data of each memory page is erased before new data is written into the memory page, if the operation is performed according to the common method, one data is recorded in one memory page every minute, 24 x 60 is erasing and writing operations are performed in 1440 times a day, 1000000 (times)/1440 is 694 days, and thus the memory is damaged in about 2 years.
Therefore, the data storage method in the prior art wastes storage space, cannot guarantee the service life of the memory, and cannot well support the technical scheme of storing the electric power value by the intelligent electric meter in a frozen mode.
Disclosure of Invention
The invention aims to provide a data storage method of an intelligent ammeter, so as to ensure the reliability and the practicability of a memory and meet the performance requirements of the intelligent ammeter on high frequency and long service life of the memory.
The technical scheme adopted by the invention for solving the technical problems is as follows: the data storage method of the intelligent electric meter comprises the following steps:
dividing the data storage time into a plurality of unit times, dividing the memory into a plurality of data blocks with the number equal to that of the unit times, and storing the data acquired in one unit time in each data block;
before each data block begins to store data, clearing the data block and writing the data block into initial storage time;
the collected data is stored in the data block according to the time of collection.
Preferably, each data block is provided with a data identifier.
More preferably, the unit time is 1 hour.
More preferably, the initial storage time comprises a time of year, month, and day.
More preferably, the time of acquisition comprises a time of year, month, day.
Preferably, each acquired data is stored in a data block occupying a fixed number of bytes.
More preferably, the acquired data determines the storage location within the data block based on the number of minutes in time of acquisition.
Preferably, the method for storing the acquired data in the data block according to the acquisition time comprises the following steps:
s1: if the current time is the whole time, if so, resetting the next data block and writing the initial storage time;
s2: whether the current time is an integral minute or not is judged, and if yes, data are collected;
s3: judging whether the initial storage time of the current data block is the current year, month and day,
if yes, go to step S4;
if not, clearing the next data block, writing the initial storage time, and entering the step S4;
s4: according to the minutes in the acquisition time, the initial storage position in the data block is determined, and the acquired data are written in sequence.
Preferably, in step S4, when the collection time is the nth minute, the starting storage location of the collected data in the data block is the xth byte, X is the number of bytes occupied by the starting storage time stored in the data block + N × each collected data is stored in the data block +1, N > is 0.
The invention has the beneficial effects that: the invention provides a data storage method of an intelligent ammeter, which comprises the steps of dividing data storage time into a plurality of unit times, dividing a memory into a plurality of data blocks with the number equal to that of the unit times, and storing data acquired in one unit time in each data block; before each data block begins to store data, clearing the data block and writing the data block into initial storage time; the collected data is stored in the data block according to the time of collection. The data acquired in one unit time is stored in each data block, and the acquired data is stored in the data blocks according to the data acquisition time, so that the data storage order is ensured; the initial storage time is written in each data block before the data is stored, and the acquired data is only stored subsequently without the storage time, so that the data storage space is saved; before each data block begins to store data, the data block is cleared, and the data is stored by taking the data block as a unit instead of taking the memory page as a storage unit, so that the erasing and writing operation times of the memory page are reduced, and the service life of the memory is prolonged.
Drawings
Fig. 1 is a schematic flow chart of a data storage method of a smart meter according to an embodiment of the invention;
FIG. 2 is a flow chart illustrating a method for storing collected data at a specified location within a data block according to a time of collection according to an embodiment of the present invention.
Detailed Description
The invention is further illustrated with reference to the following figures and examples.
Example (b):
the improved intelligent electric meter needs to store the current electric power value into the memory once per minute so as to facilitate data statistics and analysis of the electricity utilization condition of a user. The memory is required to store the latest 48-hour data, once every minute, the outdated data is automatically covered, the memory has the characteristic of power-down conservation, and the service life of the memory is guaranteed to be 20 years.
The memory we have selected is an EEPROM, model M24C512-RMN6TP, the chip supplies 3.3V, and communicates with the MCU (microprocessor) via the IIC bus. The reliability stated by the manufacturer is 1000000 (one million) writable times, the data can be stored for 40 years without loss, the storage capacity is 512Kbit (512 x 1024bit), 8 bits are one Byte, namely, the Byte number is 65536Byte (512 x 1024/8: 65536). This 65536byte capacity is divided into 512 memory pages. I.e. 128 bytes per memory page (65536/512-128). According to the erase mechanism of the EEPROM, each page needs to erase the data of the page before writing new data, which can be understood as clearing the data of the whole page before writing new data into a memory page.
As is usual, one page of memory stores one data per minute, 24 × 60/1440 erase/write operations per day, and 1000000/1440/694 days, so that the memory is damaged in about 2 years.
As shown in fig. 1, in order to meet the performance requirements of the smart meter on high frequency and long life of the memory, the invention provides a data storage method of the smart meter to ensure the reliability and practicability of the memory, which specifically includes:
s10: dividing the data storage time into a plurality of unit times, dividing the memory into a plurality of data blocks with the number equal to that of the unit times, and storing the data acquired in one unit time in each data block;
s20: before each data block begins to store data, clearing the data block and writing the data block into initial storage time;
s30: the collected data is stored in the data block according to the time of collection.
For the smart meter to store the latest 48-hour data, a memory is divided into 48 data blocks, the data collected every hour is stored in one data block, the data are stored in each data block according to the minute position, and the current 1-minute electric power value is stored every 1 minute. As soon as 512 pages are used in the memory, the integer is 10 pages per block (512/48 ═ 10.67), and we take the first 480 pages to store data. Each data block records 60 minutes of data. We define a data id for the 48-hour data, which corresponds to the 48 data blocks. The data identification is: 05300001 and 05300030(16 systems). When data of a certain hour needs to be read, only the corresponding data block needs to be read through the data identifier.
Data format: the first 5 bytes of the first storage page of each data block is used for storing the starting storage time of the data block: XX month and XX day of XX year is 00 minutes in XX month and XX day, each time of year, month and day is one byte, namely 5 bytes, and the electric power value per minute can be stored after the connection without recording the time. Since each hour is stored from 0 minute, the initial storage time may not be stored, and only the year, month, day, and hour, which takes 4 bytes. The power value is XXXXXX KW, the real part before the decimal point is 1 byte, the real part after the decimal point is accurate to 4 bits, 2 bytes in total, and 3 bytes in total. The data format is 16-system. The data allocation is as follows, with 5 bytes as the initial storage time:
initial storage time | Data 1 | Data 2 | Data 3 | … | Data 60 |
5 bytes | 3 bytes | 3 bytes | 3 bytes | … | 3 bytes |
A data block has 10 memory pages, and a memory page has 128 bytes, i.e., 128 × 10 — 1280 bytes. The actual required storage capacity is shown in the above table, and the number of bytes occupied by one data block is 5+3 × 60 — 185 bytes, and the storage capacity is completely sufficient.
As shown in fig. 2, a method for storing collected data at a designated position within a data block according to a collection time, includes:
s1: if the current time is the whole time, if so, resetting the next data block and writing the initial storage time;
s2: whether the current time is an integral minute or not is judged, and if yes, data are collected;
s3: judging whether the initial storage time of the current data block is the current year, month and day,
if yes, go to step S4;
if not, clearing the next data block, writing the initial storage time, and entering the step S4;
s4: according to the minutes in the acquisition time, the initial storage position in the data block is determined, and the acquired data are written in sequence.
And after the whole time is changed, storing the next data block, clearing the new data block, and writing the initial storage time, namely the current year, month and day.
And collecting the current electric power value in whole minute.
Judging whether the initial storage time of the current data block is the current year, month and day: if not, clearing the next data block and writing the current time (year, month, day and hour); according to the minutes in the acquisition time, the initial storage position in the data block is determined, and the acquired data are written in sequence.
If yes, determining the initial storage position in the data block according to the minutes in the acquisition time, and sequentially writing the acquired data.
The position stored in the data block is determined according to the minutes of the collected time, for example, the data collected at the 5 th minute of a certain hour, then in the data block corresponding to the hour, the initial storage time is 4 bytes, 5 minutes in 0-4 minutes, 3 bytes per minute, and 4+3 × 5 to 19 bytes in total, and then the data at the 5 th minute is stored from the 20 th byte.
Example exception handling: if power is off in the running process of the intelligent electric meter, the system stops working, after a call comes, the system detects that the initial storage time and the current time of the current data block span several hours, and the data are not stored in the spanning several whole hours. For the hour data block in which data has been stored, unwritten data is all 0 by default and does not need to be changed.
For example: in 2017, power is cut off before 10 o 'clock 03 of No. 11 of 1 month, data are recorded in the first 3 minutes of 10 o' clock, and the data in the last 57 minutes are 0, which is shown in the following table:
after 14 o 'clock before 1/11/2017, the power value starts to be stored, the data of the first 57 o' clock is defaulted to be 0 without changing, and the following table shows that:
according to the data storage method of the intelligent ammeter, provided by the invention, when the hour is punctuated, the data block (10 pages) to be written with data is erased (cleared), the initial storage time is written, then the data per minute is written into the block in sequence, the data per minute is only written into the electric power value, the time is not written, the storage space is saved, compared with the data storage method in the prior art, the method greatly prolongs the service life of the memory, and meets the requirements of the intelligent ammeter on the performance of the memory.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.
Claims (7)
1. The data storage method of the intelligent electric meter is characterized by comprising the following steps:
dividing the data storage time into a plurality of unit times, dividing the memory into a plurality of data blocks with the number equal to that of the unit times, and storing the data acquired in one unit time in each data block;
before each data block begins to store data, clearing the data block and writing the data block into initial storage time;
the acquired data determines the storage position in the data block according to the number of minutes in the acquired time; the method specifically comprises the following steps:
s1: if the current time is the whole time, if so, resetting the next data block and writing the initial storage time;
s2: whether the current time is an integral minute or not is judged, and if yes, data are collected;
s3: judging whether the initial storage time of the current data block is the current year, month and day,
if yes, go to step S4;
if not, clearing the next data block, writing the initial storage time, and entering the step S4;
s4: according to the minutes in the acquisition time, the initial storage position in the data block is determined, and the acquired data are written in sequence.
2. The data storage method of the intelligent electric meter according to claim 1, wherein each data block is provided with a data identifier.
3. The data storage method of the smart meter according to claim 1, wherein the unit time is 1 hour.
4. The data storage method of the smart meter according to claim 1, wherein the initial storage time comprises a month, a day and a year.
5. The data storage method of the intelligent electric meter according to claim 1, wherein the collection time comprises time of year, month and day.
6. The data storage method of the intelligent ammeter of claim 1 wherein each collected data is stored in a data block for a fixed number of bytes.
7. The method of claim 1, wherein in step S4, when the time of the data collection is the nth minute, the starting storage location of the collected data in the data block is the xth byte, where X is the number of bytes occupied by the starting storage time stored in the data block + N, and each collected data is stored in the data block +1, and N > is 0.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710154317.4A CN106940625B (en) | 2017-03-15 | 2017-03-15 | Data storage method of intelligent electric meter |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710154317.4A CN106940625B (en) | 2017-03-15 | 2017-03-15 | Data storage method of intelligent electric meter |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106940625A CN106940625A (en) | 2017-07-11 |
CN106940625B true CN106940625B (en) | 2020-07-17 |
Family
ID=59469119
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710154317.4A Expired - Fee Related CN106940625B (en) | 2017-03-15 | 2017-03-15 | Data storage method of intelligent electric meter |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106940625B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107544914A (en) * | 2017-09-06 | 2018-01-05 | 华立科技股份有限公司 | Electricity piecemeal storage method and system |
CN107886702A (en) * | 2017-10-31 | 2018-04-06 | 国网江苏省电力公司泰州供电公司 | Telecommunication electric energy meter and its workflow based on carrier communication |
CN109470918B (en) * | 2018-11-30 | 2021-09-07 | 武汉盛帆电子股份有限公司 | Electric quantity data processing method of IR46 electric energy meter and IR46 electric energy meter |
CN111143239B (en) * | 2019-12-27 | 2021-08-13 | 南方电网电力科技股份有限公司 | Frozen electric quantity data compression storage method and decompression method for intelligent electric meter |
CN111796775A (en) * | 2020-07-07 | 2020-10-20 | 威胜集团有限公司 | Intelligent ammeter data storage method and device |
CN112328556A (en) * | 2020-10-16 | 2021-02-05 | 威胜集团有限公司 | Electric energy curve data storage method, electric energy meter and computer readable storage medium |
CN113835635A (en) * | 2021-09-23 | 2021-12-24 | 宁夏隆基宁光仪表股份有限公司 | Intelligent electric meter data cross storage method |
CN115993940B (en) * | 2023-03-23 | 2023-07-25 | 青岛鼎信通讯股份有限公司 | Electric quantity loss prevention method and device, electric energy meter equipment and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7337358B2 (en) * | 2004-12-20 | 2008-02-26 | Microsoft Corporation | Method and computer-readable medium for verifying and saving an electronic document |
CN101431253A (en) * | 2007-11-07 | 2009-05-13 | 孙军平 | Low-voltage power distribution network data processing method, apparatus and system based on WSN |
JP5305543B2 (en) * | 2007-12-21 | 2013-10-02 | ラムバス・インコーポレーテッド | Method and apparatus for calibrating the write timing of a memory system |
CN102542029A (en) * | 2011-12-22 | 2012-07-04 | 沈阳中科博微自动化技术有限公司 | Block compressed storage method of industrial data |
CN102929794B (en) * | 2012-09-26 | 2015-12-02 | 惠州市德赛西威汽车电子股份有限公司 | The storage means of a kind of EEPROM |
CN103412889B (en) * | 2013-07-19 | 2017-10-03 | 深圳市金正方科技股份有限公司 | The data storage and query method and its system of intelligent electric meter |
CN103558453B (en) * | 2013-10-22 | 2017-01-04 | 国家电网公司 | Multiple feed straight power purchase client's maximum demand acquisition system |
-
2017
- 2017-03-15 CN CN201710154317.4A patent/CN106940625B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN106940625A (en) | 2017-07-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106940625B (en) | Data storage method of intelligent electric meter | |
US8060684B2 (en) | Memory control apparatus, memory control method and program | |
US7725646B2 (en) | Method of using a flash memory for a circular buffer | |
CN102096698B (en) | Video data storage format, storage method and search method | |
CN102135942A (en) | Method for realizing wear-leveling in storage equipment as well as the storage equipment | |
CN108563711A (en) | A kind of time series data storage method based on timing node | |
CN104220991A (en) | Architecture to allow efficient storage of data on nand flash memory | |
CN113220239A (en) | Erasing and writing method, device and equipment for flash storage and readable storage medium | |
CN101446921A (en) | Dynamic storage method of Flash memory | |
CN102103596B (en) | method for implementing file system in embedded system | |
CN112463020A (en) | Data access method, device and equipment based on Flash | |
CN109470918B (en) | Electric quantity data processing method of IR46 electric energy meter and IR46 electric energy meter | |
CN111143239B (en) | Frozen electric quantity data compression storage method and decompression method for intelligent electric meter | |
CN101105774B (en) | Logic and physical address conversion method for flash memory in data access | |
CN102520242A (en) | Recording method of load curves of electric energy meter | |
CN107291374A (en) | Method and device for recording use time of data block | |
JP5343817B2 (en) | Storage device | |
CN101576859A (en) | Data writing method, memory system and controller for nonvolatile memory | |
CN110955639A (en) | Data processing method and device | |
CN102736981A (en) | Method for increasing NOR FLASH erase/write life | |
JP6012869B2 (en) | Information management system, information management apparatus, information management method, and program | |
CN110658981A (en) | Method for prolonging service life of Flash | |
CN115686362A (en) | Data freezing method of intelligent electric meter | |
CN104572812A (en) | Historical data storage and retrieval methods | |
CN111339105B (en) | Data storage method, device and server |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200717 |