System and method for multi-mode parallel upgrade of internet of things devices
By working collaboratively with cloud servers and gateways, and extending the multiplexed frame structure and cross-module version hash tree verification based on the YMODEM protocol, the time consumption and consistency issues in parallel firmware upgrades for multiple modules are resolved, achieving efficient and reliable multi-module upgrades.
Patent Information
- Application Number
- CN202510959997.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2045-07-11
AI Technical Summary
The existing YMODEM protocol suffers from problems such as long upgrade time, network bandwidth contention, memory access conflicts, and lack of cross-module version consistency verification mechanism in multi-module parallel firmware upgrades, leading to an increased upgrade failure rate.
By working collaboratively with cloud servers and gateways, the system extends the multiplexed frame structure based on the YMODEM protocol, dynamically allocates the transmission order of the upgrade program, generates compressed differential packets, accelerates data reading using a separate dual-port RAM structure, and introduces a cross-module version hash tree verification mechanism to achieve parallel upgrades of multiple modules.
It improves the efficiency of multi-module upgrades, reduces network bandwidth consumption and the risk of version incompatibility, and enhances the reliability and consistency of upgrades.
Smart Images

Figure CN120768918B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of Internet of Things (IoT), and in particular relates to a parallel upgrade system and method for multiple modules of IoT devices. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] The YMODEM protocol is a file transfer protocol used for serial communication, especially for transferring files between embedded systems and computers. While the existing YMODEM protocol supports 1024-byte packet transmission, multiple modules require serial upgrades, which is significantly time-consuming (e.g., total time for four modules = time for a single module × 4). Furthermore, when multiple modules initiate upgrade requests simultaneously, it can easily cause network bandwidth contention and memory access conflicts (such as Flash erase / write conflicts), leading to an increased upgrade failure rate. Additionally, YMODEM's CRC checksum only applies to single-packet data and lacks a cross-module version consistency verification mechanism, potentially causing firmware version incompatibility issues among multiple modules.
[0004] In conclusion, the current YMODEM protocol is not suitable for scenarios involving parallel firmware upgrades of multiple modules. Summary of the Invention
[0005] To address the technical problems mentioned above, this invention provides a parallel upgrade system and method for multiple modules of IoT devices. Based on the YMODEM protocol, the IoT cloud platform and communication gateway work together to achieve parallel firmware upgrades for multiple modules.
[0006] To achieve the above objectives, the present invention adopts the following technical solution: The first aspect of the present invention provides a parallel upgrade system for multiple modules of Internet of Things (IoT) devices.
[0007] A parallel upgrade system for multiple modules of IoT devices, comprising: Cloud servers, gateways, and IoT devices; The gateway is configured to: convert communication information between the cloud server and IoT devices based on the YMODEM protocol extended multiplexed frame structure conversion; The cloud server is configured to: receive the status of each heterogeneous module reported by the gateway, then dynamically allocate the transmission order of the upgrade program, generate compressed differential packets for each heterogeneous module by the upgrade program, and send the compressed differential packets of each heterogeneous module according to the transmission order. The IoT device is configured to: receive compressed differential packets from multiple heterogeneous modules and temporarily store them in a backup area; compare the verification value of the firmware upgrade information in the upgrade program, and after confirming that the data is correct, decompress the compressed differential packets and write the upgrade program into the firmware.
[0008] As one implementation method, the extended multiplexed frame structure based on the YMODEM protocol is as follows: |Channel Identifier|YMODEM Standard Frame Header|Package Sequence Number|Inverse Code of Packet Sequence Number|Data Section|Arithmetic Checksum|.
[0009] As one implementation, the IoT device is further configured to: synchronously decompress differential packets and accelerate data reading using a separate dual-port RAM structure; and the boot sector firmware to write the differential rows of each heterogeneous module to the application sector according to the address based on the differential table.
[0010] As one implementation method, the IoT device is also configured to: switch to the new firmware uniformly after the writing is completed, and retain the old version if the process fails midway.
[0011] As one implementation method, the LZO algorithm is used in the cloud server to generate differential packages for each module in the upgrade program.
[0012] In one implementation, the STX / SOH switching threshold is dynamically adjusted in the gateway by monitoring the data transmission failure frequency of each channel.
[0013] As one implementation method, in the gateway, channel identifiers are dynamically allocated according to each module ID to achieve time-division multiplexing transmission of data packets from each module.
[0014] A second aspect of the present invention provides a method for parallel upgrading of multiple modules of an Internet of Things (IoT) device.
[0015] A method for parallel upgrading of multiple modules of IoT devices includes: The cloud server receives the status of each heterogeneous module reported by the gateway, then dynamically allocates the transmission order of the upgrade program, generates compressed differential packets for each heterogeneous module, and sends the compressed differential packets of each heterogeneous module to the IoT device according to the transmission order. The gateway uses the YMODEM protocol to extend the multiplexed frame structure and convert communication information between the cloud server and IoT devices. The IoT device receives compressed differential packets from multiple heterogeneous modules and temporarily stores them in the backup area; it compares the verification value of the firmware upgrade information in the upgrade program, and after confirming that the data is correct, it decompresses the compressed differential packets and writes the upgrade program into the firmware.
[0016] As one implementation method, the IoT device also simultaneously decompresses the differential packet and uses a separate dual-port RAM structure to accelerate data reading; the boot sector firmware writes the differential row of each heterogeneous module into the application area according to the address based on the differential table.
[0017] As one implementation method, the firmware is switched to the new firmware once the writing is complete; if the process fails midway, the old version is retained.
[0018] The beneficial effects of this invention are: The gateway of this invention utilizes the YMODEM protocol-based extended multiplexed frame structure to convert the communication information between the cloud server and IoT devices. The cloud server generates compressed differential packets for each heterogeneous module from the upgrade program and distributes the compressed differential packets for each heterogeneous module according to the transmission order, thereby realizing the parallel upgrade of multiple modules of IoT devices and improving the upgrade efficiency of IoT devices.
[0019] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0021] Figure 1 This is a schematic diagram of a multi-module parallel upgrade system structure for IoT devices according to an embodiment of the present invention; Figure 2 This is a flowchart of a method for parallel upgrading of multiple modules of an Internet of Things (IoT) device according to an embodiment of the present invention; Figure 3 This is a comparison chart of the effects of embodiments of the present invention. Detailed Implementation
[0022] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0023] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0024] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0025] This invention belongs to the field of firmware upgrade technology for Internet of Things (IoT) devices. Specifically, it relates to a method and system for parallel firmware upgrade of multiple modules in collaboration between an IoT cloud platform and a communication gateway based on the YMODEM protocol. It is applicable to synchronous differential upgrade scenarios of multiple heterogeneous modules (such as communication modules, sensor modules, main control MCU modules, and security chip modules) in smart terminal devices.
[0026] Combination Figure 1 and Figure 2 This invention provides a parallel upgrade system for multiple modules of an Internet of Things (IoT) device, comprising: Cloud servers, gateways, and IoT devices; The gateway is configured to: convert communication information between the cloud server and IoT devices based on the YMODEM protocol extended multiplexed frame structure conversion; The cloud server is configured to: receive the status of each heterogeneous module reported by the gateway, then dynamically allocate the transmission order of the upgrade program, generate compressed differential packets for each heterogeneous module by the upgrade program, and send the compressed differential packets of each heterogeneous module according to the transmission order. The IoT device is configured to: receive compressed differential packets from multiple heterogeneous modules and temporarily store them in a backup area; compare the verification value of the firmware upgrade information in the upgrade program, and after confirming that the data is correct, decompress the compressed differential packets and write the upgrade program into the firmware.
[0027] In the gateway, the time-division multiplexing frame structure is extended based on the YMODEM protocol, creating multiple virtual transmission channels within a single physical channel (e.g., creating four virtual transmission channels corresponding to four modules), |channel identifier|YMODEM standard frame header|packet sequence number|inverse code of packet sequence number|data segment|arithmic checksum|.
[0028] The channel identifiers for all data communication processes will not be repeated below. Each message header will be preceded by a two-bit channel identifier, which enables parallel transmission of multiple data interactions without being affected by single-channel serial results.
[0029] In this embodiment, the data frame structure adopts the following structure:
[0030] The protocol header includes: SOH=0x01 indicates that this data frame contains 128 bytes of data; STX represents 1024 bytes of data; Frame sequence number and frame sequence number complement: These indicate the number of frames transmitted. If the number is greater than 0xFF, it restarts from 0x00. The complement is used to ensure the correctness of the transmission. Filename: The filename to be transmitted, ending with '\0'; File size: The size of the file to be transferred, represented by a string, immediately following the filename. For example, to transfer a file of 1234 bytes, it would be: 0x31 0x32 0x33 0x34 0x00; Empty: After removing the filename and file size, the remaining data is filled with 0; CRC high 8 bits: The high 8 bits of the CRC-16 check data; CRC lower 8 bits: The lower 8 bits of the CRC-16 check data.
[0031] In this embodiment, the data transmission process is as follows:
[0032] The last frame has more than 128 bytes of data remaining: use STX's 1024-byte transmission, but fill the remaining space with 0x1A (Ctrl-Z); The last frame contains 128 bytes of data: using SOH for 128-byte transmission; The last frame has less than 128 bytes of data remaining: use SOH for 128-byte transmission, but fill the remaining space with 0x1A (Ctrl-Z).
[0033] In this embodiment, the structure of the tail frame is as follows:
[0034] In this embodiment, during the process of distributing the compressed differential packets of each heterogeneous module to each heterogeneous module according to the transmission order, a multi-file continuous transmission method is adopted. The specific process is as follows: Step 1. The receiver sends C to the sender, informing the sender that data transmission can begin. Upon receiving C for the first time, the receiver will transmit the filename and file size information. Step 2. After the receiver sends C to the sender, the file content transfer officially begins; Step 3. When the receiver receives the correct data, it returns ACK (Acknowledge character). If the data is incorrect, it returns NAK (Negative Acknowledgment). At this time, the sender will retransmit the previous data. Step 4. When the file transfer is complete, the sender will send an EOT (end-of-transmission). When the receiver receives the EOT for the first time, it should return a NAK. If it receives another EOT, it should return an ACK. The purpose of this is to ensure that the file transfer has ended and that there is no other interference data. Step 5. After receiving a file, the receiver sends C to the sender again. If the sender has more files to send, it will send an SOH frame with the filename and size. If the sender has no files to send, it will send an SOH data frame, in which all 128 bytes of data are 0x00.
[0035] In the gateway, channel identifiers (00 / 01 / 10 / 11) are dynamically assigned based on the module ID, enabling time-division multiplexing transmission of data packets from four modules, which improves bandwidth utilization by 40%.
[0036] In some optional embodiments, a heterogeneous module collaborative verification mechanism is used to realize consistency verification between the cloud and the device firmware. Specifically, in addition to the standard YMODEM CRC verification, a cross-module version hash tree verification is added: a Merkle root hash containing the firmware version numbers of the four modules is generated and embedded in the padding area of the start frame (the original padding 0x00 area is replaced with the storage hash value). After receiving all module data, the IoT device compares the locally calculated hash tree with the cloud value to ensure global consistency of firmware versions across multiple modules.
[0037] Suppose a terminal device contains four heterogeneous modules, each of which can be upgraded independently and has an independent firmware version number. According to the traditional serial upgrade mode, it is impossible to guarantee the consistency of the version numbers of the four modules. Therefore, a hash value of the four module version numbers can be added in the initial communication with the device. When the device receives the hash value, it can verify the version numbers of the four modules at the same time, thereby realizing the consistency verification between the cloud and the device firmware. If the hashes match, the upgrade can be rejected.
[0038] The data frame structure used in the heterogeneous module collaborative verification mechanism to achieve consistency verification between the cloud and the device firmware is explained as follows:
[0039] The data structure construction principle of the root hash in the embodiment is as follows: Leaf node initialization: The four device version numbers (denoted as V1, V2, V3, and V4) are used as leaf nodes. Each version number generates a corresponding hash value using a hash algorithm (such as SHA-256). H1 = Hash(V1) H2 = Hash(V2) H3 = Hash(V3) H4 = Hash(V4) Function: Ensures the uniqueness and tamper-proof nature of each version number.
[0040] Parent node generation: The hash values of adjacent leaf nodes are combined pairwise and then subjected to a second hash calculation to form the parent node of the next level: First-level parent node: H12 = Hash(H1 + H2) H34 = Hash(H3 + H4) Second-level parent node (root node): Root = Hash(H12 + H34) Logic: By recursively merging hash values, a tree structure is generated layer by layer upwards, eventually obtaining a unique Merkle root hash.
[0041] Balance processing: If the number of leaf nodes is odd (e.g., 5 version numbers), the last hash value needs to be copied to form an even number of nodes, such as H5 = H4, before merging and calculating.
[0042] This embodiment uses root-based hashing, which has the following advantages: (1) Tamper-proof: Any modification to the version number (e.g., V1→V1') will cause its hash value H1 to change, which in turn affects H12 and Root layer by layer. Data integrity can be quickly detected by comparing the root hash; (2) Efficient verification path: If it is necessary to verify whether a device version number (such as V3) belongs to the current Merkle tree, only the adjacent hash path (H4, H12) and the root hash are needed to reconstruct the verification chain without traversing all the data.
[0043] The root hash, as a unique digest of all version numbers, has the following characteristics: Fixed length: The root hash length is constant regardless of the size of the input data (e.g., SHA-256 is 256 bits).
[0044] Uniqueness: Different combinations of version numbers will inevitably generate different root hashes (collision resistance).
[0045] In one or more embodiments, the LZO algorithm is used in the cloud server to generate differential packages for each module in the upgrade process.
[0046] LZO employs a dictionary-based sliding window algorithm, which detects duplicate strings and replaces the original data with tuples (duration L, distance D). For example, the string "ABCDEFGHABCDEF" is compressed into the format "(08)hABCDEFGH(6,8)", achieving high compression speed (approximately 5 times that of traditional algorithms) and lossless real-time compression. The compressed data is encoded in a specific format, supporting fast decompression without additional memory usage. The data is divided into independent compression blocks, supporting parallel compression / decompression, making it suitable for distributed scenarios (such as parallel processing by four modules).
[0047] In the actual implementation process, during the dynamic allocation of the upgrade program transmission order based on the status of each heterogeneous module reported by the gateway on the cloud server: Suppose that four modules of the same device are upgraded in parallel, and data interaction is distinguished to which module based on the channel identifier. Suppose that the identifier of module 1 is 01, the identifier of module 2 is 02, the identifier of module 3 is 11, and the identifier of module 4 is 12. During the upgrade, assuming the cloud platform collects device information once per minute, each collection includes the RAM and Flash resource allocation for the four modules. When upgrading the device, the cloud server can prioritize resource allocation based on the current distribution of the modules. For example, during the initial upgrade, if modules 2 and 4 have better resources and signal strength, the firmware of modules 2 and 4 will be upgraded first, meaning channel identifiers 02 and 12 will be sent first. One minute later, the cloud-collected module information is updated, and the transmission order is dynamically adjusted again based on the latest information.
[0048] The gateway also dynamically adjusts the STX / SOH switching threshold by monitoring the NAK frequency of each channel (automatically downgrading to 128B packets when the network is poor): NAK 0x15 / / Disapproved response (receiver only).
[0049] The process of dynamically adjusting the STX / SOH switching threshold by monitoring the NAK frequency of each channel is achieved by the device response NAK encoding during the data interaction process. This encoding response is applied to blocking factors such as device data reception failure, incomplete data reception, packet fragmentation and reassembly caused by network fluctuations, reception timeout, and triggering the breakpoint resume mechanism.
[0050]
[0051] Protocol header: SOH=0x01, indicating that this data frame contains 128 bytes of data, STX represents 1024 bytes of data; Frame sequence number and frame sequence number complement: These indicate the number of frames transmitted. If the number is greater than 0xFF, it restarts from 0x00. The complement is used to ensure the correctness of the transmission. Filename: The filename to be transmitted, ending with '\0'; File size: The size of the file to be transferred, represented by a string, immediately following the filename. For example, to transfer a file of 1234 bytes, it would be: 0x31 0x32 0x33 0x34 0x00; Empty: Remove the filename and file size, and fill the remaining data with 0; CRC high 8 bits: The high 8 bits of the CRC-16 check data; CRC lower 8 bits: The lower 8 bits of the CRC-16 check data.
[0052] When the frequency of device data reception failures increases, i.e., the frequency of device uploading NAK is high, the packet size of the sent file can be dynamically changed from 1024 bytes to 128 bytes: that is, the protocol header changes from STX to SOH, reducing the size of each packet and increasing the number of packets, thereby improving the transmission success rate and resisting external influences such as network fluctuations, thus realizing adaptive flow control.
[0053] Compared with traditional single-channel YMODEM, this invention outperforms it in all metrics, including total upgrade time for four modules, peak network bandwidth usage, version consistency failure rate, and breakpoint recovery time. Figure 3 As shown.
[0054] Example 1 (Differential Packet Generation Scenario): When the main control MCU module needs to be upgraded from V2.1 to V2.3: The cloud platform calls the BSDiff algorithm to generate an differential packet (containing only the modified 367 bytes), and adds the module ID identifier 0x01 to the header of the differential packet; The differential packet embeds the extended YMODEM start frame, with the filename field formatted as "MCU_V2.1→V2.3.bin".
[0055] Example 2 (Network Jitter Response): If the sensor module (channel 3) receives 3 consecutive NAKs; The gateway automatically switches to SOH mode (128B / packet) and adds RS error correction codes to the end of the data area; After transmission is complete, any potential bit errors are corrected by comparing the RS code.
[0056] In other embodiments, a dynamic priority retransmission queue is also designed in the gateway to handle transmission failures of certain modules: The location of a lost packet can be quickly determined by the inverse code of the packet sequence number (e.g., if the inverse code of the received packet is not equal to 255 - the packet sequence number, a retransmission will be triggered). Set retransmission priority based on the criticality of module functions (e.g., communication module > main control module > sensor module) to ensure that core functions are restored first.
[0057] In this embodiment, differential comparison has the following advantages: Row-level difference extraction: The current firmware and the new firmware are compared in 16-byte rows to generate a set of difference rows. The difference rows are sorted by address to form the original difference packet; This embodiment adopts parallel module allocation: four modules process different areas of the firmware (such as boot sector, application sector, backup sector, etc.), and each module independently generates corresponding differential blocks; moreover, a block tag dictionary structure is adopted to avoid the time-consuming problem of traditional initialization, and the current and historical data blocks are distinguished by identifiers (such as 0 / 1), reducing RAM write zero operations.
[0058] In this embodiment, differential packet encoding and compression have the following advantages: structured encapsulation; firmware differential table: using BIT bits to mark the position of the differential row (e.g., BIT bit 0 represents the first row of differentials), ensuring the accuracy of the write address; compression format: the differential packets of each module are compressed by LZO and encapsulated into fixed-length data packets, which facilitates bus transmission; enhanced security: adding a total check value (e.g., CRC32) to the differential data to prevent transmission errors.
[0059] The IoT scenario adaptation of this invention has the following advantages: (1) Low resource consumption: Compression requires only 64KB of memory, and decompression has almost zero CPU overhead, making it suitable for embedded devices; (2) High compression ratio: The average compression ratio is about 50%, which significantly reduces the amount of data transmitted; (3) Adjustable parameters: Supports the balance between compression ratio and speed, such as high-level compression to optimize bandwidth and low-level compression to save memory.
[0060] In one or more embodiments, a method for parallel upgrading of multiple modules of an Internet of Things (IoT) device includes: The cloud server receives the status of each heterogeneous module reported by the gateway, then dynamically allocates the transmission order of the upgrade program, generates compressed differential packets for each heterogeneous module, and sends the compressed differential packets of each heterogeneous module to the IoT device according to the transmission order. The gateway uses the YMODEM protocol to extend the multiplexed frame structure to convert communication information between the cloud server and IoT devices. The IoT device receives compressed differential packets from multiple heterogeneous modules and temporarily stores them in the backup area; it compares the verification value of the firmware upgrade information in the upgrade program, and after confirming that the data is correct, it decompresses the compressed differential packets and writes the upgrade program into the firmware.
[0061] The IoT device also simultaneously decompresses the differential packet and uses a separate dual-port RAM structure to accelerate data reading; the boot sector firmware writes the differential row of each heterogeneous module into the application area according to the address based on the differential table.
[0062] Once the write process is complete, the system will switch to the new firmware. If the process fails midway, the old version will be retained.
[0063] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A parallel upgrade system for multiple modules of IoT devices, characterized in that, include: Cloud servers, gateways, and IoT devices; The gateway is configured to: convert communication information between the cloud server and IoT devices based on the YMODEM protocol extended multiplexed frame structure conversion; create multiple virtual transmission channels within a single physical channel, with different virtual transmission channels corresponding to different modules; and dynamically adjust the STX / SOH switching threshold by monitoring the data transmission failure frequency of each channel in the gateway. The extended multiplexing frame structure based on the YMODEM protocol is as follows: |Channel Identifier|YMODEM Standard Frame Header|Package Sequence Number|Inverse Code of Packet Sequence Number|Data Segment|Arithmetic Checksum|; The cloud server is configured to: receive the status of each heterogeneous module reported by the gateway, then dynamically allocate the transmission order of the upgrade program, generate compressed differential packets for each heterogeneous module by the upgrade program, and send the compressed differential packets of each heterogeneous module according to the transmission order. A heterogeneous module collaborative verification mechanism is adopted to realize consistency verification between the cloud and the device firmware. In addition to the standard YMODEM CRC verification, cross-module version hash tree verification is added: a Merkle tree root hash containing multiple module firmware version numbers is generated and embedded in the padding area of the start frame. The IoT device is configured to receive compressed differential packets from multiple heterogeneous modules and temporarily store them in a backup area. After receiving the compressed differential packets from all heterogeneous modules, the hash tree of the version number of each module is calculated locally and compared with the Merkle root hash sent from the cloud to ensure global consistency of firmware versions of multiple modules. If the comparison is inconsistent, the upgrade will be rejected. If the hash match is found, the verification value of the firmware upgrade information in the upgrade program is compared. After confirming that the data is correct, the differential package is decompressed and the upgrade program is written to the firmware.
2. The IoT device multi-module parallel upgrade system as described in claim 1, characterized in that, The IoT device is also configured to: synchronously decompress differential packets and accelerate data reading using a separate dual-port RAM structure; the boot sector firmware writes the differential rows of each heterogeneous module to the application sector according to the address based on the differential table.
3. The IoT device multi-module parallel upgrade system as described in claim 1, characterized in that, The IoT device is also configured to switch to the new firmware once the writing is complete, and retain the old version if the process fails midway.
4. The IoT device multi-module parallel upgrade system as described in claim 1, characterized in that, In the cloud server, the LZO algorithm is used to generate differential packages for each module in the upgrade program.
5. The IoT device multi-module parallel upgrade system as described in claim 1, characterized in that, In the gateway, channel identifiers are dynamically allocated according to each module ID to achieve time-division multiplexing transmission of data packets from each module.
6. A method for parallel upgrading of multiple modules of IoT devices, applied to the parallel upgrading system for multiple modules of IoT devices as described in any one of claims 1-5, characterized in that, include: The cloud server receives the status of each heterogeneous module reported by the gateway, then dynamically allocates the transmission order of the upgrade program, generates compressed differential packets for each heterogeneous module, and sends the compressed differential packets of each heterogeneous module to the IoT device according to the transmission order. The gateway uses the YMODEM protocol to extend the multiplexed frame structure and convert communication information between the cloud server and IoT devices. The extended multiplexing frame structure based on the YMODEM protocol is as follows: |Channel Identifier|YMODEM Standard Frame Header|Package Sequence Number|Inverse Code of Packet Sequence Number|Data Segment|Arithmetic Checksum|; IoT devices receive compressed differential packets from multiple heterogeneous modules and temporarily store them in the backup area; After comparing the verification value of the firmware upgrade information in the upgrade program and confirming that the data is correct, the differential package is decompressed and the upgrade program is written to the firmware.
7. The method for parallel upgrading of multiple modules of IoT devices as described in claim 6, characterized in that, The IoT device also simultaneously decompresses the differential packet and uses a separate dual-port RAM structure to accelerate data reading; the boot sector firmware writes the differential row of each heterogeneous module into the application area according to the address based on the differential table.
8. The method for parallel upgrading of multiple modules of IoT devices as described in claim 6, characterized in that, Once the write process is complete, switch to the new firmware. If the process fails midway, retain the old version.
Citation Information
Patent Citations
Component module upgrading method, component module and financial robot
CN114579166A
