CN105930193A - Operating system based energy meter software online upgrade method and system - Google Patents

Operating system based energy meter software online upgrade method and system Download PDF

Info

Publication number
CN105930193A
CN105930193A CN201610292327.XA CN201610292327A CN105930193A CN 105930193 A CN105930193 A CN 105930193A CN 201610292327 A CN201610292327 A CN 201610292327A CN 105930193 A CN105930193 A CN 105930193A
Authority
CN
China
Prior art keywords
module
program
energy meter
electric energy
data
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
Application number
CN201610292327.XA
Other languages
Chinese (zh)
Other versions
CN105930193B (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.)
CEIEC ELECTRIC TECHNOLOGY Inc
Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd
State Grid Corp of China SGCC
Original Assignee
CEIEC ELECTRIC TECHNOLOGY Inc
Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd
State Grid Corp of China SGCC
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 CEIEC ELECTRIC TECHNOLOGY Inc, Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd, State Grid Corp of China SGCC filed Critical CEIEC ELECTRIC TECHNOLOGY Inc
Priority to CN201610292327.XA priority Critical patent/CN105930193B/en
Publication of CN105930193A publication Critical patent/CN105930193A/en
Application granted granted Critical
Publication of CN105930193B publication Critical patent/CN105930193B/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
    • G06F8/656Updates while running
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/51Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems at application loading time, e.g. accepting, rejecting, starting or inhibiting executable software based on integrity or source reliability
    • 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

Landscapes

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

Abstract

The present invention discloses an operating system based energy meter software online upgrade method. The method comprises: firstly executing handshake process upgrade; then carrying out security verification; carrying out program transmission, program check, program curing and program loading; and finally carrying out upgrade confirmation. According to an operating system based energy meter software architecture and an online upgrade method thereof disclosed by the present invention, requirements of both reliability and flexibility are taken into account, and a legal metrology module is processed independently, so that it is ensured that core metering functions are not affected by update and failure of other modules; and through software online upgrade, energy meter software online update can be implemented in a facilitated manner, and during non-legal metrology relevant software upgrading, the correct operation of metering functions are not affected, so that based on ensuring the reliability, flexibility of use of the energy meter is greatly improved.

Description

A kind of electric energy meter software online upgrading method and system based on operating system
Technical field
The present invention relates to electric energy meter field, a kind of electric energy meter software online upgrading method based on operating system.
Background technology
Electric energy meter once hanging net operation at present, its software is upgraded not in line, returns factory's burning again unless removed Program also verifies again.This point cannot adapt to the demand being continually changing in running.Especially as the Internet+, The development of technology of Internet of things, the proposition of the concepts such as big data, cloud platform, electric energy meter to incorporate this big technology ring big In border, its software flexibility requires more and more higher.Require that electric energy meter is meeting outside basic metering, meter-reading function, moreover it is possible to Enough change upgrading software or download new functional unit according to demand in electric energy meter running, i.e. needs to possess Line upgrade function.
Possess merely online upgrading function and remain inadequate, owing to current electric energy meter software framework is substantially employing list Sheet machine system, its software is an entirety, must first stop all functions during upgrading, waits the upgrading of all programs complete After restart again, electric energy during online upgrading so certainly will be caused to stop accumulative, and this is unacceptable.
For this reason, it may be necessary to first study a kind of new electric energy meter software framework, this software architecture supports on-line software updating, And do not affect the properly functioning of metering during non-metering related software is upgraded.
Multitask, modularization management that embedded OS possesses because of it, it is prone to the characteristics such as extension, aboundresources, It is widely used in all trades and professions, is also used in electric energy meter harvester field, but the application in electric energy meter has no.To embed Formula operating system is applied in electric energy meter, the problem that can effectively solve software flexible upgrading, but to take into account electric energy simultaneously The precision of table, reliability of electric power problem, then need the characteristic according to electric energy meter to carry out specific aim process.
Accordingly, it would be desirable to a kind of electric energy meter software online upgrading method based on operating system.
Summary of the invention
It is an object of the invention to provide a kind of electric energy meter software online upgrading method based on operating system.
It is an object of the invention to be realized by such technical scheme:
A kind of based on operating system the electric energy meter software online upgrading method that the present invention provides, comprises the following steps:
S1 upgrading is shaken hands: host computer sends software upgrading request message, and selects module to be upgraded;Electric energy meter After receiving upgrade request, it is judged that upgrade request message format and module to be upgraded are the most correct, it is judged that recognize after Zheng Que For shaking hands successfully, reply correct response message, and enter next step S2, the most directly exit escalation process;
S2 safety verification: host computer sends upgrade key, whether electric energy meter checking upgrade key is consistent with preset value; If met, then pass through safety verification and enter next step S3;The most directly exit escalation process;
S3 program transportation: the target execution program transportation that host computer will be upgraded is to electric energy meter, and electric energy meter is first after receiving It is cached in RAM;Host computer sends the complete message of program transportation, and described message performs program with whole target CRC check code;
S4 breakpoint transmission: electric energy meter waits new program transportation message, starts to continue from breakpoint location last time after receiving The routine data that caching newly receives, until the program transportation received is complete;
S5 program ver-ify: electric energy meter performs the length of program according to the target received, calculates RAM buffer area intermediate range The CRC check code of sequence, the CRC check code in the complete message of program transportation whether verification sends with host computer is consistent, As checked the most then and entering next step S6, the most directly exit whole escalation process;
S6 program Solidification: electric energy meter is by the program copy of RAM buffer area to address, corresponding region, program storage area; Determining program size, the most directly exits whole escalation process as exceeded limit value;If not less than, then program curing;
S7 program loads: the module type that electric energy meter is upgraded according to this, reloads the program after upgrading and runs;
S8 upgrades confirmation: after the program after upgrading is reloaded, recalculate the program CRC check code in FLASH, And this CRC check code is fed back to host computer;After host computer receives this CRC check code, the program checked and download CRC check code is the most consistent, if verification is consistent, thinks and upgrades successfully, and escalation process terminates, otherwise it is assumed that upgrading Failure.
Further, the upgraded module selected in described step S1 includes legality measurement module, kernel module, main application Any one module in module and expanded application module.
Further, the safety verification in described step S2 includes software verification and two aspects of hardware verification;Described soft Part checking refers to key authentication, sends upgrade key by host computer, and whether electric energy meter authentication secret is consistent with preset value Realize key authentication process;Described hardware verification refers to when electric energy meter is in end cap open mode, to upgrading legal system Metering module and kernel module carry out proof procedure.
Further, the target execution program transportation that the host computer in described step S3 will be upgraded is to electric energy meter, specifically Realize according to following steps:
According to maximum data message length, whole target execution program is divided into the multiple message of continuous print;Transmission is all successively Message;Until end of transmission.
Further, it is to realize according to the module type of upgrading that the program in described step S7 loads, if upgrading Module be legality measurement module and kernel module, then use the automatically reset mode of whole device to reload;If The module of upgrading is main application module and expanded application module, then reloaded the journey of the two module by kernel module Sequence.
Also include a kind of electric energy meter software online upgrade system based on operating system, including kernel module and respectively with Legality measurement module, main application module and the expanded application module that kernel module connects;
Described kernel module, for electric energy meter power-up initializing and the software and hardware resources managing whole electric energy meter;
Described legality measurement module, measures energy data for Real-time Collection and processes energy data;
Described main application module, if for storage dry-cure energy data module and by processing at energy data module Reason energy data;
Described expanded application module, for self-defined energy data processing module.
Further, described kernel module includes guiding module, operating system nucleus, application management module and driving Support module;
Described guiding module has been used for power-up initializing, and is booted up operating system nucleus;
Described operating system nucleus, for providing at the memory management on operating system basis, task scheduling, interruption Reason process;
Described application management module, is used for starting and monitor legality measurement module, main application module and expanded application The running status of module, and automatically update the module of monitoring misoperation;
Described driving support module, it is provided that access bottom hardware resource interface, for legality measurement module, main application module Use with expanded application module.
Further, described main application module includes data computational threads unit, data storage threads unit, display thread Unit and communication thread unit;
Described data computational threads unit, for reading the energy data of legality measurement module, real-time measuring data, root Calculate requirement according to real-time measuring data, carry out load record process, monitor and judge whether decompression, defluidization event And carry out record, in the way of shared drive, it is supplied to data storage threads unit, display thread units and communication thread Unit uses;
Described data storage threads unit, for receiving the data that data computational threads processed, and by up-to-date generation Electric energy, requirement, logout are cured in nonvolatile memory;
Described display thread units, is used for monitoring key-case, carries out the display of button circulation, Automatic Cycle, self-inspection Process, the data of data computational threads unit are shown by liquid crystal display mode;
Described communication thread unit, for processing the transmitting-receiving of RS-485 serial ports and infrared data, according to DL/T 645 Agreement carries out the process of data.
Owing to have employed technique scheme, present invention have the advantage that:
Electric energy meter software framework based on operating system provided by the present invention and the method for online upgrading thereof, having taken into account can By property and motility two aspect requirement, by legality measurement module independent process, it is ensured that the function of measuring of core is not by other The impact that module updates, lost efficacy, by on-line software updating, can conveniently realize the online updating of electric energy meter software, And when non-legality measurement related software is upgraded, the correct operation of function of measuring can't be affected, ensureing reliability On the basis of, greatly improve the motility of electric energy meter application.
Other advantages, target and the feature of the present invention will be illustrated to a certain extent in the following description, and And to a certain extent, will be apparent to those skilled in the art based on to investigating hereafter, or Person can be instructed from the practice of the present invention.The target of the present invention and other advantages can pass through description below Realize with claims and obtain.
Accompanying drawing explanation
The accompanying drawing of the present invention is described as follows.
Fig. 1 is the electric energy meter software framework of the present invention.
Fig. 2 is that the electric energy meter target of the present invention performs program Solidification address distribution schematic diagram.
Fig. 3 is the electric energy meter software online upgrading flow chart of the present invention.
Detailed description of the invention
The invention will be further described with embodiment below in conjunction with the accompanying drawings.
Embodiment 1
As it can be seen, the electric energy meter software online upgrading method based on operating system that the present embodiment provides, the method is full Foot does not affect the requirement that metering is properly functioning during upgrading non-metering related software, its step is as follows:
S1 upgrading is shaken hands: host computer sends software upgrading request message, and selects module to be upgraded, including method Metering module processed, kernel module, main application module, expanded application module, upgrading can only select one of which every time; After electric energy meter receives upgrade request, it is judged that upgrade request message format and module to be upgraded are the most correct, it is judged that just Think after Que and shake hands successfully, reply correct response message, enter into step S2, the most directly exit escalation process;
S2 safety verification: include software verification and two aspects of hardware verification.Software verification refers to key authentication, on Position machine sends upgrade key, and whether electric energy meter authentication secret is consistent with preset value;Hardware verification is only for upgrading legal system meter Amount module, kernel module, only electric energy meter are in end cap open mode and just allow the two module upgrade, it is ensured that core The safety of software function.Safety verification, by then entering S3, the most directly exits escalation process;
S3 program transportation: the target execution program transportation that host computer will be upgraded is to electric energy meter, and electric energy meter is first after receiving It is cached in RAM.Due to target, to perform program relatively big, commonly reaches tens KB or hundreds of KB, according to during transmission Whole target execution program is divided into the multiple message of continuous print by big data message length, and each packet maximum length is 100 Byte, after treating all message transmissions, host computer sends the complete message of program transportation, and this message is simultaneous with whole Target performs the CRC check code of program, enters S4 afterwards;As transmitting procedure is interrupted, electric energy meter continues 1 point Zhong Wei receives program transportation message, or middle interting transmits other type message, the most first caches in the program transmitted Hold, enter S4;
S4 breakpoint transmission: electric energy meter waits new program transportation message, starts to continue from breakpoint location last time after receiving The routine data that caching newly receives, as received the complete message of program transportation, then enters S5;As transmitting procedure is sent out again Raw interruption, continues to wait under S4 state;After entering breakpoint transmission such as electric energy meter, continue within 10 minutes, not receive yet newly Program transportation message, directly exit whole escalation process;
S5 program ver-ify: after electric energy meter receives the complete message of program transportation that host computer sends, according to the mesh received The length of mark execution program, calculates the CRC check code of RAM buffer area Program, and whether verification sends with host computer The complete message of program transportation in CRC check code consistent, as verification unanimously then enters S6, the most directly exit whole Individual escalation process;
S6 program Solidification: electric energy meter by the program copy of RAM buffer area to address, corresponding region, program storage area, Use during duplication and first wipe the mode write again;Determining program size while of before solidification, the most directly moves back as exceeded limit value Go out whole escalation process;Solidify the most laggard enter S7;
S7 program loads: the module type that electric energy meter is upgraded according to this, reloads the program after upgrading and runs. If upgrading legal system metering module, kernel module, the automatically reset mode of whole device is used to reload;If It is upgrading main application module, expanded application module, is then reloaded the program of the two module by kernel module, The most main application module, the operation of expanded application module are unaffected.After the program that completes loads, enter S8;
S8 upgrades confirmation: after the program after upgrading is reloaded, recalculate the program CRC check code in FLASH, And this CRC check code is fed back to host computer;After host computer receives this CRC check code, the program checked and download CRC check code is the most consistent, if verification is consistent, thinks and upgrades successfully, and escalation process terminates, otherwise it is assumed that upgrading Failure, now can choose whether again to upgrade.
In order to be further ensured that safety, for the electric energy meter with ESAM encrypting module, above-mentioned upgrade step S1, Upgrading message in S2 all uses state's close SMI algorithm to be encrypted.
Use above-mentioned online upgrading method, to main application module, the non-metering related software of expanded application module the two When upgrading, by the task dynamic loading function utilizing operating system to be possessed, make legality measurement in escalation process The operation of module is unaffected, again reads the electric energy during upgrading from legality measurement module by caching after having upgraded Data, it is ensured that energy data is not lost.It addition, escalation process have employed maltilevel security encryption measures, it is ensured that journey Sequence suffers malicious sabotage.
Embodiment 2
The electric energy meter software framework based on operating system of the present embodiment offer and online upgrade system thereof, meet non-meter The requirement that metering is properly functioning is not affected, including kernel module, legality measurement module, master during amount related software upgrading Application module, expanded application module and driving support module;
Described kernel module, is the basis of whole electric energy meter software operation, completes electric energy meter power-up initializing, and manage The software and hardware resources of whole electric energy meter.Including guiding module, operating system nucleus, application management module, driving The several submodule of support module.Wherein guide module to complete power-up initializing, and be booted up operating system nucleus;Behaviour Make system kernel and the functions such as the memory management on operating system basis, task scheduling, interrupt processing are provided;Application journey Sequence management module starts legality measurement module, main application module, expanded application module, and monitors the fortune of these three module Market condition, restarts respective modules after noting abnormalities, and coordinates online upgrading function to complete the two after program upgrading Automatically updating of module;Support module is driven to provide the access interface to hardware resource, hard for other module accesses bottoms Part resource uses;
Described legality measurement module, complete real-time measuring data, the collection of energy data and calculating, energy data unloading, Freeze to process.This module independent operating, and the data that all meterings are relevant, including the meritorious electricity of forward of total and each rate Energy, reverse active energy, four-quadrant reactive energy, combination active energy, combination reactive energy etc., all by this mould Block separate storage manages, the interference whether not run by other module;
Described main application module, completes the main application function of electric energy meter, including requirement calculating, load record, event note Record, data store, show, communication etc..It is made up of multiple relatively independent threads on software, calculate including data, Data store, show, communicate several thread.
Main application module includes data computational threads unit, data storage threads unit, display thread units and order wire Cheng Danyuan;
Described data computational threads unit, for reading the energy data of legality measurement module, real-time measuring data, root Calculate requirement according to real-time measuring data, carry out load record process, monitor and judge whether decompression, defluidization event And carry out record, after these data calculate, in the way of shared drive, it is supplied to data storage threads unit, display Thread units and communication thread unit use;
Described data storage threads unit, for receiving the data that data computational threads processed, and by up-to-date generation Electric energy, requirement, logout are cured in nonvolatile memory;
Described display thread units, is used for monitoring key-case, carries out the display of button circulation, Automatic Cycle, self-inspection Process, the data of data computational threads unit are presented to operator by liquid crystal and checks;
Described communication thread unit, for processing the transmitting-receiving of RS-485 serial ports, infrared data, according to DL/T 645 Agreement carries out the process of data, by the way of communication, the data of data computational threads unit is presented to operator and looks into See.
Data computational threads in the present embodiment reads the energy data of legality measurement module, real-time measuring data, according to Real-time measuring data calculates requirement, carries out load record process, monitors and judges whether the event such as decompression, defluidization And carry out record;Data storage threads receives the data that data computational threads processed, and is distributed by shared drive mode Use to other module, and the electric energy of up-to-date generation, requirement, logout are cured in nonvolatile memory; The display data that generate according to data storage threads of thread, in conjunction with key-case, carry out button circulation, Automatic Cycle, The display of self-inspection processes;Communication thread processes RS-485 serial ports, the transmitting-receiving of infrared data, according to DL/T 645 agreement Carry out the process of data;
Described expanded application module, use electric energy that main application module generates, measurement in real time, requirement, load record, The data such as logout, the function that self-defined extension is new.It is characterized in that, this module can individually unload and install, and Can customize design and develop the function required for user according to user's needs, and, this modular program can be independent Upgrading, does not affect metering, meter-reading function during upgrading;
Above-mentioned kernel module, legality measurement module, main application module, expanded application module the most individually compile, after compiling Target perform file leave in different program storage areas.
Embodiment 3
Seeing Fig. 1, the electric energy meter based on operating system of the present invention, including legality measurement module, kernel module, master Application module, expanded application module.When being embodied as, with three-phase multifunctional electrical energy meter as target, hardware uses The implementation of CPU+ computation chip, CPU uses ARM9 frame chip AM1808, and computation chip uses TI's ADE7880 high accuracy three phase metering IC.Peripheral chip includes the NOR FLASH chip of a piece of 8MB size, is used for depositing Put program;The DDR2 chip of a piece of 64MB, for the operation of operating system and deposit ephemeral data;A piece of 8MB SPI FLASH chip, be used for depositing various electric energy, requirement, event log data.In order to ensure that software system is transported The reliability of row and real-time, operating system selects vxworks operating system, this behaviour of transplant and run in AM1808 Make system.
Kernel module includes guiding module, operating system nucleus, application management module and driving support module several Submodule.Wherein guide module to use uboot to realize, complete power-up initializing, and be booted up kernel module;Behaviour Make system kernel and the functions such as the memory management on operating system basis, task scheduling, interrupt processing are provided;Application journey Sequence management module startup main application module, expanded application module, and monitor the ruuning situation of the two module, work as discovery Restart respective modules after exception, and coordinate online upgrading function complete the two module after program upgrading the most more Newly;Support module is driven to provide the access interface to hardware resource, for other module accesses bottom hardware resources, Including button, display, memorizer, serial ports, general I/O interface etc. drive, each drive be provided which open, Read, write, ioctl, close interface function, for application program.
Legality measurement module uses a single RTP (real time processing tasks) to realize, and is read by SPI serial ports The split-phase of ADE7880 computation chip is meritorious, idle, apparent electric energy, is calculated the meritorious electricity of forward of total and each rate The electric energy such as energy, reverse active energy, four-quadrant reactive energy, combination active energy, combination reactive energy, by reading Take the instantaneous values such as the voltage of ADE7880 computation chip, electric current, power to obtain real-time measuring data, by time clock The clearing unloading of electric energy processed and freeze to process.These electric energy and real-time measuring data are placed on outside DDR2 and deposit after calculating In reservoir, for other module.
Main application module uses a single RTP (real time processing tasks) to realize equally, be divided into data to calculate, Data store, show, communicate several sub-line journey, RTP start immediately after running.Wherein data computational threads reads The energy data of legality measurement module, real-time measuring data, calculate requirement according to real-time measuring data, carry out load Record processes, and monitors and judges whether the event such as decompression, defluidization occurs and carries out record;Data storage threads receives data The data that computational threads processed, distribute to other module by shared drive mode and use, and by the electricity of up-to-date generation Energy, requirement, logout are cured in outside SPI FLASH chip, by calling the memorizer that kernel module provides Drive this curing operation;The data that display thread generates according to data storage threads, call kernel module and carry The button of confession, display drive, and carry out the display process of button circulation, Automatic Cycle, self-inspection;Communication thread processes RS-485 serial ports, the transmitting-receiving of infrared data, by calling the serial port drive that kernel module provides, carry out DL/T 645 The process of protocol data;The data of main application module leave in after calculating in outside DDR2 memorizer equally;
Expanded application module is also adopted by a single RTP (real time processing tasks) and realizes, in the implementation case Extend the application of an ethernet access.This RTP reads the data in outside DDR2, by the HTTP of Ethernet Agreement, it is provided that local web access interface, it is achieved the online web page access of electric energy meter data is checked.
Fig. 2, the kernel module of the present embodiment offer, legality measurement module, main application module, expanded application mould are provided Block compiling after executable file be respectively vxWorks.bin, legalMeas.vxe, mainApp.vxe, ExtendApp.vxe, leave in respectively NOR FLASH program storage first address 0x0,0x200000,0x300000, In the memory space of 0x500000,0x600000, size limits and is respectively 2MB, 1MB, 2MB, 1MB, remains 2MB Memory space is as continuing to employ in advance.After electric energy meter powers on, first from 0x0 address load operating kernel module, then pass through Kernel module loads legal system metering module, main application module, expanded application module successively and runs.
Fig. 3 describes electric energy meter and the process of upper computer software and mutual flow process during online upgrading, includes S1~S8 totally eight steps, specific as follows:
S1 upgrading is shaken hands: host computer sends software upgrading request message, and selects module to be upgraded, including interior Core module, legality measurement module, main application module, expanded application module, upgrading can only select one of which every time; After electric energy meter receives upgrade request, it is judged that upgrade request message format and module to be upgraded are the most correct, it is judged that just Think after Que and shake hands successfully, reply correct response message, enter into step S2, the most directly exit escalation process; In order to ensure safety, for the electric energy meter with ESAM encrypting module, upgrading handshake message uses the close SMI of state to calculate Method is encrypted;
S2 safety verification: include software verification and two aspects of hardware verification.Software verification refers to key authentication, on Position machine sends upgrade key, and whether electric energy meter authentication secret is consistent with preset value;Hardware verification is only for upgrading legal system meter Amount module, kernel module, only electric energy meter are in end cap open mode and just allow the two module upgrade, it is ensured that core The safety of software function.Safety verification, by then entering S3, the most directly exits escalation process;In order to ensure peace Quan Xing, for the electric energy meter with ESAM encrypting module, upgrading handshake message uses state's close SMI algorithm to be encrypted;
S3 program transportation: the target execution program transportation that host computer will be upgraded is to electric energy meter, and electric energy meter is first after receiving It is cached in DDR2 chip.Owing to target performs program relatively greatly, commonly reach tens KB or hundreds of KB, during transmission According to maximum data message length, whole target execution program is divided into the multiple message of continuous print, each packet maximum length Being 100 bytes, after treating all message transmissions, host computer sends the complete message of program transportation, and this message carries simultaneously There is whole target to perform the CRC check code of program, enter S4 afterwards;As transmitting procedure is interrupted, electric energy meter is held The continuous program transportation message that do not receives for 1 minute, or middle interting transmit other type message, the most first caches and has transmitted Contents of program, enters S4;
S4 breakpoint transmission: electric energy meter waits new program transportation message, starts to continue from breakpoint location last time after receiving The routine data that caching newly receives, as received the complete message of program transportation, then enters S5;As transmitting procedure is sent out again Raw interruption, continues to wait under S4 state;After entering breakpoint transmission such as electric energy meter, continue within 10 minutes, not receive yet newly Program transportation message, directly exit whole escalation process;
S5 program ver-ify: after electric energy meter receives the complete message of program transportation that host computer sends, according to the mesh received The length of mark execution program, calculates the CRC check code of DDR2 buffer area Program, and whether verification was sent out with host computer CRC check code in the complete message of program transportation come is consistent, as verification unanimously then enters S6, the most directly exits Whole escalation process;
S6 program Solidification: electric energy meter, by the program copy of DDR2 buffer area to NOR FLASH, uses first during duplication The mode that erasing writes again;According to the module type upgraded during duplication, program is deposited in corresponding program storage area, Kernel module, legality measurement module, main application module, expanded application module respectively corresponding first address 0x0,0x200000, 0x300000、0x500000、0x600000;Simultaneously determining program size before solidification, as exceed respectively limit value 2MB, 1MB, 2MB, 1MB, the most directly exit escalation process;S7 is entered after program Solidification success;
S7 program loads: the module type that electric energy meter is upgraded according to this, reloads the program after upgrading and runs. If upgrading legal system metering module, kernel module, the automatically reset mode of whole device is used to reload;If It is upgrading main application module, expanded application module, is then reloaded the program of the two module by kernel module, The most main application module, the operation of expanded application module are unaffected.After the program that completes loads, enter S8;
S8 upgrades confirmation: after the program after upgrading is reloaded, recalculate the program CRC school in NOR FLASH Test code, and this CRC check code is fed back to host computer;After host computer receives this CRC check code, check and download Program CRC check code is the most consistent, if verification is consistent, thinks and upgrades successfully, and escalation process terminates, otherwise it is assumed that Upgrade unsuccessfully, now can choose whether again to upgrade.
The present embodiment have employed RS-485 serial ports and two kinds of upgrading modes of Ethernet, and two ways uses above-mentioned identical Step.Ethernet upgrading mode speed is fast, but does not possess ethernet network due to scene, and cannot encrypt in communication, Therefore only as the local maintenance upgrading after the software upgrading before dispatching from the factory, or the dismounting of field electric energy table;RS-485 serial ports Mode possesses existing communication network, therefore can use as remote upgrade, but owing to serial ports speed is slow, it is impossible to upgrading The program (such as kernel module) that program is bigger, can as main application module, the upgrading mode of expanded application module, As the upgrading mode of ruling by law metering module, but can also measure and will be affected during upgrading ruling by law metering module.
The electric energy meter software framework of the present embodiment offer and the method for online upgrading thereof, survey, right in implementation process After the upgrading of main application module, expanded application modular program, re-read the energy data after upgrading, carry out with standard scale Relatively, its error be consistent when not upgrading.
Finally illustrating, above example is only in order to illustrate technical scheme and unrestricted, although with reference to relatively The present invention has been described in detail by good embodiment, it will be understood by those within the art that, can be to the present invention Technical scheme modify or equivalent, without deviating from objective and the scope of the technical program, it all should be contained In the middle of scope of the presently claimed invention.

Claims (8)

1. an electric energy meter software online upgrading method based on operating system, it is characterised in that: comprise the following steps:
S1 upgrading is shaken hands: host computer sends software upgrading request message, and selects module to be upgraded;Electric energy meter After receiving upgrade request, it is judged that upgrade request message format and module to be upgraded are the most correct, it is judged that recognize after Zheng Que For shaking hands successfully, reply correct response message, and enter next step S2, the most directly exit escalation process;
S2 safety verification: host computer sends upgrade key, whether electric energy meter checking upgrade key is consistent with preset value; If met, then pass through safety verification and enter next step S3;The most directly exit escalation process;
S3 program transportation: the target execution program transportation that host computer will be upgraded is to electric energy meter, and electric energy meter is first after receiving It is cached in RAM;Host computer sends the complete message of program transportation, and described message performs program with whole target CRC check code;
S4 breakpoint transmission: electric energy meter waits new program transportation message, starts to continue from breakpoint location last time after receiving The routine data that caching newly receives, until the program transportation received is complete;
S5 program ver-ify: electric energy meter performs the length of program according to the target received, calculates RAM buffer area intermediate range The CRC check code of sequence, the CRC check code in the complete message of program transportation whether verification sends with host computer is consistent, As checked the most then and entering next step S6, the most directly exit whole escalation process;
S6 program Solidification: electric energy meter is by the program copy of RAM buffer area to address, corresponding region, program storage area; Determining program size, the most directly exits whole escalation process as exceeded limit value;If not less than, then program curing;
S7 program loads: the module type that electric energy meter is upgraded according to this, reloads the program after upgrading and runs;
S8 upgrades confirmation: after the program after upgrading is reloaded, recalculate the program CRC check code in FLASH, And this CRC check code is fed back to host computer;After host computer receives this CRC check code, the program checked and download CRC check code is the most consistent, if verification is consistent, thinks and upgrades successfully, and escalation process terminates, otherwise it is assumed that upgrading Failure.
2. electric energy meter software online upgrading method based on operating system as claimed in claim 1, it is characterised in that: The upgraded module selected in described step S1 includes that legality measurement module, kernel module, main application module and extension should By any one module in module.
3. electric energy meter software online upgrading method based on operating system as claimed in claim 1, it is characterised in that: Safety verification in described step S2 includes software verification and two aspects of hardware verification;Described software verification refers to close Key is verified, sends upgrade key by host computer, and whether electric energy meter authentication secret is consistent with preset value and realizes key and test Card process;Described hardware verification refers to when electric energy meter is in end cap open mode, to upgrading legal system metering module and interior Core module carries out proof procedure.
4. electric energy meter software online upgrading method based on operating system as claimed in claim 1, it is characterised in that: The target execution program transportation that host computer in described step S3 will be upgraded is to electric energy meter, specifically according to following steps Realize:
According to maximum data message length, whole target execution program is divided into the multiple message of continuous print;Transmission is all successively Message;Until end of transmission.
5. electric energy meter software online upgrading method based on operating system as claimed in claim 1, it is characterised in that: It is to realize according to the module type of upgrading that program in described step S7 loads, if the module of upgrading is legal system Metering module and kernel module, then use the automatically reset mode of whole device to reload;If the module of upgrading is Main application module and expanded application module, then reload the program of the two module by kernel module.
6. an electric energy meter software online upgrade system based on operating system, it is characterised in that: include kernel module And legality measurement module, main application module and the expanded application module being connected with kernel module respectively;
Described kernel module, for electric energy meter power-up initializing and the software and hardware resources managing whole electric energy meter;
Described legality measurement module, measures energy data for Real-time Collection and processes energy data;
Described main application module, if for storage dry-cure energy data module and by processing at energy data module Reason energy data;
Described expanded application module, for self-defined energy data processing module.
7. electric energy meter software online upgrade system based on operating system as claimed in claim 6, it is characterised in that: Described kernel module includes guiding module, operating system nucleus, application management module and driving support module;
Described guiding module has been used for power-up initializing, and is booted up operating system nucleus;
Described operating system nucleus, for providing at the memory management on operating system basis, task scheduling, interruption Reason process;
Described application management module, is used for starting and monitor legality measurement module, main application module and expanded application The running status of module, and automatically update the module of monitoring misoperation;
Described driving support module, it is provided that access bottom hardware resource interface, for legality measurement module, main application module Use with expanded application module.
8. electric energy meter software online upgrade system based on operating system as claimed in claim 6, it is characterised in that: Described main application module includes data computational threads unit, data storage threads unit, display thread units and order wire Cheng Danyuan;
Described data computational threads unit, for reading the energy data of legality measurement module, real-time measuring data, root Calculate requirement according to real-time measuring data, carry out load record process, monitor and judge whether decompression, defluidization event And carry out record, in the way of shared drive, it is supplied to data storage threads unit, display thread units and communication thread Unit uses;
Described data storage threads unit, for receiving the data that data computational threads processed, and by up-to-date generation Electric energy, requirement, logout are cured in nonvolatile memory;
Described display thread units, is used for monitoring key-case, carries out the display of button circulation, Automatic Cycle, self-inspection Process, the data of data computational threads unit are shown by liquid crystal display mode;
Described communication thread unit, for processing the transmitting-receiving of RS-485 serial ports and infrared data, assists according to DL/T645 View carries out the process of data.
CN201610292327.XA 2016-05-05 2016-05-05 A kind of electric energy meter software online upgrading method and system based on operating system Active CN105930193B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610292327.XA CN105930193B (en) 2016-05-05 2016-05-05 A kind of electric energy meter software online upgrading method and system based on operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610292327.XA CN105930193B (en) 2016-05-05 2016-05-05 A kind of electric energy meter software online upgrading method and system based on operating system

Publications (2)

Publication Number Publication Date
CN105930193A true CN105930193A (en) 2016-09-07
CN105930193B CN105930193B (en) 2019-04-16

Family

ID=56834547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610292327.XA Active CN105930193B (en) 2016-05-05 2016-05-05 A kind of electric energy meter software online upgrading method and system based on operating system

Country Status (1)

Country Link
CN (1) CN105930193B (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN106569853A (en) * 2016-11-02 2017-04-19 宁波三星医疗电气股份有限公司 Dual-core electric energy meter software upgrade testing method
CN106775588A (en) * 2016-11-30 2017-05-31 合肥科迈捷智能传感技术有限公司 A kind of firmware upgrade method based on principal and subordinate processor framework
CN107346255A (en) * 2017-05-18 2017-11-14 国网浙江省电力公司电力科学研究院 A kind of electric energy meter system upgrade method and electric energy meter system
CN108011750A (en) * 2017-11-10 2018-05-08 宁波三星医疗电气股份有限公司 The firmware upgrade method of communication module in a kind of centralized meter-reading system
CN108334282A (en) * 2017-12-28 2018-07-27 宁德时代新能源科技股份有限公司 Method and device for downloading program file of automobile electronic control unit
CN108964843A (en) * 2018-06-27 2018-12-07 宁波三星智能电气有限公司 A method of it is realized and is upgraded by intelligent electric energy meter infrared interface
CN109086106A (en) * 2018-06-20 2018-12-25 宁波三星智能电气有限公司 A method of the configuration area electric energy meter Code shows object
CN109189434A (en) * 2018-09-20 2019-01-11 安徽南瑞中天电力电子有限公司 A kind of online upgrading method of electric energy meter
CN110764813A (en) * 2019-10-31 2020-02-07 京东方科技集团股份有限公司 Upgrading method of system software and running method thereof
CN112163216A (en) * 2020-08-28 2021-01-01 中国电力科学研究院有限公司 Method and system for establishing safe computing environment of intelligent electric energy meter
CN112688942A (en) * 2020-12-23 2021-04-20 南方电网电力科技股份有限公司 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM
WO2021109522A1 (en) * 2019-12-06 2021-06-10 江苏智臻能源科技有限公司 Method for upgrading resident user load identification module
CN113204367A (en) * 2021-06-10 2021-08-03 华立科技股份有限公司 Function upgrading method and device, electronic equipment and storage medium
CN113312078A (en) * 2021-05-07 2021-08-27 南方电网数字电网研究院有限公司 Electric energy meter software modularization difference upgrading method and electric energy meter system
CN113377057A (en) * 2021-07-06 2021-09-10 河南牧原智能科技有限公司 Control device
CN114675861A (en) * 2022-04-07 2022-06-28 无锡市恒通电器有限公司 System software safety upgrading method of single-phase electric energy meter based on real-time operating system
CN118092981A (en) * 2024-04-19 2024-05-28 石家庄科林电气股份有限公司 Rapid upgrading method of Internet of things electric energy meter and electric energy meter

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102970372A (en) * 2012-12-04 2013-03-13 威胜集团有限公司 Remote upgrade method for carrier communication module of automatic meter reading system
CN103425505A (en) * 2012-05-21 2013-12-04 深圳市金正方科技有限公司 IC card electric energy meter on-line upgrading method and system
CN104063254A (en) * 2014-07-14 2014-09-24 威胜集团有限公司 Online upgrading method for electric energy meter
CN104572178A (en) * 2014-12-19 2015-04-29 南昌市科陆智能电网科技有限公司 Method and system for remote differential upgrading of electric energy meter embedding type software

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425505A (en) * 2012-05-21 2013-12-04 深圳市金正方科技有限公司 IC card electric energy meter on-line upgrading method and system
CN102970372A (en) * 2012-12-04 2013-03-13 威胜集团有限公司 Remote upgrade method for carrier communication module of automatic meter reading system
CN104063254A (en) * 2014-07-14 2014-09-24 威胜集团有限公司 Online upgrading method for electric energy meter
CN104572178A (en) * 2014-12-19 2015-04-29 南昌市科陆智能电网科技有限公司 Method and system for remote differential upgrading of electric energy meter embedding type software

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106485140A (en) * 2016-10-17 2017-03-08 中国电力科学研究院 A kind of upgrade method of electric energy meter and upgrade-system
CN106569853B (en) * 2016-11-02 2020-06-23 宁波三星医疗电气股份有限公司 Software upgrading test method for double-core electric energy meter
CN106569853A (en) * 2016-11-02 2017-04-19 宁波三星医疗电气股份有限公司 Dual-core electric energy meter software upgrade testing method
CN106775588A (en) * 2016-11-30 2017-05-31 合肥科迈捷智能传感技术有限公司 A kind of firmware upgrade method based on principal and subordinate processor framework
CN107346255A (en) * 2017-05-18 2017-11-14 国网浙江省电力公司电力科学研究院 A kind of electric energy meter system upgrade method and electric energy meter system
CN108011750A (en) * 2017-11-10 2018-05-08 宁波三星医疗电气股份有限公司 The firmware upgrade method of communication module in a kind of centralized meter-reading system
CN108011750B (en) * 2017-11-10 2021-02-26 宁波三星医疗电气股份有限公司 Firmware upgrading method for communication module in centralized meter reading system
CN108334282A (en) * 2017-12-28 2018-07-27 宁德时代新能源科技股份有限公司 Method and device for downloading program file of automobile electronic control unit
CN108334282B (en) * 2017-12-28 2021-07-09 宁德时代新能源科技股份有限公司 Method and device for downloading program file of automobile electronic control unit
CN109086106A (en) * 2018-06-20 2018-12-25 宁波三星智能电气有限公司 A method of the configuration area electric energy meter Code shows object
CN108964843A (en) * 2018-06-27 2018-12-07 宁波三星智能电气有限公司 A method of it is realized and is upgraded by intelligent electric energy meter infrared interface
CN109189434A (en) * 2018-09-20 2019-01-11 安徽南瑞中天电力电子有限公司 A kind of online upgrading method of electric energy meter
CN110764813A (en) * 2019-10-31 2020-02-07 京东方科技集团股份有限公司 Upgrading method of system software and running method thereof
WO2021109522A1 (en) * 2019-12-06 2021-06-10 江苏智臻能源科技有限公司 Method for upgrading resident user load identification module
CN112163216B (en) * 2020-08-28 2022-04-01 中国电力科学研究院有限公司 Method and system for establishing safe computing environment of intelligent electric energy meter
CN112163216A (en) * 2020-08-28 2021-01-01 中国电力科学研究院有限公司 Method and system for establishing safe computing environment of intelligent electric energy meter
CN112688942A (en) * 2020-12-23 2021-04-20 南方电网电力科技股份有限公司 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM
CN112688942B (en) * 2020-12-23 2022-02-11 南方电网电力科技股份有限公司 Electric energy meter firmware program upgrading method, device, medium and equipment based on ESAM
CN113312078A (en) * 2021-05-07 2021-08-27 南方电网数字电网研究院有限公司 Electric energy meter software modularization difference upgrading method and electric energy meter system
CN113204367A (en) * 2021-06-10 2021-08-03 华立科技股份有限公司 Function upgrading method and device, electronic equipment and storage medium
CN113204367B (en) * 2021-06-10 2023-04-14 华立科技股份有限公司 Function upgrading method and device, electronic equipment and storage medium
CN113377057A (en) * 2021-07-06 2021-09-10 河南牧原智能科技有限公司 Control device
CN114675861A (en) * 2022-04-07 2022-06-28 无锡市恒通电器有限公司 System software safety upgrading method of single-phase electric energy meter based on real-time operating system
CN118092981A (en) * 2024-04-19 2024-05-28 石家庄科林电气股份有限公司 Rapid upgrading method of Internet of things electric energy meter and electric energy meter

Also Published As

Publication number Publication date
CN105930193B (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN105930193A (en) Operating system based energy meter software online upgrade method and system
US20220121455A1 (en) Intent-based cluster administration
CN104520814B (en) System and method for configuring cloud computing systems
CN114253793A (en) Dynamic tracking control
CN104541247B (en) System and method for adjusting cloud computing system
CN110073646A (en) Safe IoT equipment updates
CN204990315U (en) Circuit and smart phone
CN104778074B (en) A kind of calculating task processing method and processing device
US10944581B2 (en) Increasing processing capacity of processor cores during initial program load processing
CN105281955A (en) Business and resource orchestration system, method and device
CN109753391A (en) The systems, devices and methods of the functional test of one or more structures of processor
CN108076457A (en) A kind of safety-type power grid private radio communication module of wisdom based on linux system
US20220308938A1 (en) Systems and methods for power management for modern workspaces
CN115668083A (en) Configuration device, update server and method for software update of a technical installation
CN106095415A (en) Exploitation file packing method, Apparatus and system
CN106569874B (en) Store the operating method and physical server of equipment
CN107678771A (en) A kind of method for optimizing battery management system online upgrading
US20200151049A1 (en) Increasing processing capacity of processor cores during initial program load processing
US20200151021A1 (en) Increasing processing capacity of virtual machines
CN111367621A (en) Intelligent contract timing processing method, block chain node and storage medium
CN108112268A (en) Management and the relevant load balancer of automatic expanded set
CN109948330B (en) Method, device, equipment and storage medium for implementing application management service
US20240160431A1 (en) Technologies to update firmware and microcode
CN104181927B (en) A kind of Flight Control Law management method and device
CN108614715A (en) A kind of Internet of Things gas meter, flow meter that can independently upgrade and upgrade method

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