Transmission line of electricity intelligent monitoring device software remote auto update methodTechnical field
The present invention relates to the transmission line of electricity monitoring technical field, be specifically related to a kind of transmission line of electricity intelligent monitoring device software remote auto update method.
Background technology
The transmission line of electricity intelligent monitoring device be mounted in being used on the iron tower of power transmission line monitor transmission line of electricity freeze thickness, wave amplitude, iron tower degree of tilt and the device of meteorologic parameter on every side; Its work under bad environment, reliability requirement are very high, carry out field software and upgrade very difficulty.For guaranteeing that transmission line of electricity intelligent monitoring device reliably working and function update, often need upgrade its application program, because the singularity of its installation site, when having determined that it is carried out program updates, remote update is the best approach.
At present, mostly transmission line of electricity intelligent monitoring device processor inside is digital signal processor (DSP) or advanced RISC machines (ARM), and use single-chip microcomputer (MCU) is also arranged.The update method of processor application programs; Also the difference because of processor is different: because DSP and ARM inside have bootstrap routine (BOOT-ROOM), so type processor can carry out remote update with inner telecommunications components and the public communication network of device by the bootstrap routine application programs through self built-in communication component; And MCU is not owing to there is bootstrap routine; So can't carry out the remote update of application program through above method; Even the MCU that has has boot program loads device (BSL); But this type of BSL can't upgrade the application program of self as the bootstrap routine of DSP or ARM, also just can't carry out remote update.
Transmission line of electricity intelligent monitoring device processor inside uses the benefit of MCU to be, can use the MCU of super low-power consumption, and it is minimum that the power consumption of total system is dropped to, and the power consumption of system is one of main technical indicator of system.Use super low-power consumption MCU, application program is simplified most, system running speed is the fastest, reacts the rapidest, so, realize that the remote update of super low-power consumption MCU application program has the meaning of particular importance as far as the transmission line of electricity intelligent monitoring device.
Summary of the invention
The purpose of this invention is to provide a kind of transmission line of electricity intelligent monitoring device software remote auto update method, make the super low-power consumption MCU in the transmission line of electricity intelligent monitoring device have the function of software remote update.
Technical scheme of the present invention is following:
A kind of transmission line of electricity intelligent monitoring device software remote auto update method comprises the steps:
(1) starts or restart MCU, operation BIOS;
(2) whether the memory inside of inspection MCU has updating mark, if updating mark is arranged, then changes step (3a) ~ (3c) over to; If there is not updating mark, then change step (4) over to;
(3a) program code and the interrupt service routine in application space and interrupt service routine space are wiped;
The new application program that (3b) will be kept in the buffer zone is write application space and interrupt service routine space with new interrupt service routine;
(3c) will preserve new application program and wipe, the updating mark of preserving will be wiped, change step (1) over to the buffer zone of new interrupt service routine;
(4) jump to the porch of application program, run application;
(5) through telecommunications components, in the inspection local computer whether the redaction of application program is arranged, if redaction is arranged, then change step (6) over to; If there is not redaction, then change step (7) over to;
(6) redaction of application program is downloaded to be wiped free of in the clean buffer zone, the storer inner at MCU writes updating mark, changes step (1) over to;
(7) application program is normally moved.
In the technique scheme:
Said MCU is the MCU of a kind of FLASH of having storer and built-in communication interface;
Said FLASH memory inside is divided into program area and two zones of buffer zone; Said program area is equipped with application program and BIOS.
Said telecommunications components is the intraware of transmission line of electricity intelligent monitoring device, and it can be communicated by letter with MCU, can communicate by letter with public communication network again.
Useful technique effect of the present invention is:
One, the present invention uses the processor of super low-power consumption MCU as the transmission line of electricity intelligent monitoring device; Make the power consumption of transmission line of electricity intelligent monitoring device reach minimum; Make the travelling speed and the reaction velocity of transmission line of electricity intelligent monitoring device reach the fastest, greatly improved the overall performance of transmission line of electricity intelligent monitoring device.
Two, the present invention makes telecommunications components, the public communication network that configuration MCU transmission line of electricity intelligent monitoring device can include through the built-in communication interface of MCU, device; Software in the local computer is carried out remote update automatically and brings into operation automatically, and this just makes the transmission line of electricity intelligent monitoring device of configuration MCU have actual use value.
Three, the present invention has used the processor of super low-power consumption MCU as the transmission line of electricity intelligent monitoring device, has further improved the overall performance of transmission line of electricity intelligent monitoring device.
Description of drawings
Fig. 1 is that system of the present invention forms synoptic diagram.
Fig. 2 is a FB(flow block) of the present invention.
Embodiment
Further specify below in conjunction with the accompanying drawing specific embodiments of the invention.
Fig. 1 shows system of the present invention and forms synoptic diagram.As shown in Figure 1;MCU 2 in the transmission line of electricity intelligent monitoring device 1 non-indigenous is that a kind of have can be from the super low-power consumption MCU of erasable flash memory (FLASH) 3 and built-incommunication interface 8; The FLASH storer 3 of this MCU is divided into two zones, and one is program area 4, and another is a buffer zone 5; 4 are equipped with two programs in the program area; One is Basic Input or Output System (BIOS) (BIOS) 6, and another is an application program 7, and buffer zone 5 is to be used for the temporary application program that is used to upgrade that from local computer, reads.In the life cycle of transmission line of electricity intelligent monitoring device,BIOS 6 is constant or does not upgrade in advance, the just application program 7 that changes or upgrade.Application program 7 is communicated by letter with thetelecommunications components 9 in the transmission line of electricity intelligent monitoring device 1 through the built-incommunication interface 8 of MCU, and thistelecommunications components 9 is communicated by letter withlocal computer 11 throughpublic communication network 10 again.
Fig. 2 shows FB(flow block) of the present invention.As shown in Figure 2; During the application program operation,, whether redaction (the step 5) of application program is arranged in the inspection local computer through telecommunications components; When in finding local computer, the application software that can supply upgrade being arranged; Then new application software is read into and has been wiped free of among the MCU in the clean buffer zone, the ad-hoc location at the inner storer of MCU writes updating mark then, restarts MCU (step 6).
When MCU starts or restarts, at first move BIOS (step 1), carry out specific operation after, jump to application program by BIOS again, run application; When MCU produces inside or external interrupt, at first enter into the BIOS relevant and interrupt with MCU hardware, interrupt jumping to the interrupt service routine operation of application program again by BIOS.
When BIOS moves; Whether the ad-hoc location of at first checking the storer that MCU is inner has updating mark (step 2); If have; Then at first the program code and the interrupt service routine in application space and interrupt service routine space are wiped (step 3a), the new application program that will be kept at again in the buffer zone is write application space and interrupt service routine space (step 3b) with new interrupt service routine, will preserve new application program again and wipe with the buffer zone of new interrupt service routine; Then the updating mark of preserving is wiped, restart MCU (step 3c) at last; If BIOS finds there is not the program updates sign, then jump to the porch of application program, still move previous application program (step 4).
At this moment, when checking that once more (during step 5), find has not had available renewal in the local computer to the redaction whether application program is arranged in the local computer, and the application program (step 7) of renewal has been accomplished in then normal operation.
In the present embodiment; Super low-power consumption MCU 2 in the transmission line of electricity intelligent monitoring device 1 selects the MSP430F5438A of U.S. Texas Instruments (TI) for use;Communication interface 8 in the MSP430F5438A is selected UART0 for use; Can the interrupt service routine of bios program, BIOS interrupt routine and application program, application program be placed in the 0x005c00-0x01ffff space of the inner erasable FLASH storer of MSP430F5438A, can buffer zone be arranged on 0x020000-0x02ffffspace.Telecommunications components 9 in the transmission line of electricity intelligent monitoring device 1 is selected the MC52i of the built-in ICP/IP protocol stack of Siemens Company for use, andpublic communication network 10 is selected the GPRS of China Mobile for use, andlocal computer 11 is selected any suitable computing machine, for example PC for use.
Above-described only is preferred implementation of the present invention, the invention is not restricted to above embodiment.Be appreciated that other improvement and variation that those skilled in the art directly derive or associate under the prerequisite that does not break away from basic design of the present invention, all should think to be included within protection scope of the present invention.