Method for automatically upgrading terminal equipment in batches and implementation
The method of automatically upgrading terminal equipment through multicast protocol solves the problems of cumbersome, time-consuming and inefficient upgrade methods in the existing technology, realizes full automation batch upgrades, and improves production efficiency and R&D quality.
Patent Information
- Application Number
- CN202510079455.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-18
- Publication Date
- 2025-05-16
AI Technical Summary
The upgrade methods of existing terminal equipment are cumbersome, time-consuming and inefficient, especially the traditional WEB page upgrade and welding and removing FLASH chip upgrade methods, resulting in increased production costs and equipment damage.
The multicast protocol is used to automatically upgrade terminal devices in batches. By initializing the Ethernet card configuration parameters, receiving multicast type data packets, extracting and verifying valid data segments, and automatically writing upgrade data to the FLASH chip to realize version update of the main and backup partitions.
Fully automated batch upgrades have been achieved, reducing human resources demand, improving production efficiency and R&D quality, and avoiding the increase in costs caused by equipment damage and repeated operations.
Smart Images

Figure CN120010887A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of terminal equipment upgrade, and in particular to a method and implementation for automatically upgrading terminal equipment in batches by using a multicast protocol. Background Art
[0002] During the R&D and debugging phases and the production process, terminal equipment manufacturers often encounter high-frequency updates of device software, updates of device configuration files, and modifications of various device parameters.
[0003] There are two traditional ways to upgrade in the production process: log in to the WEB page and use the HTTP protocol to upgrade, and solder the FLASH chip and use the burning tool to upgrade. These two mainstream technical upgrade methods are very complicated, and multiple devices cannot be upgraded at the same time, the production efficiency is very low, and the following problems will be encountered during production operations:
[0004] (1) Login to the WEB page protocol upgrade method. Each device needs to log in to the management page and manually enter the account name and password. After successful login, go to the upgrade page to select the path where the upgrade file is located, and download the upgrade image file to the device through the HTTP protocol. The upgrade needs to be repeated twice to complete the version update of the primary and backup partitions.
[0005] (2) The upgrade method of soldering and removing the FLASH chip using a burning tool requires the operation of a professional hardware engineer. Removing the FLASH chip from the circuit board can easily damage the circuit board. Repeated soldering and removing can damage the pad, making the circuit board scrapped and unusable. Moreover, after upgrading with a burner, all the calibration parameters and configuration parameters in the device are cleared, and calibration and configuration operations need to be performed again, which requires increasing the production operation process and a large amount of labor costs.
[0006] In view of the above two upgrading methods, although the process is simple, the repetition rate is extremely high, the whole process is time-consuming and labor-intensive, and the efficiency is very low, which ultimately leads to increased production costs. An efficient and energy-saving method is needed to solve the above problems. Summary of the invention
[0007] The present invention aims to provide a method for transmitting upgrade files using a multicast protocol. The method provides a fully automatic batch upgrade method for production, which can reduce the use of human resources, improve production efficiency and reduce costs. It can also speed up the process of research and development and improve the quality of research and development. At the same time, it can solve the defect problem that the operation of WEB page upgrade is cumbersome and time-consuming. It can also solve the problem that the existing soldering and detaching FLASH burning upgrade method causes the circuit board to be scrapped due to repeated soldering and detaching of chips.
[0008] The present invention solves the above problems through the following technical solutions:
[0009] A method for automatically upgrading terminal devices in batches using a multicast protocol, the method comprising the following steps:
[0011] Step S1: Initialize the Ethernet card configuration parameters and configure the size of the receive data buffer.
[0012] Step S2: Entering the multicast receiving waiting loop processing; cyclically receiving multicast type data messages.
[0013] Step S3: After receiving the multicast upgrade data packet, extract the valid data segment from the multicast upgrade data packet, and perform a check to determine whether the data is legal or not. Otherwise, discard the data packet.
[0014] When there is a multicast upgrade packet in the received downlink data, the received multicast packet is verified. The multicast IP address identifies an IP multicast group. The class D address space is allocated to IP multicast, and its range is from 224.0.0.0 to 239.255.255.255. In binary representation, the first four bits of the IP multicast address are all 1110 octets (1) octet (2) octet (3) octet (4) 1110. Therefore, the mask can be used to calculate and match according to the position to determine whether the received data packet is a multicast protocol.
[0015] Step S4: Continue to receive data and temporarily store it in the specified memory. When the received packet type is an end packet, it means that all the upgrade data has been received.
[0016] Step S5: Enter the upgrade mode after receiving.
[0017] Step S6: After entering the upgrade mode, first compare the sequence number of the received data packet. If the sequence number of this packet does not exist in the received list, it means that it is a new data packet and can be received and saved; if it is the same sequence number, it means that it is a duplicate packet and can be directly discarded without processing.
[0018] Step S7: Then compare the type of the data packet. If it is an upgrade data type, save it in the cache, and then sort and save the data by packet number to prevent overwriting problems. If the received packet type is a keep-alive packet, it means that it is a heartbeat time update packet of the multicast upgrade process, and the timeout mechanism time of the upgrade process needs to be synchronized and updated.
[0019] Step S8: Write the received data to the specified partition in the flash chip, and upgrade both the primary and standby partitions at the same time.
[0020] Step S9: After the upgrade data is written into the primary and backup partitions, the LED light flashes at intervals of 1 second, indicating that the upgrade is successful.
[0021] Step S10: After the upgrade is completed, the network cable can be unplugged, and the terminal device will enter the normal working mode after restarting.
[0022] Compared with the existing traditional technology, the present invention has the following advantages and beneficial effects:
[0023] (1) Reduce human resources: Only one computer network card is needed to be connected to a 48-port switch, and the 48 ports of the switch are connected to 48 terminal devices for upgrading at the same time. After the device upgrade is completed, other devices can be replaced and connected to the network cable to continue the upgrade. The entire process can be operated by one person.
[0024] (2) Automatic, fast and efficient: The software receives upgrade data through the multicast protocol, automatically detects and re-collects data packets that fail verification, and automatically matches and discards duplicate data packets. The entire process does not require manual operation.
[0025] (3) Convenient and safe: It is convenient for R&D personnel to upgrade the new version for debugging. The upgrade process does not require soldering and removing FLASH, and will not cause the equipment circuit board to be scrapped. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a topological diagram of terminal devices for automatic batch upgrading of the present invention;
[0027] Figure 2 The flowchart of the BootLoader parsing buttons and saving configurations of the present invention;
[0028] Figure 3 The flowchart of receiving, verifying and storing multicast data packets of the present invention;
[0029] Figure 4 The present invention is a flowchart for upgrading the process of writing data into a FLASH chip. DETAILED DESCRIPTION
[0030] The present invention is further described below through specific implementation and detailed description in conjunction with the accompanying drawings, but the embodiments of the present invention are not limited thereto, including the following implementation and detailed description:
[0031] A. Automatically batch upgrade terminal device topology, such as Figure 1 Shown:
[0032] The difference between the multicast protocol upgrade and the widely used HTTP unicast protocol upgrade is that when a computer host sends the same data to n devices using the unicast protocol, the computer host needs to send it to n devices separately, for a total of n times. When a computer host sends the same data to n devices using the multicast protocol, it only needs to send it once, and the data is replicated by the routers and switches in the network and sent to each recipient, which saves both server resources and network backbone bandwidth resources.
[0033] Compared with the broadcast protocol, the multicast protocol only makes a copy of the data to the receiver after the multicast receiver sends a request to the router, thus saving the receiver's bandwidth. In the broadcast mode, the network device sends all broadcast information to all devices regardless of whether the receiver needs it or not, thus occupying a large amount of the receiver's access bandwidth.
[0034] The advantages of multicast protocol upgrade are as follows:
[0035] It can save system resources and bandwidth of the host computer sending data;
[0036] 2. Multicast is selectively copied to the devices that request it, and can be sent to multiple devices at the same time;
[0037] 3. Multicast can be widely transmitted across the public network, while broadcast can only be transmitted within a local area network or a dedicated broadcast network;
[0038] 4. Multicast can save network backbone bandwidth
[0039] B.BootLoader parses the buttons and saves the configuration, such as Figure 2 Shown:
[0040] (1) After booting, the software first enters the BootLoader program. In the BootLoader main loop, there is a key input waiting delay, and the waiting timeout is 1 second.
[0041] (2) If a serial port input key command is received, enter the command line mode, parse the received command, parse the configuration parameters carried in the command, and then save them in the BootLoader environment variables. (3) Configuration parameters related to the upgrade function:
[0042] Multicast upgrade protocol enable switch: mupgrade_en = 1
[0043] Device local IP address: ipaddr = 192.168.1.8
[0044] Device mask IP address: netmask = 255.255.255.0
[0045] Server IP address: serverip=192.168.1.188
[0046] If no serial port input key command is received after the waiting timeout, the kernel program is started in normal mode, otherwise it enters the multicast upgrade mode.
[0047] The above embodiments and detailed descriptions are only preferred embodiments of the present invention, and the embodiments of the present invention are not limited by the above embodiments. Those skilled in the art can make changes, substitutions, and deformations to the present invention without departing from the design concept of the present invention, which all belong to the scope of protection of the present invention.
Claims
1. A method and implementation for automatically upgrading terminal devices in batches, characterized in that: The following steps are involved: Step S1: Initialize the Ethernet card configuration parameters and configure the size of the receiving data buffer; Step S2: Entering the multicast receiving waiting loop processing; cyclically receiving multicast type data messages; Step S3: After receiving the multicast upgrade data packet, extract the valid data segment from the multicast upgrade data packet, check and judge whether it is legal data, receive it, otherwise discard the data packet; Step S4: Continue to receive data and temporarily store it in the specified memory. When the received packet type is an end packet, it means that all the upgrade data has been received; Step S5: Entering the upgrade mode after receiving is completed; Step S6: After entering the upgrade mode, firstly, the sequence number of the received data packet is compared. If the sequence number of the packet does not exist in the received list, it means that it is a new data packet and can be received and saved; if the sequence number is the same, it means that it is a duplicate packet and can be directly discarded without processing; Step S7: Then, the data packet type is compared and if it is an upgrade data type, it is saved in the cache, and then the data is sorted and saved according to the packet sequence number to prevent the problem of overwriting; If the received packet type is a keep-alive packet, it means that it is a heartbeat time update packet of the multicast upgrade process. The timeout mechanism time of the upgrade process needs to be updated synchronously; Step S6: writing the received data to the specified partition in the flash chip, and upgrading both the primary and standby partitions; Step S7: After the upgrade data is written into the primary and backup partitions, the LED light flashes at intervals of 1 second, indicating that the upgrade is successful; Step S8: After the upgrade is completed, the network cable can be unplugged, and the terminal device will enter the normal working mode after restarting.