Search

CN-121984856-A - Firmware upgrading method, device and storage medium

CN121984856ACN 121984856 ACN121984856 ACN 121984856ACN-121984856-A

Abstract

The application discloses a firmware upgrading method, equipment and a storage medium, which relate to the technical field of industrial automation and comprise the steps of receiving a firmware upgrading instruction sent by an upper computer, sending an upgrading detection message to terminal nodes in a network based on the firmware upgrading instruction, determining the number of terminal nodes which can be upgraded concurrently according to the received upgrading detection response message, determining the terminal nodes to be upgraded according to the number of the terminal nodes, transmitting a firmware upgrading data packet to the terminal nodes to be upgraded, and broadcasting a restarting instruction to the terminal nodes to be upgraded after the transmission of the firmware upgrading data packet is completed so that the terminal nodes to be upgraded can complete firmware upgrading. The method and the system detect the online terminal before upgrading and dynamically determine the concurrent upgrading scale, enable the upgrading task to adapt to the available resources of the network, avoid communication congestion or resource waste caused by blind concurrency, execute firmware fragment transmission and restarting on the terminal node based on the concurrency quantity, and remarkably improve the firmware upgrading efficiency of the large-scale industrial terminal.

Inventors

  • YIN XUEZHI
  • YANG GUILIN
  • YU XINYANG

Assignees

  • 深圳市三旺通信股份有限公司

Dates

Publication Date
20260505
Application Date
20260302

Claims (10)

  1. 1. A firmware upgrade method, characterized in that the firmware upgrade method comprises: receiving a firmware upgrading instruction sent by an upper computer, and sending an upgrading detection message to a terminal node in a current network based on the firmware upgrading instruction; Determining the number of terminal nodes which can be updated concurrently according to the received updating detection response message; determining terminal nodes to be upgraded according to the number of the terminal nodes which can be upgraded concurrently, and transmitting firmware upgrading data packets to the terminal nodes to be upgraded; and broadcasting a restarting instruction to the terminal node to be upgraded after the transmission of the firmware upgrading data packet is completed, so that the terminal node to be upgraded can complete firmware upgrading.
  2. 2. The firmware upgrade method of claim 1, wherein the step of determining the number of concurrently upgradeable terminal nodes according to the received upgrade probe response message comprises: Counting the number of the received upgrade detection response messages in a preset period of time, and acquiring a system load index of the current network; When the system load index does not exceed a preset performance threshold, taking the number of the received upgrade detection response messages as the number of terminal nodes capable of being upgraded concurrently; and when the system load index exceeds the performance threshold, reducing the number of the terminal nodes which can be upgraded concurrently according to the deviation degree of the system load index and the performance threshold.
  3. 3. The firmware upgrade method as claimed in claim 1, wherein the step of determining the terminal node to be upgraded according to the number of the concurrently upgradeable terminal nodes, and transmitting the firmware upgrade data packet to the terminal node to be upgraded comprises: Receiving a terminal node list to be upgraded configured by an upper computer, and generating a device identification frame containing firmware upgrading parameters; selecting a corresponding number of terminal nodes from the terminal node list to be upgraded according to the number of the terminal nodes which can be upgraded concurrently, taking the terminal nodes as the terminal nodes to be upgraded, and identifying the terminal nodes to be upgraded; Broadcasting the equipment identification frame through AUTBUS buses so that the terminal node to be upgraded responds to the equipment identification frame, and the terminal node which is not identified does not respond to the equipment identification frame; After receiving the confirmation response returned by the terminal node to be upgraded, transmitting the firmware upgrading data packet to the terminal node to be upgraded in a fragmented manner; and determining a transmission result of the firmware upgrading data packet according to the response state of the terminal node to be upgraded.
  4. 4. A firmware upgrade method as claimed in claim 3, wherein said step of transmitting said firmware upgrade data packet to said terminal node to be upgraded in slices after receiving a confirmation response returned from said terminal node to be upgraded comprises: sequentially sending the fragment messages of the firmware upgrading data packet to the terminal node to be upgraded, and starting a preset timeout timer after sending each fragment message; if a part of terminal nodes to be upgraded do not return a response message aiming at the current fragmented message within the timeout timer, continuing to send the next fragmented message; and marking the terminal node to be upgraded which successfully receives all the fragmented messages as successful upgrading after the transmission of all the fragmented messages is completed.
  5. 5. A firmware upgrade method as defined in claim 3, wherein after said step of transmitting said firmware upgrade data packet to said terminal node to be upgraded in slices after receiving a confirmation response returned from said terminal node to be upgraded, said firmware upgrade method further comprises: Acquiring a system load index of a current network; if the system load index exceeds a preset performance threshold, reducing the number of the terminal nodes which can be upgraded concurrently; And transmitting the firmware upgrading data packet to the terminal node to be upgraded in a slicing way based on the adjusted quantity of the terminal nodes which can be upgraded concurrently.
  6. 6. The firmware upgrade method as claimed in claim 1, wherein the step of broadcasting a restart instruction to the terminal node to be upgraded after the transmission of the firmware upgrade data packet is completed, so that the terminal node to be upgraded completes the firmware upgrade comprises: Determining a target terminal node with successful firmware upgrading from the terminal nodes to be upgraded according to the transmission result of the firmware upgrading data packet; And broadcasting a restarting instruction carrying a delay restarting parameter to the target terminal node so that the target terminal node restarts after the corresponding delay time to finish firmware upgrading.
  7. 7. The firmware upgrade method of claim 1, wherein the firmware upgrade method further comprises: in the process of transmitting a firmware upgrading data packet to the terminal node to be upgraded, if a management node is interrupted in communication, recording the current upgrading progress, and marking the current upgrading state as a breakpoint continuous transmission state, wherein the upgrading progress comprises the terminal node which has completed firmware upgrading, the terminal node which is in progress with firmware upgrading and the terminal node which has not completed firmware upgrading; controlling the terminal node which is being subjected to firmware upgrading to store the successfully received fragment message sequence number; And after the management node communication is restored, if the breakpoint resume state is detected, continuously transmitting the rest firmware upgrade data packet to the corresponding terminal node according to the current upgrade progress and the fragment message sequence number corresponding to the terminal node which is being subjected to firmware upgrade.
  8. 8. The firmware upgrade method as claimed in claim 7, wherein the step of continuing to transmit the remaining firmware upgrade data packet to the corresponding terminal node according to the current upgrade progress and the fragment message sequence number corresponding to the terminal node performing the firmware upgrade comprises: Acquiring the last recorded successfully received fragment message sequence number of the terminal node which is undergoing firmware upgrading; determining the next sequence number of the successfully received fragment message sequence number as a target fragment sequence number; sequentially issuing the rest fragments of firmware upgrading data packets to the corresponding terminal nodes from the target fragments according to the ascending sequence of the fragments; After issuing the fragment message of each remaining firmware upgrading data packet, starting a preset overtime timer, and if a response message returned by the corresponding terminal node is received in the overtime timer, continuing to issue the next fragment message until the transmission of all the remaining fragment messages is completed.
  9. 9. A firmware upgrade apparatus comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the firmware upgrade method as claimed in any one of claims 1 to 8.
  10. 10. A storage medium, characterized in that the storage medium is a computer-readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the steps of the firmware upgrade method according to any one of claims 1 to 8.

Description

Firmware upgrading method, device and storage medium Technical Field The present application relates to the field of industrial automation technologies, and in particular, to a firmware upgrade method, apparatus, and storage medium. Background In industrial automation systems, remote firmware upgrades of devices are typically centrally controlled by a management node and distribute firmware data to end nodes one by one. Because the management node can only sequentially execute firmware upgrading operation on a single terminal node, when a large number of terminal devices are deployed in the system, a large amount of time is required to finish firmware transmission and upgrading of all the terminal devices, so that the firmware upgrading efficiency is low, and the high-efficiency firmware maintenance requirement of a large-scale industrial field is difficult to meet. The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present application and is not intended to represent an admission that the foregoing is prior art. Disclosure of Invention The application mainly aims to provide a firmware upgrading method, equipment and a storage medium, and aims to solve the technical problem of low firmware upgrading efficiency. To achieve the above object, an embodiment of the present application provides a firmware upgrade method, including: receiving a firmware upgrading instruction sent by an upper computer, and sending an upgrading detection message to a terminal node in a current network based on the firmware upgrading instruction; Determining the number of terminal nodes which can be updated concurrently according to the received updating detection response message; determining terminal nodes to be upgraded according to the number of the terminal nodes which can be upgraded concurrently, and transmitting firmware upgrading data packets to the terminal nodes to be upgraded; and broadcasting a restarting instruction to the terminal node to be upgraded after the transmission of the firmware upgrading data packet is completed, so that the terminal node to be upgraded can complete firmware upgrading. In one embodiment, the step of determining the number of concurrently upgradeable terminal nodes according to the received upgrade probe response message includes: Counting the number of the received upgrade detection response messages in a preset period of time, and acquiring a system load index of the current network; When the system load index does not exceed a preset performance threshold, taking the number of the received upgrade detection response messages as the number of terminal nodes capable of being upgraded concurrently; and when the system load index exceeds the performance threshold, reducing the number of the terminal nodes which can be upgraded concurrently according to the deviation degree of the system load index and the performance threshold. In an embodiment, the step of determining the terminal node to be upgraded according to the number of the terminal nodes capable of being upgraded concurrently and transmitting the firmware upgrade data packet to the terminal node to be upgraded includes: Receiving a terminal node list to be upgraded configured by an upper computer, and generating a device identification frame containing firmware upgrading parameters; selecting a corresponding number of terminal nodes from the terminal node list to be upgraded according to the number of the terminal nodes which can be upgraded concurrently, taking the terminal nodes as the terminal nodes to be upgraded, and identifying the terminal nodes to be upgraded; Broadcasting the equipment identification frame through AUTBUS buses so that the terminal node to be upgraded responds to the equipment identification frame, and the terminal node which is not identified does not respond to the equipment identification frame; After receiving the confirmation response returned by the terminal node to be upgraded, transmitting the firmware upgrading data packet to the terminal node to be upgraded in a fragmented manner; and determining a transmission result of the firmware upgrading data packet according to the response state of the terminal node to be upgraded. In an embodiment, the step of transmitting the firmware upgrade data packet to the terminal node to be upgraded after receiving the acknowledgement response returned by the terminal node to be upgraded includes: sequentially sending the fragment messages of the firmware upgrading data packet to the terminal node to be upgraded, and starting a preset timeout timer after sending each fragment message; if a part of terminal nodes to be upgraded do not return a response message aiming at the current fragmented message within the timeout timer, continuing to send the next fragmented message; and marking the terminal node to be upgraded which successfully receives all the fragmented messages as successful upgrading after the t