2017 2nd International Conference on Artificial Intelligence: Techniques and Applications (AITA 2017) ISBN: 978-1-60595-491-2 Research and Design of Distributed Remote Upgrade Technology for Voltage Monitoring Terminal Yi-qin BAO School of Information Engineering, Nanjing Xiaozhuang University, Nanjing, China, 211171 Keywords: Distributed system, Droken-point Continuously-transferring, Remote upgrade. Abstract. Grid voltage monitor is a terminal to measure the voltage and the voltage distortion rate, analysis of voltage quality, is one of the essential tools for power system monitoring, assessment of power supply voltage quality. With the continuous growing number of voltage monitoring terminal and the function demand, it is a daily requirement that regularly remote upgrade voltage monitor embedded software IAP, but, remote upgrade is a high-risk operation, many manufacturers have non-unified standard to realize the upgrade process, there are still upgrading the efficiency, stability and safety of the problem to think, sometimes operation improper or communication interrupt, will cause the voltage monitor abnormal work or crash, affecting the normal operation of the whole system. This paper introduced a BP_IAP method for distributed broken-point continuouslytransferring, safety certification, to ensure reliable operation of remote upgrade, through practice test, the whole upgrade platform work efficiency and safety, reduce the transport time and save upgrading process performance. Introduction In this paper, Firstly we discuss remote voltage monitor system infrastructures, providing a standard remote upgrading [1] algorithm, implemented by HEX download file, in the last part we compared with other traditional upgrading methods, we present a new method BP_IAP method, it is a high real-time system with remote safety certification [2] and it can retransfer files between two nodes from the latest file transfer break point[3], and makes file resources in the system can be shared by group. Through above steps ensure that remote embedded software upgrading process is smooth, high performance and safety. It is useful for voltage quality control and boost voltage terminal upgrading and monitor performance management to a high level. System Infrastructure and Platform Designing Voltage Monitors System and Components Remote voltage monitors terminal designing. Remote voltage monitor terminal implementation based on LPC2136 chip, it support 32KB RAM and built-in flash 256k memory, two series port, SPI interface.the LPC2136 microcontrollers are based on a 16/32-bit ARM7TDMI-S CPU with real-time emulation and embedded trace support, that combine the microcontroller with 256 kb of embedded high-speed flash memory. A 128-bit wide memory interface and unique accelerator architecture enable 32-bit code execution at maximum clock rate. Voltage Monitors System Infrastructure The voltage monitoring system mainly includes the voltage monitor, the front end computer server, the database and the WEB server, the remote monitoring and remote monitoring application system, the WEB application terminal, etc., and the distributed system [4], as shown in Figure 1. The voltage monitor is connected to the front end by the fixed IP address with the GPRS and the data communication is realized. However, with the increase of the number of the front machine (up to 207
10000 sites) connected with the voltage monitor, the load balance [5] technology is implemented in the system. The connection between the voltage monitor and the front engine is dynamic, and the program is completed by the task scheduling dispatched. System Software Framework and Design System Software Introduction Figure 1. Voltage monitor system and upgrading system. Software platform include front end server and master station application platform, frond end server talk with master platform, receive master station sending diagrams. By telecommunication protocol analysis, Front end server connect with task dispatcher and telecom interface, connect with monitor terminal. File Transfer Protocol Format Upgrading process is involved in upgrade file transfer, it is important to specify the data frame format. Table 1. Frame structure. Field Identification Beginning character Length Length Beginning characte Control Address field Link data Check Sum End of character value meaning 68H L L 68H C A data cs 16H Table 2. Link customer data frame format. Data field ID Application level function code AFN Frame sequence SEQ Data Unit ID (1-N) DA.DT. Data Unit (1-N) UNIT In above frame format, the link address field contains the administrative area code + terminal address (remote voltage monitor address), it is the only identification for the distributed data sending and receiving. The user data contains all user type data, and the data is distinguished by the function code and data unit identification, as shown in table 2. HEX File Frame Structure Analysis Voltage monitor terminal adopted ARM7 LPC2136 chip, use keil simulation and developing kit, 208
produced HEX file, this file can edit with editor software, the information contained in each row as listed as follows: Table 3. HEX data frame. LEN ADDR TYPE DATA CS Above in table 3, LEN column stands for data byte number, length is one byte, Address presents the beginning address, 2 bytes, Type: record type,one byte, Hex file begin when type=04,hex file data record when type=00,data: Hex data file length=len,cs: Check sum. For example: one HEX file :020000040000FA :1020000018F09FE518F09FE518F09FE510F09FE5A8 :102010000CF09FE5846FA0B80CF09FE50CF09FE5F5 :102020002C21000034200000382000009420000003 :0CBF90000000000040000040EC1F00001A :00000001FF Above file data can be read as following: (1) Header file : 020000040000FA Here: 02 stand for record data length byte number 0000: this four consecutive 0 is always configured 04: record data type 0000: the fragment address FA: check sum value (2) Data file part: :1020000018F09FE518F09FE518F09FE510F09FE5A8 10: byte lengths of current row record 2000: EPROM memory begin address, this address is for the programming address that EPROM will wirte 00: type of record, here stands for data record 18F0-9FE5: HEX file data A8: Check sum of record (3) File end : 00000001FF 00 data byte number in record 0000 this field values is configured to 0000 04 this field is red FF Check sum of record Remote Upgrading Software Created Program to burn to the voltage monitor, include two programming: one is boot.hex, another is main.hex. boot.hex is booting program. Compile starting with 0x0, boot.hex has integrated two programs: boot.hex and main.hex. boot.hex is the start point of the program, the start address from the beginning of the 0x0, the main function is: when the power mounted, boot.hex look up the boot flag (4 bytes), if it equals 0xAA, 0xAA then enter the main program main.hex, if the value is 0x55, will fetch new main.hex by GPRS channel and override previous main.hex program. Main.hex is a remote upgrading program, if we upgrade this main program, we set the beginning address 0X2000, when compiled it, beginning address starting from 0x2000,main.hex can realize the function of voltage monitor terminal. If we don t upgrade the remote monitor software, we set the beginning address 0X0000,at the same time, we don t need boot.hex file According to above section, adopt file format to merge two Hex file: boot.hex and main.hex into one dy-main.hex file, format as following: 209
Boot header: Boot body: address starting from 0x0 Main body: address starting from 0x2000 Main end. Dy-main.hex is an IAP function of the voltage monitor program, to be written to LPC2136 in advance in main station, then sending upgrade software from the main station to local site, then go through online upgrading process by dy_main.hex program. File Transfer with Breakpoint Continuously Transfer Solution File transfer with breakpoint continuingly functions. (1) The master site fetched main.hex program according to section 2.3, count the total row numbers stored in variable RowNum, calculate the total diagram number stored in variable TotalNum, each 16 lines into a packet. The C program for calculating above RowNum and TotalNum parameter is as follows: RowNum=RowNum-2; if (RowNum%16=0) TotalNum=(RowNum/16); else TotalNum=(RowNum/16)+1; (2) Before sen ding, each line data with ASC code character will be converted into Hexadecimal code, a packet consist of 16 lines, according to the format of table 5, each file stores 16 rows of data, a total of 16*16=256 bytes, the last file may be less than 256 bytes. (3) To send data packets according to section 2.2 the communication protocol. (4) In the last frame of the packet we need to put extra 2 bytes, which is the entire file data checksum(cs). (5) The terminal receives all packets and computes the checksum( CS1) of all packet datas. If CS is equal to CS1, the file transfer is correct. File Transfer with Break Point Principle. For example, before dy_main.hex file sent, It will be divided into small packet message, which contain n messages, message sequences number beginning at S1 and ending at Sn, corresponding assigned each initial transfer status Fi=0 (i=1,n). By GPRS telecommunication all messages will be sent, if error occurred or timeout reached (10 seconds),the same packet will be sent again, up to three times before success. While receiving correct response message after the upgrade, check all message sign Fi (i=1, n) in platform side, such as Fi equal 0, Si is the breakpoint. Repeat the above process of message re-send, until all the message flag assigned to 1; finally compares checksum, these steps shown as in figure 4. If receive error response or time out, then repeat. Repeat above procedure send the messages from Si, until all message flag value equals to 1. Remote Software Upgrading Safety Designing Remote software upgrading is a high risk operation; upgrading process should be strictly controlled, also pay attention to the upgrading efficiency, like upgrade time duration, successful rate, especially in actual scenarios system platform need upgrade large number of terminal at the same time, should avoid the system crash and other issues, so in above process, we designed the following algorithm and techniques: (1) Each voltage terminal assigned unique code, for example each monitor with an area code + terminal address code as terminal ID, the front-end machine can be set by multi-thread technology to realize synchronization upgrade. (2) Before front end machine connect with voltage monitor terminal terminal, use the AFN code (06H) to authenticate each other (3) When the transmission message is transmitted, each packet has a parity check code to ensure that the message is correct. 210
(4) After the end of the packet transmission, the entire file is verified to ensure the integrity of the upgrade file. (5) If transfer file check is correct, will mark 4 byte with value as four 0x55H as symbol, then restart the terminal, the boot program substitute it with new program if it find the value equals four 0x55H, with replacement upgrade process successfully finished, the new symbol will be assigned to four 0xAA, to ensure the correct operation of the upgrade. (6) Finally, the master station is confirmed by reading the software version number to determine the upgrading job done. Through above upgrading steps and technology process, ensure the security of the file remote upgrade successfully. System Upgrade Validation & Testing In our ARM7 test environment, we adopted our new upgrading method compared with traditional voltage monitor terminal process, testing item including the number of upgrading site,file size, loss of package, consumption time, and successfully rate as following: Table 4. Adopt Tradition IAP upgrade method. VS Table 5. Adopt new BP- IAP upgrade method. upgrade number file size packet loss rate time success rate upgrade number file size packet loss rate time success rate 40 212Kb 15.6% 200Min 95% 50 287Kb 6.5% 28Min 100% From above test results can be seen, the new voltage monitor BP_IAP upgrade 50 terminals only 28 minutes, and the traditional voltage monitor IAP upgrade 40 terminals has been used for 200 minutes, it is very clear that BP_IAP upgrade efficiency greatly improved, more important is the success rate from 95% to 100%, and the security is better, to achieve the purpose of BP_IAP remote upgrade. Conclusions This paper describes the design and implementation of remote upgrade based on ARM7 voltage monitor. The paper mainly describes the design and implementation of ARM7 chip HEX file, communication protocol, and remote upgrade software platform. The platform is based on the GPRS communication distribution to realize file remote upgrade. In addition, the BP_IAP upgrade technology used in this paper has certain benefits and reference for other embedded system remote upgrades. References [1] Liu Jing, Liu Xiaoxiao, Tian Jianwei, Wen Hui. Design and implementation of remote upgrade platform for power information acquisition terminal [J]. Computer applications and software, 2014. 31 (1):330-333. [2] Dai Hao. Design and implementation of FTP based file timing transmission software [J]. Computer applications and software, 2013, 30(1): 332 333. [3] Xu Xuguang, Ou Yuyi, Ling Jie, Jiang Xiangyang, Wang shuang tu. Based PUF lightweight RFID security authentication protocol [J]. Computer applications and software, 2014, 31(11): 302 306. [4] Wang Zheng. One Distributed component model [J] support an OpenMP thread bound.computer applications and software.2013, 30(3): 203 206. [5] Kim, Li Qiu. Dynamic load balancing scheme based on multi-objective genetic algorithm [J]. Computer engineering and Science.2013, 35(12):102-106. [6] Jiao fu, a task scheduling algorithm with fuzzy multiple objectives[j] computer engineering and Science. 2014, 36(9)L1644-1649. 211