Differential increment ota upgrading method based on mosbus wireless data transmission

CN118869671APending Publication Date: 2024-10-29ZHEJIANG WELLSUN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410873024.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

然而,尽管OTA技术在一定程度上改善了设备更新的便捷性和效率,但传统的OTA技术在差分增量更新方面存在一些局限性,无法充分利用网络带宽和存储空间,导致更新过程耗时且消耗大量资源

Benefits of technology

[0016] The beneficial effects of the present invention are as follows: This technology uses differential data transmission to achieve a more efficient firmware and software update method, and brings many advantages to equipment management and maintenance. First of all, the differential incremental OTA technology based on the modbus protocol adopts a differential data transmission method. Only part of the updated data needs to be transmitted, which greatly reduces the amount of data and transmission time during the update process, and saves network bandwidth and storage space. Secondly, this technology supports intelligent version management, which can accurately identify the changed parts of firmware and software, and accurately update according to update requirements, reducing the complexity and risk of updates, and improving the stability and security of the system. In addition, the differential incremental OTA technology based on the Modbus protocol also supports wireless transmission, making equipment maintenance more convenient. Updates can be completed without a physical connection, which greatly facilitates equipment management and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869671A_ABST
    Figure CN118869671A_ABST
Patent Text Reader

Abstract

The invention discloses a difference increment ota upgrading method based on mosbus wireless data transmission. The difference increment ota upgrading method comprises the following steps: step 1, obtaining a new firmware program and a firmware program running in current equipment; 2, importing the new firmware program and the old firmware program into differential package generation software to generate a differential package; step 3, importing the generated differential packet into a modbus host; 4, sending an upgrading instruction through the modbus host, and informing the slave computer that firmware upgrading is about to be carried out; and 5, the slave receives the upgrade command, erases the differential packet write-in area, sends an ACK response to the host, and notifies the host to prepare to receive differential packet data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a differential incremental OTA upgrade method based on MOSbus wireless data transmission, belonging to the field of embedded RT-Thread operating system equipment. Background Art

[0002] The current OTA (Over-The-Air) technology is developing rapidly in the field of embedded rt-thread operating system devices. The main purpose of this technology is to update the firmware and software of the device through wireless transmission, thereby improving the performance, function and security of the device. In general, differential upgrade can greatly reduce the download volume, especially for embedded single-chip microcomputers with small resources, it can greatly reduce the maintenance cost, because the upgrade and maintenance of embedded devices are generally OTA upgrades over the air, such as NB-I0T, LoraWan, Bluetooth, infrared, etc. The download speed is limited by baud rate, packet length, air interface environment, etc., and the firmware package is updated very slowly, while differential upgrade can greatly reduce the download process. However, although OTA technology has improved the convenience and efficiency of device updates to a certain extent, traditional OTA technology has some limitations in differential incremental updates, and cannot fully utilize network bandwidth and storage space, resulting in a time-consuming update process and consumption of a lot of resources. In addition, the existing OTA technology also has certain bottlenecks when dealing with large-scale device updates, and cannot meet the needs of completing device firmware and software updates quickly, accurately and at low cost. Summary of the invention

[0003] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a differential incremental OTA upgrade method based on MOSbus wireless data transmission.

[0004] A differential incremental OTA upgrade method based on MOSbus wireless data transmission comprises the following steps:

[0005] Step 1: Get the new firmware and the firmware currently running on the device;

[0006] Step 2: Import the new firmware program and the old firmware program into the differential packet generation software to generate a differential packet; Step 3: Import the generated differential packet into the modbus host;

[0007] Step 4: Send an upgrade command through the modbus host to notify the slave that a firmware upgrade is about to be performed; Step 5: After receiving the upgrade command, the slave writes the differential packet into the erase area and sends an ACK response to the host to notify the host that it is ready to receive the differential packet data;

[0008] Step 6: After receiving the ACK response from the slave, the Modbus host starts to send differential packet data, sets a timeout, and waits for a response. If no response is received after the timeout, it is considered that the slave has not received this packet of data. The host continues to send the data packet until it receives a response from the slave, then sends the next differential packet data, and repeats this cycle until all differential packet data are sent;

[0009] Step 7: After receiving all the differential packet data, the slave machine will perform differential recovery and reorganization by itself, and restart. The program after the restart is the new release version program.

[0010] Furthermore, in step 4, when the host sends an upgrade instruction to a slave, the slave will send a confirmation message to the host if it receives the instruction, and wake up the upgrade thread to do preparations before the upgrade.

[0011] Preferably, the preparation work includes obtaining the FLASH differential packet writing position from the machine and erasing the area to ensure that the differential packet data is written smoothly.

[0012] Furthermore, in step 6, when the host receives a confirmation message from the slave, it starts to send a differential packet data message to the slave. The message should contain the following information: the destination address, source address, actual size (bytes) of the differential packet data contained in the message, and the packet number to which the message data sent this time belongs. After the host sends this packet of data, it sets a timeout and waits for a response from the slave. If no response is received after the timeout, it repeats sending this data packet.

[0013] Furthermore, in step 6, the slave performs a CRC check after receiving the message sent by the host, and extracts the differential packet data and packet sequence number in the message and determines whether it meets its own required packet sequence number. If it meets the requirements, it is written into FLASH and an ACK confirmation message is sent to the host; if it does not meet the requirements, it is discarded and a reply message is sent to the slave.

[0014] Furthermore, the reply message contains the following information: source address, destination address, function code, and required packet sequence, which is used to notify the host to adjust the differential packet data to be sent; when the host receives the ACK response sent from the slave, it chooses to send the next differential packet data or adjust the differential packet data to be sent according to its content.

[0015] Preferably, in step 7, the slave starts to execute the preset differential recovery program after receiving the last differential packet data, and chooses to restart to enter the preset flashing program, whose main function is to restore the differential data in FLASH to the newly released version program, and the upgrade is completed.

[0016] The beneficial effects of the present invention are as follows: This technology utilizes differential data transmission to achieve a more efficient firmware and software update method, which brings many advantages to equipment management and maintenance. First, the differential incremental OTA technology based on the modbus protocol adopts a differential data transmission method, which only needs to transmit the update part of the data, greatly reducing the amount of data and transmission time during the update process, saving network bandwidth and storage space. Secondly, this technology supports intelligent version management, can accurately identify the changed parts of the firmware and software, and accurately update according to the update requirements, reducing the complexity and risk of the update, and improving the stability and security of the system. In addition, the differential incremental OTA technology based on the modbus protocol also supports wireless transmission, making equipment maintenance more convenient, and the update can be completed without physical connection, which greatly facilitates equipment management and maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, without paying creative labor, other drawings obtained based on these drawings still belong to the scope of the present invention.

[0018] Figure 1 This is a schematic diagram for upgrading modbus wireless communication;

[0019] Figure 2 This is a schematic diagram of the slave upgrade procedure. DETAILED DESCRIPTION

[0020] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.

[0021] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0022] The directions and positions mentioned in the present invention, such as "upper", "lower", "front", "back", "left", "right", "inside", "outside", "top", "bottom", "side", etc., are only for reference to the directions or positions of the drawings. Therefore, the directions and positions used are for explaining and understanding the present invention, but not for limiting the scope of protection of the present invention.

[0023] like Figure 1-2As shown, an embodiment of a differential incremental OTA upgrade method based on MOSbus wireless data transmission of the present invention includes the following steps:

[0024] Step 1: Get the new firmware and the firmware currently running on the device;

[0025] Step 2: Import the new firmware program and the old firmware program into the differential package generation software to generate a differential package;

[0026] Step 3: Import the generated differential packet into the modbus host;

[0027] Step 4: Send an upgrade command through the modbus host to notify the slave that a firmware upgrade is about to be performed; Step 5: After receiving the upgrade command, the slave writes the differential packet into the erase area and sends an ACK response to the host to notify the host that it is ready to receive the differential packet data;

[0028] Step 6: After receiving the ACK response from the slave, the Modbus host starts to send differential packet data, sets a timeout, and waits for a response. If no response is received after the timeout, it is considered that the slave has not received this packet of data. The host continues to send the data packet until it receives a response from the slave, then sends the next differential packet data, and repeats this cycle until all differential packet data are sent;

[0029] Step 7: After receiving all the differential packet data, the slave machine will perform differential recovery and reorganization by itself, and restart. The program after the restart is the new release version program.

[0030] The master-slave working mode based on the modbus wireless communication mode is as follows Figure 1 As shown in the figure: the master and slave follow the "request-response" mode, and the slave cannot actively send data to the master. The master uses broadcasting to request the slave, and each slave has its own unique device ID. Therefore, the message data should contain at least the destination address, source address, function code, and data to ensure that the slave can correctly respond to the master.

[0031] The wireless communication mode can be based on at least one of wireless communication technologies or wired communication technologies such as Wireless Fidelity (WIFI), Ultra Wide Band (UWB), Bluetooth, ZigBee, Near Field Communication (NFC), Low-Power Wide-Area Network (LPWAN), Global Navigation Satellite System (GNSS), Cellular network, Wireless Local Area Networks (WLAN), Local Area Network (LAN), and Wide Area Network (WAN).

[0032] The present invention aims to realize a differential OTA technology based on wireless transmission of the Modbus protocol, and brings innovation to the app upgrade of the embedded operating system RT-Thread device. In general, the differential incremental OTA technology based on the Modbus protocol has significant advantages in improving update efficiency, saving resource consumption, and reducing system risks, and brings innovative solutions to the OTA update of the embedded operating system RT-Thread device. The promotion and application of this technology will bring more efficient, safer and more convenient equipment management and maintenance methods to the industry.

[0033] A) In step 4, when the host sends an upgrade instruction to a slave, the slave will send a confirmation message to the host if it receives the instruction, and wake up the upgrade thread to prepare for the upgrade. Figure 2 As shown: The preparation work includes obtaining the FLASH differential packet write location from the machine and erasing the area to ensure that the differential packet data is written smoothly.

[0034] B) In step 6, when the host receives the confirmation message from the slave, it starts to send differential packet data messages to the slave. The message should contain the following information: the destination address, source address, actual size (bytes) of the differential packet data contained in the message, and the packet number to which the message data sent this time belongs; after the host sends this packet of data, it sets a timeout and waits for a response from the slave. If no response is received after the timeout, it repeats sending this data packet.

[0035] Steps A and B are repeated cyclically until all differential packets have been sent to the target slave.

[0036] After receiving the message sent by the host, the slave performs a CRC check, extracts the differential packet data and packet sequence number in the message, and determines whether it meets its own required packet sequence number. If it meets the requirements, it is written into FLASH and an ACK confirmation message is sent to the host; if it does not meet the requirements, it is discarded and a reply message is sent to the slave.

[0037] In step 7, the slave receives the last differential packet data and starts to execute the preset differential recovery program after sending a confirmation to the host. It chooses to restart and enter the preset flashing program, whose main function is to restore the differential data in FLASH to the newly released version program. The upgrade is now complete.

[0038] This solution is not limited to upgrading only one slave at a time. The master can also choose to upgrade all slaves in this batch. The specific strategy is implemented by the master.

[0039] This technology uses differential data transmission to achieve a more efficient firmware and software update method, bringing many advantages to device management and maintenance. First, the differential incremental OTA technology based on the modbus protocol adopts the method of differential data transmission, which only needs to transmit the update part of the data, greatly reducing the amount of data and transmission time during the update process, saving network bandwidth and storage space. Secondly, this technology supports intelligent version management, can accurately identify the changed parts of the firmware and software, and accurately update according to the update requirements, reducing the complexity and risk of the update, and improving the stability and security of the system. In addition, the differential incremental OTA technology based on the modbus protocol also supports wireless transmission, making equipment maintenance more convenient, and the update can be completed without physical connection, which greatly facilitates equipment management and maintenance.

[0040] Although the invention has been described with reference to several specific embodiments, it should be understood that the invention is not limited to the specific embodiments disclosed. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A differential incremental OTA upgrade method based on mosbus wireless data transmission, characterized in that: The following steps are involved: Step 1: Get the new firmware and the firmware currently running on the device; Step 2: Import the new firmware program and the old firmware program into the differential package generation software to generate a differential package; Step 3: Import the generated differential packet into the modbus host; Step 4: Send an upgrade command through the modbus master to notify the slave that a firmware upgrade is about to be performed; Step 5: The slave receives the upgrade command, writes the differential packet into the erase area, sends an ACK response to the host, and informs the host that it is ready to receive the differential packet data; Step 6: After receiving the ACK response from the slave, the Modbus host starts to send differential packet data, sets a timeout, and waits for a response. If no response is received after the timeout, it is considered that the slave has not received this packet of data. The host continues to send the data packet until it receives a response from the slave, then sends the next differential packet data, and repeats this cycle until all differential packet data are sent; Step 7: After receiving all the differential packet data, the slave machine will perform differential recovery and reorganization by itself, and restart. The program after the restart is the new release version program.

2. The differential incremental OTA upgrade method based on MOSbus wireless data transmission according to claim 1, characterized in that: In step 4, when the host sends an upgrade instruction to a slave, the slave will send a confirmation message to the host if it receives the instruction, and wake up the upgrade thread to do preparations before the upgrade.

3. The differential incremental OTA upgrade method based on MOSbus wireless data transmission according to claim 2, characterized in that: The preparation work includes obtaining the FLASH differential packet writing position from the machine and erasing the area to ensure that the differential packet data is written smoothly.

4. The differential incremental OTA upgrade method based on MOSbus wireless data transmission according to claim 1, characterized in that: In step 6, when the host receives the confirmation message from the slave, it starts to send differential packet data messages to the slave. The message should contain the following information: the destination address, source address, actual size (bytes) of the differential packet data contained in the message, and the packet number to which the message data sent this time belongs. After the host sends this packet of data, it sets a timeout and waits for a response from the slave. If no response is received after the timeout, the host repeats sending this data packet.

5. The differential incremental OTA upgrade method based on MOSbus wireless data transmission according to claim 1, characterized in that: In step 6, after receiving the message sent by the host, the slave performs a CRC check, extracts the differential packet data and packet sequence number in the message, and determines whether it meets its own required packet sequence number. If it meets the requirements, it is written into FLASH and an ACK confirmation message is sent to the host; if it does not meet the requirements, it is discarded and a reply message is sent to the slave.

6. The differential incremental OTA upgrade method based on MOSbus wireless data transmission as claimed in claim 5, characterized in that: The reply message contains the following information: source address, destination address, function code, and required packet sequence, which is used to notify the host to adjust the differential packet data to be sent; when the host receives the ACK response sent by the slave, it chooses to send the next differential packet data or adjust the differential packet data to be sent according to its content.

7. The differential incremental OTA upgrade method based on MOSbus wireless data transmission according to claim 1, characterized in that: In step 7, the slave receives the last differential packet data and starts to execute the preset differential recovery program after sending a confirmation to the host. It chooses to restart and enter the preset flashing program, whose main function is to restore the differential data in FLASH to the newly released version program. The upgrade is now complete.