CN105511918B - A kind of data memory format automatic maintenance method of intelligent electric energy meter - Google Patents

A kind of data memory format automatic maintenance method of intelligent electric energy meter Download PDF

Info

Publication number
CN105511918B
CN105511918B CN201510879994.3A CN201510879994A CN105511918B CN 105511918 B CN105511918 B CN 105511918B CN 201510879994 A CN201510879994 A CN 201510879994A CN 105511918 B CN105511918 B CN 105511918B
Authority
CN
China
Prior art keywords
file
data
firmware
electric energy
energy meter
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.)
Active
Application number
CN201510879994.3A
Other languages
Chinese (zh)
Other versions
CN105511918A (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.)
JIANGSU HUAYUAN APPARATUS AND INSTR Co.,Ltd.
Original Assignee
Jiangsu Linyang Solarfun 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 Jiangsu Linyang Solarfun Co Ltd filed Critical Jiangsu Linyang Solarfun Co Ltd
Priority to CN201510879994.3A priority Critical patent/CN105511918B/en
Publication of CN105511918A publication Critical patent/CN105511918A/en
Application granted granted Critical
Publication of CN105511918B publication Critical patent/CN105511918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

A kind of data memory format automatic maintenance method of intelligent electric energy meter, the method include file system upgrading, file format conversion and automatic maintenance;In firmware upgrade, if data memory format changes, automatic data maintenance is prevented number loss or entanglement by intelligent electric energy meter.In order to facilitate intelligent electric energy meter automatic data maintenance, data memory format is defined as simple file system, i.e., the data of intelligent electric energy are divided into several files;If file system changes, need on the file copy in old file system to new address, and the file that convert file formats change.In use, the problem of being not necessarily to take care loss of data or entanglement after the firmware upgrade of intelligent electric energy meter scene, due to being automatically performed maintenance by intelligent electric energy meter completely, the time of the data maintenance caused by firmware upgrade is greatly saved in the present invention.

Description

A kind of data memory format automatic maintenance method of intelligent electric energy meter
Technical field
The present invention relates to the electrical energy measurement field of electric energy meter, specifically a kind of data memory format of intelligent electric energy meter Automatic maintenance method.
Background technology
Currently, with the high speed development of intelligent grid, intelligent electric energy meter needs the data for acquiring and recording more and more, passes The storage organization of system has been unable to meet user demand, since the node store structure design of structuring is simple, is easy to software developer It safeguards, so being mainstream selection of the current electric energy meter producer in terms of Software for Design;But the shortcomings that storage organization of structuring It is to be inserted into or delete a data in defined structure, may result in entire storage organization can all change, in table The data and meter of record the configuration parameter of itself can all lose, and largely limit the development of electric energy meter software upgrading; With the changes in demand of user, the increase of function is unavoidable, if directly replacing electric energy meter, can be brought in this way to social resources Greatly waste;Data format automatic maintenance method is stored, the trouble and worry of current electric energy meter firmware upgrade can be solved.
Due to electric energy meter cost limiting factor, hardware resource is caused to be insufficient to allow with big file system, such as FATFS, Therefore we have studied low costs, easily realize, and securely and reliably, the simple file system safeguarded automatically convenient for data memory format.
Invention content
The purpose of the present invention is being directed to the problem of live firmware upgrade leads to loss of data in intelligent electric energy meter, propose a kind of The data memory format automatic maintenance method of intelligent electric energy meter.
The technical scheme is that:
A kind of data memory format automatic maintenance method of intelligent electric energy meter, it includes the following steps:
S1, file is divided, i.e., it is mutually only the data of intelligent electric energy to be divided into several according to different functions Vertical subfile, each subfile are equipped with corresponding fileversion number;
S2, in firmware upgrade, if fileversion number changes, by the file copy in FileVersion to new On address, and the file that convert file formats change.
The step S2 of the present invention specifically includes following steps:
When S2-1, firmware upgrade, intelligent electric energy meter receives new firmware, before application firmware, needs to check new firmware With the firmware file system version number of current firmware, to judge whether firmware file system is compatible with, if firmware file system Version number is consistent, then is compatible with, and directly upgrades, if incompatible, acquisition request upgrade file system converts firmware;
S2-2, into Boot programs, first determine whether firmware file system version number changes, if do not become Change, then directly upgrade, load electric energy meter APP, the upgrade file system conversion that load step S2-1 is obtained if having changed is solid Part goes to step S2-3;
After S2-3, loading upgrading filesystem conversion firmware, the data in memory are loaded onto in NORFlash first, To ensure that data are not lost during conversion;
Judge whether the fileversion number of each subfile changes, it, will be current if fileversion number does not change File imported into new storage address, if fileversion number changes, the data of current file format are converted to new file Format, then new file is imported into new storage address;
S2-4, after executing upgrade file system conversion firmware, fileversion number is revised as to newest, restarting, Boot programs load electric energy meter APP.
In the step S2-3 of the present invention, the data of current file format, which are converted to new file format, is specially:
Each data length in current file version is compared with each data length in FileVersion after upgrading:
If the data length of same position becomes 0 from several bytes, file format need not be copied when conversion FileVersion of the shellfish position data to after upgrading;
If the data length of same position becomes several bytes from 0, after upgrading when file format is converted FileVersion file in the default value of the position is written.
The default value of the present invention is full 0.
Beneficial effects of the present invention:
The present invention in use, without taking care loss of data or the problem of entanglement after the firmware upgrade of intelligent electric energy meter scene, by In being automatically performed maintenance by intelligent electric energy meter completely, the time of the data maintenance caused by firmware upgrade is greatly saved.
Description of the drawings
Fig. 1 is the flow chart of the present invention.
Fig. 2 is the file system upgrading schematic diagram of the present invention.
Fig. 3 is the file format transfer process schematic diagram of the present invention.
Specific implementation mode
The present invention is further illustrated with reference to the accompanying drawings and examples.
As shown in Figure 1, a kind of data memory format automatic maintenance method of intelligent electric energy meter, it includes the following steps:
S1, file is divided, i.e., it is mutually only the data of intelligent electric energy to be divided into several according to different functions Vertical subfile, each subfile are equipped with corresponding fileversion number;
S2, in firmware upgrade, if fileversion number changes, by the file copy in FileVersion to new On address, and the file that convert file formats change;Specially:
When S2-1, firmware upgrade, intelligent electric energy meter receives new firmware, before application firmware, needs to check new firmware With the firmware file system version number of current firmware, to judge whether firmware file system is compatible with, if firmware file system Version number is consistent, then is compatible with, and directly upgrades, if incompatible, acquisition request upgrade file system converts firmware;
S2-2, into Boot programs, first determine whether firmware file system version number changes, if do not become Change, then directly upgrade, load electric energy meter APP, the upgrade file system conversion that load step S2-1 is obtained if having changed is solid Part goes to step S2-3;
After S2-3, loading upgrading filesystem conversion firmware, the data in memory are loaded onto in NORFlash first, To ensure that data are not lost during conversion;
Judge whether the fileversion number of each subfile changes, it, will be current if fileversion number does not change File imported into new storage address, if fileversion number changes, the data of current file format are converted to new file Format, then new file is imported into new storage address;
S2-4, after executing upgrade file system conversion firmware, fileversion number is revised as to newest, restarting, Boot programs load electric energy meter APP.
When specific implementation:
In order to realize the storage data format automatic maintenance method of intelligent electric energy meter, it is necessary first to which definition is a kind of convenient for storage The easy file system that data format is safeguarded automatically:
The data of intelligent electric energy meter are divided into mutually independent subfile according to different functions, each subfile includes There are version number, each item data etc..These subfiles merge the file system for being formed intelligent electric energy meter.
If file system changes, need on the file copy in old file system to new address, and The file that convert file formats change greatlys save the time of maintenance.
As shown in Fig. 2, when file system upgrades, file system V0.1 is upgraded to V0.2
1)By the file 1 of file system V0.1,0x100 byte is read from initial address 0x00000004, storage is arrived On the addresses 0x0x00000404 of V0.2 systems;
2)By the file 2 of file system V0.1,0x200 byte is read from initial address 0x00000104, storage is arrived On the addresses 0x0x00000104 of V0.2 systems;
As shown in figure 3, being file format transfer process schematic diagram:
Delete a data:The length of data 3 is 1 byte in V0.1 versions, and the length of the data 3 in V0.2 versions It is 0, then need not be copied in data 3 to the file of V0.2 versions when file format is converted.
Increase a data:The length of data 4 is 0 byte in V0.1 versions, and the length of the data 4 in V0.2 versions It is 10, then needs the default value that data 4 are written in the file of V0.2 versions when file format is converted(It is defaulted as full 0).
Part that the present invention does not relate to is the same as those in the prior art or can be realized by using the prior art.

Claims (3)

1. the data memory format automatic maintenance method of a kind of intelligent electric energy meter, it is characterized in that it includes the following steps:
S1, file is divided, i.e., the data of intelligent electric energy meter is divided into several independently of each other according to different functions Subfile, each subfile be equipped with corresponding fileversion number;
S2, in firmware upgrade, if fileversion number changes, by the file copy in FileVersion to new address On, and the file that convert file formats change;
Step S2 specifically includes following steps:
When S2-1, firmware upgrade, intelligent electric energy meter receives new firmware, before application firmware, needs to check new firmware and work as The file system version number of preceding firmware, to judge whether firmware file system is compatible with, if firmware file system version number one It causes, is then compatible with, directly upgrade, if incompatible, acquisition request upgrade file system converts firmware;
S2-2, into Boot programs, first determine whether file system version number changes, if do not changed, directly Upgrading loads electric energy meter APP, and the upgrade file system that load step S2-1 is obtained if having changed converts firmware, goes to step S2-3;
After S2-3, loading upgrading filesystem conversion firmware, the data in memory are loaded onto in NORFlash first, to protect Card data are not lost during conversion;
Judge whether the fileversion number of each subfile changes, if fileversion number does not change, by current file It is imported into new storage address, if fileversion number changes, the data of current file format are converted into new file format, New file is imported into new storage address again;
S2-4, after executing upgrade file system conversion firmware, fileversion number is revised as to newest, restarting, Boot journeys Sequence loads electric energy meter APP.
2. the method that data memory format according to claim 1 is safeguarded automatically, it is characterized in that in step S2-3, it will be current The data of file format are converted to new file format:
Each data length in current file version is compared with each data length in FileVersion after upgrading:
If the data length of same position becomes 0 from several bytes, file format need not copy this when conversion FileVersion of the position data to after upgrading;
If the data length of same position becomes several bytes from 0, by the text after upgrading when file format is converted The default value of the position is written in the file of part version.
3. the method that data memory format according to claim 2 is safeguarded automatically, it is characterized in that default value is full 0.
CN201510879994.3A 2015-12-06 2015-12-06 A kind of data memory format automatic maintenance method of intelligent electric energy meter Active CN105511918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510879994.3A CN105511918B (en) 2015-12-06 2015-12-06 A kind of data memory format automatic maintenance method of intelligent electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510879994.3A CN105511918B (en) 2015-12-06 2015-12-06 A kind of data memory format automatic maintenance method of intelligent electric energy meter

Publications (2)

Publication Number Publication Date
CN105511918A CN105511918A (en) 2016-04-20
CN105511918B true CN105511918B (en) 2018-10-26

Family

ID=55719925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510879994.3A Active CN105511918B (en) 2015-12-06 2015-12-06 A kind of data memory format automatic maintenance method of intelligent electric energy meter

Country Status (1)

Country Link
CN (1) CN105511918B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111061699B (en) * 2019-11-05 2024-02-09 广西电网有限责任公司 Method and device for updating version of electric energy meter database
CN112114193B (en) * 2020-07-30 2022-06-03 宁波三星医疗电气股份有限公司 Method for metering single chip microcomputer power loss prevention through upgrading module terminal

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103346816A (en) * 2013-06-28 2013-10-09 长沙威胜信息技术有限公司 Wireless communication system and remote updating method thereof
CN103685554A (en) * 2013-12-25 2014-03-26 浙江云巢科技有限公司 Upgrading method, device and system
CN104007996A (en) * 2014-06-16 2014-08-27 南京融教科技有限公司 Reliable firmware upgrading realizing method for distributed control system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100083242A1 (en) * 2008-09-30 2010-04-01 Kai Altstaedt Installation management system for an aircraft server

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103346816A (en) * 2013-06-28 2013-10-09 长沙威胜信息技术有限公司 Wireless communication system and remote updating method thereof
CN103685554A (en) * 2013-12-25 2014-03-26 浙江云巢科技有限公司 Upgrading method, device and system
CN104007996A (en) * 2014-06-16 2014-08-27 南京融教科技有限公司 Reliable firmware upgrading realizing method for distributed control system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
稳定可靠的机顶盒嵌入式系统软件升级设计方法;郭金花;《中国优秀硕士学位论文全文数据库 信息科技辑》;20100815(第8期);全文 *

Also Published As

Publication number Publication date
CN105511918A (en) 2016-04-20

Similar Documents

Publication Publication Date Title
CN103955363B (en) A kind of manufacture method of program upgrade installation package
CN105867947B (en) Data processing method and device after preset application program updating
CN102520948B (en) Application maintenance update method and device
CN103324474B (en) Based on (SuSE) Linux OS across the method for System structure ISO and module
CN101840332B (en) Data processing method, device and system of JAVA intelligent card
CN102567053A (en) Method and device for downgrading software version
CN103942063A (en) Centralized configuration and remote deployment method for Java Web application
CN102779191B (en) A kind of system that realizes of MySQL database smooth upgrade and implementation method
CN108037941B (en) Based on the application program update method of public plug-in unit, electronic equipment, storage medium
CN108268299A (en) A kind of Docker based on OpenStack cloud platforms shares storage solution
CN111258587A (en) Method, device, equipment and storage medium for realizing android application plug-in
CN105677789A (en) Method and system for managing directory capacity of distributed file system
CN111045714A (en) Firmware updating method and device, earphone and computer readable storage medium
CN102541969B (en) File protection method and system based on file allocation table (FAT) file system, and memory
CN105511918B (en) A kind of data memory format automatic maintenance method of intelligent electric energy meter
CN105224309A (en) A kind of method and apparatus transferring function
CN102760075A (en) Method and system for realizing application configuration of intelligent card
CN104717558A (en) Backing up and restoring method of set top box data
CN108984102B (en) Method, system and computer program product for managing a storage system
TW201814546A (en) Device component loading method, apparatus and internet of things system
CN104572140A (en) Method, device and system for transplanting operating system
CN103019819A (en) Dynamic link library uniform scheduling method based on plug-in mechanism
CN105468304A (en) Native memory card and management method thereof
CN101373473B (en) Method and system for reducing file quantity in embedded system flash memory
CN109933358A (en) For reducing the control method of measuring equipment program upgrading amount

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210917

Address after: No.188, Tianyuan East Road, Jiangning District, Nanjing City, Jiangsu Province, 210000

Patentee after: JIANGSU HUAYUAN APPARATUS AND INSTR Co.,Ltd.

Address before: No. 666, Linyang Road, Qidong City, Nantong City, Jiangsu Province, 226200

Patentee before: JIANGSU LINYANG ENERGY Co.,Ltd.