CN117938833A - Upgrade method and system of composite network topology system - Google Patents

Upgrade method and system of composite network topology system Download PDF

Info

Publication number
CN117938833A
CN117938833A CN202311833286.7A CN202311833286A CN117938833A CN 117938833 A CN117938833 A CN 117938833A CN 202311833286 A CN202311833286 A CN 202311833286A CN 117938833 A CN117938833 A CN 117938833A
Authority
CN
China
Prior art keywords
upgrade
terminal
primary terminal
upgrading
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311833286.7A
Other languages
Chinese (zh)
Inventor
钱伟健
陈富喜
李波
邵海
何奇瑞
巫耀光
周叶
侯绿培
范强军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Wanlida Electrical Automation Co ltd
Original Assignee
Zhuhai Wanlida Electrical Automation 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 Zhuhai Wanlida Electrical Automation Co ltd filed Critical Zhuhai Wanlida Electrical Automation Co ltd
Priority to CN202311833286.7A priority Critical patent/CN117938833A/en
Publication of CN117938833A publication Critical patent/CN117938833A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a system for upgrading a composite network topology system, wherein the method comprises the following steps: respectively compressing related upgrade files of the primary terminal and the secondary terminal to respectively obtain upgrade compression packages of the primary terminal and the secondary terminal; configuring communication parameters of client software, and defining a communication protocol according to the communication parameters; the method comprises the steps of importing a primary terminal upgrading compression packet into a client, and transmitting a primary terminal upgrading compression packet fraction data packet to the primary terminal through a user-defined network upgrading strategy; decompressing the upgrade compression package of the primary terminal through the primary terminal, and finishing the upgrade of the primary terminal according to the configuration file of the primary terminal; and determining the secondary terminal to be upgraded according to the upgrade parameter file of the secondary terminal through the primary terminal, transmitting the upgrade compression packet of the secondary terminal, decompressing the upgrade compression packet of the secondary terminal through the secondary terminal, and finishing the upgrade of the secondary terminal according to the configuration file of the secondary terminal. The invention achieves the aim of upgrading a plurality of terminals at a time and supporting breakpoint continuous transmission.

Description

Upgrade method and system of composite network topology system
Technical Field
The invention relates to the technical field of software upgrading, in particular to a method and a system for upgrading a composite network topology system.
Background
The rapid development of national economy in China drives the rapid development of various industries, especially the requirements of resident life and enterprise production and processing on electric power are increased year by year in recent years, and power supply enterprises continuously introduce new technologies and new electric power equipment in order to meet the requirements of electric power and electric energy in social activities. The power distribution network is automated, integrates multiple technologies such as a computer, automation and network information, performs design transformation on the basis of a traditional power grid system, and has the functions of realizing real-time state monitoring, remote control and the like of the whole power grid system, so that the daily operation and maintenance level of a power supply enterprise is improved, the working pressure of power supply enterprise staff is reduced, and the power distribution network has higher practical significance for improving the safety and stability of power supply of the power grid system.
Currently, in an existing distribution network automation power system, a distribution network main station generally uses 101 and 104 protocols to communicate with a distribution network primary terminal and a protection terminal for remote upgrade. However, because the development levels of the areas are different, wired optical fiber transmission is adopted in some places, wireless 4G transmission is adopted in some places, a file can be generally only sent to one terminal every time for upgrading, the speed of sending the file every time is very slow, and a part of area master stations can send 200 bytes of data every 3 seconds, once the line is broken and upgrade data is required to be retransmitted, the upgrade efficiency is extremely low for the site of wireless access protection terminal equipment, and once the data is not fully sent or damaged, the upgrade failure of the distribution network protection terminal can be caused, the current operation program is damaged, the terminal cannot be operated after upgrade and reset is protected, and the safety of a power grid is greatly influenced.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an upgrading method and an upgrading system of a composite network topology system, which are used for solving the technical problems that the upgrading efficiency is low and the data is easy to be incomplete or damaged because the remote upgrading method of the traditional distribution network terminal only can upgrade one terminal at a time and the upgrading data is required to be retransmitted after disconnection occurs, thereby achieving the purposes of upgrading a plurality of terminals at a time and supporting breakpoint continuous transmission.
In order to solve the problems, the technical scheme adopted by the invention is as follows:
an upgrade method of a composite network topology system includes the following steps:
Copying the upgrade file and the configuration file of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file by a linux virtual machine to obtain a upgrade compression package of the secondary terminal;
Copying an upgrade file and a configuration file of a primary terminal, an upgrade parameter file of a secondary terminal and an upgrade compression package of the secondary terminal into an upgrade folder, and compressing by a linux virtual machine to obtain an upgrade compression package of the primary terminal;
Configuring communication parameters of client software, defining communication protocols of the client software and the primary terminal according to the communication parameters, and defining communication protocols of the primary terminal and the secondary terminal;
Importing the primary terminal upgrading compression packet into a client, and transmitting the primary terminal upgrading compression packet data packet to the primary terminal through a custom network upgrading strategy;
Decompressing the primary terminal upgrading compression packet through the primary terminal, copying and executing the upgrading file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing upgrading of the primary terminal;
Determining a secondary terminal to be upgraded according to the upgrade parameter file of the secondary terminal by the primary terminal, transmitting the upgrade compression packet of the secondary terminal by an FTP protocol, decompressing the upgrade compression packet of the secondary terminal by the secondary terminal after the transmission is completed, copying the upgrade file of the secondary terminal to a designated position according to the configuration file of the secondary terminal, and executing the upgrade file to finish the upgrade of the secondary terminal.
As a preferred embodiment of the present invention, when compressing the secondary terminal upgrade folder by the linux virtual machine, the method includes:
Determining a specific compression packet format of the secondary terminal upgrading compression packet according to the compatibility of the secondary terminal based on the linux embedded system;
The configuration file of the secondary terminal comprises: an upgrade file list and an upgrade file path.
As a preferred embodiment of the present invention, when compressing the primary terminal upgrade folder by the linux virtual machine, the method includes:
determining a specific compression packet format of the primary terminal upgrade compression packet according to the compatibility of the primary terminal based on the linux embedded system;
The upgrade parameter file of the secondary terminal comprises: the secondary terminal IP list, the number of failed retransmissions and the time-out time for sending the secondary upgrade compressed packet; the configuration file of the secondary terminal comprises: an upgrade file list and an upgrade file path.
As a preferred embodiment of the present invention, when configuring communication parameters of client software, the communication parameters include: the IP and port of the primary terminal, the number of failed retransmissions and the transmission time of the primary terminal upgrade compressed packet;
When defining the communication protocol between the client software and the primary terminal, the communication protocol comprises: an upgrade activation message, an upgrade activation confirmation message, an upgrade data packet message, an upgrade breakpoint continuous transmission activation confirmation message, a data transmission end confirmation message with a check code, a data transmission end confirmation message, an upgrade file damage message, an upgrade execution completion message, a heartbeat message and a confirmation frame message;
when defining the communication protocol between the primary terminal and the secondary terminal, the communication protocol includes: the method comprises the steps of data transmission ending message with check codes, data transmission ending confirmation message, upgrading file damage message, upgrading execution completion message and preset port.
As a preferred embodiment of the present invention, when transmitting an upgrade compressed packet data packet to a primary terminal through a custom network upgrade policy, the method includes:
establishing network connection between the client software and the primary terminal;
splitting the primary terminal upgrading compression packet into a plurality of data packets through the client software, and issuing the data packets to the primary terminal one by one;
after the data packets are sent, extracting 32-bit CRC check codes of the primary terminal upgrading compression packet through the client software, and generating a data transmission end message with the check codes;
The data transmission end message with the check code is sent to the primary terminal, and after the primary terminal receives the data transmission end message with the check code, all received data packets are combined into an upgrade compression packet, and a 32-bit CRC check code of the upgrade compression packet is extracted;
Judging whether the 32-bit CRC check code in the data transmission ending message with the check code is consistent with the 32-bit CRC check code of the upgrading compressed packet;
if yes, the network transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the network transmission is considered to be failed, and a data transmission confirmation failure message is replied, so that the client software resends the primary terminal upgrading compression packet to the primary terminal.
As a preferred embodiment of the present invention, when decompressing the primary terminal upgrade compressed packet by the primary terminal, the method includes:
judging whether the primary terminal upgrade compressed packet is decompressed successfully or not;
if yes, a software upgrading success message is sent to the client software, a user-defined upgrading strategy is executed, and the upgrading of the primary terminal is completed;
if not, deleting the primary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the client software, so that the client can resend the primary terminal upgrade compression package.
As a preferred embodiment of the present invention, when copying and executing the upgrade program of the primary terminal to a designated location, the upgrade program comprises:
Reading an upgrade file list of an upgrade file, which is contained in the configuration file of the primary terminal, and judging whether the upgrade file list is consistent with an upgrade file list in the upgrade compression package of the primary terminal;
if not, the upgrade file is considered to be damaged, an upgrade file damage message is sent to the client software, the client is informed of failure in upgrade, and the upgrade is stopped;
If yes, extracting an upgrade file list path and file names of the upgrade file, judging whether corresponding files exist in the upgrade file list path one by one, if yes, deleting the corresponding files in the corresponding paths, copying the corresponding upgrade files to the corresponding paths according to the upgrade file and executing the upgrade files, and sending an upgrade execution completion message to the client software to complete the upgrade of the primary terminal.
As a preferred embodiment of the present invention, when the transmission of the secondary terminal upgrade compressed packet is performed through an FTP protocol, the method includes:
The upgrade parameter files of the secondary terminals are read through the primary terminals, the number N of the secondary terminals is determined, and links between N FTP client threads and FTP servers of the N secondary terminals are established;
Judging whether the number of times of transmission upgrading exceeds the number of times of upgrading retransmission of the secondary terminal or not through the primary terminal;
If yes, sending an upgrade failure message of the corresponding secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the corresponding secondary terminal number to the client software for prompting;
If not, judging whether the time for FTP transmission of the secondary terminal upgrading compressed packet exceeds the sending timeout time;
If yes, sending an upgrade failure message of the corresponding secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the corresponding secondary terminal number to the client software for prompting;
if not, the secondary terminal upgrade compression packet is sent through an FTP protocol.
As a preferred embodiment of the present invention, after the transmission is completed, further comprising:
transmitting a data transmission end message with a check code to the secondary terminal through the primary terminal;
judging whether the message check code is consistent with the upgrade compressed packet check code or not through the secondary terminal;
if yes, the data transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the FTP upgrade transmission is considered to be failed, and a data transmission confirmation failure message is replied so that the primary terminal can resend the secondary terminal upgrade compression packet;
when the secondary terminal decompresses the secondary terminal upgrade compressed package, the method comprises the following steps:
judging whether the secondary terminal upgrade compressed packet is decompressed successfully or not;
if yes, a successful software upgrading message is sent to the primary terminal, a self-defined upgrading strategy is executed, and upgrading of the secondary terminal is completed;
if not, deleting the secondary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the primary terminal so that the primary terminal can send the secondary terminal upgrade compression package again.
An upgrade system for a composite network topology system, comprising:
a secondary compression unit: the method comprises the steps that an upgrade file and a configuration file of a secondary terminal are copied into an upgrade folder, and are compressed through a linux virtual machine, so that a secondary terminal upgrade compression packet is obtained;
A first-stage compression unit: the upgrade compression package of the primary terminal is obtained by copying an upgrade file and a configuration file of the primary terminal, an upgrade parameter file of the secondary terminal and an upgrade compression package of the secondary terminal into an upgrade folder together and compressing the upgrade file and the configuration file by a linux virtual machine;
Communication protocol definition unit: the communication parameters are used for configuring the client software, defining the communication protocol between the client software and the primary terminal according to the communication parameters, and defining the communication protocol between the primary terminal and the secondary terminal;
A sub-packet transmission unit: the method comprises the steps that a primary terminal upgrading compression packet is imported into a client, and the primary terminal upgrading compression packet data packet is transmitted to the primary terminal through a user-defined network upgrading strategy;
a primary upgrading unit: the upgrade compression package is used for decompressing the primary terminal upgrade compression package through the primary terminal, copying and executing the upgrade file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing the upgrade of the primary terminal;
A secondary upgrading unit: and the second-level terminal is used for determining a second-level terminal to be upgraded according to the upgrade parameter file of the second-level terminal, transmitting the upgrade compression packet of the second-level terminal through an FTP protocol, decompressing the upgrade compression packet of the second-level terminal through the second-level terminal after the transmission is completed, copying the upgrade file of the second-level terminal to a designated position according to the configuration file of the second-level terminal, and executing the upgrade file to finish the upgrade of the second-level terminal.
Compared with the prior art, the invention has the beneficial effects that:
The invention connects the software upgrading client to the embedded system primary terminal through the wireless network, the quantity and the type of the upgrading files are programmable, the upgrading is carried out under the condition of not changing the main program, the programs and the files needed by a plurality of embedded systems can be carried in the one-time upgrading transmission process, the upgrading is not needed to be carried out by one file, the plurality of primary terminals and the plurality of secondary terminals can be upgraded at one time, the breakpoint continuous transmission is supported, the embedded system primary terminal can continuously transmit the upgrading data after being suddenly disconnected, powered off and reconnected in the upgrading process, the upgrading time is effectively saved, and the maintenance cost is reduced.
The invention is described in further detail below with reference to the drawings and the detailed description.
Drawings
Fig. 1 is a step diagram of an upgrade method of a composite network topology system provided by the present invention;
Fig. 2 is a schematic diagram of an upgrade method of a composite topology system and a breakpoint continuous transmission network transmission strategy of the system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a method for upgrading a composite topology system and a primary terminal upgrade script execution strategy of the system according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of an upgrade method and a second-level terminal upgrade policy of a composite topology system according to an embodiment of the present invention.
Detailed Description
The method for upgrading the composite network topology system provided by the invention, as shown in figure 1, comprises the following steps:
Step S1: copying the upgrade file and the configuration file of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file by a linux virtual machine to obtain a upgrade compression package of the secondary terminal;
Step S2: copying the upgrade file and the configuration file of the primary terminal, the upgrade parameter file of the secondary terminal and the upgrade compression package of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file by a linux virtual machine to obtain an upgrade compression package of the primary terminal;
Step S3: configuring communication parameters of client software, defining a communication protocol between the client software and a primary terminal according to the communication parameters, and defining a communication protocol between the primary terminal and a secondary terminal;
Step S4: the method comprises the steps of importing a primary terminal upgrading compression packet into a client, and transmitting a primary terminal upgrading compression packet fraction data packet to the primary terminal through a user-defined network upgrading strategy;
Step S5: decompressing the upgrade compression package of the primary terminal through the primary terminal, copying and executing the upgrade file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing the upgrade of the primary terminal;
step S6: the method comprises the steps of determining a secondary terminal to be upgraded according to an upgrade parameter file of the secondary terminal through a primary terminal, transmitting a secondary terminal upgrade compression packet through an FTP protocol, decompressing the secondary terminal upgrade compression packet through the secondary terminal after transmission is completed, copying and executing the upgrade file of the secondary terminal to a designated position according to a configuration file of the secondary terminal, and completing the upgrade of the secondary terminal.
In the step S1, when compressing the secondary terminal upgrade folder by the linux virtual machine, the method includes:
determining a specific compression packet format of a secondary terminal upgrading compression packet according to the compatibility of the secondary terminal based on the linux embedded system;
The configuration file of the secondary terminal comprises: an upgrade file list and an upgrade file path.
In the step S2, when compressing the primary terminal upgrade folder by the linux virtual machine, the method includes:
determining a specific compression packet format of a primary terminal upgrade compression packet according to the compatibility of the primary terminal based on the linux embedded system;
The upgrade parameter file of the secondary terminal comprises: the secondary terminal IP list, the number of failed retransmissions and the time-out time for sending the secondary upgrade compressed packet; a configuration file of a secondary terminal, comprising: an upgrade file list and an upgrade file path.
In the step S3, when the communication parameters of the client software are configured, the communication parameters include: IP and port of the primary terminal, failure retransmission times and primary terminal upgrade compressed packet sending time;
When defining a communication protocol between client software and a primary terminal, the communication protocol comprises: an upgrade activation message, an upgrade activation confirmation message, an upgrade data packet message, an upgrade breakpoint continuous transmission activation confirmation message, a data transmission end confirmation message with a check code, a data transmission end confirmation message, an upgrade file damage message, an upgrade execution completion message, a heartbeat message and a confirmation frame message;
When defining the communication protocol of the primary terminal and the secondary terminal, the communication protocol comprises: the method comprises the steps of data transmission ending message with check codes, data transmission ending confirmation message, upgrading file damage message, upgrading execution completion message and preset port.
In the step S4, when transmitting the upgrade compressed packet data packet to the primary terminal through the customized network upgrade policy, the method includes:
establishing network connection between client software and a primary terminal;
splitting the upgrade compressed packet of the primary terminal into a plurality of data packets through client software, and transmitting the data packets to the primary terminal one by one;
After the transmission of a plurality of data packets is completed, extracting 32-bit CRC check codes of the primary terminal upgrade compression packet through client software, and generating a data transmission end message with the check codes;
Transmitting the data transmission end message with the check code to a primary terminal, and after receiving the data transmission end message with the check code, the primary terminal combines all received data packets into an upgrade compression packet and extracts a 32-bit CRC check code of the upgrade compression packet;
Judging whether the 32-bit CRC check code in the data transmission end message with the check code is consistent with the 32-bit CRC check code of the upgrade compressed packet;
if yes, the network transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the network transmission is considered to be failed, and a data transmission confirmation failure message is replied, so that the client software resends the primary terminal upgrading compression packet to the primary terminal.
In the step S5, when decompressing the primary terminal upgrade compressed packet by the primary terminal, the method includes:
judging whether the first-level terminal upgrade compressed package is decompressed successfully or not;
If yes, a successful software upgrading message is sent to the client software, and a custom upgrading strategy is executed to complete the upgrading of the primary terminal;
If not, deleting the primary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the client software, so that the client can send the primary terminal upgrade compression package again.
In the step S5, when the upgrade program of the primary terminal is copied to the designated location and executed, the step S includes:
Reading an upgrade file list of an upgrade file, which is contained in a configuration file of the primary terminal, and judging whether the upgrade file list is consistent with an upgrade file list in an upgrade compression package of the primary terminal;
if not, the upgrade file is considered to be damaged, an upgrade file damage message is sent to the client software, the client is informed of failure in upgrade, and the upgrade is stopped;
If yes, extracting an upgrade file list path and file names of the upgrade file, judging whether corresponding files exist in the upgrade file list path one by one, if yes, deleting the corresponding files in the corresponding paths, copying the corresponding upgrade files to the corresponding paths according to the upgrade file and executing the upgrade files, and sending an upgrade execution completion message to the client software to complete upgrade of the primary terminal.
In the step S6, when the transmission of the secondary terminal upgrade compressed packet is performed through the FTP protocol, the method includes:
The upgrade parameter files of the secondary terminals are read through the primary terminals, the number N of the secondary terminals is determined, and links between N FTP client threads and FTP servers of the N secondary terminals are established;
judging whether the number of times of transmission upgrading exceeds the number of times of upgrading retransmission of the secondary terminal through the primary terminal;
If yes, sending an upgrade failure message corresponding to the secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the number corresponding to the secondary terminal to the client software for prompting;
If not, judging whether the time for upgrading the compressed packet by the FTP transmission secondary terminal exceeds the sending timeout time;
If yes, sending an upgrade failure message corresponding to the secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the number corresponding to the secondary terminal to the client software for prompting;
if not, the second-level terminal upgrade compression packet is sent through the FTP protocol.
In the step S6, after the transmission is completed, the method further includes:
Transmitting a data transmission end message with a check code to a secondary terminal through the primary terminal;
judging whether the message check code is consistent with the upgrade compressed packet check code or not through a secondary terminal;
if yes, the data transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the FTP upgrade transmission is considered to be failed, and a data transmission confirmation failure message is replied so that the primary terminal can send the secondary terminal upgrade compression packet again;
when the compression packet is decompressed by the secondary terminal, the method comprises the following steps:
judging whether the compression packet of the upgrade of the secondary terminal is decompressed successfully or not;
if yes, a successful software upgrading message is sent to the primary terminal, and a self-defined upgrading strategy is executed to complete the upgrading of the secondary terminal;
If not, deleting the secondary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the primary terminal, so that the primary terminal can send the secondary terminal upgrade compression package again.
The invention provides an upgrade system of a composite network topology system, which comprises: the system comprises a secondary compression unit, a primary compression unit, a communication protocol definition unit, a sub-packet transmission unit, a primary upgrading unit and a secondary upgrading unit.
A secondary compression unit: the method is used for copying the upgrade file and the configuration file of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file by a linux virtual machine to obtain a upgrade compression package of the secondary terminal.
A first-stage compression unit: the method is used for copying the upgrade file and the configuration file of the primary terminal, the upgrade parameter file of the secondary terminal and the upgrade compression package of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file of the primary terminal through a linux virtual machine to obtain the upgrade compression package of the primary terminal.
Communication protocol definition unit: the communication parameters are used for configuring the client software, and the communication protocol between the client software and the primary terminal is defined according to the communication parameters, and the communication protocol between the primary terminal and the secondary terminal is defined.
A sub-packet transmission unit: the method is used for importing the primary terminal upgrading compression packet into the client, and transmitting the primary terminal upgrading compression packet fraction data packet to the primary terminal through a user-defined network upgrading strategy.
A primary upgrading unit: the method is used for decompressing the upgrade compression package of the primary terminal through the primary terminal, copying and executing the upgrade file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing the upgrade of the primary terminal.
A secondary upgrading unit: the method comprises the steps of determining a secondary terminal to be upgraded through the primary terminal according to an upgrade parameter file of the secondary terminal, transmitting a secondary terminal upgrade compression packet through an FTP protocol, decompressing the secondary terminal upgrade compression packet through the secondary terminal after transmission is completed, copying and executing the upgrade file of the secondary terminal to a designated position according to a configuration file of the secondary terminal, and finishing the upgrade of the secondary terminal.
The following examples are further illustrative of the present invention, but the scope of the present invention is not limited thereto.
Step 1, copying an upgrade program and a configuration file of a secondary terminal into an upgrade folder, and compressing the upgrade program and the configuration file into a secondary terminal upgrade compression packet on a linux virtual machine;
In specific implementation, the specific process of packing the upgrade compressed package is as follows: copying all upgrade files and folders required by a secondary terminal to a path on a linux virtual machine, inputting a linux compression command, compressing the upgrade files and folders into an upgrade compression packet, and supporting decompression of the compression packet by the secondary terminal, wherein the upgrade programs and files on which the upgrade depends cannot be acquired by the secondary terminal; the configuration file includes an upgrade file list and an upgrade file path.
Step 2, copying the upgrade program and configuration file of the primary terminal, the upgrade parameter file of the secondary terminal and the upgrade compression package of the secondary terminal into an upgrade folder, and compressing the upgrade package of the primary terminal on the linux virtual machine;
In specific implementation, the specific process of packing the upgrade compressed package is as follows: on a linux virtual machine, copying an upgrade program and a configuration file of a primary terminal, a upgrade parameter file of a secondary terminal and an upgrade compression packet of the secondary terminal to a path, inputting a linux compression command, compressing the upgrade compression packet, and needing the primary terminal to support decompression of the compression packet, otherwise, the primary terminal cannot acquire the upgrade program and the files on which the upgrade depends; the secondary terminal upgrade parameter file includes: the secondary terminal IP list, the number of times of secondary terminal failed retransmission and the time-out time for the secondary terminal upgrading compressed packet transmission; if the secondary terminal IP list comprises 10 secondary terminals, the secondary terminal IP list needs to fill in 10 IPs, and the IPs must be in the same network section with the primary terminal; the configuration file includes an upgrade file list and an upgrade file path.
Step 3, configuring communication parameters of client software, defining a communication protocol between the client software and a primary terminal, and defining a communication protocol between the primary terminal and a secondary terminal;
In specific implementation, the communication parameters include the IP of the primary terminal, the client software and the primary terminal need to be the same network segment IP, the client software sets a primary terminal port, the primary terminal monitors the port set by the client software, the TCP/IP protocol is used as the standard, the client issues handshake connection according to the IP and the port of the primary terminal, and the primary terminal monitors according to the local IP and the preset port; and the client software and the primary terminal judge whether the network is disconnected or not through the disconnection delay time, and judge the disconnection and handshake with the primary terminal again when the client exceeds the disconnection delay time and does not receive the message of the primary terminal. And similarly, if the primary terminal does not receive the client message after exceeding the disconnection delay time, disconnecting and waiting for the connection of the client again. The disconnection reconnection time is the delay time waiting after disconnection. And the number of reconnection times of the client is used for automatically reconnecting the client, and after the number of reconnection times is exceeded, the client is manually reconnected.
The communication protocol between the client software and the primary terminal comprises an upgrade activation message, an upgrade activation confirmation message, an upgrade data packet message, an upgrade breakpoint continuous transmission activation confirmation message, a data transmission end message with a check code, a data transmission end confirmation (success/failure) message, an upgrade file damage message, an upgrade execution completion message, a heartbeat message and a confirmation frame message. And if the client does not receive the server message for more than 15 seconds, actively transmitting the heartbeat message, and similarly, if the primary terminal does not receive the client message for 15 seconds, actively transmitting the heartbeat message so as to keep the connection between the client and the primary terminal. The client sends an upgrade message, and the primary end needs to reply a confirmation frame message to keep the connection between the client and the primary terminal. The communication protocol of the primary terminal and the secondary terminal comprises the following steps: data transmission ending message with check code, data transmission ending confirmation (success/failure) message, upgrading file damage message, upgrading execution completion message and preset port.
Step 4, importing the primary upgrading compression packet into a client, and transmitting the primary upgrading compression packet sub-packet to a primary terminal through a self-defined network upgrading strategy by using a self-defined protocol;
in an implementation, as shown in fig. 2, the custom network upgrade policy includes:
step 101, establishing network connection between client software and a primary terminal;
102, judging whether the number of times of failed retransmission is exceeded, if yes, stopping the upgrading step, and if no, the client side transmits an upgrading activation message to the primary terminal;
Step 103, the primary terminal receives the upgrade activation message, replies an upgrade activation confirmation message, and if the client receives the upgrade activation confirmation message, the step 104 is executed, if not, the number of times of failed retransmission is increased by 1, and then the step 102 is executed;
Step 104, the client judges whether to start breakpoint continuous transmission according to the cache state, if yes, step 107 is executed, and if not, step 105 is executed;
Step 105, after receiving the upgrade activation confirmation message of the primary terminal, the client splits the primary upgrade compressed packet file, encapsulates the primary upgrade compressed packet file into data packets, sends the data packets to the primary terminal one by one, judges whether the data packets are the last frame of data packets, if yes, executes step 109, and if not, executes step 106;
Step 106, in the process of issuing the network data packet, judging whether the message reply time of the primary terminal exceeds the disconnection delay time, if not, executing step 108, and if so, executing step 102;
Step 107, the client sends a breakpoint continuous transmission activation message, and the primary terminal replies a breakpoint continuous transmission confirmation message; the breakpoint continuous transmission confirmation message comprises: after receiving the offset address of the file content and receiving the breakpoint resume confirm message, the client judges whether to execute breakpoint resume, if yes, step 105 is executed, the client continues to send upgrade compression packet data according to the offset address of the breakpoint resume file, if not, the client executes step 102 and upgrades again;
step 108, the client software sends the data packet, judges whether the timeout time is exceeded, if yes, executes step 102, otherwise, executes step 105.
Step 109, after the last frame of data packet is sent, extracting 32-bit CRC check code of the upgrade compressed packet of the primary terminal, sending a data transmission end message with check code to the primary terminal, after the primary terminal receives the data transmission end message with check code, combining all the data packets into a file, then extracting the 32-bit CRC check code of the upgrade compressed packet, judging whether the 32-bit CRC check code in the packet is consistent with the 32-bit CRC check code of the upgrade compressed packet, if so, executing the upgrade step of step 5, replying an upgrade confirmation message, if not, discarding the upgrade compressed packet, failing the upgrade, replying an upgrade failure message, and stopping the upgrade;
Step 110, if the client software receives the upgrade success message, the transmission is prompted to be completed, and if the client software receives the upgrade failure message, the upgrade is prompted to fail, and the upgrade is stopped.
Step 5, decompressing the primary upgrading compression packet, copying the upgrading file to a designated position according to the configuration file of the primary upgrading compression packet, and completing a primary terminal upgrading strategy;
In specific implementation, as shown in fig. 3, the primary terminal upgrades the policy, the content is the following steps:
Step 201, the configuration file in the primary terminal upgrade package includes an update file, where the update file includes: an upgrade file list and an upgrade file list path. Reading an upgrade file list of an upgrade file, judging whether the upgrade file list is consistent with an upgrade file list in an upgrade compression package, if so, executing step 202, if not, damaging the upgrade file, sending an upgrade file damage message to client software, notifying the client of upgrade failure, and stopping upgrading;
Step 202, extracting an upgrade file list path and file names of the upgrade file, judging whether corresponding files exist in the upgrade file list path one by one, if yes, deleting the corresponding files in the corresponding path, copying the upgrade files to the corresponding path according to the upgrade file, finishing the upgrade of the primary terminal, and if not, copying the corresponding upgrade files to the corresponding path according to the upgrade file, sending an upgrade execution completion message to the client software, and finishing the upgrade of the primary terminal.
Step 6, the primary terminal determines the secondary terminal to be upgraded according to the secondary terminal upgrading parameter file, finishes the data transmission of the upgrading compression packet of the secondary terminal through the FTP protocol, decompresses the secondary upgrading compression packet after finishing the transmission, copies the upgrading file to a designated position according to the configuration file of the secondary upgrading compression packet, and finishes the secondary terminal upgrading strategy;
in a specific implementation, as shown in fig. 4, the secondary terminal upgrade policy includes:
Step 301, a primary terminal reads a secondary terminal upgrade parameter file, determines the number N of secondary terminals, and establishes links between N FTP client threads and FTP servers of the N secondary terminals;
Step 302, the primary terminal judges whether the number of times of transmission upgrading exceeds the number of times of upgrading retransmission of the secondary terminal, if yes, the upgrade failure message corresponding to the secondary terminal is transmitted, the upgrade of the corresponding secondary terminal is stopped, the upgrade failure message with the number corresponding to the secondary terminal is transmitted to the client software for prompting, and if not, the step 303 is executed;
Step 303, judging whether the data time of the FTP transmission secondary upgrade compressed packet exceeds the transmission timeout time, if so, executing step 302, and if not, executing step 304;
Step 304, transmitting the second-level upgrade compression packet data through the FTP protocol, judging whether the transmission is completed, if not, continuing to execute step 303; if yes, go to step 305;
Step 305, the primary terminal extracts the 32-bit CRC check code of the upgrade compressed packet of the secondary terminal, then sends a data transmission end message with the check code to the secondary terminal, the secondary terminal extracts whether the 32-bit CRC check code in the message is consistent with the 32-bit CRC check code of the upgrade compressed packet received by the secondary terminal, if yes, the data transmission is completed, a primary terminal data transmission confirmation (success) message is replied, and the primary terminal sends the data transmission confirmation (success) message with the number of the secondary terminal to client software for prompting, and step 306 is executed; if not, the FTP data transmission fails, a data transmission acknowledgement (failure) message is replied, and step 302 is executed;
step 306, the configuration file in the secondary terminal upgrade package includes an update file, and the update file includes: and if not, the upgrade file is damaged, and an upgrade file damage message is sent to the primary terminal to execute step 302.
Step 307, extracting an upgrade file list path and file names of the upgrade file, judging whether the corresponding file exists in the upgrade file list path one by one, if yes, deleting the corresponding file in the corresponding path, copying the upgrade file to the corresponding path according to the upgrade file, finishing the upgrade of the secondary terminal, if not, copying the corresponding upgrade file to the corresponding path according to the upgrade file, sending an upgrade execution completion message to the primary terminal, and finishing the upgrade of the secondary terminal.
The above embodiments are only preferred embodiments of the present invention, and the scope of the present invention is not limited thereto, but any insubstantial changes and substitutions made by those skilled in the art on the basis of the present invention are intended to be within the scope of the present invention as claimed.

Claims (10)

1. The method for upgrading the composite network topology system is characterized by comprising the following steps of:
Copying the upgrade file and the configuration file of the secondary terminal into an upgrade folder, and compressing the upgrade file and the configuration file by a linux virtual machine to obtain a upgrade compression package of the secondary terminal;
Copying an upgrade file and a configuration file of a primary terminal, an upgrade parameter file of a secondary terminal and an upgrade compression package of the secondary terminal into an upgrade folder, and compressing by a linux virtual machine to obtain an upgrade compression package of the primary terminal;
Configuring communication parameters of client software, defining communication protocols of the client software and the primary terminal according to the communication parameters, and defining communication protocols of the primary terminal and the secondary terminal;
Importing the primary terminal upgrading compression packet into a client, and transmitting the primary terminal upgrading compression packet data packet to the primary terminal through a custom network upgrading strategy;
Decompressing the primary terminal upgrading compression packet through the primary terminal, copying and executing the upgrading file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing upgrading of the primary terminal;
Determining a secondary terminal to be upgraded according to the upgrade parameter file of the secondary terminal by the primary terminal, transmitting the upgrade compression packet of the secondary terminal by an FTP protocol, decompressing the upgrade compression packet of the secondary terminal by the secondary terminal after the transmission is completed, copying the upgrade file of the secondary terminal to a designated position according to the configuration file of the secondary terminal, and executing the upgrade file to finish the upgrade of the secondary terminal.
2. The upgrade method of the composite network topology system according to claim 1, wherein when compressing the secondary terminal upgrade folder by a linux virtual machine, comprising:
Determining a specific compression packet format of the secondary terminal upgrading compression packet according to the compatibility of the secondary terminal based on the linux embedded system;
The configuration file of the secondary terminal comprises: an upgrade file list and an upgrade file path.
3. The upgrade method of the composite network topology system according to claim 1, wherein when compressing the primary terminal upgrade folder by a linux virtual machine, comprising:
determining a specific compression packet format of the primary terminal upgrade compression packet according to the compatibility of the primary terminal based on the linux embedded system;
The upgrade parameter file of the secondary terminal comprises: the secondary terminal IP list, the number of failed retransmissions and the time-out time for sending the secondary upgrade compressed packet; the configuration file of the secondary terminal comprises: an upgrade file list and an upgrade file path.
4. The method for upgrading a composite network topology system according to claim 1, wherein when configuring communication parameters of the client software, the communication parameters include: the IP and port of the primary terminal, the number of failed retransmissions and the transmission time of the primary terminal upgrade compressed packet;
When defining the communication protocol between the client software and the primary terminal, the communication protocol comprises: an upgrade activation message, an upgrade activation confirmation message, an upgrade data packet message, an upgrade breakpoint continuous transmission activation confirmation message, a data transmission end confirmation message with a check code, a data transmission end confirmation message, an upgrade file damage message, an upgrade execution completion message, a heartbeat message and a confirmation frame message;
when defining the communication protocol between the primary terminal and the secondary terminal, the communication protocol includes: the method comprises the steps of data transmission ending message with check codes, data transmission ending confirmation message, upgrading file damage message, upgrading execution completion message and preset port.
5. The upgrade method of a composite network topology system of claim 1, wherein when transmitting upgrade compressed packet data packets to the primary terminal through a custom network upgrade policy, comprising:
establishing network connection between the client software and the primary terminal;
splitting the primary terminal upgrading compression packet into a plurality of data packets through the client software, and issuing the data packets to the primary terminal one by one;
after the data packets are sent, extracting 32-bit CRC check codes of the primary terminal upgrading compression packet through the client software, and generating a data transmission end message with the check codes;
The data transmission end message with the check code is sent to the primary terminal, and after the primary terminal receives the data transmission end message with the check code, all received data packets are combined into an upgrade compression packet, and a 32-bit CRC check code of the upgrade compression packet is extracted;
Judging whether the 32-bit CRC check code in the data transmission ending message with the check code is consistent with the 32-bit CRC check code of the upgrading compressed packet;
if yes, the network transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the network transmission is considered to be failed, and a data transmission confirmation failure message is replied, so that the client software resends the primary terminal upgrading compression packet to the primary terminal.
6. The upgrade method of a composite network topology system according to claim 1, wherein when decompressing the primary terminal upgrade compression package through the primary terminal, comprising:
judging whether the primary terminal upgrade compressed packet is decompressed successfully or not;
if yes, a software upgrading success message is sent to the client software, a user-defined upgrading strategy is executed, and the upgrading of the primary terminal is completed;
if not, deleting the primary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the client software, so that the client can resend the primary terminal upgrade compression package.
7. The upgrade method of the composite network topology system according to claim 1, wherein when the upgrade program of the primary terminal is copied to a designated location and executed, comprising:
Reading an upgrade file list of an upgrade file, which is contained in the configuration file of the primary terminal, and judging whether the upgrade file list is consistent with an upgrade file list in the upgrade compression package of the primary terminal;
if not, the upgrade file is considered to be damaged, an upgrade file damage message is sent to the client software, the client is informed of failure in upgrade, and the upgrade is stopped;
If yes, extracting an upgrade file list path and file names of the upgrade file, judging whether corresponding files exist in the upgrade file list path one by one, if yes, deleting the corresponding files in the corresponding paths, copying the corresponding upgrade files to the corresponding paths according to the upgrade file and executing the upgrade files, and sending an upgrade execution completion message to the client software to complete the upgrade of the primary terminal.
8. The upgrade method of a composite network topology system according to claim 1, wherein when the transmission of the secondary terminal upgrade compression packet is performed through an FTP protocol, comprising:
The upgrade parameter files of the secondary terminals are read through the primary terminals, the number N of the secondary terminals is determined, and links between N FTP client threads and FTP servers of the N secondary terminals are established;
Judging whether the number of times of transmission upgrading exceeds the number of times of upgrading retransmission of the secondary terminal or not through the primary terminal;
If yes, sending an upgrade failure message of the corresponding secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the corresponding secondary terminal number to the client software for prompting;
If not, judging whether the time for FTP transmission of the secondary terminal upgrading compressed packet exceeds the sending timeout time;
If yes, sending an upgrade failure message of the corresponding secondary terminal, stopping upgrading of the corresponding secondary terminal, and sending the upgrade failure message with the corresponding secondary terminal number to the client software for prompting;
if not, the secondary terminal upgrade compression packet is sent through an FTP protocol.
9. The method for upgrading a composite network topology system of claim 1, further comprising, after the transmission is completed:
transmitting a data transmission end message with a check code to the secondary terminal through the primary terminal;
judging whether the message check code is consistent with the upgrade compressed packet check code or not through the secondary terminal;
if yes, the data transmission is considered to be completed, and a data transmission confirmation success message is replied;
If not, the FTP upgrade transmission is considered to be failed, and a data transmission confirmation failure message is replied so that the primary terminal can resend the secondary terminal upgrade compression packet;
when the secondary terminal decompresses the secondary terminal upgrade compressed package, the method comprises the following steps:
judging whether the secondary terminal upgrade compressed packet is decompressed successfully or not;
if yes, a successful software upgrading message is sent to the primary terminal, a self-defined upgrading strategy is executed, and upgrading of the secondary terminal is completed;
if not, deleting the secondary terminal upgrade compression package and all the decompressed files, and sending a software upgrade failure message to the primary terminal so that the primary terminal can send the secondary terminal upgrade compression package again.
10. An upgrade system for a composite network topology system, comprising:
a secondary compression unit: the method comprises the steps that an upgrade file and a configuration file of a secondary terminal are copied into an upgrade folder, and are compressed through a linux virtual machine, so that a secondary terminal upgrade compression packet is obtained;
A first-stage compression unit: the upgrade compression package of the primary terminal is obtained by copying an upgrade file and a configuration file of the primary terminal, an upgrade parameter file of the secondary terminal and an upgrade compression package of the secondary terminal into an upgrade folder together and compressing the upgrade file and the configuration file by a linux virtual machine;
Communication protocol definition unit: the communication parameters are used for configuring the client software, defining the communication protocol between the client software and the primary terminal according to the communication parameters, and defining the communication protocol between the primary terminal and the secondary terminal;
A sub-packet transmission unit: the method comprises the steps that a primary terminal upgrading compression packet is imported into a client, and the primary terminal upgrading compression packet data packet is transmitted to the primary terminal through a user-defined network upgrading strategy;
a primary upgrading unit: the upgrade compression package is used for decompressing the primary terminal upgrade compression package through the primary terminal, copying and executing the upgrade file of the primary terminal to a designated position according to the configuration file of the primary terminal, and finishing the upgrade of the primary terminal;
A secondary upgrading unit: and the second-level terminal is used for determining a second-level terminal to be upgraded according to the upgrade parameter file of the second-level terminal, transmitting the upgrade compression packet of the second-level terminal through an FTP protocol, decompressing the upgrade compression packet of the second-level terminal through the second-level terminal after the transmission is completed, copying the upgrade file of the second-level terminal to a designated position according to the configuration file of the second-level terminal, and executing the upgrade file to finish the upgrade of the second-level terminal.
CN202311833286.7A 2023-12-28 2023-12-28 Upgrade method and system of composite network topology system Pending CN117938833A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311833286.7A CN117938833A (en) 2023-12-28 2023-12-28 Upgrade method and system of composite network topology system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311833286.7A CN117938833A (en) 2023-12-28 2023-12-28 Upgrade method and system of composite network topology system

Publications (1)

Publication Number Publication Date
CN117938833A true CN117938833A (en) 2024-04-26

Family

ID=90753040

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311833286.7A Pending CN117938833A (en) 2023-12-28 2023-12-28 Upgrade method and system of composite network topology system

Country Status (1)

Country Link
CN (1) CN117938833A (en)

Similar Documents

Publication Publication Date Title
CN102297493B (en) Method and system for monitoring air conditioning units
CN105898893B (en) Full-duplex communication method for mobile terminal and Internet of things equipment
CN104636986B (en) A kind of method that scheduling telesecurity remote control based on service is checked
CN105095022A (en) Data backup method and device
CN109067560B (en) Self-description terminal plug and play method based on open communication
CN110445683B (en) Server, equipment, method and system for monitoring survival state of server
CN107508916B (en) Server link management method for intelligent robot
CN110493775A (en) The communication means and system being adapted to by ATT and abnormality processing
CN113810788A (en) Intelligent ammeter information transmission method and device and terminal equipment
CN116699964A (en) Redundant operation method and system for industrial process controller
CN114157675A (en) Complete synchronous communication system for operation information of multiple low-voltage transformer areas
CN100481779C (en) Upgrade control method and control device
CN104021025A (en) Remote microwave outdoor unit upgrading method
CN117938833A (en) Upgrade method and system of composite network topology system
CN102869032A (en) Device and method for monitoring and alarming power supply of base station
CN112822171A (en) Preposed acquisition system and method based on Internet of things protocol
CN105391031A (en) Data processing method and system of relay protection device with plurality of plugins
CN115268965A (en) Adaptive software remote upgrading method and system for low-voltage intelligent circuit breaker
CN110474953A (en) Terminal control method, apparatus and system based on cloud SIM
CN102710666B (en) RADIUS (remote authentication dial in user service) client overtime treating method in WLAN (wireless local area network) system
CN105045759B (en) Control communication method of financial self-service equipment
CN117938869A (en) Compression packet upgrading method and system for network file transmission breakpoint continuous transmission
CN113518087A (en) IOT protocol reverse docking method and device
CN104731071A (en) Redundant-waste heat backup method of mater engine in centralized control system
CN201274574Y (en) Wireless modem supporting configuration modification by short message method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination