CN109388422A - Updating firmware program method and its electric energy meter - Google Patents

Updating firmware program method and its electric energy meter Download PDF

Info

Publication number
CN109388422A
CN109388422A CN201811124787.7A CN201811124787A CN109388422A CN 109388422 A CN109388422 A CN 109388422A CN 201811124787 A CN201811124787 A CN 201811124787A CN 109388422 A CN109388422 A CN 109388422A
Authority
CN
China
Prior art keywords
firmware program
program
file
target firmware
target
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
CN201811124787.7A
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.)
Wasion Group Co Ltd
Original Assignee
Wasion Group 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 Wasion Group Co Ltd filed Critical Wasion Group Co Ltd
Priority to CN201811124787.7A priority Critical patent/CN109388422A/en
Publication of CN109388422A publication Critical patent/CN109388422A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R22/00Arrangements for measuring time integral of electric power or current, e.g. electricity meters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Power Engineering (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of updating firmware program methods, including download target firmware program and examine;The current firmware program of target firmware program covering storage;Independent compilation is carried out to boot program and target firmware program using duplexing journey Compilation Method respectively;It is a target firmware program file by independent boot program project file and target firmware program engineering integrating documents and stores;The file obtained after integration is written in the controller of equipment to be upgraded and completes the updating firmware program of equipment to be upgraded.The invention also discloses the electric energy meters including the updating firmware program method.The present invention is by carrying out separately independent compiling and integration to boot program and target firmware program; and guarantee the reliability and integrality in firmware upgrade process using all kinds of protection mechanisms; therefore the method for the present invention can greatly improve the reliability of updating firmware program; and the method for the present invention is simple and reliable, realizes simple.

Description

Updating firmware program method and its electric energy meter
Technical field
Present invention relates particularly to a kind of updating firmware program method and its electric energy meters.
Background technique
With the development of economic technology, all types of electronic products have been widely used for people's production and life and work as In, endless convenience is brought to people's production and life.
Meanwhile making rapid progress with electronic technology, in order to extend the life cycle of electronic product, electronic product inner core The updating firmware program of the heart just becomes one of important means.Especially measuring instrument (such as electric energy meter, intellectual water meter, intelligence Gas meter, flow meter or intelligent calorimeter etc.), since it carries the task of metering, and the realization of metering tasks is with firmware program mostly Subject to, therefore, the firmware upgrade of the electronic product including measuring instrument is just particularly important.
By taking electric energy meter as an example, the distribution of electric energy meter is extremely discrete, if using artificial to being consolidated by the way of field upgrade The upgrading of part program, it is not only time-consuming and laborious, and also cost is high, has been no longer desirable for existing market environment.And firmware journey The radio upgrade of sequence, has the advantages that low in cost and high-efficient, so existing, arrived that electronic product is all made of is wirelessly to rise The mode of grade carries out the upgrading of firmware program.
But the escalation process of existing firmware program, generally comprise the downloading of firmware program and the upgrading of firmware program Two parts.The downloading of firmware program is sent target firmware program to be upgraded by way of remote radio communication degree Electronic equipment, until electronic equipment to be upgraded is stable, reliable and correct received and stored target firmware program;And consolidate The upgrading of part program, then after loading the target firmware program of preservation for electronic product, erasing therein core memory is existing Some firmware programs, and target firmware program is written in the internal core memory of itself, to complete the liter of firmware program Grade.
Currently, the escalation process of firmware program, is generally adopted by the mode of either simplex journey Compilation Method, i.e. target firmware journey The boot code and target firmware program code of sequence share the same compiler and generate built-in code.But single engineering compiling side Method has following defects that when the adjustment amplitude of target firmware program is bigger, the built-in code that compiler generates may become Change, the compiling that this variation can influence the region boot exports as a result, make it while changing, to reduce firmware program The reliability of upgrading;Meanwhile either simplex journey Compilation Method is merely able to be further added by check information after exporting entire file, and cannot be independent Application program is verified, implementation process is more complicated, and often complicated process error rate is high;Finally, single engineering compiling side Method can only overall output file, the data volume for downloading program every time requires to increase data download time comprising boot program, increase Big communication risk of error.
Summary of the invention
One of the objects of the present invention is to provide the firmware journeys that one kind can greatly improve the reliability of updating firmware program Sequence upgrade method.
The second object of the present invention is to provide a kind of electric energy meter, which includes the updating firmware program side Method.
This updating firmware program method provided by the invention, includes the following steps:
S1. device downloads target firmware program to be upgraded is into the memory of itself;
S2. the target firmware program completed to step S1 downloading is tested;
S3. qualified target firmware program will be examined to cover the current firmware program that equipment to be upgraded is locally stored;
S4. independent compilation is carried out to boot program and target firmware program using duplexing journey Compilation Method respectively, thus shape At mutually independent boot program project file and target firmware program engineering file;
S5. by the obtained mutually independent boot program project file of step S4 and target firmware program engineering integrating documents For a target firmware program file, and stored;
S6. the file obtained after step S5 integration is written in the controller of equipment to be upgraded, to complete to be upgraded set Standby updating firmware program.
Downloading target firmware program described in step S1 is into the memory of itself, specially in downloading target firmware program During, it is every to receive several data, CRC check is just carried out in equipment to be upgraded, to guarantee the target firmware journey of downloading The integrality and correctness of sequence.
Downloading target firmware program described in step S1 is into the memory of itself, specially in downloading target firmware program During contain power down and resume mechanism, to guarantee the integrality of target firmware program downloading.
Memory described in step S1 is the external flash of equipment to be upgraded.
Independent volume is carried out to boot program and target firmware program using duplexing journey Compilation Method respectively described in step S4 It translates, so that mutually independent boot program project file and target firmware program engineering file are formed, specially using following step It is rapid to carry out independent compilation:
Boot program is carried out individually compiling to form boot program project file by the controller of equipment to be upgraded, and Boot program exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling;
Target firmware program is carried out individually compiling to form target firmware program engineering by the controller of equipment to be upgraded File, and target firmware program exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling.
By obtained mutually independent boot program project file and target firmware program engineering file described in step S5 It is integrated into a target firmware program file, boot program project file is specially embedded into firmware program in a manner of array In project file, to be by obtained mutually independent boot program project file and target firmware program engineering integrating documents One target firmware program file.
By obtained mutually independent boot program project file and target firmware program engineering file described in step S5 It is integrated into a target firmware program file, navigates to boot program project file admittedly specially by the way of document alignment Fixation position in part program engineering file, thus the mutually independent boot program project file and target firmware journey that will obtain Process engineering integrating documents are a target firmware program file.
Storage described in step S5, specially storage is into the external flash of equipment to be upgraded.
If mistake has occurred during storing target firmware program file, equipment to be upgraded abandons this firmware liter Grade.
The file obtained after integration is written described in step S6 in the controller of equipment to be upgraded, specially using as follows File is written step:
(1) controller of equipment to be upgraded backs up the current firmware program stored on flash inside controller, so The current firmware program stored on internal flash is wiped afterwards;Meanwhile increasing checking procedure in backup;
(2) the target firmware program file writing controller inside flash that controller will be stored in external flash;
(3) the target firmware program being written on flash inside controller Read Controller, and with stored on external flash Target firmware program file compare, thus guarantee write-in target firmware program correctness.
Controller described in step (2) will be in the target firmware program file writing controller that be stored in external flash Portion flash, specifically further include: if controller stored in reading external flash target firmware program file when mistake occurs, Then current firmware program is re-write flash inside controller by controller, and stops this updating firmware program.
The target firmware program being written on flash inside Read Controller described in step (3), and on external flash The target firmware program file of storage compares, and is specially compared using following rule:
If the target firmware program of write-in is identical as the target firmware program of storage, the target firmware program being written is just Really;If the target firmware program of write-in and the target firmware program of storage be not identical, will be stored in external flash again Flash inside target firmware program file writing controller, and carry out contrasting detection:
If testing result is still mistake, the target firmware program file being stored in external flash is write again Enter flash inside controller, and carry out contrasting detection: if testing result is correct, updating firmware program completion;If detection knot Fruit remains as mistake, then assert failure, stops upgrading.
The present invention also provides a kind of electric energy meter, which includes the updating firmware program method.
This updating firmware program method provided by the invention, by being separated to boot program and target firmware program Independent compiling and integration, and guarantee the reliability and integrality in firmware upgrade process using all kinds of protection mechanisms, therefore The method of the present invention can greatly improve the reliability of updating firmware program, and the method for the present invention is simple and reliable, realize simple.
Detailed description of the invention
Fig. 1 is the method flow diagram of the method for the present invention.
Specific embodiment
It is as shown in Figure 1 the method flow diagram of the method for the present invention: this updating firmware program method provided by the invention, packet Include following steps:
S1. device downloads target firmware program to be upgraded is into the memory (such as external flash) of itself;In downloading mesh It is every to receive several data during marking firmware program, CRC check is just carried out in equipment to be upgraded, to guarantee downloading The integrality and correctness of target firmware program;Meanwhile also suggesting resuming mechanism comprising power down in downloading, to guarantee target The integrality of firmware program downloading;
S2. the target firmware program completed to step S1 downloading is tested;
S3. qualified target firmware program will be examined to cover the current firmware program that equipment to be upgraded is locally stored;
S4. independent compilation is carried out to boot program and target firmware program using duplexing journey Compilation Method respectively, thus shape At mutually independent boot program project file and target firmware program engineering file;
Specifically, boot program is carried out individually compiling to form boot program engineering text by the controller of equipment to be upgraded Part, and boot program exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling;
Target firmware program is carried out individually compiling to form target firmware program engineering by the controller of equipment to be upgraded File, and target firmware program exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling;
S5. by the obtained mutually independent boot program project file of step S4 and target firmware program engineering integrating documents For a target firmware program file, and stored (for example storage is to external flash);
Specifically, boot program project file is embedded into firmware program project file in a manner of array, thus will Obtained mutually independent boot program project file and target firmware program engineering integrating documents is a target firmware program File;Alternatively, boot program project file is navigated to the fixation in firmware program project file by the way of document alignment Position, to be a mesh by obtained mutually independent boot program project file and target firmware program engineering integrating documents Mark firmware program file;
Meanwhile if mistake has occurred during storing target firmware program file, equipment to be upgraded abandons this Firmware upgrade;
S6. the file obtained after step S5 integration is written in the controller of equipment to be upgraded, to complete to be upgraded set Standby updating firmware program;Specially file is written using following steps:
(1) controller of equipment to be upgraded backs up the current firmware program stored on flash inside controller, so The current firmware program stored on internal flash is wiped afterwards;Meanwhile increasing checking procedure in backup;
(2) the target firmware program file writing controller inside flash that controller will be stored in external flash;
If mistake occurs when the target firmware program file that controller stores in reading external flash, controller will Current firmware program re-writes flash inside controller, and stops this updating firmware program;
(3) the target firmware program being written on flash inside controller Read Controller, and with stored on external flash Target firmware program file compare, thus guarantee write-in target firmware program correctness;Specially using as follows Rule compares:
If the target firmware program of write-in is identical as the target firmware program of storage, the target firmware program being written is just Really;If the target firmware program of write-in and the target firmware program of storage be not identical, will be stored in external flash again Flash inside target firmware program file writing controller, and carry out contrasting detection:
If testing result is still mistake, the target firmware program file being stored in external flash is write again Enter flash inside controller, and carry out contrasting detection: if testing result is correct, updating firmware program completion;If detection knot Fruit remains as mistake, then assert failure, stops upgrading.
This updating firmware program method provided by the present application can be used for other any need and carry out updating firmware program Electronic equipment, including all types of measuring instruments (such as electric energy meter, water meter, gas meter, flow meter, calorimeter etc.), electric energy management terminal, Distribution terminal, electric energy quality monitoring equipment, grid automation terminal, acquisition terminal, concentrator, data collector, measuring instrument, Write by hand device, fault detector etc..

Claims (10)

1. a kind of updating firmware program method, includes the following steps:
S1. device downloads target firmware program to be upgraded is into the memory of itself;
S2. the target firmware program completed to step S1 downloading is tested;
S3. qualified target firmware program will be examined to cover the current firmware program that equipment to be upgraded is locally stored;
S4. independent compilation is carried out to boot program and target firmware program using duplexing journey Compilation Method respectively, to form phase Mutual independent boot program project file and target firmware program engineering file;
It S5. is one by the obtained mutually independent boot program project file of step S4 and target firmware program engineering integrating documents A target firmware program file, and stored;
S6. the file obtained after step S5 integration is written in the controller of equipment to be upgraded, to complete equipment to be upgraded Updating firmware program.
2. updating firmware program method according to claim 1, it is characterised in that downloading target firmware described in step S1 Program is into the memory of itself, every to receive several data specially during downloading target firmware program, just wait rise CRC check is carried out in grade equipment, to guarantee the integrality and correctness of the target firmware program of downloading;Meanwhile in downloading mesh Power down is contained during mark firmware program and resumes mechanism, to guarantee the integrality of target firmware program downloading.
3. updating firmware program method according to claim 1 or 2, it is characterised in that using duplexing journey described in step S4 Compilation Method carries out independent compilation to boot program and target firmware program respectively, to form mutually independent boot program work Journey file and target firmware program engineering file specially carry out independent compilation using following steps:
Boot program is carried out individually compiling to form boot program project file, and boot journey by the controller of equipment to be upgraded Sequence exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling;
Target firmware program is carried out individually compiling to form target firmware program engineering file by the controller of equipment to be upgraded, And target firmware program exclusively enjoys all resources of the controller of equipment to be upgraded in independent compiling.
4. updating firmware program method according to claim 3, it is characterised in that mutual by what is obtained described in step S5 Independent boot program project file and target firmware program engineering integrating documents are a target firmware program file, specially Boot program project file is embedded into firmware program project file in a manner of array, thus mutually independent by what is obtained Boot program project file and target firmware program engineering integrating documents are a target firmware program file.
5. updating firmware program method according to claim 4, it is characterised in that mutual by what is obtained described in step S5 Independent boot program project file and target firmware program engineering integrating documents are a target firmware program file, specially Boot program project file is navigated into the fixation position in firmware program project file by the way of document alignment, thus will Obtained mutually independent boot program project file and target firmware program engineering integrating documents is a target firmware program File.
6. updating firmware program method according to claim 5, it is characterised in that if in storage target firmware program file During mistake has occurred, then equipment to be upgraded abandons this firmware upgrade.
7. updating firmware program method according to claim 6, it is characterised in that will be obtained after integration described in step S6 File be written in the controller of equipment to be upgraded, specially file is written using following steps:
(1) controller of equipment to be upgraded backs up the current firmware program stored on flash inside controller, then will The current firmware program erasing stored on internal flash;
(2) the target firmware program file writing controller inside flash that controller will be stored in external flash;
(3) the target firmware program being written on flash inside controller Read Controller, and with the mesh that is stored on external flash Mark firmware program file compares, to guarantee the target firmware program correctness of write-in.
8. updating firmware program method according to claim 7, it is characterised in that controller described in step (2) will store The flash inside the target firmware program file writing controller in external flash, specifically further include: if controller is being read Mistake occurs when the target firmware program file stored in external flash, then current firmware program is re-write control by controller Flash inside device processed, and stop this updating firmware program.
9. updating firmware program method according to claim 8, it is characterised in that in Read Controller described in step (3) The target firmware program being written on portion flash, and compared with the target firmware program file stored on external flash, have Body is to be compared using following rule:
If the target firmware program of write-in is identical as the target firmware program of storage, the target firmware program being written is correct;If The target firmware program of write-in and the target firmware program of storage be not identical, then will be stored in the target in external flash again Flash inside firmware program file writing controller, and carry out contrasting detection:
If testing result is still mistake, the target firmware program file being stored in external flash is written controls again Flash inside device processed, and carry out contrasting detection: if testing result is correct, updating firmware program completion;If testing result is still So it is mistake, then assert failure, stops upgrading.
10. a kind of electric energy meter, it is characterised in that include updating firmware program method described in one of claim 1~9.
CN201811124787.7A 2018-09-26 2018-09-26 Updating firmware program method and its electric energy meter Pending CN109388422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811124787.7A CN109388422A (en) 2018-09-26 2018-09-26 Updating firmware program method and its electric energy meter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811124787.7A CN109388422A (en) 2018-09-26 2018-09-26 Updating firmware program method and its electric energy meter

Publications (1)

Publication Number Publication Date
CN109388422A true CN109388422A (en) 2019-02-26

Family

ID=65419273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811124787.7A Pending CN109388422A (en) 2018-09-26 2018-09-26 Updating firmware program method and its electric energy meter

Country Status (1)

Country Link
CN (1) CN109388422A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112379909A (en) * 2020-12-04 2021-02-19 安徽江淮汽车集团股份有限公司 Method, device and equipment for refreshing combination instrument program and storage medium
CN113656112A (en) * 2021-10-21 2021-11-16 成都怡康科技有限公司 Firmware program configuration method applied to serialized products
CN117149242A (en) * 2023-11-01 2023-12-01 深圳市杰美康机电有限公司 Driver batch upgrading method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851645A (en) * 2006-01-17 2006-10-25 华为技术有限公司 Upgrading device and method in operation for monolithic processor system
CN101246430A (en) * 2008-03-13 2008-08-20 中兴通讯股份有限公司 Method for implementing Boot bootstrap program of wireless terminal product
CN106648759A (en) * 2016-11-30 2017-05-10 苏州华芯微电子股份有限公司 Common programming device firmware updating method
CN107729040A (en) * 2017-09-28 2018-02-23 郑州云海信息技术有限公司 A kind of IAP method and system of single-chip microcomputer

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851645A (en) * 2006-01-17 2006-10-25 华为技术有限公司 Upgrading device and method in operation for monolithic processor system
CN101246430A (en) * 2008-03-13 2008-08-20 中兴通讯股份有限公司 Method for implementing Boot bootstrap program of wireless terminal product
CN106648759A (en) * 2016-11-30 2017-05-10 苏州华芯微电子股份有限公司 Common programming device firmware updating method
CN107729040A (en) * 2017-09-28 2018-02-23 郑州云海信息技术有限公司 A kind of IAP method and system of single-chip microcomputer

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112379909A (en) * 2020-12-04 2021-02-19 安徽江淮汽车集团股份有限公司 Method, device and equipment for refreshing combination instrument program and storage medium
CN113656112A (en) * 2021-10-21 2021-11-16 成都怡康科技有限公司 Firmware program configuration method applied to serialized products
CN117149242A (en) * 2023-11-01 2023-12-01 深圳市杰美康机电有限公司 Driver batch upgrading method and device
CN117149242B (en) * 2023-11-01 2024-02-23 深圳市杰美康机电有限公司 Driver batch upgrading method and device

Similar Documents

Publication Publication Date Title
CN109388422A (en) Updating firmware program method and its electric energy meter
CN103164328B (en) The regression testing method of a kind of business function, Apparatus and system
CN106909510A (en) A kind of method and server for obtaining test case
CN106950489A (en) A kind of electric power detection and fail-ure criterion system and method
CN107678913A (en) A kind of multi-functional configurable Anti-single particle radiation system and method
CN110928324B (en) Unmanned plane flight parameter acquisition equipment and calibration method thereof
CN109992508A (en) Test exemple automation generation method, device and electronic equipment
CN104461899A (en) Method and system for analyzing resource consumption in testing process and testing terminal
CN113157508B (en) Test method, system, device, equipment and storage medium of embedded system
CN109902005A (en) A kind of method and system of automatic test
CN109813999A (en) A kind of Fault Diagnosis of Distribution Network algorithm automatically testing platform, method and application
CN1952818A (en) Testing method of program unit with capability of checking test result automatically
CN109521960A (en) Data read-write method, device and system
CN104778118A (en) Improvement method for automatic testing technology
CN104850411A (en) Storage system reference evaluation program generating method and apparatus
CN112100081B (en) Upgrade test method and device based on double-core intelligent electric meter and computer equipment
CN110209585A (en) A kind of software test case intelligent training method, terminal and storage medium
CN107451058A (en) A kind of software development methodology and device
CN110209586A (en) A kind of automatic software test method based on artificial intelligence, terminal and storage medium
CN106293857A (en) A kind of wireless mode carries out the method for software upgrading
CN110350991A (en) A kind of optical module Auto-Test System, method, computer equipment and storage medium
CN104199713A (en) Embedded Linux operation system trimming customization method
CN109684152A (en) A kind of RISC-V processor instruction method for down loading and its device
CN106201790A (en) A kind of adjustment method based on DSDT table and debugging system
CN110134598B (en) Batch processing method, device and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190226