A distributed IO firmware batch upgrade system, method and terminal device
By designing a distributed I/O firmware batch upgrade system, and utilizing a host computer communication module and a boot loading module, batch upgrades of all devices can be achieved without disassembling the PCB. This solves the problems of low upgrade efficiency and complex operation in existing technologies, improves upgrade efficiency, and simplifies the operation process.
Patent Information
- Application Number
- CN202310261868.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-03-17
AI Technical Summary
Existing distributed I/O firmware upgrade methods suffer from low efficiency, complex operation, and high difficulty. In particular, they are inefficient when upgrading each module independently while the device is running normally, and upgrading modules in special locations is difficult.
Design a distributed I/O firmware batch upgrade system, including a host computer communication module, a boot loading module, and a batch upgrade communication module. It realizes inter-device networking communication through a data bus, automatically assigns addresses, and performs batch upgrades on all devices without disassembling the PCB.
This technology enables batch upgrades to be completed via the data bus of the I/O device itself without disassembling the PCB of the I/O device, improving upgrade efficiency, simplifying the operation process, and reducing manual intervention.
Smart Images

Figure CN116088911B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a system, method, and apparatus, and more particularly to a distributed I / O firmware batch upgrade system, method, and terminal device, belonging to the field of industrial automation technology. Background Technology
[0002] Distributed I / O is a concept that has emerged in recent years. Its main purpose is to solve the problems of traditional integrated I / O, which is not conducive to expansion and maintenance. Once some I / O is damaged, the entire control device needs to be replaced, resulting in extremely high maintenance costs. Distributed I / O is a device in which the I / O device and the control device are separated. It can be installed in a distributed manner at various nodes of the device. That is, the distributed I / O module is the I / O module and the control system are separated. It can be easily assembled into various parts of the device, which is convenient for wiring. Moreover, when one module is damaged, only the cover module needs to be replaced, without affecting the use of others.
[0003] With the continuous development of technology, product functions are constantly being upgraded and optimized. Correspondingly, for distributed I / O, implementing firmware upgrades and upgrades is particularly important. Currently, there are two methods for distributed I / O firmware upgrades: offline upgrades and online upgrades.
[0004] Offline upgrades involve using a debugger or emulator to flash firmware onto the product's MCU. This method requires specialized equipment and involves upgrading the product's PCB. Therefore, when the product has been assembled into a complete unit, the outer casing needs to be removed to flash firmware onto the internal PCB. This method is difficult to implement and complex in end-user applications, so it is generally used in factory single-board firmware flashing.
[0005] Online upgrade is a technology that allows firmware upgrades to be performed while the device is running normally. No debugger is required. The firmware is flashed into the device through the device's built-in communication interface to complete the update. For distributed I / O devices, although this upgrade method does not require the PCB to be removed, each device module needs to be upgraded independently. However, the number of distributed I / O device modules is large, so this upgrade method is inefficient and slow. For I / O devices with special installation locations, the upgrade is difficult. Summary of the Invention
[0006] To address the shortcomings of the aforementioned technologies, this invention provides a distributed I / O firmware batch upgrade system, method, and apparatus.
[0007] To address the above technical issues, the present invention employs the following technical solution: a distributed I / O-based firmware batch upgrade method. The host computer reads and parses the upgrade package. Upon successful parsing, it sends an upgrade command. Upon receiving the upgrade command, the slave computer's application jumps to the startup loading program and erases the application. After successful erasure, it begins receiving and verifying the upgrade packages sent by the host computer. This process continues until all upgrade packages have been received. Then, the entire application is re-verified. If verification is successful, the upgrade is returned as successful; otherwise, it is returned as failed. After a successful upgrade, communication is re-networked, devices are reassigned addresses, and the upgrade process begins for the next device.
[0008] Furthermore, the upgrade method specifically includes the following steps:
[0009] Step S1: The host computer reads and parses all the firmware for upgrade. If the firmware matches, the upgrade begins.
[0010] Step S2: After the loader receives the upgrade command from the host computer, it erases the device application and returns to the upgrade-allowed state;
[0011] Step S3: The host computer decomposes the upgrade data package and sends it to the startup loading module program in sequence. After receiving the data sent by the host computer, the startup loading module program verifies whether the data is correct. If the data is correct, it is written to the application memory.
[0012] Step S4: The host computer checks whether the data packet has been completely sent. After the data packet has been sent, the loading program is started to verify the data of the entire application. If the verification is successful, the upgrade is returned as successful.
[0013] Step S5: After receiving the device upgrade success information, the host computer checks whether all devices have been upgraded successfully. If there are still devices that have not been upgraded, the host computer re-networks all devices, assigns addresses, and prepares to upgrade the next device.
[0014] Step S6: Repeat steps S2 to S5 until all devices are successfully upgraded;
[0015] Step S7: After all devices have been successfully upgraded, set the devices to normal operating status and end the upgrade process.
[0016] Furthermore, the system includes:
[0017] A startup loading module, which includes, but is not limited to, startup guidance, application verification, and firmware upgrade functions;
[0018] The host computer communication module is used for program firmware parsing and data exchange with the slave computer.
[0019] A batch upgrade communication module is used to establish network communication between various distributed I / O devices.
[0020] Furthermore, when the startup loading module detects that the current flag is the firmware upgrade flag, the program enters the firmware upgrade state and waits for the host computer to issue a firmware upgrade command;
[0021] If the current flag indicates a normal startup state, the program enters the normal boot state and first verifies the integrity of the application. If the verification is successful, the program jumps to the application; if the verification fails, the program is set to firmware upgrade state.
[0022] Furthermore, the firmware upgrade function includes device flash memory erasure, data verification, and firmware burning to the device flash memory.
[0023] Furthermore, after entering the firmware upgrade state, the host computer issues a firmware upgrade command, first erasing the application stored in the device's flash memory, and then issuing a program upgrade data packet. If the data is correct, the data packet is written to the device's flash memory; otherwise, the data is discarded. This process is repeated until the host computer completes the transmission of all data packets.
[0024] Furthermore, the workflow of the host computer communication module is as follows: read and parse the program file, check whether the file matches the slave device, and only if they match completely can the upgrade be performed. After successful matching, the host computer and the slave device start handshaking to upgrade.
[0025] A terminal device that utilizes a distributed I / O-based firmware batch upgrade system.
[0026] This invention enables batch upgrades of all devices without disassembling the IO device PCB or using dedicated equipment. Batch upgrades can be completed simply through the IO device's data bus, eliminating the need for individual upgrades for each device and greatly improving firmware upgrade efficiency. Attached Figure Description
[0027] Figure 1 This is a flowchart illustrating the distributed I / O firmware batch upgrade method of the present invention. Detailed Implementation
[0028] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0029] To address the shortcomings of existing distributed I / O firmware upgrade methods, this invention aims to design a distributed I / O firmware batch upgrade system and method that can achieve batch upgrades of all devices without the need for dedicated equipment or PCB disassembly. The basic idea is to first design a distributed I / O firmware batch upgrade system comprising a host computer communication module, a boot loading module, and a batch upgrade communication module.
[0030] The specific implementation plan is as follows: The designed boot loading module includes, but is not limited to, boot guidance, application verification, and firmware upgrade functions. When the device is powered on, the program enters the boot loading module. The program first checks the firmware upgrade flag stored in a specific address in the device's flash memory. If the current flag is the firmware upgrade flag, the program enters the firmware upgrade state and waits for the host computer to issue a firmware upgrade command. If the current flag is in the normal boot state, the program enters the normal boot state. In the normal boot state, the program first verifies the integrity of the application, that is, performs a CRC check on the entire application space. If the check is successful, it means that the application is correct, and the program jumps to the application. If the check fails, the program is set to the firmware upgrade state and waits for the host computer to issue a firmware upgrade command.
[0031] The firmware upgrade function includes erasing the device's flash memory, data verification, and writing the firmware to the device's flash memory. When the host computer issues a firmware upgrade command, the program first erases the application stored in the device's flash memory. After erasing is complete, it notifies the host computer. Upon receiving the completion signal, the host computer begins sending the program upgrade data packet. Upon receiving the data packet, the device first verifies its correctness. If the data is correct, it writes the data packet to the device's flash memory; otherwise, it discards the data. This process repeats until the host computer has completed the transmission of all data packets. After all data packets have been transmitted, the startup program will again verify the integrity of the entire application. If the verification is successful, it will return an upgrade success message.
[0032] Batch upgrade communication modules are mainly used to establish network communication between various distributed I / O devices, realize automatic address allocation for each device, and then complete the sequential upgrade of each module through communication scheduling.
[0033] The host computer communication module is used for program firmware parsing and data exchange with the slave computer. Its main workflow is as follows: reading program files. In order to ensure the confidentiality of program files, all program firmware is encrypted. Therefore, when the host computer reads the program file, it first needs to decrypt the program file. After decryption, the host computer parses the program file and checks whether the file matches the slave computer. Only if they match completely can the upgrade be performed. After successful matching, the host computer and the slave computer start handshaking to upgrade.
[0034] Based on the above-mentioned distributed I / O firmware batch upgrade system setup, the flow of the distributed I / O firmware batch upgrade method disclosed in this invention is as follows: Figure 1 As shown:
[0035] The host computer reads and parses the upgrade package. Upon successful parsing, it sends an upgrade command. The slave device receives the upgrade command and, via its application, jumps to the startup loader. The startup loader begins erasing the application. After successful erasure, it begins receiving and verifying upgrade packages from the host computer. This process continues until all upgrade packages have been received. Then, the entire application is verified again. If verification is successful, an upgrade success message is returned; otherwise, an upgrade failure message is returned. After a successful upgrade, communication is re-established, device addresses are reassigned, and the upgrade process begins for the next device.
[0036] The distributed I / O firmware batch upgrade method provided by this invention specifically includes the following steps:
[0037] Step S1: The host computer reads and parses all the firmware for upgrade. If the firmware matches, the upgrade begins.
[0038] Step S2: After the loader receives the upgrade command from the host computer, it erases the device application and returns to the upgrade-allowed state;
[0039] Step S3: The host computer decomposes the upgrade data package and sends it to the startup loading module program in sequence. After receiving the data sent by the host computer, the startup loading module program verifies whether the data is correct. If the data is correct, it is written to the application memory.
[0040] Step S4: The host computer checks whether the data packet has been completely sent. After the data packet has been sent, the loading program is started to verify the data of the entire application. If the verification is successful, the upgrade is returned as successful.
[0041] Step S5: After receiving the device upgrade success information, the host computer checks whether all devices have been upgraded successfully. If there are still devices that have not been upgraded, the host computer re-networks all devices, assigns addresses, and prepares to upgrade the next device.
[0042] Step S6: Repeat steps S2 to S5 until all devices are successfully upgraded;
[0043] Step S7: After all devices have been successfully upgraded, set the devices to normal operating status and end the upgrade process.
[0044] The present invention also discloses a terminal device for running a distributed I / O firmware batch upgrade system.
[0045] Compared with existing technologies, this invention allows for batch upgrades of distributed I / O devices in the application field without the need for manual disassembly. All devices can be upgraded in batches simply through the I / O data bus, eliminating the need for individual upgrades of each device and greatly improving the upgrade efficiency of distributed I / O devices.
[0046] The above embodiments are not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the technical solution of the present invention are also within the protection scope of the present invention.
Claims
1. A method for batch firmware upgrades using distributed I / O, characterized in that: The upgrade method is as follows: The host computer reads and parses the upgrade package. After successful parsing, it sends an upgrade command. Upon receiving the upgrade command, the slave computer jumps from the application to the startup loading program and erases the application. After successful erasure, it begins to receive upgrade packages sent by the host computer and verifies them. This process continues until all upgrade packages have been received. Then, the entire application is verified again. If the verification is successful, the upgrade is returned as successful; otherwise, the upgrade fails. After a successful upgrade, communication will be re-established, the device will be re-addressed, and then the upgrade process will begin for the next device. The upgrade method specifically includes the following steps: Step S1: The host computer reads and parses all the firmware for upgrade. If the firmware matches, the upgrade begins. Step S2: After the loader receives the upgrade command from the host computer, it erases the device application and returns to the upgrade-allowed state; Step S3: The host computer decomposes the upgrade data package and sends it to the startup loading module program in sequence. After receiving the data sent by the host computer, the startup loading module program verifies whether the data is correct. If the data is correct, it is written to the application memory. Step S4: The host computer checks whether the data packet has been completely sent. After the data packet has been sent, the loading program is started to verify the data of the entire application. If the verification is successful, the upgrade is returned as successful. Step S5: After receiving the device upgrade success information, the host computer checks whether all devices have been upgraded successfully. If there are still devices that have not been upgraded, the host computer re-networks all devices, assigns addresses, and prepares to upgrade the next device. Step S6: Repeat steps S2 to S5 until all devices are successfully upgraded; Step S7: After all devices have been successfully upgraded, set the devices to normal operating status and end the upgrade process.
2. A firmware batch upgrade system based on the distributed I / O firmware batch upgrade method of claim 1, characterized in that: The system includes: A startup loading module, which includes, but is not limited to, startup guidance, application verification, and firmware upgrade functions; The host computer communication module is used for program firmware parsing and data exchange with the slave computer. A batch upgrade communication module is used to establish network communication between various distributed I / O devices.
3. The distributed I / O firmware batch upgrade system according to claim 2, characterized in that: When the startup loading module detects that the current flag is the firmware upgrade flag, the program enters the firmware upgrade state and waits for the host computer to send a firmware upgrade command. If the current flag indicates a normal startup state, the program enters the normal boot state and first verifies the integrity of the application. If the verification is successful, the program will jump to the application; if the verification fails, the program will be set to firmware upgrade mode.
4. The distributed I / O firmware batch upgrade system according to claim 3, characterized in that: The firmware upgrade function includes erasing the device flash memory, verifying data, and burning firmware into the device flash memory.
5. The distributed I / O firmware batch upgrade system according to claim 4, characterized in that: After entering the firmware upgrade state, the host computer issues a firmware upgrade command, first erasing the application stored in the device's flash memory, and then sending the program upgrade data packet. If the data is correct, the data packet is written to the device's flash memory; otherwise, the data is discarded. This process is repeated until the host computer completes the transmission of all data packets.
6. The distributed I / O firmware batch upgrade system according to claim 2, characterized in that: The workflow of the host computer communication module is as follows: read and parse the program file, check whether the file matches the slave computer, and upgrade can only be performed if the file matches completely. After successful matching, the host computer and the slave computer start handshaking to upgrade.
7. A terminal device, characterized in that: The application has a distributed I / O firmware batch upgrade system as described in any one of claims 3-6.
Citation Information
Patent Citations
Online upgrading method for multiple BMU application programs based on CAN bus
CN110908690A
PLC broadcast batch upgrading method and system
CN113596623A
Method for upgrading programs in batches in RS485 networking mode
CN115408030A