A remote upgrade method for an Internet of Things gateway

By dividing the FLASH area of ​​the IoT gateway into multiple areas and using the RAM buffer and the FLASH area to work together, the problem of insufficient capacity of the IoT gateway RAM buffer is solved, and the reliability and continuity of large-capacity firmware upgrades are achieved, ensuring the normal operation of the gateway.

CN119561923BActive Publication Date: 2025-09-02WUXI GUANZHIJIE DATA INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411761593.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-09-02
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In the prior art, the Internet of Things gateway cannot receive large firmware upgrade packages in one go due to the small RAM buffer capacity, resulting in the inability to complete the remote upgrade.

Method used

The FLASH area of ​​the Internet of Things gateway is divided into FLASH buffer, FLASH backup area and FLASH execution area. The upgrade data is written to the FLASH buffer through the RAM buffer, and the data is transmitted using the larger capacity of the FLASH area, and time management is carried out to ensure the integrity and reliability of the upgrade process.

Benefits of technology

It realizes that the IoT gateway can receive and write firmware upgrade packages several times the size of the RAM buffer when the RAM buffer capacity is limited, ensuring the continuity and integrity of the upgrade process, avoiding the abnormal operation of the gateway caused by upgrade failure or communication interruption, and improving the upgrade effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119561923B_ABST
    Figure CN119561923B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of Internet of Things gateway management, and specifically provides a remote upgrade method for an Internet of Things gateway, comprising a host computer system equipped with a firmware upgrade package and an Internet of Things gateway to be upgraded, wherein a receiving RAM buffer and a FLASH area are provided inside the Internet of Things gateway; the FLASH area is divided into a FLASH buffer area, a FLASH backup area, and a FLASH execution area; the remote upgrade method sets a specified length for writing into the FLASH buffer area, records the written length written into the FLASH buffer area, and records the current full length of the RAM buffer area, and repeatedly writes the upgrade data received in the RAM buffer area into the FLASH area, thereby making full use of FLASH resources, occupying less RAM resources to receive a firmware upgrade package several times the size of the RAM buffer area, and realizing remote upgrade of a large-capacity program of the gateway; the present invention performs time management on the entire upgrade process, avoids the problem of abnormal upgrade time caused by upgrade failure or communication interruption, which causes the gateway to fail to operate normally, and improves the upgrade effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things gateway management, and in particular to a remote upgrading method for an Internet of Things gateway. Background Art

[0002] IoT gateways play a crucial role in the IoT era, serving as the link between sensory networks and traditional communication networks. As gateway devices, they facilitate protocol conversion between sensory networks and communication networks, as well as between different types of sensory networks. They enable both wide-area and local-area interconnection. Furthermore, IoT gateways must possess device management capabilities. Through IoT gateways, operators can manage underlying sensory nodes, gain access to relevant information about each node, and implement remote control.

[0003] The method for implementing remote upgrade of the gateway in the existing technology is: reserving a receiving buffer for receiving firmware upgrade packages in the RAM area of ​​the embedded microprocessor inside the gateway, and after receiving the firmware upgrade package once, writing it into the program area of ​​the non-volatile storage space FLASH to complete the upgrade; however, the RAM capacity inside the embedded microprocessor is generally small but the FLASH capacity is relatively large, and the program running also requires RAM space. Therefore, the RAM buffer reserved for remote program upgrade cannot be too large. As the program is continuously iterated and upgraded, the upgrade package capacity becomes larger and larger. Once the reserved RAM buffer size is exceeded, the gateway will not be able to receive the firmware upgrade package in one go, and the remote upgrade cannot be completed. Summary of the Invention

[0004] In view of the shortcomings of the prior art described above, the purpose of the present invention is to provide a remote upgrade method for an Internet of Things gateway, which is used to solve the problem in the prior art that the gateway cannot receive a large firmware upgrade package in full at one time by receiving the firmware upgrade package in the RAM area at one time.

[0005] To achieve the above-mentioned and other related purposes, the present invention provides a remote upgrade method for an Internet of Things gateway, comprising a host computer system equipped with a firmware upgrade package and an Internet of Things gateway to be upgraded, wherein the Internet of Things gateway is internally provided with a receiving RAM buffer and a FLASH area;

[0006] The FLASH area is divided into a FLASH buffer area, a FLASH backup area, and a FLASH execution area; and the remote upgrade method comprises the following steps:

[0007] Step 1: Establish a remote connection between the IoT gateway and the host system through the network port;

[0008] Step 2: The gateway starts to receive the upgrade data of the firmware upgrade package and puts the received upgrade data into the RAM buffer;

[0009] Step 3: After the upgrade data received by the gateway reaches the block length, the received length of the current RAM buffer is recorded;

[0010] Step 4: The upgrade data starts to be written from the RAM buffer to the specified length set in the FLASH buffer;

[0011] Step 5: After the upgrade data is written into the FLASH buffer, the written length of the FLASH buffer is recorded;

[0012] Step 6: The gateway continues to receive the upgrade data. The upgrade data in its RAM buffer is received again starting from the position after the last upgrade data recorded in step 4 reaches the block length. Repeat the upgrade data receiving and writing operation in step 4 until all upgrade data is received.

[0013] Step 7: When the length of the next round of upgrade data received by the gateway exceeds the length of the RAM buffer, the current RAM buffer full length is recorded;

[0014] Step 8: When the upgrade data received reaches the end of the RAM buffer, the next round of received upgrade data will be placed at the beginning of the RAM buffer.

[0015] Step 9: When the upgrade data received by the gateway reaches the specified length, the received length of the current RAM buffer is re-recorded;

[0016] Step 10: The gateway continues to write the upgrade data into the FLASH buffer starting from the RAM buffer location recorded in step 8;

[0017] Step 11: After receiving all the required upgrade data, the gateway writes the upgrade data into the FLASH buffer for the last time.

[0018] Step 12: Verify the upgrade data received in the FLASH buffer. After verification, write the upgrade data into the FLASH backup area and send back a signal to the host computer indicating that the upgrade data has been successfully received.

[0019] Step 13: After the FLASH backup area is successfully written, continue to write the upgrade data into the FLASH execution area;

[0020] Step 14: After the upgrade data is written into the FLASH execution area, a success signal is sent back to the upper level;

[0021] Step 15: After the new program is successfully executed, a new version number is sent to the host system to ensure the integrity of the upgrade again.

[0022] In one embodiment of the present invention, in step 4, the specified length of the FLASH buffer depends on the read and write characteristics of the FLASH inside the gateway. When the FLASH supports word writing, the specified length is set to word; when the FLASH only supports block erasure and block writing, the specified length is set to the block size that supports block writing.

[0023] In one embodiment of the present invention, the specified length of the FLASH buffer is calculated based on the relationship between the time required to write the upgrade data to the FLASH and the reception time. The calculation is as follows: the size of the FLASH buffer is set to L1, and the specified length is L2; ​​the time required for the RAM receiving buffer to receive the specified length is T1; the time required for the FLASH buffer to write the specified length is T2, then L1>([T2 / T1]+2)*L2 must be satisfied.

[0024] In one embodiment of the present invention, in step 7, before the gateway receives the next round of upgrade data, the operation of writing into the FLASH buffer is completed.

[0025] In one embodiment of the present invention, the remote upgrade method also includes time management of the upgrade process when the gateway is in the waiting for upgrade state; this time management must be met during the operation process of steps 1 to 15. If any process fails in the middle, the gateway will return the relevant status of the upper computer and perform version rollback.

[0026] A remote upgrade device for an Internet of Things gateway, wherein the host computer system is installed in the remote upgrade device for the Internet of Things gateway; the remote upgrade device for the Internet of Things gateway comprises: a memory and a processor, wherein the memory stores a computer program that can be called by the processor, and when the computer program is executed by the processor, the steps of the remote upgrade method for the Internet of Things gateway are implemented.

[0027] A computer-readable storage medium stores an Internet of Things gateway remote upgrade program, which, when executed by a processor, implements the steps of the Internet of Things gateway remote upgrade method.

[0028] As described above, the remote upgrade method of the Internet of Things gateway of the present invention has the following beneficial effects:

[0029] The present invention utilizes that the RAM buffer capacity of the gateway for receiving data is small and cannot receive all the upgrade data of the firmware upgrade package at one time, while the capacity of the FLASH area inside the gateway is large enough, and the rate at which the gateway writes the upgrade data received by the RAM buffer into the FLASH area is much greater than the upgrade data receiving rate, so the gateway will not affect the upgrade data reception of the firmware upgrade package when writing the upgrade data; after the gateway receives the upgrade data length of the specified firmware upgrade package, the upgrade data received by the RAM buffer is written into the FLASH buffer, and the current received length of the RAM buffer is recorded. After the upgrade data is written into the FLASH buffer, the written length written into the FLASH buffer is recorded, and the gateway continues to wait for reception; the re-reception of the RAM buffer and the re-writing of the FLASH buffer are executed from the last completed position; when the reception length of the RAM buffer is full, the reception length full flag is recorded, and the next round of upgrade data reception continues to be received from the first position of the RAM buffer; after receiving the block length again, the gateway The unwritten upgrade data in the RAM buffer continues to be written into the FLASH buffer. When the execution reaches the end position of the RAM buffer, the upgrade data to be written continues to be written from the first position of the RAM buffer. After all firmware upgrade packages are received and written into the buffer FLASH area, the upgrade data is verified and then written into the FLASH backup area and the FLASH execution operation is performed. The remote upgrade method for the Internet of Things gateway provided by the present invention sets a specified length for writing into the FLASH buffer, records the written length written into the FLASH buffer, and records the current full length of the RAM buffer. The upgrade data received in the RAM buffer is repeatedly written into the FLASH area, and the FLASH resources are fully utilized. Less RAM resources can be occupied to receive firmware upgrade packages several times the size of the RAM buffer, thereby realizing remote upgrade of large-capacity programs of the gateway. The present invention performs time management on the entire upgrade process to avoid upgrade time abnormalities caused by upgrade failure or communication interruption, which may lead to the problem that the gateway cannot operate normally, thereby improving the upgrade effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The figure shows a schematic diagram of the space comparison of the firmware upgrade package, RAM cache area and FLASH area in Example 1.

[0031] Figure 2 Shown is a block diagram of the upper computer system establishing a connection with the Internet of Things gateway in step 1 of Example 1.

[0032] Figure 3 It shows the block structure of the RAM buffer in Example 1 and a schematic diagram of the storage direction of the upgrade data in the RAM buffer.

[0033] Figure 4It is a schematic diagram showing that the RAM buffer receives the upgrade data of the firmware upgrade package and writes it into the FLASH buffer in Example 1.

[0034] Figure 5 A schematic diagram showing the transmission of upgrade data in the FLASH area in Example 1. DETAILED DESCRIPTION

[0035] The following describes the implementation of the present invention through specific embodiments. People skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification.

[0036] See also Figures 1 to 5 It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not intended to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modifications, changes in proportions, or adjustments in sizes shall still fall within the scope of the technical contents disclosed in the present invention, provided that they do not affect the efficacy and objectives that can be achieved by the present invention.

[0037] Example 1, please refer to Figure 1 , Figure 1 Where a is a RAM cache area, b is a firmware upgrade package, c is a FLASH cache area, d is a FLASH backup area, and e is a FLASH execution area. This embodiment provides a remote upgrade method for an Internet of Things gateway, including a host computer system equipped with a firmware upgrade package and an Internet of Things gateway to be upgraded. The Internet of Things gateway is internally provided with a receiving RAM buffer area and a FLASH area; the FLASH area is divided into a FLASH buffer area, a FLASH backup area, and a FLASH execution area; the remote upgrade method comprises the following steps:

[0038] See also Figure 2-5 , Figure 3 In the example, a single block S is the specified length for writing to FLASH, block 1 is the first address of the RAM buffer area, and block 10 is the last address of the RAM buffer area; Figure 4 In the figure, a1 is the free RAM block for transferred data, a2 is the RAM block for receiving upgrade data, b1 is the data of the received firmware upgrade package, and c1 is the upgrade data written to the FLASH buffer; Step 1: Establish a remote connection between the IoT gateway and the host computer system through the network port;

[0039] Step 2: The gateway starts to receive the upgrade data of the firmware upgrade package and puts the received upgrade data into the RAM buffer;

[0040] Step 3: After the upgrade data received by the gateway reaches the block length, the received length of the current RAM buffer is recorded;

[0041] Step 4. The upgrade data starts to be written from the RAM buffer to the specified length set in the FLASH buffer; the specified length of the FLASH buffer depends on the read and write characteristics of the FLASH inside the gateway. When the FLASH supports word writing, the specified length is set to word; when the FLASH only supports block erasing and block writing, the specified length is set to the block size that supports block writing; the specified length of the FLASH buffer is calculated by the relationship between the time required to write the upgrade data to the FLASH and the reception time, which is calculated as follows: set the size of the FLASH buffer area to L1 and the specified length to L2; the time required for the RAM receiving buffer area to receive the specified length is T1; the time required for the FLASH buffer area to write the specified length is T2, then it is necessary to satisfy L1>([T2 / T1]+2)*L2; in order to prevent unexpected situations such as interruptions, L1 can be appropriately added with some redundancy to ensure that the contents in the RAM receiving buffer area have enough time to be written to the FLASH buffer area;

[0042] Step 5: After the upgrade data is written into the FLASH buffer, the written length of the FLASH buffer is recorded;

[0043] Step 6: The gateway continues to receive the upgrade data. The upgrade data in its RAM buffer is received again starting from the position after the last upgrade data recorded in step 4 reaches the block length. Repeat the upgrade data receiving and writing operation in step 4 until all upgrade data is received.

[0044] Step 7: When the length of the next round of upgrade data received by the gateway exceeds the length of the RAM buffer, the full length of the current RAM buffer is recorded; before the gateway receives the next round of upgrade data, the operation of writing into the FLASH buffer is completed to ensure the integrity and reliability of the upgrade data reception;

[0045] Step 8: When the upgrade data received reaches the end of the RAM buffer, the next round of upgrade data will be placed at the beginning of the RAM buffer. Since the upgrade data has been processed through steps 3 to 6, the first position of the RAM buffer has been vacated, ensuring the continuity of upgrade data reception.

[0046] Step 9: When the upgrade data received by the gateway reaches the specified length, the received length of the current RAM buffer is re-recorded;

[0047] Step 10: The gateway continues to write the upgrade data into the FLASH buffer starting from the RAM buffer location recorded in step 8;

[0048] Step 11: After receiving all the required upgrade data, the gateway writes the upgrade data into the FLASH buffer for the last time.

[0049] Step 12: Verify the upgrade data received in the FLASH buffer. After verification, write the upgrade data into the FLASH backup area and send back a signal to the host computer indicating that the upgrade data has been successfully received.

[0050] Step 13: After the FLASH backup area is successfully written, continue to write the upgrade data into the FLASH execution area;

[0051] Step 14: After the upgrade data is written into the FLASH execution area, a success signal is sent back to the upper level;

[0052] Step 15: After the new program is successfully executed, a new version number is sent to the host system to ensure the integrity of the upgrade again.

[0053] The remote upgrade method also includes time management for the upgrade process when the gateway is in the state of waiting for upgrade; this time management must be met during the operation process of steps 1 to 15. If any process fails during the process, the gateway will return the relevant status of the host computer and perform version rollback; time management can be based on laboratory simulation or previous experience in upgrading similar equipment, and a detailed time breakdown and estimation can be made for each link of the upgrade process. For example, the time consumption of pulling the upgrade package from the server to the local gateway storage is calculated based on the network bandwidth (1Gbps bandwidth takes about 4-6 seconds to download a 500MB upgrade package, and 100Mbps takes 40-60 seconds), server response delay, etc.; the time consumption of verifying the integrity and legality of the upgrade package is estimated to be 5-10 minutes; executing the upgrade script and updating the system files, simple patch operations take 10-20 minutes, and comprehensive system upgrades take 30-90 minutes; restarting and initializing the gateway device, a normal restart takes 3-8 minutes, and complex configuration loading and service self-starting may be extended to 15-20 minutes. Aggregate the time for each step and add an additional 20%-30% as a flexible buffer to determine the theoretical total upgrade duration. During the upgrade process, start operations promptly within the selected upgrade window according to the established plan. Utilize professional network management software and command-line tools to track progress in real time, recording the start and end times of each key node, such as when the upgrade package begins downloading, when the download completes, and when the upgrade installation starts and ends. If a step exceeds the estimated duration by more than 30%, immediately pause the operation and investigate the cause. This could be network jitter causing slow downloads, device disk read / write failures affecting file updates, etc. Quickly troubleshoot the issue to ensure a seamless process. After confirming the upgrade is successful and the business is running stably, organize the team to review the entire upgrade process, analyze the reasons for the discrepancy between the actual time spent and the estimated time spent at each step, and develop targeted optimization strategies for timed-out steps, such as optimizing network configuration to increase download speeds, streamlining upgrade scripts to reduce execution time, etc. This experience will be archived to improve the time management plan for subsequent gateway upgrade iterations.

[0054] The present invention utilizes that the RAM buffer capacity of the gateway for receiving data is small and cannot receive all the upgrade data of the firmware upgrade package at one time, while the capacity of the FLASH area inside the gateway is large enough, and the rate at which the gateway writes the upgrade data received by the RAM buffer into the FLASH area is much greater than the upgrade data receiving rate, so the gateway will not affect the upgrade data reception of the firmware upgrade package when writing the upgrade data; after the gateway receives the upgrade data length of the specified firmware upgrade package, the upgrade data received by the RAM buffer is written into the FLASH buffer, and the current received length of the RAM buffer is recorded. After the upgrade data is written into the FLASH buffer, the written length written into the FLASH buffer is recorded, and the gateway continues to wait for reception; the re-receiving of the RAM buffer and the re-writing of the FLASH buffer are from the last completed position The system starts execution at the location where the upgrade is set; when the receiving length of the RAM buffer is full, the receiving length full flag is recorded, and the next round of upgrade data reception continues to be received from the first position of the RAM buffer; after receiving the block length again, the gateway continues to write the unwritten upgrade data in the RAM buffer into the FLASH buffer. When the execution reaches the end position of the RAM buffer, the upgrade data to be written continues to be written from the first position of the RAM buffer; after all firmware upgrade packages are received and written into the buffer FLASH area, the upgrade data is verified and then written into the FLASH backup area and the FLASH execution operation is performed to realize remote upgrade of large-capacity gateway programs; the present invention performs time management on the entire upgrade process to avoid upgrade time abnormalities caused by upgrade failure or communication interruption, which may lead to the problem that the gateway cannot operate normally, thereby improving the upgrade effect.

[0055] Example 2. This example uses the remote upgrade method of the Internet of Things gateway provided in Example 1 to upgrade a gateway containing an embedded microprocessor. The microprocessor model of the gateway is stm32f103rct6, the operating frequency is 72Mhz, the network port communication baud rate is 115200b / s, the total RAM space is 48K, the total FLASH space is 256K, and it supports half-word (16bit) writing. The firmware upgrade package size is 50K.

[0056] Because the size of the program upgrade package exceeds the total RAM space, the entire firmware upgrade package cannot be downloaded in one go using RAM. Calculations and testing show that the time it takes for the microprocessor to receive one byte of the firmware upgrade package (8 data bits + 1 start bit + 1 end bit, a total of 10 bits) from the host computer is T≈10 / 115200≈87us, while the time it takes to write a half-word (16 bits) of FLASH is approximately 69us. Taking a half-word (16 bits) as the specified length, L2 = 2 bytes, T1 ≈ 2*87 (ignoring the time it takes to write to RAM) ≈ 174us, and T2 ≈ 69us. Substituting this into the formula L1 > ([T2 / T1] + 2) * L2 yields: L1 > 4 bytes. To prevent abnormalities, ensure reliability, and allow for the remaining RAM used by the program, L1 is redundant, so L1 is selected as 1KB.

[0057] The results of using this method to upgrade gateways containing embedded microprocessors are as follows: when the firmware upgrade package is larger than the total RAM space, only 1k of RAM buffer is used to successfully implement remote upgrade of 50KB firmware upgrade package for more than 200 such gateways in a certain project, indicating that this method is feasible and reliable.

[0058] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0059] In summary, the remote upgrade method for the Internet of Things gateway provided by the present invention sets a specified length for writing to the FLASH buffer, records the length written to the FLASH buffer, and records the current full length of the RAM buffer. The upgrade data received by the RAM buffer is repeatedly written into the FLASH area, making full use of the FLASH resources. With less RAM resources, a firmware upgrade package several times the size of the RAM buffer can be received, thereby realizing remote upgrade of large-capacity gateway programs. The present invention manages the entire upgrade process in time, avoiding upgrade time anomalies caused by upgrade failures or communication interruptions, which may lead to the inability of the gateway to operate normally, thereby improving the upgrade effect. Therefore, the present invention effectively overcomes the various shortcomings of the prior art and has high industrial utilization value.

[0060] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.

Claims

1. A remote upgrade method for an Internet of Things gateway, comprising a host computer system equipped with a firmware upgrade package and an Internet of Things gateway to be upgraded, wherein the Internet of Things gateway is internally provided with a receiving RAM buffer and a FLASH area; It is characterized by: The FLASH area is divided into a FLASH buffer area, a FLASH backup area, and a FLASH execution area; and the remote upgrade method comprises the following steps: Step 1: Establish a remote connection between the IoT gateway and the host system through the network port; Step 2: The gateway starts to receive the upgrade data of the firmware upgrade package and puts the received upgrade data into the RAM buffer; Step 3: After the upgrade data received by the gateway reaches the block length, the received length of the current RAM buffer is recorded; Step 4: The upgrade data starts to be written from the RAM buffer to the specified length set in the FLASH buffer; Step 5: After the upgrade data is written into the FLASH buffer, the written length of the FLASH buffer is recorded; Step 6: The gateway continues to receive the upgrade data. The upgrade data in its RAM buffer is received again starting from the position after the last upgrade data recorded in step 4 reaches the block length. Repeat the upgrade data receiving and writing operation in step 4 until all upgrade data is received. Step 7: When the length of the next round of upgrade data received by the gateway exceeds the length of the RAM buffer, the current RAM buffer full length is recorded; Step 8: When the upgrade data received reaches the end of the RAM buffer, the next round of received upgrade data will be placed at the beginning of the RAM buffer. Step 9: When the upgrade data received by the gateway reaches the specified length, the received length of the current RAM buffer is re-recorded; Step 10: The gateway continues to write the upgrade data into the FLASH buffer starting from the RAM buffer location recorded in step 8; Step 11: After receiving all the required upgrade data, the gateway writes the upgrade data into the FLASH buffer for the last time. Step 12: Verify the upgrade data received in the FLASH buffer. After verification, write the upgrade data into the FLASH backup area and send back a signal to the host computer indicating that the upgrade data has been successfully received. Step 13: After the FLASH backup area is successfully written, continue to write the upgrade data into the FLASH execution area; Step 14: After the upgrade data is written into the FLASH execution area, a success signal is sent back to the upper level; Step 15: After the new program is successfully executed, a new version number is sent to the host system to ensure the integrity of the upgrade again.

2. The remote upgrade method of the Internet of Things gateway according to claim 1, characterized in that: In step 4, the prescribed length of the FLASH buffer depends on the read and write characteristics of the FLASH inside the gateway. When the FLASH supports word writing, the prescribed length is set to words; When FLASH only supports block erasing and block writing, the prescribed length is set to the block size that supports block writing.

3. The remote upgrade method of the Internet of Things gateway according to claim 2, characterized in that: The specified length of the FLASH buffer is calculated based on the relationship between the time required to write the upgrade data to the FLASH and the reception time. The calculation is as follows: the size of the FLASH buffer is set to L1, and the specified length is L2; ​​the time required for the RAM receiving buffer to receive the specified length is T1; the time required for the FLASH buffer to write the specified length is T2, then L1>([T2 / T1]+2)*L2 must be satisfied.

4. The remote upgrade method of the Internet of Things gateway according to claim 1, characterized in that: In step 7, before the gateway receives the next round of upgrade data, the operation of writing into the FLASH buffer is completed.

5. The remote upgrade method of the Internet of Things gateway according to claim 1, characterized in that: The remote upgrade method also includes time management of the upgrade process when the gateway is in the upgrade waiting state; this time management must be met during the operation process of steps 1 to 15. If any process fails in the middle, the gateway will return the relevant status of the host computer and perform version rollback.

6. A remote upgrade device for an Internet of Things gateway, wherein the host computer system is installed in the remote upgrade device for an Internet of Things gateway; characterized in that: The IoT gateway remote upgrade device includes: a memory and a processor, wherein the memory stores a computer program that can be called by the processor, and when the computer program is executed by the processor, the steps of the IoT gateway remote upgrade method according to any one of claims 1 to 5 are implemented.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an Internet of Things gateway remote upgrade program, which, when executed by a processor, implements the steps of the Internet of Things gateway remote upgrade method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Multimedia conferencing system

    US20030187632A1

  • DSP on-line upgrading method for dynamically adjusting RAM space

    CN108153536A

  • Method, system and application for realizing upgrading double backups by multiplexing user data area

    CN118779150A