CN110730104A - Method for upgrading multi-device batch firmware of mesh network device - Google Patents

Method for upgrading multi-device batch firmware of mesh network device Download PDF

Info

Publication number
CN110730104A
CN110730104A CN201911036462.8A CN201911036462A CN110730104A CN 110730104 A CN110730104 A CN 110730104A CN 201911036462 A CN201911036462 A CN 201911036462A CN 110730104 A CN110730104 A CN 110730104A
Authority
CN
China
Prior art keywords
firmware
target node
upgrading
node equipment
node device
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
CN201911036462.8A
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.)
LEXIN INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd
Espressif Systems Shanghai Co Ltd
Original Assignee
LEXIN INFORMATION TECHNOLOGY (SHANGHAI) 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 LEXIN INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd filed Critical LEXIN INFORMATION TECHNOLOGY (SHANGHAI) Co Ltd
Priority to CN201911036462.8A priority Critical patent/CN110730104A/en
Publication of CN110730104A publication Critical patent/CN110730104A/en
Priority to PCT/CN2020/124558 priority patent/WO2021083244A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1433Saving, restoring, recovering or retrying at system level during software upgrading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/04Network management architectures or arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method for upgrading multi-device batch firmware of mesh network equipment, which comprises the following steps: the host generates a firmware compression packet with an identifier and sends the firmware compression packet to root node equipment of the mesh network; the root node equipment decompresses the firmware compression packet, verifies the correctness of the firmware, repacks and compresses the firmware, and pushes the firmware to the target node equipment in a multicast mode; the upgrading firmware supports breakpoint continuous transmission in the transmission process of the mesh network; and decompressing the firmware by the target node equipment, performing CRC (cyclic redundancy check) on the firmware identification, and upgrading and restarting the firmware after the firmware identification passes the CRC. And returning to the old version for starting when the target node equipment is abnormally restarted. And the target node equipment reports the version to the host after starting, and the host confirms whether the upgrade is successful or not. By compression and breakpoint continuous transmission, the invention reduces the consumption of network and storage resources in the process of firmware transmission and improves the speed of batch upgrading; through the firmware type checking and version rollback mechanism, the device upgrading exception caused by the mismatching of the firmware and the device to be upgraded is prevented.

Description

Method for upgrading multi-device batch firmware of mesh network device
Technical Field
The invention relates to the technical field of wireless mesh networks, in particular to a method for upgrading multi-device batch firmware of mesh network devices.
Background
In the prior art, mesh network devices generally use single devices to upgrade one by one, and firmware is required to be transmitted from a host to a device to be upgraded at one time. In the upgrading mode, once a packet of data is lost in the transmission process, all data needs to be retransmitted, so that the upgrading speed is low, and the upgrading success rate is low. Moreover, the upgrading mode has no perfect firmware checking mechanism, and various types of devices usually exist in the mesh network, so that the situation that the upgraded firmware is not matched with the devices is easily caused, and the normal work of the devices is influenced.
Chinese patent CN108347346A (a method for upgrading devices in a mesh network) discloses a method for upgrading firmware of a mesh device by using a network. In this method, when a device to be upgraded receives an upgrade command, it requests new firmware content from its parent node rather than directly from the root node. If the father node stores the new firmware, the new firmware is directly sent to the equipment to be upgraded, so that the new firmware is prevented from being transmitted from the host through the root node, and the network flow is saved. If the parent node does not have new firmware, then siblings under the same parent node are preferably queried for the presence of new firmware. And when the brother node and the father node of the device to be upgraded do not have new firmware, recursively requesting from the father node at the upper level until the root node is requested, and requesting the new firmware from the host. By the aid of the upgrading mode, under the condition that most nodes in the mesh network have new firmware, the firmware transmission efficiency can be improved. However, in this method, the order in which the new firmware is queried is searched from the leaf node to the root node from the bottom up. Thus, as the patent itself indicates, if there are few devices in the mesh network that have new firmware, recursive finding would instead increase the time to obtain the new firmware. The patent suggests that in practice, new firmware should be recursively sought from the parent node and requested directly from the root node at the same time.
PCT patent WO2015167321a1 (a method of firmware upgrade in a wireless mesh network) discloses a way that involves 3 main steps. Firstly, all the devices needing to be upgraded are searched from the network, then the devices are recombined into a tree network according to various parameters (such as network signal strength), and finally, firmware is pushed from top to bottom from a root node of a new tree network until all the devices are completely upgraded. This upgrade requires the network to be reassembled before upgrading, and thus has an impact on the devices in normal operating conditions. In addition, the upgrading method still cannot solve the problem that the firmware needs to be transmitted integrally under the condition that the transmission fails.
Disclosure of Invention
The invention aims to provide a method for upgrading multi-device batch firmware of mesh network equipment, which mainly solves the problems in the prior art: the size of firmware transmission data is reduced, retransmission is not needed when packet loss occurs in firmware transmission in a wireless network, and the problems that upgrading fails and equipment does not work correctly due to mismatching of new firmware and equipment are solved.
In order to achieve the above object, the present invention provides a method for upgrading firmware in batches of multiple devices of a mesh network device, which is used for initiating and completing firmware upgrade of the mesh network device from a host to multiple mesh network devices in the same network, and is characterized by comprising the following steps:
step 1, the host generates the firmware and compresses the firmware to form a firmware compression package;
step 2, the host transmits the firmware compression packet to the root node equipment of the current mesh network; the root node equipment decompresses the firmware compression packet, verifies whether the firmware is correct or not, if the verification fails, the upgrading fails, and exits the upgrading process;
step 3, the host transmits a list of devices to be upgraded to the root node device; the device list to be upgraded comprises all target node devices;
step 4, the root node equipment checks the correctness of the received equipment list to be upgraded, if the equipment list to be upgraded is wrong, the upgrading is failed, and the upgrading process is quitted;
step 5, the root node equipment sends an upgrade state request to all the target node equipment;
step 6, after the target node equipment receives the upgrade state request, erasing the existing firmware in the flash partition of the equipment, and returning a packet loss condition to the root node equipment;
step 7, the root node device distributes the firmware to the target node device according to the received packet loss condition; the method specifically comprises the following steps:
step 7.1, the root node prepares the firmware into a transmission data packet according to the received packet loss condition; the transmission data packet comprises the content of the firmware after data compression; taking the root node device as a father node device;
step 7.2, the father node device distributes the transmission data packet to the intermediate transmission node device or the target node device;
step 7.3, the intermediate transmission node device or the target node device receives the transmission data packet;
step 7.4, if the current device is the intermediate transmission node device, taking the current node as the new father node device, and skipping to step 7.2 to continue; if the current device is the target node device, jumping to step 8;
step 8, the target node device receives the transmission data packet, decompresses the transmission data packet, restores the transmission data packet into the firmware, and writes the firmware into the flash partition;
step 9, the target node equipment marks a flash starting partition running after the next restart as a newly-upgraded firmware partition;
step 10, the target node equipment sends upgrade completion information to the root node equipment;
step 11, after receiving the upgrade completion information sent by all the target node devices, the root node device sends a restart command to all the target node devices;
step 12, the target node equipment is restarted after receiving the restart command;
step 13, after the start is completed, the target node device reports the version information of the current device of the target node device to the host;
and step 14, the host checks the version information sent by each target node device, confirms whether the target node device is upgraded successfully or not, and finishes upgrading the target node device.
Furthermore, in the process that the root node device distributes the firmware to the target node device through the direct node device, breakpoint continuous transmission is supported; the method comprises the following specific steps:
step 6 is decomposed into:
step 6.1, after the target node equipment receives the upgrading state request, judging whether the equipment has an upgrading breakpoint or not; if the upgrade breakpoint does not exist, or the upgrade breakpoint exists but the version of the firmware to be upgraded is not consistent with the firmware version marked by the upgrade breakpoint, erasing the existing firmware in the flash partition of the equipment;
6.2, the target node equipment returns a packet loss condition to the root node equipment according to the information of whether the upgrade breakpoint exists and the information contained in the upgrade breakpoint under the condition that the upgrade breakpoint exists;
in step 7, step 7.1 decomposes to:
step 7.1.1, the root node equipment determines the firmware content to be transmitted according to the received packet loss condition; the firmware content to be transmitted is a part or all of the firmware;
7.1.2, the root node device divides the firmware to be transmitted into fixed sizes, compresses the firmware to be transmitted into the transmission data packets, and carries out serial number identification on the transmission data packets;
step 8 is decomposed into:
step 8.1a, the target node equipment receives the transmission data packet, decompresses the transmission data packet and writes the decompressed transmission data packet into the flash partition;
step 8.2a, the target node device records the serial number and the upgrading condition of the transmission data packet and writes the serial number and the upgrading condition into the flash partition to form the upgrading breakpoint in step 6.1;
and 8.3a, after the target node equipment receives all the transmission data packets, splicing to form the complete firmware.
Further, a step 8.2 a' is inserted after the step 8.2a and the step 8.3 a:
step 8.2 a', the target node equipment records the size of the transmission data packet which is currently stored but not reported; when the size of the transmission data packet which is stored but not reported currently reaches the specific proportion of the size of the firmware, the target node device reports the state to the father node device, and clears the size of the transmission data packet which is stored but not reported.
Further, in the step 8.2 a', the specific ratio is 10%.
Further, when the root node device, the target node device, and the transmission intermediate device write the entire contents of the firmware into the flash partition, the method may actively check the firmware, and specifically includes:
step 1 is expanded to:
step 1.1, the host generates the firmware, and the firmware comprises a string of firmware identifications with fixed length; the firmware identification consists of a device type and a version number;
step 1.2, the host compresses the generated firmware to form the firmware compression package;
step 2 is extended to:
step 2.1, the host transmits the firmware compression packet to the root node equipment of the current mesh network;
step 2.2, the root node equipment receives the firmware compression packet;
step 2.3, the root node device decompresses the firmware compressed packet and writes the firmware into the flash partition;
step 2.4, checking the correctness of the firmware identification through a firmware verification algorithm; if the error occurs, returning the error to the host;
step 8 is decomposed into:
step 8.1b, the target node device receives the transmission data packet and decompresses the transmission data packet into the firmware;
8.2b, checking the correctness of the firmware identification through the firmware verification algorithm; and if the error occurs, returning the error to the father node equipment, and requesting retransmission.
Further, the firmware check algorithm is a CRC check algorithm; the firmware identification is 128 bytes in length.
Further, the step 9 is decomposed into:
9.1, the target node equipment marks the flash starting partition running after the next restart as a new upgraded firmware partition;
9.2, the target node equipment clears the abnormal restart times;
the step 12 is decomposed into:
step 12.1, the target node equipment is restarted after receiving the restart command;
step 12.2, in the starting process, the target node equipment detects the self state; if the state is abnormal, the target node equipment reads the recorded abnormal restart times; if the abnormal restart times reach a preset value, the target node equipment marks the flash starting partition running after the next restart as an unemplified firmware partition; if the abnormal restarting times do not reach the preset value, the target node equipment marks the abnormal restarting times to increase by one; and when the state of the target node equipment is abnormal, the target node equipment is initiatively restarted.
Further, the host is a server, a mobile terminal, or a PC device.
Furthermore, the connection mode of the host and the root node device is serial port, I2C, SPI, wired network, Wi-Fi and Bluetooth.
Further, in the compression process described in step 1, the adopted compression coding is differential coding, run-length coding or Huffman coding.
In view of the above technical features, the present invention has the following advantages:
before the firmware is transmitted, the firmware is compressed, so that the consumption of network and storage resources in the firmware transmission process is reduced.
By using a multicast mode, the firmware is pushed from top to bottom in the tree-shaped mesh network, so that each device to be upgraded is prevented from being in direct communication with the host, and the speed of batch upgrading is increased.
A breakpoint resume mechanism is supported; when packet loss occurs in wireless network transmission, the whole firmware does not need to be retransmitted, and only the data packet which is not transmitted successfully needs to be transmitted.
A firmware type checking and version rollback mechanism is added to prevent the device upgrading exception caused by the fact that the firmware is not matched with the device to be upgraded. The firmware type check is closed before upgrading, and the version rollback can process the firmware upgrading exception (such as abnormal power failure) caused by the exception in the upgrading process.
Drawings
FIG. 1 is a network topology diagram of the upgrading method of the efficient mesh network device of the present invention;
fig. 2 is a diagram of firmware transmission interaction between a host and a root node device according to the efficient mesh network device upgrading method of the present invention;
fig. 3 is a firmware upgrade interaction diagram of a root node device and a target node device of the efficient mesh network device upgrade method of the present invention;
fig. 4 is a flowchart of deployment and upgrade firmware of a target node of the efficient mesh network device upgrade method of the present invention.
The system comprises a host 1, a root node device 2, a target node device 3, a root node device 4 and a mesh network 5.
Detailed Description
The invention will be further illustrated with reference to specific embodiments. It should be understood that these examples are for illustrative purposes only and are not intended to limit the scope of the present invention. Further, it should be understood that various changes or modifications of the present invention may be made by those skilled in the art after reading the teaching of the present invention, and such equivalents may fall within the scope of the present invention as defined in the appended claims.
Referring to fig. 1, the present invention discloses a method for upgrading firmware in batches of multiple devices of a mesh network device, which includes a process of initiating, by a host 1, a firmware update of a target node device 3, and finally confirming, by the host 1, a firmware version of the target node device 3. The host 1 is a PC, a mobile device, or a server, and is used to provide and prepare new firmware to be upgraded, and initiate a firmware upgrade request. Physically, in the host 1, a connection is established only with the root node device 2 in the mesh network 5 in which the target node device 3 is located, and this connection is provided by the host root node device connection 4. The host root node device connection 4 contains serial port, I2C, SPI, network cable, Wi-Fi and bluetooth.
The mesh network equipment upgrading comprises three stages, wherein the first stage is that a host pushes upgrading firmware and an equipment list to be upgraded to root node equipment of a mesh network, the second stage is that the root node equipment pushes the upgrading firmware to a target node according to information in the equipment list to be upgraded, the target node receives and stores the upgrading firmware, and the third stage is that the target node finishes deployment of the upgrading firmware in a restarting mode and formally starts to work by adopting the upgraded firmware.
Referring to fig. 2, in a first stage of the mesh network upgrade, the host initiates a start to a termination of sending an upgrade request from the root node device to the target node, and the specific steps include:
step 1.1, a host generates firmware, wherein the firmware comprises a string of firmware identification with the length of 128 bytes; the firmware identification contains information such as device type and version number.
And step 1.2, the host compresses the generated firmware to generate a compressed firmware packet, wherein the adopted compression algorithm comprises differential coding, run-length coding or Huffman coding.
And 2.1, the host transmits the compressed firmware packet through the root node equipment of the mesh network.
And 2.2, the root node equipment receives the compressed firmware packet and decompresses the firmware.
2.3, the root node equipment checks the correctness of the firmware identification in the firmware through a firmware verification algorithm; if the error occurs, the error is returned to the host computer, and the upgrading is quitted. The firmware check algorithm is a CRC check algorithm.
Step 3, the host transmits a list of equipment to be upgraded to the root node equipment; the device list to be upgraded contains the identifiers of all the target node devices.
And 4, the root node equipment checks the correctness of the received equipment list to be upgraded, if the equipment list to be upgraded is wrong, the upgrading is failed, and the upgrading process is quitted.
And 5, the root node equipment sends an upgrade state request to all target node equipment in the equipment list to be upgraded.
Referring to fig. 3, in the second stage of the mesh network upgrade, starting from when the target device to be upgraded receives the upgrade condition to when the target node prepares to deploy the firmware, the specific steps include:
and 6.1, the target node equipment receives the upgrade state request from the root node.
6.2, the target node equipment judges whether an upgrading breakpoint exists in the equipment; if no upgrade break point exists, the step 6.5 is carried out, otherwise, the step 6.3 is carried out.
And 6.3, the target node equipment judges whether the firmware version to be upgraded is consistent with the firmware version stored at the existing upgrade breakpoint, if not, the step 6.4 is carried out, and if not, the step 6.6 is carried out.
And 6.4, erasing the upgrade breakpoint information of the target node equipment.
And 6.5, erasing the existing firmware in the flash partition of the target node equipment by the target node equipment.
And 6.6, the target node equipment prepares breakpoint information (if any) and packet loss information according to the information whether the upgrade breakpoint exists and the information contained in the upgrade breakpoint when the upgrade breakpoint exists.
And 6.7, returning the packet loss condition to the root node equipment by the target node equipment.
Step 7, the root node equipment distributes the firmware to the target node equipment according to the received packet loss condition; the method specifically comprises the following steps:
step 7.1.1, the root node equipment determines the firmware content to be transmitted according to the received packet loss condition; according to the difference of the packet loss situation, the firmware content to be transmitted is a part of or the whole firmware.
And 7.1.2, the root node equipment divides the firmware to be transmitted into fixed size, compresses the firmware into transmission data packets, and carries out serial number identification on each transmission data packet. And identifies the root node device as a parent node device.
And 7.2, the father node device distributes the transmission data packet to the intermediate transmission node device or the target node device. If the transmitted device is the intermediate transmission node device, the transmitted node is taken as a new father node device, and the step 7.2 is skipped to continue; if the transmitted equipment is the target node equipment, jumping to the step 8;
and 8.1, the target node equipment receives the transmission data packet, decompresses the received transmission data packet and writes the decompressed transmission data packet into the flash partition.
And 8.2, the target node equipment records the serial number and the upgrading condition of the transmission data packet and writes the serial number and the upgrading condition into the flash partition to form an upgrading breakpoint in the step 6.2 so as to record the information of the transmission data packet which is correctly received.
And 8.3, the target node equipment updates the size of the transmission data packet which is currently stored but not reported, and judges whether the size of the transmission data packet which is currently stored but not reported reaches the size of the whole firmware by 10%. If so, step 8.4 is entered, otherwise, step 8.1 is skipped to continue receiving the subsequent transmission data packet.
And 8.4, the target node device reports the state (including the saved size information of the transmission packet) through the father node device of the target node device, and clears the size of the transmission data packet which is saved but not reported.
And 8.5, the target node equipment judges whether all the transmission data packets are received or not, and if not, the target node equipment jumps to the step 8.1 to continue receiving the subsequent transmission data packets.
And 8.6, the target node equipment checks the correctness of the firmware identification through a firmware check algorithm (CRC check algorithm). If the data packet is wrong, returning the mistake to the father node equipment, requesting retransmission, and skipping to the step 8.1 for waiting to receive the retransmitted transmission data packet; otherwise step 8.7 is entered.
And 8.7, marking the flash partition running after the next restart as a new upgraded firmware partition by the target node equipment, clearing the abnormal restart times, and preparing to start to deploy new firmware.
Referring to fig. 4, in the third stage of the mesh network upgrade, the step from the time when the target device to be upgraded sends the upgrade completion information to the time when the host checks the version number of the deployment firmware reported by the target device includes:
and 9, the target node equipment sends upgrade completion information to the root node equipment to indicate that the target node equipment completes the acceptance and burning of the new firmware and prepares for deployment.
Step 10, the root node equipment collects the upgrading information from each target node and judges whether all the target nodes finish deployment preparation. And if all the target nodes are completely prepared for deployment, the step 11 is entered, otherwise, the step 5 is entered, and the firmware is pushed to the target nodes which are not prepared for deployment.
And 11, the root node equipment sends a restart command to all the target node equipment to start to deploy the new firmware.
Step 12.1, the target node equipment is restarted after receiving the restart command;
and step 12.2, in the starting process, the target node equipment detects the self state.
And if the state is abnormal, the target node equipment reads the recorded abnormal restart times. And if the abnormal restarting times reach a preset value, the target node equipment marks the flash partition running after the next restart as the non-upgraded firmware partition. And if the abnormal restarting times do not reach the preset value, increasing the abnormal restarting times by one and then storing. When the state of the target node equipment is abnormal, the target node equipment is initiatively restarted again, and the step 12.2 is carried out in the process of restarting again, and the self state is detected.
And step 13, under the condition that the starting state is normal, after the starting is finished, the target node device reports step by step through the father node device (including the root node device), and finally, the current running firmware version information of the host is notified.
Step 14, the host checks whether the firmware version information sent by each target node device is consistent with the version of the firmware generated in step 1.1. If the node equipment is consistent with the target node equipment, the target node equipment is confirmed to be successfully upgraded, otherwise, the target node equipment is confirmed to be unsuccessfully upgraded. And finishing the firmware upgrading process no matter the firmware upgrading process is successful or failed.
The mesh network devices in this embodiment all have partition tables to define the flash layout of the mesh network devices. In this embodiment, the size of the flash is 4 mbytes, and all the mesh network devices are divided into two types, each having a different partition table type. Specifically, one is a partition table without factory partition, and the other is a partition table with factory partition. The partition table of the non-factory partition comprises two partitions, namely OTA _0 and OTA _1, which are related to firmware upgrading. The partition table with the factorary partition comprises three partitions, namely OTA _, OTA _1 and factorary partitions, and the partitions are related to the upgraded firmware. The partition table itself cannot be upgraded by means of firmware upgrade, but other means must be adopted to erase the entire flash first and then rewrite the partition table.
The OTA _0 and OTA _1 partitions are jointly used, and a version rollback mechanism of the mesh network equipment is realized. The default OTA _0 is the active partition, i.e., the target node device completes booting from the OTA _0 partition, while OTA _1 is the inactive partition. In the firmware upgrading process, the process of changing the partition states of the OTA _0 and the OTA _1 comprises the following steps:
step 1, starting firmware upgrading, and identifying and erasing the inactive partition by the target node equipment.
Step 3, the new firmware will be written into the inactive partition.
And 4, after the firmware is written, starting verification.
And 5, successfully upgrading the firmware, updating the inactive partition and indicating that the inactive partition is the active partition.
Step 6, when the next boot is performed, the firmware will be booted from this partition. After restarting, the active partition and the inactive partition complete the switch.
And 7, checking whether the current inactive partition is upgraded or not. If not, repeating the steps 1 to 6 to complete the upgrading of the current inactive partition.
When the root node device uses the partition table with the factorary partition, the factorary partition is used as a buffer area of the firmware compression package for updating by the root node device, is used for storing the firmware compression package from the host, and is also a basis for subsequently pushing the firmware compression package to the target node device. In the case where the root node device uses a partition table without factory partitions, the inactive partition in OTA _0 or OTA _1 will be used as a buffer for the firmware compression packet. In this case, if the root node device encounters a version rollback condition, the version rolled back firmware may not be the original version.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A method for upgrading firmware of multiple devices in batches of mesh network devices is used for initiating and finishing firmware upgrading of the mesh network devices from a host to the multiple mesh network devices in the same network, and is characterized by comprising the following steps:
step 1, the host generates the firmware and compresses the firmware to form a firmware compression package;
step 2, the host transmits the firmware compression packet to the root node equipment of the current mesh network; the root node equipment decompresses the firmware compression packet, verifies whether the firmware is correct or not, if the verification fails, the upgrading fails, and exits the upgrading process;
step 3, the host transmits a list of devices to be upgraded to the root node device; the device list to be upgraded comprises all target node devices;
step 4, the root node equipment checks the correctness of the received equipment list to be upgraded, if the equipment list to be upgraded is wrong, the upgrading is failed, and the upgrading process is quitted;
step 5, the root node equipment sends an upgrade state request to all the target node equipment;
step 6, after the target node equipment receives the upgrade state request, erasing the existing firmware in the flash partition of the equipment, and returning a packet loss condition to the root node equipment;
step 7, the root node device distributes the firmware to the target node device according to the received packet loss condition; the method specifically comprises the following steps:
step 7.1, the root node prepares the firmware into a transmission data packet according to the received packet loss condition; the transmission data packet comprises the content of the firmware after data compression; taking the root node device as a father node device;
step 7.2, the father node device distributes the transmission data packet to the intermediate transmission node device or the target node device;
step 7.3, the intermediate transmission node device or the target node device receives the transmission data packet;
step 7.4, if the current device is the intermediate transmission node device, taking the current node as the new father node device, and skipping to step 7.2 to continue; if the current device is the target node device, jumping to step 8;
step 8, the target node device receives the transmission data packet, decompresses the transmission data packet, restores the transmission data packet into the firmware, and writes the firmware into the flash partition;
step 9, the target node equipment marks a flash starting partition running after the next restart as a newly-upgraded firmware partition;
step 10, the target node equipment sends upgrade completion information to the root node equipment;
step 11, after receiving the upgrade completion information sent by all the target node devices, the root node device sends a restart command to all the target node devices;
step 12, the target node equipment is restarted after receiving the restart command;
step 13, after the start is completed, the target node device reports the version information of the current device of the target node device to the host;
and step 14, the host checks the version information sent by each target node device, confirms whether the target node device is upgraded successfully or not, and finishes upgrading the target node device.
2. The method for upgrading firmware in batches by multiple devices according to claim 1, wherein breakpoint resuming is supported in the process that the root node device distributes the firmware to the target node device through its direct node device; the method comprises the following specific steps:
step 6 is decomposed into:
step 6.1, after the target node equipment receives the upgrading state request, judging whether the equipment has an upgrading breakpoint or not; if the upgrade breakpoint does not exist, or the upgrade breakpoint exists but the version of the firmware to be upgraded is not consistent with the firmware version marked by the upgrade breakpoint, erasing the existing firmware in the flash partition of the equipment;
6.2, the target node equipment returns a packet loss condition to the root node equipment according to the information of whether the upgrade breakpoint exists and the information contained in the upgrade breakpoint under the condition that the upgrade breakpoint exists;
in step 7, step 7.1 decomposes to:
step 7.1.1, the root node equipment determines the firmware content to be transmitted according to the received packet loss condition; the firmware content to be transmitted is a part or all of the firmware;
7.1.2, the root node device divides the firmware to be transmitted into fixed sizes, compresses the firmware to be transmitted into the transmission data packets, and carries out serial number identification on the transmission data packets;
step 8 is decomposed into:
step 8.1a, the target node equipment receives the transmission data packet, decompresses the transmission data packet and writes the decompressed transmission data packet into the flash partition;
step 8.2a, the target node device records the serial number and the upgrading condition of the transmission data packet and writes the serial number and the upgrading condition into the flash partition to form the upgrading breakpoint in step 6.1;
and 8.3a, after the target node equipment receives all the transmission data packets, splicing to form the complete firmware.
3. The method for upgrading firmware in batches with multiple devices according to claim 2, characterized in that a step 8.2 a' is inserted after the step 8.2a and the step 8.3 a:
step 8.2 a', the target node equipment records the size of the transmission data packet which is currently stored but not reported; when the size of the transmission data packet which is stored but not reported currently reaches the specific proportion of the size of the firmware, the target node device reports the state to the father node device, and clears the size of the transmission data packet which is stored but not reported.
4. The method for multi-device batch firmware upgrade according to claim 3, wherein in step 8.2 a', the specific proportion is 10%.
5. The method according to claim 1, wherein when the root node device, the target node device, and the transmission intermediate device write the entire content of the firmware into the flash partition, the method actively checks the firmware, specifically comprising:
step 1 is expanded to:
step 1.1, the host generates the firmware, and the firmware comprises a string of firmware identifications with fixed length; the firmware identification consists of a device type and a version number;
step 1.2, the host compresses the generated firmware to form the firmware compression package;
step 2 is extended to:
step 2.1, the host transmits the firmware compression packet to the root node equipment of the current mesh network;
step 2.2, the root node equipment receives the firmware compression packet;
step 2.3, the root node device decompresses the firmware compressed packet and writes the firmware into the flash partition;
step 2.4, checking the correctness of the firmware identification through a firmware verification algorithm; if the error occurs, returning the error to the host;
step 8 is decomposed into:
step 8.1b, the target node device receives the transmission data packet and decompresses the transmission data packet into the firmware;
8.2b, checking the correctness of the firmware identification through the firmware verification algorithm; and if the error occurs, returning the error to the father node equipment, and requesting retransmission.
6. The method of multi-device batch firmware upgrade of claim 5, wherein the firmware checking algorithm is a CRC checking algorithm; the firmware identification is 128 bytes in length.
7. The method for upgrading firmware in batches with multiple devices according to claim 1, wherein the step 9 is decomposed into:
9.1, the target node equipment marks the flash starting partition running after the next restart as a new upgraded firmware partition;
9.2, the target node equipment clears the abnormal restart times;
the step 12 is decomposed into:
step 12.1, the target node equipment is restarted after receiving the restart command;
step 12.2, in the starting process, the target node equipment detects the self state; if the state is abnormal, the target node equipment reads the recorded abnormal restart times; if the abnormal restart times reach a preset value, the target node equipment marks the flash starting partition running after the next restart as an unemplified firmware partition; if the abnormal restarting times do not reach the preset value, the target node equipment marks the abnormal restarting times to increase by one; and when the state of the target node equipment is abnormal, the target node equipment is initiatively restarted.
8. The method for multi-device batch firmware upgrade of claim 1, wherein the host is a server, a mobile terminal or a PC device.
9. The method for multi-device batch firmware upgrade according to claim 1, wherein the host and the root node device are connected by serial port, I2C, SPI, network cable, Wi-Fi and bluetooth.
10. The method for upgrading firmware in batches with multiple devices according to claim 1, wherein in the compression process of step 1, the adopted compression coding is differential coding, run-length coding or Huffman coding.
CN201911036462.8A 2019-10-29 2019-10-29 Method for upgrading multi-device batch firmware of mesh network device Pending CN110730104A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911036462.8A CN110730104A (en) 2019-10-29 2019-10-29 Method for upgrading multi-device batch firmware of mesh network device
PCT/CN2020/124558 WO2021083244A1 (en) 2019-10-29 2020-10-28 Multi-device batch firmware upgrade method for mesh network device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911036462.8A CN110730104A (en) 2019-10-29 2019-10-29 Method for upgrading multi-device batch firmware of mesh network device

Publications (1)

Publication Number Publication Date
CN110730104A true CN110730104A (en) 2020-01-24

Family

ID=69222346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911036462.8A Pending CN110730104A (en) 2019-10-29 2019-10-29 Method for upgrading multi-device batch firmware of mesh network device

Country Status (2)

Country Link
CN (1) CN110730104A (en)
WO (1) WO2021083244A1 (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111541774A (en) * 2020-05-08 2020-08-14 杭州粒合信息科技有限公司 Equipment upgrading method, device and system
CN111722852A (en) * 2020-06-10 2020-09-29 深圳市千分一智能技术有限公司 Firmware burning method and device and computer readable storage medium
CN112087515A (en) * 2020-09-10 2020-12-15 苏州德姆斯信息技术有限公司 Aerial upgrading system and aerial upgrading method for terminal firmware
CN112152836A (en) * 2020-08-11 2020-12-29 珠海市一微半导体有限公司 Method, system and chip for automatically upgrading remote firmware of small storage capacity equipment
WO2021083244A1 (en) * 2019-10-29 2021-05-06 乐鑫信息科技(上海)股份有限公司 Multi-device batch firmware upgrade method for mesh network device
CN112799707A (en) * 2021-01-18 2021-05-14 福建新大陆通信科技股份有限公司 CTID (computer telephony integration) access control firmware upgrading method and system
CN112887146A (en) * 2021-01-28 2021-06-01 杭州迪普科技股份有限公司 Network node upgrading method and device and electronic equipment
CN113031985A (en) * 2021-02-07 2021-06-25 厦门亿联网络技术股份有限公司 Wireless upgrading method
CN113407377A (en) * 2021-06-21 2021-09-17 英博超算(南京)科技有限公司 OTA upgrade failure rollback version method
CN113452782A (en) * 2021-06-28 2021-09-28 烽火通信科技股份有限公司 Upgrading method and device under mesh networking
CN114245319A (en) * 2021-12-03 2022-03-25 南京矽力微电子技术有限公司 Bluetooth Mesh-based enhanced broadcast concurrent OTA (over the air) firmware upgrading method
CN115021873A (en) * 2022-06-13 2022-09-06 浙江大华技术股份有限公司 Data retransmission method and device and electronic equipment
CN115113891A (en) * 2022-07-27 2022-09-27 苏州浪潮智能科技有限公司 PCIe Switch firmware upgrading method and related components
CN116149713A (en) * 2023-04-19 2023-05-23 广州擎天实业有限公司 Program upgrading method and device for all-level equipment under tree-type heterogeneous network
WO2023116425A1 (en) * 2021-12-23 2023-06-29 深圳创维数字技术有限公司 Wireless mesh network upgrade method and apparatus, and main node and storage medium
CN115113891B (en) * 2022-07-27 2024-10-22 苏州浪潮智能科技有限公司 PCIE SWITCH firmware upgrading method and related components

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015817A (en) * 2017-05-25 2017-08-04 孙文现 A kind of method of equipment firmware aerial upgrade
CN107453925A (en) * 2017-09-21 2017-12-08 山东康威通信技术股份有限公司 Remote firmware updating method and cloud platform based on multistage communication platform
CN108347346A (en) * 2017-12-29 2018-07-31 乐鑫信息科技(上海)有限公司 Device updating method in a kind of mesh networks
US20190138295A1 (en) * 2018-12-28 2019-05-09 Intel Corporation Delivery of firmware updates in a low-power mesh network

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
MY170817A (en) * 2014-04-30 2019-08-30 Mimos Berhad A method for upgrading firmware in a wireless mesh network
CN110365510A (en) * 2018-04-10 2019-10-22 上海仪电(集团)有限公司中央研究院 It is a kind of can to network node batch OTA upgrade things-internet gateway and OTA upgrade method
CN109769239A (en) * 2019-03-06 2019-05-17 乐鑫信息科技(上海)股份有限公司 Method for carrying out OTA firmware upgrade to the node in bluetooth Mesh network
CN110730104A (en) * 2019-10-29 2020-01-24 乐鑫信息科技(上海)股份有限公司 Method for upgrading multi-device batch firmware of mesh network device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107015817A (en) * 2017-05-25 2017-08-04 孙文现 A kind of method of equipment firmware aerial upgrade
CN107453925A (en) * 2017-09-21 2017-12-08 山东康威通信技术股份有限公司 Remote firmware updating method and cloud platform based on multistage communication platform
CN108347346A (en) * 2017-12-29 2018-07-31 乐鑫信息科技(上海)有限公司 Device updating method in a kind of mesh networks
US20190138295A1 (en) * 2018-12-28 2019-05-09 Intel Corporation Delivery of firmware updates in a low-power mesh network

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021083244A1 (en) * 2019-10-29 2021-05-06 乐鑫信息科技(上海)股份有限公司 Multi-device batch firmware upgrade method for mesh network device
CN111541774A (en) * 2020-05-08 2020-08-14 杭州粒合信息科技有限公司 Equipment upgrading method, device and system
CN111722852A (en) * 2020-06-10 2020-09-29 深圳市千分一智能技术有限公司 Firmware burning method and device and computer readable storage medium
CN111722852B (en) * 2020-06-10 2024-10-25 深圳市千分一智能技术有限公司 Firmware burning method, equipment and computer readable storage medium
CN112152836B (en) * 2020-08-11 2022-12-13 珠海市一微半导体有限公司 Remote firmware automatic upgrading method, system and chip for small storage capacity equipment
CN112152836A (en) * 2020-08-11 2020-12-29 珠海市一微半导体有限公司 Method, system and chip for automatically upgrading remote firmware of small storage capacity equipment
CN112087515A (en) * 2020-09-10 2020-12-15 苏州德姆斯信息技术有限公司 Aerial upgrading system and aerial upgrading method for terminal firmware
CN112799707A (en) * 2021-01-18 2021-05-14 福建新大陆通信科技股份有限公司 CTID (computer telephony integration) access control firmware upgrading method and system
CN112887146A (en) * 2021-01-28 2021-06-01 杭州迪普科技股份有限公司 Network node upgrading method and device and electronic equipment
CN113031985B (en) * 2021-02-07 2022-10-14 厦门亿联网络技术股份有限公司 Wireless upgrading method
CN113031985A (en) * 2021-02-07 2021-06-25 厦门亿联网络技术股份有限公司 Wireless upgrading method
CN113407377B (en) * 2021-06-21 2023-09-08 英博超算(南京)科技有限公司 Method for rollback version in failure of OTA upgrading
CN113407377A (en) * 2021-06-21 2021-09-17 英博超算(南京)科技有限公司 OTA upgrade failure rollback version method
CN113452782B (en) * 2021-06-28 2022-04-26 烽火通信科技股份有限公司 Upgrading method and device under mesh networking
CN113452782A (en) * 2021-06-28 2021-09-28 烽火通信科技股份有限公司 Upgrading method and device under mesh networking
CN114245319A (en) * 2021-12-03 2022-03-25 南京矽力微电子技术有限公司 Bluetooth Mesh-based enhanced broadcast concurrent OTA (over the air) firmware upgrading method
WO2023116425A1 (en) * 2021-12-23 2023-06-29 深圳创维数字技术有限公司 Wireless mesh network upgrade method and apparatus, and main node and storage medium
CN115021873A (en) * 2022-06-13 2022-09-06 浙江大华技术股份有限公司 Data retransmission method and device and electronic equipment
CN115113891A (en) * 2022-07-27 2022-09-27 苏州浪潮智能科技有限公司 PCIe Switch firmware upgrading method and related components
CN115113891B (en) * 2022-07-27 2024-10-22 苏州浪潮智能科技有限公司 PCIE SWITCH firmware upgrading method and related components
CN116149713A (en) * 2023-04-19 2023-05-23 广州擎天实业有限公司 Program upgrading method and device for all-level equipment under tree-type heterogeneous network
CN116149713B (en) * 2023-04-19 2023-12-15 广州擎天实业有限公司 Program upgrading method and device for all-level equipment under tree-type heterogeneous network

Also Published As

Publication number Publication date
WO2021083244A1 (en) 2021-05-06

Similar Documents

Publication Publication Date Title
CN110730104A (en) Method for upgrading multi-device batch firmware of mesh network device
CN110096294B (en) Method for wirelessly upgrading MCU application program at any breakpoint
CN107179909B (en) Software upgrading method and device and computer readable storage medium
CN110621011B (en) OTA firmware upgrading method and system based on Bluetooth device side
CN101593119B (en) Method and device for firmware over-the-air of exclusive flash memory combined equipment
RU2419839C2 (en) Software update system and method for portable ota supporting mobile terminal
CN108021410A (en) A kind of firmware upgrade method and system of intelligent appliance equipment
US20160085538A1 (en) Over-the-air updates for ble devices
US10469620B2 (en) Method for transferring a new software version to at least one electricity meter via a communication network
CN108449198A (en) A kind of method, system and the storage device of OTA upgradings
CN105978937A (en) Bluetooth slave device and upgrade method thereof
CN112631628A (en) Singlechip upgrading method, singlechip and storage medium
CN111796853A (en) Firmware upgrading method, system, equipment and computer storage medium
CN114840242A (en) System upgrading method and device of electronic equipment and readable storage medium
CN109002305B (en) Method and system for updating equipment program
CN108664255B (en) Software upgrading method and device
CN113315797A (en) Method, system and node for remote upgrading of local area network in batches
CN113326219B (en) Burning method based on burning system and computer storage medium
CN114860278A (en) Voice chip OTA upgrading method
CN113138788A (en) Air conditioner program upgrading method and air conditioner system
CN112612528B (en) System software selective starting and remote updating method based on Bootloader
CN112804071B (en) Online upgrade method, upgrade file providing method, device and storage medium
CN116483409A (en) Remote firmware updating method, system, electronic equipment and storage medium
CN108833128A (en) A kind of method that equipment updates
CN107665123B (en) Firmware updating 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200124

RJ01 Rejection of invention patent application after publication