Method and system for over-the-air upgrading of local area network equipment
Through the coordinated work of the device management system server and gateway, the automatic upgrade of the equipment and the interruption of breakpoints are realized, solving the problems of low upgrade reliability and efficiency in the existing technology, and is suitable for industrial wireless LAN environments.
Patent Information
- Application Number
- CN202510517645.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-04-24
AI Technical Summary
The existing aerial upgrade method of LAN equipment is difficult to ensure the reliability and efficiency of upgrades in industrial wireless LAN environments, especially when the equipment is densely distributed and network conditions are limited, it is easy to lead to network congestion and manual intervention.
The upgrade tasks are issued through the device management system server, and the gateway generates and subcontracts to transmit upgrade packages. The device realizes breakpoint transmission and integrity verification, and automatically backs up and rolls back program files to ensure the automation and reliability of the upgrade process.
It has realized the automation upgrade of equipment, reduced manual intervention and operation and maintenance costs, improved the reliability and efficiency of upgrades, and adapted to the unattended upgrade needs of industrial scenarios.
Smart Images

Figure CN120034851A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of local area network equipment upgrade, and in particular to a method and system for over-the-air upgrade of local area network equipment. Background Art
[0002] As a means of updating device firmware or software without physical contact, over-the-air upgrade technology is particularly important in the field of industrial Internet of Things. In industrial wireless LANs, such as WIA-FA network scenarios, devices are usually deployed in complex environments and in large numbers. It is necessary to ensure the efficiency and reliability of the upgrade process while avoiding interference with device operation.
[0003] In the existing technology, over-the-air upgrades are mostly managed in a centralized manner, with the upgrade package pushed to the device and the installation triggered through the management platform. However, in the LAN environment of industrial sites, the devices are densely distributed and the network conditions are limited, and the existing solutions are often difficult to cope with the challenges in actual applications. For example, since the bandwidth of industrial wireless networks is limited and susceptible to interference, large-scale equipment upgrades are prone to network congestion, resulting in interruption of the upgrade task; and the existing breakpoint-resume mechanism lacks persistent storage of the session state on the device side. Once the upgrade is interrupted, it is necessary to rely on manual re-triggering of the process, which not only increases the operation and maintenance costs, but also may cause version confusion due to operational errors. In addition, the existing technology usually does not integrate automatic version verification and rollback functions. If the device runs abnormally after the upgrade, manual intervention is required to restore the old version, which is difficult to meet the strict requirements for unattended upgrades in industrial scenarios. With the faster and faster technical upgrades and version iterations of industrial wireless LAN devices, how to uniformly upgrade and manage the product programs that have been put into user application sites based on over-the-air upgrade technology and improve upgrade reliability and efficiency is an urgent problem to be solved. Summary of the invention
[0004] The object of the present invention is to provide a method and system for upgrading a LAN device over the air, so as to solve the problem that the upgrade reliability and upgrade efficiency of the existing LAN device over the air upgrade method need to be improved.
[0005] In a first aspect, the present invention provides a method for upgrading a local area network device over the air, comprising: After receiving the upgrade instruction from the device management system server, the gateway generates an upgrade package from the program file uploaded by the device management system server and sends the upgrade package information to the target path of the device; After receiving the upgrade package information, the device replies to the gateway with the current program version number; The gateway compares the current program version number with the upgrade version number to determine whether an upgrade is required; if the current program version number of the device is higher than or equal to the upgrade version number, no upgrade is required; if the current program version number of the device is lower than the upgrade version number, the upgrade will begin, and the gateway will sub-packetize the upgrade package to transmit to the device; each data packet has the same size, including the current packet number, data size and cyclic redundancy check code; If the gateway does not receive a download request for the next data packet from the device within the preset time after sending the current data packet, it is determined to be a transmission timeout and the retransmission function is started; if the retransmission exceeds the preset number of times, the gateway will feedback the download interruption exception to the device management system server and re-download the program file; After receiving the data, the device replies to the gateway with the size of the received data and starts receiving the upgrade data according to the starting position of the file in the target path.
[0006] Furthermore, the device has a breakpoint resume function, and the device automatically stores the download task session number and a linked list file for reading and writing a linked list of stored related information; if the device is abnormally interrupted, when the download task is received again, the historical download information is read from the download task session number corresponding to the linked list file, and a download package request is sent to the gateway from the continuation package number based on the historical download information.
[0007] Furthermore, after the upgrade package is received, the device calculates the hash value of the upgrade package and compares it with the hash value provided by the received file information to perform integrity verification; if the verification fails, the verification result is fed back to the gateway. If the verification result is that the upgrade package is successfully received, the program file is downloaded successfully, and the device replaces the program file to perform the upgrade; Before replacing the old file, the existing program file is automatically backed up and stored in the specified local path of the device; after the program file is replaced and backed up, the upgrade operation is completed and the device is restarted; then the program monitoring script is started, and if an abnormal operation is detected, the file rollback is triggered, the program file version is replaced back and the device is restarted.
[0008] Furthermore, after the device restarts, it searches the currently stored linked list file to see if there is a completed upgrade verification file. If so, it determines that this program startup is an upgrade restart, and actively sends the corresponding node session number, upgrade result and current program version number of the device to the gateway. The gateway compares the current program version number of the device with the upgrade version number, and feeds back the upgrade result to the device management system server.
[0009] Furthermore, the device management system server, gateway and devices have a time synchronization function. After the device management system server issues an upgrade task, the time upgrade interval is configured. All devices that go online within the specified time are checked for upgrade versions. If the device program file version is lower than the target version, the gateway automatically issues an upgrade request to the device to perform an over-the-air upgrade of the LAN device.
[0010] In a second aspect, the present invention provides a system for over-the-air upgrading of LAN devices, comprising: a device management system server, a gateway, and downstream devices, wherein the devices include wireless access points and wireless node terminal devices; the device management system server is connected to the gateway, the gateway is connected to the wireless access point, and the wireless access point is connected to the wireless node terminal device; The device management system server is used to send the program to be upgraded to the designated location of the gateway, display the upgrade status and version information of the devices in the system, and display the specific information of the downloaded program files; it has the function of automatically upgrading the device and can issue upgrade instructions to the online devices according to the specified time interval; The gateway is used to generate an upgrade package from the program file uploaded by the device management system server after receiving the upgrade instruction from the device management system server, and send the upgrade package information to the target path of the device; receive the current program version number replied by the device; compare the current program version number with the upgrade version number to determine whether an upgrade is required; if the current program version number of the device is higher than or equal to the upgrade version number, no upgrade is required; if the current program version number of the device is lower than the upgrade version number, the upgrade is started, and the gateway transmits the upgrade package to the device in packets; each data packet has the same size, including the current packet number, data size and cyclic redundancy check code; if the gateway does not receive a download request for the next data packet from the device within a preset time after sending the current data packet, it is determined that the transmission has timed out and the retransmission function is started; if the retransmission exceeds the preset number of times, the gateway feedbacks the download interruption exception to the device management system server and re-downloads the program file; The device is used to reply the current program version number to the gateway after receiving the upgrade package information sent by the gateway; after receiving the data, reply the size of the received data to the gateway, and start receiving the upgrade data according to the file start position of the target path.
[0011] Furthermore, the device has a breakpoint resume function, and the device automatically stores the download task session number and a linked list file for reading and writing a linked list of stored related information; if the device is abnormally interrupted, when the download task is received again, the historical download information is read from the download task session number corresponding to the linked list file, and a download package request is sent to the gateway from the continuation package number based on the historical download information.
[0012] Furthermore, the device is also used to: after the upgrade package is received, calculate the hash value of the upgrade package and compare it with the hash value provided by the received file information to perform integrity verification; if the verification fails, feed back the verification result to the gateway; if the verification result is that the upgrade package is successfully received, the program file is downloaded successfully, and the device replaces the program file to perform the upgrade; Before replacing the old file, the existing program file is automatically backed up and stored in the specified local path of the device; after the program file is replaced and backed up, the upgrade operation is completed and the device is restarted; then the program monitoring script is started, and if an abnormal operation is detected, the file rollback is triggered, the program file version is replaced back and the device is restarted.
[0013] Furthermore, the device is also used to: after the device is restarted, retrieve whether the currently stored linked list file has a completed upgrade verification file. If so, determine that the program startup is an upgrade restart, and actively send the corresponding node session number, upgrade result and current program version number of the device to the gateway. The gateway compares the current program version number of the device with the upgrade version number, and feeds back the upgrade result to the device management system server.
[0014] Furthermore, the device management system server, gateway and device have a time synchronization function. After the device management system server issues an upgrade task, the time upgrade interval is configured. All devices that are online within the specified time are checked for upgrade versions. If the device program file version is lower than the target version, the gateway automatically issues an upgrade request to the device to perform an over-the-air upgrade of the LAN device.
[0015] The present invention has the following beneficial effects: a method and system for over-the-air upgrading of LAN devices of the present invention, wherein the upgrade task of the designated device is issued by the device management system server, and the upgrade task is issued by the gateway, and the devices in the system automatically download the software and automatically complete the upgrade restart, version verification and abnormal rollback functions, thereby ensuring that the device can reliably complete the automatic upgrade function and reducing labor costs and the impact of manual upgrade errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 It is the topology diagram of the on-site system equipment; Figure 2 This is a specific upgrade flow chart of an embodiment of the present invention; Figure 3 The device upgrade and rollback flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The technical solutions provided by the embodiments of the present invention are described in detail below in conjunction with the drawings.
[0019] The present invention provides a method and system for upgrading local area network equipment over the air. The on-site system equipment topology diagram is shown in Figure 1 , including: device management system server, gateway and downstream devices. The device management system server is directly connected to the gateway and can control and manage the gateway and all downstream devices. The devices include wireless access points and wireless node terminal devices; the gateway is connected to the wireless access point, and the wireless access point is connected to the wireless node terminal device.
[0020] In the device management system, users can upload program files that need to be updated to the gateway and issue upgrade tasks for designated devices to complete the upgrade of programs or files on target devices. At the same time, devices in the system can automatically perform version verification and version rollback based on the downloaded update program version. At the same time, when the upgrade download is abnormally interrupted, the device has a breakpoint resume function to save network resources.
[0021] Among them, the device management system server is used for the user upgrade interactive interface: it can send the program to be upgraded to the designated location of the gateway, display the upgrade status and version information of the device in the system, and display the specific information of the downloaded program file. It also has the function of automatically upgrading the device, and can issue upgrade instructions to the online device according to the specified time interval.
[0022] The functional modules on the gateway side include the file upgrade management module and the device status monitoring module. The file upgrade management module is used for upgrade package generation, main program version comparison, and program sub-package reading and distribution. The gateway automatically generates an upgrade package based on the specified version file, including the file name, file size, file path, etc., and distributes the program file to the device target path. The gateway can compare the new version with the type of online device and the current version number information. If the current version is lower than the updated version, the upgrade process is started and the verification result is reported to the management platform. After the file enters the download process, the gateway can divide the program file into download data packets according to the specified size, read the data from the file, and distribute it to the device in sequence according to the device request package number. The device status monitoring module is used for real-time status collection and timeout retransmission function. The gateway can query the current version information of the device and send it to the device management system server. If a device has a download reply timeout of more than three retransmissions, it will trigger an alarm to send to the device management system server, so that the device can be marked as abnormal interruption state.
[0023] The functions of the device end include: upgrade receiving and downloading module, file verification and backup module, and file upgrade and rollback module. The upgrade receiving and downloading module is used to receive upgrade packages and resume the download from breakpoint. It listens to the gateway upgrade connection request of the bound port, receives the specific information of the file, replies to the size of the received data, and starts to receive the upgrade data according to the starting position of the target path file. The device stores the linked list of information related to the download task session number, and has a corresponding read-write storage linked list file. When the device abnormally interrupts the download, it will read the historical download information from the linked list when it receives the download task again, and send the download package from the continuation package number to request the gateway to download the file. The file verification and backup module is used for file integrity verification and backup management. After receiving the file, the file hash value is calculated, the integrity check is performed, and it is compared with the received file size. If it fails, the verification result is sent to the gateway. Before replacing the old file, the existing file is automatically backed up to the local storage or the specified backup path to ensure the rapid and effective rollback operation. The file upgrade and rollback module is used to first start the upgrade file replacement and backup, and complete the device restart; then start the program monitoring script, and trigger the file rollback when an abnormal operation is detected, replace it back to the previous version and restart the device.
[0024] The present invention provides a method for upgrading a local area network device over the air, comprising the following steps: After the gateway receives the upgrade instruction from the device management system server, it immediately establishes a dedicated upgrade connection session with the target upgrade device and generates an upgrade package for the program file uploaded by the device management system server. According to the file with the specified unique version number, the upgrade package is automatically generated, including the file name, file size, file path and other information, and sent to the target device. After the device receives the upgrade package information, it replies to the gateway with the current program version number. The gateway compares the current program version number with the upgrade version number to determine whether an upgrade is required; if the current program version number of the device is higher than or equal to the upgrade version number, no upgrade is required; if the current program version number of the device is lower than the upgrade version number, the upgrade will start, and the gateway will sub-packetize the upgrade package for transmission to the device; each data packet is the same size, including the current packet number, data size and cyclic redundancy check code.
[0025] If the gateway does not receive a download request for the next data packet from the device within the preset time after sending the current data packet, it is determined that the transmission has timed out and the retransmission function is started. In this embodiment, the preset time is 5 seconds. If the retransmission exceeds the preset number of times, the gateway will feedback the download interruption exception to the device management system server and re-download the program file. In this embodiment, the preset number of times is 3 times. After receiving the data, the device replies to the gateway with the size of the received data and starts receiving the upgrade data according to the starting position of the file in the target path.
[0026] Among them, the device has the function of breakpoint resumption. The device automatically stores the download task session number and the linked list file used to read and write the linked list of storage related information; if the device is abnormally interrupted, when the download task is received again, the historical download information is read from the download task session number corresponding to the linked list file, and the download package request is sent to the gateway from the continuation package number according to the historical download information.
[0027] When the upgrade package is received, the device calculates the hash value of the upgrade package and compares it with the hash value provided by the received file information to perform an integrity check; if the check fails, the check result is fed back to the gateway. If the check result shows that the upgrade package is received successfully, the program file is downloaded successfully, and the device replaces the program file to perform the upgrade.
[0028] Before replacing the old files, the existing program files are automatically backed up and stored in the specified local path of the device to ensure that the rollback operation is quick and effective; after the program files are replaced and backed up, the upgrade operation is completed and the device is restarted; then the program monitoring script is started, and if an abnormal operation is detected, the file rollback is triggered, the program file version is replaced back to the previous version and the device is restarted.
[0029] After the device restarts, it searches the currently stored linked list file to see if there is a completed upgrade verification file. If so, it determines that this program startup is an upgrade restart, and actively sends the corresponding node session number, upgrade result and current program version number of the device to the gateway. The gateway compares the current program version number of the device with the upgrade version number, and feeds back the upgrade result to the device management system server.
[0030] The device management system server, gateway and devices have time synchronization function. After the device management system server issues the upgrade task, the time upgrade interval is configured. All devices that go online within the specified time will be checked for upgrade version. If the device program file version is lower than the target version, the gateway will automatically issue an upgrade request to the device to perform over-the-air upgrade of the LAN device.
[0031] See also Figure 2 , is a specific upgrade flow chart of an embodiment of the present invention. The gateway establishes an upgrade connection, obtains the firmware version information of all devices, and determines whether the device needs to be upgraded. If not, the process ends. If yes, a mutually exclusive thread is created and sent for each device. Information such as the file name, file size, and file path is sent to the device. After receiving the above information, the device requests a file data packet. The gateway node sends a file data packet. Determine whether the device receives it successfully. If not, retransmit the current data packet, and then re-determine whether the device receives it successfully. If yes, send the next data packet until the device completes the download. After the device completes the download, send an upgrade instruction. Feedback the device information and the updated version number to the device management system server, and the process ends. The downstream device first creates a socket and binds a port. Listen to the bound port to request the device version. Send the current version information to the gateway. Determine whether the device needs to be upgraded. If not, the process ends. If yes, record the current file information and find the download package number. Receive the data packet sent by the gateway node. Check whether the received data packets are continuous. If not, apply for the next packet and receive the data packet again. If yes, write to the file and record the next packet number. Determine whether the number of downloaded packages is complete. If not, continue to receive data packets. If yes, the download is complete, wait for the upgrade operation to be performed, and the device restarts. Determine whether the new file application is successful. If not, restore the old version. If yes, actively detect the upgrade result and the process ends.
[0032] See also Figure 3, which is a flow chart of device upgrade and rollback in an embodiment of the present invention. The device starts to continuously listen to whether it has received an upgrade instruction. If not, it continues to listen. If it receives a start upgrade instruction, the device renames the file with the same name in the target folder to filename.bak - VERSION, then moves the upgraded file to the target folder and grants the same execution permission, and then sends a device upgrade start response, after which the device automatically restarts. The device boots up the program and automatically starts the instruction, immediately runs the automatic monitoring script, and then monitors whether the program can run normally for 10 seconds. If so, wait for version verification information and send the current version number of the program, and the device upgrade is complete. If not, it is determined that the upgrade has failed. At this time, the executable file is renamed to bak - err, and the latest version file in the directory is deleted and bak - VERSION is restored. The device automatically restarts, waits for version verification information and sends the current version number of the program, and the device upgrade is complete.
[0033] Based on the above system equipment upgrade method, users can monitor and control the equipment upgrade status through the management platform, complete the management and operation of the system equipment upgrade, and improve the upgrade efficiency and operation reliability.
[0034] The above-described embodiments of the present invention do not limit the protection scope of the present invention.
Claims
1. A method for upgrading a local area network device over the air, characterized in that: include: After receiving the upgrade instruction from the device management system server, the gateway generates an upgrade package from the program file uploaded by the device management system server and sends the upgrade package information to the target path of the device; After receiving the upgrade package information, the device replies to the gateway with the current program version number; The gateway compares the current program version number with the upgrade version number to determine whether an upgrade is needed; If the current program version number of the device is higher than or equal to the upgrade version number, there is no need to upgrade; if the current program version number of the device is lower than the upgrade version number, the upgrade will start, and the gateway will transmit the upgrade package to the device in packets; each data packet has the same size, including the current packet number, data size and cyclic redundancy check code; If the gateway does not receive a download request for the next data packet from the device within the preset time after sending the current data packet, it is determined to be a transmission timeout and the retransmission function is started; if the retransmission exceeds the preset number of times, the gateway will feedback the download interruption exception to the device management system server and re-download the program file; After receiving the data, the device replies to the gateway with the size of the received data and starts receiving the upgrade data according to the starting position of the file in the target path; The device has a breakpoint resume function, and the device automatically stores the download task session number and a linked list file for reading and writing a linked list of storage related information; If the device is abnormally interrupted, when receiving the download task again, it reads the historical download information from the download task session number corresponding to the linked list file, and sends a download package request to the gateway from the continuation package number according to the historical download information; After the upgrade package is received, the device calculates the hash value of the upgrade package and compares it with the hash value provided by the received file information for integrity verification; If the verification fails, the verification result is fed back to the gateway. If the verification result is that the upgrade package is received successfully, the program file is downloaded successfully, and the device replaces the program file and performs the upgrade; Before replacing the old file, the existing program file is automatically backed up and stored in the specified local path of the device; after the program file is replaced and backed up, the upgrade operation is completed and the device is restarted; then the program monitoring script is started, and if an abnormal operation is detected, the file rollback is triggered, the program file version is replaced back and the device is restarted.
2. A method for upgrading a LAN device over the air as claimed in claim 1, characterized in that: After the device restarts, it searches the currently stored linked list file to see if there is a completed upgrade verification file. If so, it determines that this program startup is an upgrade restart, and actively sends the corresponding node session number, upgrade result and current program version number of the device to the gateway. The gateway compares the current program version number of the device with the upgrade version number, and feeds back the upgrade result to the device management system server.
3. A method for upgrading a LAN device over the air as claimed in claim 1, characterized in that: The device management system server, gateway and devices have time synchronization function. After the device management system server issues the upgrade task, the time upgrade interval is configured. All devices that go online within the specified time will be checked for upgrade version. If the device program file version is lower than the target version, the gateway will automatically issue an upgrade request to the device to perform over-the-air upgrade of the LAN device.
4. A system for upgrading local area network equipment over the air, characterized in that: include: Device management system server, gateway and downstream devices, including wireless access points and wireless node terminal devices; The device management system server is connected to the gateway, the gateway is connected to the wireless access point, and the wireless access point is connected to the wireless node terminal device; The device management system server is used to send the program to be upgraded to the designated location of the gateway, display the upgrade status and version information of the devices in the system, and display the specific information of the downloaded program files; it has the function of automatically upgrading the device and can issue upgrade instructions to the online devices according to the specified time interval; The gateway is used to generate an upgrade package from the program file uploaded by the device management system server after receiving the upgrade instruction from the device management system server, and send the upgrade package information to the target path of the device; and receive the current program version number replied by the device; Compare the current program version number with the upgrade version number to determine whether an upgrade is needed; If the current program version number of the device is higher than or equal to the upgrade version number, there is no need to upgrade; if the current program version number of the device is lower than the upgrade version number, the upgrade will start, and the gateway will transmit the upgrade package to the device in packets; each data packet has the same size, including the current packet number, data size and cyclic redundancy check code; if the gateway does not receive the device's download request for the next data packet within the preset time after sending the current data packet, it is determined to be a transmission timeout and the retransmission function is started; if the retransmission exceeds the preset number of times, the gateway will feedback the download interruption exception to the device management system server and re-download the program file; The device is used to reply the current program version number to the gateway after receiving the upgrade package information sent by the gateway; after receiving the data, reply the size of the received data to the gateway, and start receiving the upgrade data according to the starting position of the file in the target path; The device has a breakpoint resume function, and the device automatically stores the download task session number and a linked list file for reading and writing a linked list of storage related information; If the device is abnormally interrupted, when receiving the download task again, it reads the historical download information from the download task session number corresponding to the linked list file, and sends a download package request to the gateway from the continuation package number according to the historical download information; The device is also used to: after the upgrade package is received, calculate the hash value of the upgrade package and compare it with the hash value provided by the received file information to perform integrity verification; If the verification fails, the verification result is fed back to the gateway. If the verification result is that the upgrade package is received successfully, the program file is downloaded successfully, and the device replaces the program file and performs the upgrade; Before replacing the old file, the existing program file is automatically backed up and stored in the specified local path of the device; after the program file is replaced and backed up, the upgrade operation is completed and the device is restarted; then the program monitoring script is started, and if an abnormal operation is detected, the file rollback is triggered, the program file version is replaced back and the device is restarted.
5. A system for upgrading LAN devices over the air as claimed in claim 4, characterized in that: The device is also used to: after the device is restarted, retrieve whether the currently stored linked list file has a completed upgrade verification file. If so, determine that the program startup is an upgrade restart, and actively send the corresponding node session number, upgrade result and current program version number of the device to the gateway. The gateway compares the current program version number of the device with the upgrade version number, and feeds back the upgrade result to the device management system server.
6. A system for upgrading LAN devices over the air as claimed in claim 4, characterized in that: The device management system server, gateway and device have a time synchronization function. After the device management system server issues an upgrade task, the time upgrade interval is configured. All devices that are online within the specified time are checked for upgrade versions. If the device program file version is lower than the target version, the gateway automatically issues an upgrade request to the device to perform an over-the-air upgrade of the LAN device.
Citation Information
Patent Citations
Offline download system and method
CN103248636A
Terminal equipment remote software version distribution method and system
CN105763369A
Over-the-air firmware upgrading method and system for Internet of Things equipment
CN111212121A
Whole network terminal automatic upgrading method based on WIA-PA gateway
CN114531353A
Multi-device application collaborative upgrading method based on red-mine operating system
CN119835158A