CN100543680C - A kind of method of the electric energy meter chip program being carried out down loading updating - Google Patents

A kind of method of the electric energy meter chip program being carried out down loading updating Download PDF

Info

Publication number
CN100543680C
CN100543680C CNB2007100729524A CN200710072952A CN100543680C CN 100543680 C CN100543680 C CN 100543680C CN B2007100729524 A CNB2007100729524 A CN B2007100729524A CN 200710072952 A CN200710072952 A CN 200710072952A CN 100543680 C CN100543680 C CN 100543680C
Authority
CN
China
Prior art keywords
electric energy
energy meter
applications
upper layer
layer software
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2007100729524A
Other languages
Chinese (zh)
Other versions
CN101221506A (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.)
Shenzhen Clou Electronics Co Ltd
Original Assignee
Shenzhen Clou Electronics 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 Shenzhen Clou Electronics Co Ltd filed Critical Shenzhen Clou Electronics Co Ltd
Priority to CNB2007100729524A priority Critical patent/CN100543680C/en
Publication of CN101221506A publication Critical patent/CN101221506A/en
Application granted granted Critical
Publication of CN100543680C publication Critical patent/CN100543680C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present invention relates to a kind of the electric energy meter chip program be carried out the method for down loading updating, carry out following steps at upper layer software (applications): a. upper layer software (applications) downlink broadcast command frame 1...N; B. the descending question and answer command frame of upper layer software (applications) N+1, descending upper layer software (applications) output CRC16 check results; C. the descending question and answer command frame of upper layer software (applications) N+2 reads the zone bit data that electric energy meter returns; Carry out following steps at electric energy meter: after the d. electric energy meter receives the broadcasting instructions frame data, switch to the refresh routine state and upgrade processing accordingly; E. after receiving the descending command frame N+1 of upper layer software (applications), the descending CRC16 check results of upper layer software (applications) and the CRC16 check results of electric energy meter inside are compared processing; F. after receiving the descending command frame N+2 of upper layer software (applications), electric energy meter returns the acknowledgement frame of band zone bit data to upper layer software (applications).Implement the present invention, make electric energy meter chip program down loading updating in the electric energy meter mass production process, speed is faster, reliability is higher.

Description

A kind of method of the electric energy meter chip program being carried out down loading updating
Technical field
The present invention relates to electric energy meter and communication technique field, more particularly, relate to a kind of method of the electric energy meter chip program being carried out down loading updating.
Background technology
In the electric energy meter production run, the general existence when laying in a large amount of stocks with preemergency, various type products are arranged in the stock, product chips program is also had nothing in common with each other.When the needs shipment, generally be the product that from stock, accesses the model that adapts, but product function may not accord with the demands of the market comprehensively in the stock, at this moment need the chip program in the stock is carried out down loading updating, so that meet the need of market.In the mass production process, particularly tight in the time of delivery, more seem particularly convenient important when shipment amount is big.
As shown in Figure 1, in the prior art, generally adopt catechetical software download update scheme, the step of down loading updating is as follows:
S1, upper layer software (applications) send command frame to electric energy meter.Upper layer software (applications) downlink broadcast command frame 1...N, N is by the decision of chip program size, and per 128 bytes are a frame.
S2, electric energy meter receive and handle described command frame.Electric energy meter is handled the command frame 1...N that the upper layer software (applications) module is sent, and each command frame of sending for upper layer software (applications) all can the echo reply frame.
S3, upper layer software (applications) are handled the acknowledgement frame that electric energy meter returns.That is to say that the upper layer software (applications) module all can be handled one by one for the acknowledgement frame 1...N that electric energy meter returns.
S4, upper layer software (applications) carry out verification to acknowledgement frame in the processing procedure to the acknowledgement frame that returns, do not make mistakes if handle, and represent that then electric energy meter is qualified, the program down loading updating success; Otherwise the expression electric energy meter is defective, and program down loading updating is unsuccessful.
S5, continue the down loading updating of next piece electric energy meter chip program and circulation execution in step S1.
Hence one can see that, and prior art can only be upgraded plot of electric energy meter chip, and speed is slow, and it is more to lose time; And this scheme only carried out verification once to the down loading updating of electric energy meter chip, and this verification is difficult to guarantee the integrality and the security of 100% down loading updating packet, so also can cause the data down loading updating unsuccessful.
Summary of the invention
Above-mentioned defective at prior art, the present invention will solve in the prior art that the electric energy meter chip program is carried out in the method for down loading updating existing speed is slow, problems such as security is low, a kind of method of the electric energy meter chip program being carried out down loading updating is provided, so that electric energy meter is carried out high speed, efficiently, down loading updating accurately.
The technical solution adopted for the present invention to solve the technical problems is: provides a kind of the electric energy meter chip program carried out the method for down loading updating, between upper layer software (applications) and electric energy meter, carry out data transmission,
Carry out following steps at upper layer software (applications):
A, upper layer software (applications) downlink broadcast command frame 1...N, wherein N is by the chip program size decision of electric energy meter;
B, the descending question and answer command frame of upper layer software (applications) N+1, the check results of descending upper layer software (applications) output cyclic redundancy check (CRC), described CRC16 check results is by the verification among the described broadcasting instructions frame 1...N and to carry out the cyclic redundancy check (CRC) computing resultant;
C, the descending question and answer command frame of upper layer software (applications) N+2 read the zone bit data that electric energy meter returns;
Carry out following steps at electric energy meter:
After d, electric energy meter receive described broadcasting instructions frame data, switch to the refresh routine state and upgrade processing accordingly;
E, receive the descending command frame N+1 of upper layer software (applications) after, the check results of the cyclic redundancy check (CRC) of the check results of the downlink cycle redundancy check of upper layer software (applications) and electric energy meter inside is compared processing;
F, receive the descending command frame N+2 of upper layer software (applications) after, electric energy meter sends the acknowledgement frame of band zone bit data to upper layer software (applications).
In method of the present invention, described step c specifically comprises:
If described zone bit data are 1, it is unsuccessful to represent that then this electric energy meter chip program upgrades;
If described zone bit data are 0, represent that then this electric energy meter chip program upgrades successfully.
In method of the present invention, in the described steps d, corresponding renewal is handled and is specifically comprised:
D1, to put zone bit be 0;
D2, after receiving complete broadcasting instructions frame 1...N, carry out verification and computing, and check whether safe and complete of described command frame;
D3, carry out the renewal of electric energy meter program; If any illegal situation appears in verification or renewal process, then putting zone bit is 1, but not up any command frame in the whole broadcasting process.
In method of the present invention, among the described step e, described comparison process specifically comprises:
If the check results of the downlink cycle redundancy check of upper layer software (applications) is identical with the check results of the cyclic redundancy check (CRC) of electric energy meter inside, represent that then the command frame of being received is continuous, and each frame all is complete;
If the check results of the downlink cycle redundancy check of upper layer software (applications) is different with the check results of the cyclic redundancy check (CRC) of electric energy meter inside, the packet of then representing to be received is 1 for illegal with its mark position.
In method of the present invention, the data transmission between described upper layer software (applications) and the described electric energy meter adopts the DL/T645-1997 communication protocol.
In method of the present invention, each frame data of broadcasting instructions frame are 128 bytes, and in the descending process of broadcasting instructions frame, electric energy meter is forbidden the up-on command frame, and electric energy meter is forbidden initiatively up-on command frame in the chip program renewal process.
In method of the present invention, the method for calibration that described cyclic redundancy check (CRC) employing cyclic redundancy check (CRC) is 16 is carried out verification to the checksum result of all broadcasting instructions frames.
In method of the present invention, after electric energy meter receives the broadcasting instructions frame data, upgrade chip program; If if mistake occurs, be 1 with the mark position then in this renewal process, expression electric energy meter refresh routine is defective.
In method of the present invention, described upper layer software (applications) is connected with described electric energy meter by RS232 or RS485 serial ports.
In method of the present invention, the data transmission between described upper layer software (applications) and power source, standard scale, the error plate adopts internal standard communication protocol.
The invention solves two subject matters in the down loading updating system of the prior art: the efficiency of one down loading updating, the complete and safety problem of data transmission during its two down loading updating.Thereby make the production run efficient of electric energy meter improve greatly, the program downloading reliability is higher, security is stronger, and data are more complete, can reach more practical effect.
Description of drawings
The invention will be further described below in conjunction with drawings and Examples, in the accompanying drawing:
Fig. 1 is the process flow diagram of down loading updating of the electric energy meter chip program of prior art;
Fig. 2 is the process flow diagram of the down loading updating of electric energy meter chip program of the present invention;
Fig. 3 is the structural representation of the down loading updating of a plurality of electric energy meter chip programs of the present invention;
Fig. 4 is the process flow diagram of down loading updating of a plurality of electric energy meter chip programs of Fig. 3.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
As shown in Figure 2, a kind of the electric energy meter chip program is carried out the method for down loading updating, wherein,
Need upgrade the electric energy meter of chip program for any, upper layer software (applications) sends the command frame data to electric energy meter according to the following steps:
A, upper layer software (applications) downlink broadcast command frame 1...N, N is by the decision of chip program size, and per 128 bytes are a frame, and it is descending that every frame is pressed DL/T645-1997 " multifunctional electric energy meter communication protocol " frame format.
B, the descending question and answer command frame of upper layer software (applications) N+1, descending upper layer software (applications) output cyclic redundancy check (CRC) (CyclicRedundancy Check/Code, abbreviation CRC) check results, what cyclic redundancy check (CRC) adopted in the preferred embodiment of the present invention is the method for calibration of 16 of cyclic redundancy check (CRC), be CRC16, this CRC16 check results is by the verification among the broadcasting instructions frame 1...N and carry out CRC16 verification computing and drawn.
C, the descending question and answer command frame of upper layer software (applications) N+2 read electric energy meter zone bit data, if flag is 1, the expression electric energy meter is defective, and program down loading updating is unsuccessful; Otherwise the expression electric energy meter is qualified, the program down loading updating success.
For electric energy meter, then receive and handle the command frame of sending by upper layer software (applications) according to the following steps:
D, electric energy meter switch to the refresh routine state, and to put zone bit be 0; After receiving complete broadcasting instructions frame 1...N, carry out verification and computing, and check whether safe and complete of described command frame; And then carry out the renewal of electric energy meter program.If any illegal situation appears in verification or renewal process, then putting zone bit is 1, but not up any command frame in the whole broadcasting process.
E, receive the descending command frame N+1 of upper layer software (applications) after, the descending CRC16 check results of upper layer software (applications) and the CRC16 check results of electric energy meter inside are compared, if both are identical, represent that then the command frame of being received is continuous, and each frame all is complete.Otherwise the packet that expression is received is 1 for illegal with its mark position.
F, receive the descending command frame N+2 of upper layer software (applications) after, electric energy meter is made and being replied, and returns the acknowledgement frame of band zone bit data to upper layer software (applications).
The method that electric energy meter chip program of the present invention is downloaded adopts the broadcasting instructions data download, utilizes verification, verification and CRC16 verification provide guarantee to the complete safety of data again.
Fig. 3 shows the structural representation of the down loading updating of a plurality of electric energy meter chip programs, down loading updating software links to each other with communication controller (as the CL2011 communication controller) in the rack by the PC serial ports, by communication controller power controlling source (as the CL303 power source), standard scale (as the CL311V2 standard scale), by school electric energy communication (Ji Yuan when being accurate among Fig. 3, Ji Yuan during as the CL191 precision), communication controller and power source, standard scale is followed internal standard communication protocol (as CLT1.0 communication protocol) jointly, and follows multifunctional electric energy meter communication protocol DL/T645-1997 with calibrated meter communication protocol.
Be provided with two row's electric energy meters on the meter hanging frame in the preferred embodiment of the present invention, totally 12, that is to say that 12 electric energy meter chip programs can carry out down loading updating simultaneously, communication controler communicates by each electric energy meter in Error Calculator (as the CL188E Error Calculator) and the meter hanging frame respectively.
As shown in Figure 4, according to the step of above-mentioned electric energy meter chip program down loading updating, specific as follows:
Step 1:PC machine is connected with power source, standard scale, communication controller and meter hanging frame by serial ports, and promptly the down loading updating software in the PC instructs to power source, standard scale, Error Calculator (as the CL188E Error Calculator) company of sending machine by the PC serial ports.
Step 2: after connecting machine and instructing successfully, according to by the essential informations such as electric current and voltage in school, power source sent rise sourse instruction, and the power that adapts of output and calibrated meter.
After the constant power source is stable, all calibrated meter broadcasting instructions are entered the down loading updating state, this moment, all calibrated meters were understood toot sound (can be set to ring three), and liquid crystal display enters the renewal original state, and all calibrated meter mark positions are 0.
Step 3: the down loading updating program is carried out piecemeal to needs electric energy meter chip program length and is handled, the program that embodiments of the invention will need to download is divided into the N frame, it is the N=Len/128 frame, every frame is 128 bytes, last frame is not enough to be mended " 0 ", every frame period 500ms is descending by broadcasting instructions, broadcast downstream 1-N frame.
Step 4: after all ammeters receive broadcast data, then begin data are handled.If any mistake is arranged, then zone bit is 1 in the result; If without any mistake, then expression is normal, and zone bit is constant.But in the program broadcasting process, do not return any uplink frame.
Step 5: broadcast downstream N+1 frame, this frame are CRC16 verification frame result's Frame.
Step 6: after all ammeters receive the result data of broadcasting CRC check, compare with self check results, if unequal, then zone bit is 1; If equate that then zone bit is constant.But in the program broadcasting process, do not return any uplink frame.
Step 7: broadcast downstream N+2 frame, and read every calibrated meter target zone bit data.
Step 8: calibrated meter returns the Frame that has the zone bit data after receiving instruction.
Step 9: the down loading updating program judges that according to the zone bit data of every calibrated meter zone bit is that 0 this table of expression is qualified, otherwise represents that this table is for defective.
Hence one can see that, adopt method of the present invention can make electric energy meter chip program down loading updating in the electric energy meter mass production process, speed is faster, reliability is higher, security is stronger, data are more complete, table time of down loading updating of the present invention is the same with 12 table times, efficient than prior art scheme improves 12 times, thereby reaches more practical effect.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1, a kind of the electric energy meter chip program is carried out the method for down loading updating, between upper layer software (applications) and electric energy meter, carries out data transmission, it is characterized in that,
Carry out following steps at upper layer software (applications):
A, upper layer software (applications) downlink broadcast command frame 1...N, wherein N is by the chip program size decision of electric energy meter;
B, the descending question and answer command frame of upper layer software (applications) N+1, the check results of descending upper layer software (applications) output cyclic redundancy check (CRC), the check results of described cyclic redundancy check (CRC) is by the verification among the described broadcasting instructions frame 1...N and to carry out the cyclic redundancy check (CRC) computing resultant;
C, the descending question and answer command frame of upper layer software (applications) N+2 read the zone bit data that electric energy meter returns;
Carry out following steps at electric energy meter:
After d, electric energy meter receive described broadcasting instructions frame data, switch to the refresh routine state and upgrade processing accordingly;
E, receive the descending command frame N+1 of upper layer software (applications) after, the check results of the cyclic redundancy check (CRC) of the check results of the downlink cycle redundancy check of upper layer software (applications) and electric energy meter inside is compared processing;
F, receive the descending command frame N+2 of upper layer software (applications) after, electric energy meter sends the acknowledgement frame of band zone bit data to upper layer software (applications).
2, according to claim 1 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that described step c specifically comprises:
If described zone bit data are 1, it is unsuccessful to represent that then this electric energy meter chip program upgrades;
If described zone bit data are 0, represent that then this electric energy meter chip program upgrades successfully.
3, according to claim 1 and 2 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that in the described steps d, corresponding renewal is handled and specifically comprised:
D1, to put zone bit be 0;
D2, after receiving complete broadcasting instructions frame 1...N, carry out verification and computing, and check whether safe and complete of described command frame;
D3, carry out the renewal of electric energy meter program; If any illegal situation appears in verification or renewal process, then putting zone bit is 1, but not up any command frame in the whole broadcasting process.
4, according to claim 1 and 2 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that among the described step e, described comparison process specifically comprises:
If the check results of the downlink cycle redundancy check of upper layer software (applications) is identical with the check results of the cyclic redundancy check (CRC) of electric energy meter inside, represent that then the command frame of being received is continuous, and each frame all is complete;
If the check results of the downlink cycle redundancy check of upper layer software (applications) is different with the check results of the cyclic redundancy check (CRC) of electric energy meter inside, the packet of then representing to be received is 1 for illegal with its mark position.
5, according to claim 1 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that the data transmission between described upper layer software (applications) and the described electric energy meter adopts the DL/T645-1997 communication protocol.
6, method of the electric energy meter chip program being carried out down loading updating according to claim 1, it is characterized in that, each frame data of broadcasting instructions frame are 128 bytes, in the descending process of broadcasting instructions frame, electric energy meter is forbidden the up-on command frame, and electric energy meter is forbidden initiatively up-on command frame in the chip program renewal process.
7, method according to claim 1 is characterized in that, the method for calibration that described cyclic redundancy check (CRC) employing cyclic redundancy check (CRC) is 16 is carried out verification to the checksum result of all broadcasting instructions frames.
8, according to claim 1 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that, after electric energy meter receives the broadcasting instructions frame data, upgrade chip program; If if mistake occurs, be 1 with the mark position then in this renewal process, expression electric energy meter refresh routine is defective.
9, according to claim 1 the electric energy meter chip program is carried out the method for down loading updating, it is characterized in that described upper layer software (applications) is connected with described electric energy meter by RS232 or RS485 serial ports.
CNB2007100729524A 2007-01-12 2007-01-12 A kind of method of the electric energy meter chip program being carried out down loading updating Expired - Fee Related CN100543680C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007100729524A CN100543680C (en) 2007-01-12 2007-01-12 A kind of method of the electric energy meter chip program being carried out down loading updating

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007100729524A CN100543680C (en) 2007-01-12 2007-01-12 A kind of method of the electric energy meter chip program being carried out down loading updating

Publications (2)

Publication Number Publication Date
CN101221506A CN101221506A (en) 2008-07-16
CN100543680C true CN100543680C (en) 2009-09-23

Family

ID=39631366

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007100729524A Expired - Fee Related CN100543680C (en) 2007-01-12 2007-01-12 A kind of method of the electric energy meter chip program being carried out down loading updating

Country Status (1)

Country Link
CN (1) CN100543680C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102890757B (en) * 2012-09-11 2015-08-05 中国电力科学研究院 A kind of comparison method of electric energy meter software and Compare System thereof
CN102929655A (en) * 2012-09-26 2013-02-13 瑞斯康达科技发展股份有限公司 Method for writing data files into flash memory chip as well as pre-treatment method and device
CN103473088B (en) * 2013-08-30 2018-01-02 北京远特科技股份有限公司 A kind of single-chip microcomputer online upgrading method and system
CN103677943B (en) * 2013-12-27 2017-08-15 浙江众邦机电科技有限公司 A kind of sewing machine control method for upgrading software
CN104503897B (en) * 2014-10-21 2017-07-21 惠州市龙鼎盛电力科技有限公司 A kind of electric energy meter software design method that a variety of interactive modes can be achieved
CN105511912B (en) * 2015-11-28 2017-09-12 惠州市蓝微新源技术有限公司 A kind of program down-loading method based on CAN
CN108768709A (en) * 2018-05-18 2018-11-06 深圳国人通信股份有限公司 A kind of serial ports remote upgrade method of the network equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5548527A (en) * 1992-02-21 1996-08-20 Abb Power T&D Company Inc. Programmable electrical energy meter utilizing a non-volatile memory
FR2879777A1 (en) * 2004-12-17 2006-06-23 Actaris Sas Soc Par Actions Si New application code downloading method for energy meter, involves controlling verification of presence of control information of code in memory, and permitting meter to remain in limited operating mode if information is not in memory

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5548527A (en) * 1992-02-21 1996-08-20 Abb Power T&D Company Inc. Programmable electrical energy meter utilizing a non-volatile memory
FR2879777A1 (en) * 2004-12-17 2006-06-23 Actaris Sas Soc Par Actions Si New application code downloading method for energy meter, involves controlling verification of presence of control information of code in memory, and permitting meter to remain in limited operating mode if information is not in memory

Also Published As

Publication number Publication date
CN101221506A (en) 2008-07-16

Similar Documents

Publication Publication Date Title
CN100543680C (en) A kind of method of the electric energy meter chip program being carried out down loading updating
CN104702474B (en) A kind of EtherCAT master station devices based on FPGA
CN105117253A (en) BootLoader based remote upgrade method for UV LED (Ultraviolet Light Emitting Diode) curing system
CN106933632A (en) FPGA function online upgrading methods based on Ethernet
CN104580484B (en) A kind of remote upgrade method of GPRS terminals
CN201383709Y (en) Remote software automatic upgrading device for intelligent electric device
CN105159109B (en) A kind of PLC controller remote update system
CN105278437A (en) Modbus RTU/ASCII protocol realization method based on S7-300/400 PLC
CN104859909A (en) Packing method of mobile phone and control device
CN102711095B (en) A kind of method of the node in wireless sensor network being carried out to radio upgrade
CN102787932A (en) Apparatus and method for matching and calibrating electric control diesel engine based on serial communication
CN105335316A (en) Motor assembling line serial port server based on cloud computation
CN103955190B (en) A kind of network control method for distributed intelligence test system
CN103419199A (en) Teaching system based on open type welding robot
CN108469961A (en) One kind is based on micromation embedded platform remote update system and method
CN204733178U (en) A kind of EtherCAT master station device based on FPGA
CN104660372B (en) One kind is based on single-chip microcomputer asynchronous serial port multi-channel data transmission method and system
CN106598668A (en) Method for carrying out remote upgrade on AGV (Automatic Guided Vehicle) logistic transportation system on basis of dispatching system
CN107301067A (en) Beidou subscriber machine remote update system and its upgrade method based on IAP technologies
CN205281479U (en) Intelligent substation's SCD file inspection device
CN204926225U (en) Signature equipment
CN105721563A (en) Intelligent window curtain control system based on Android and Zigbee
CN103838587A (en) Control system remote upgrading method and device based on GPRS
CN112147562B (en) Bluetooth communication frame-based meter calibration method, system and meter calibration device
CN104713553A (en) Signal processing apparatus of micro-inertia measurement unit, and method thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090923

Termination date: 20130112

CF01 Termination of patent right due to non-payment of annual fee