WO2022241918A1 - 一种物联网设备远程升级方法及装置 - Google Patents

一种物联网设备远程升级方法及装置 Download PDF

Info

Publication number
WO2022241918A1
WO2022241918A1 PCT/CN2021/104181 CN2021104181W WO2022241918A1 WO 2022241918 A1 WO2022241918 A1 WO 2022241918A1 CN 2021104181 W CN2021104181 W CN 2021104181W WO 2022241918 A1 WO2022241918 A1 WO 2022241918A1
Authority
WO
WIPO (PCT)
Prior art keywords
upgrade
code
application program
area
app
Prior art date
Application number
PCT/CN2021/104181
Other languages
English (en)
French (fr)
Inventor
何杰
程诗猛
周杰
张新访
董逢华
Original Assignee
武汉天喻信息产业股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 武汉天喻信息产业股份有限公司 filed Critical 武汉天喻信息产业股份有限公司
Publication of WO2022241918A1 publication Critical patent/WO2022241918A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16YINFORMATION AND COMMUNICATION TECHNOLOGY SPECIALLY ADAPTED FOR THE INTERNET OF THINGS [IoT]
    • G16Y30/00IoT infrastructure
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Definitions

  • the present application relates to the technical field of Internet of Things devices, and in particular to a method and device for remotely upgrading Internet of Things devices.
  • This application provides a remote upgrade method for Internet of Things devices. By partitioning the storage area of the Internet of Things devices, downloading the upgrade file by itself, and without affecting the normal operation, the application program is updated based on the upgrade code stored in the corresponding partition. Updates to facilitate daily work.
  • the present application provides a method for remotely upgrading an Internet of Things device, the method comprising the following steps:
  • the Internet of Things device downloads the update file of the installed application program from the service platform, and obtains the APP code in the update file;
  • the IoT device stores the APP code in a preset upgrade code area
  • the application program is upgraded;
  • the IoT device is configured with a boot loading area, an APP code area, and an upgrade code area;
  • the bootloader area is used to store bootloader code corresponding to the application program
  • the APP code area is used to store the APP code corresponding to the application program
  • the upgrade code area is used to store the APP code in the update file
  • the APP code mentioned above is a code that will change during an upgrade.
  • the Internet of Things device downloads the update file of the installed application program from the service platform, and before obtaining the APP code in the update file, the following steps are also included:
  • the IoT device periodically sends the version information of the application program installed by itself to the service platform through a heartbeat report;
  • the service platform compares the version information of the application program of the IoT device with the version information of the application program of the server;
  • the service platform sends an upgrade prompt to the IoT device; wherein,
  • the upgrade prompt includes an upgrade URL and the latest version number of the application program.
  • the IoT device downloads the update file of the installed application program from the service platform, and when obtaining the APP code in the update file, also obtains the length of the APP code in the update file;
  • Said Internet of Things device is qualified to verify said APP code in said upgrade code area, including the following steps:
  • the IoT device identifies the length of the APP code in the upgrade code area
  • the length of the APP code in the identified upgrade code area is compared with the length of the APP code in the update file, and if the lengths are consistent, the verification is successful.
  • the method includes the following steps:
  • the application program is repaired based on the APP code in the APP code area.
  • the method also includes the following steps:
  • the IoT device After the IoT device obtains the APP code in the update file, it generates an upgrade mark information in its preset configuration area.
  • the upgrade of the application program also includes the following steps:
  • the IoT device After the IoT device passes the verification of the APP code in the upgrade code area, identify whether the tag information exists in the configuration area,
  • the application program is restarted, and the application program is upgraded based on the APP code in the upgrade code area.
  • the present application provides a device for remotely upgrading an Internet of Things device, the device comprising:
  • a storage area division module which is used to configure a bootloader area, an APP code area, and an upgrade code area in the IoT device;
  • An update file obtaining module which is used to download the update file of the installed application program from the service platform, and obtain the APP code in the update file;
  • a file management module which is used to download the update file of the installed application program from the service platform, and obtain the APP code in the update file;
  • a program upgrade module which is used to upgrade the application program after the APP code in the upgrade code area is verified as qualified;
  • the bootloader area is used to store bootloader code corresponding to the application program
  • the APP code area is used to store the APP code corresponding to the application program
  • the upgrade code area is used to store the APP code in the update file
  • the APP code mentioned above is a code that will change during an upgrade.
  • the device also includes:
  • a version comparison module which is used to regularly send the version information of the application program installed on the Internet of Things device to the service platform through the heartbeat report, and receive the version information of the application program of the Internet of Things device from the service platform.
  • the comparison result obtained after comparing with the version information of the application program of the server;
  • the version comparison module is also used to receive an upgrade prompt sent by the service platform when the two version information comparisons are inconsistent; wherein,
  • the upgrade prompt includes an upgrade URL and the latest version number of the application program.
  • program upgrade module is also used to identify the length of the APP code in the upgrade code area, and combine the identified APP code in the upgrade code area with the APP code in the update file. The length of the code is compared, and if the length is the same, the verification is passed.
  • the device also includes:
  • a program repair module configured to repair the application program based on the APP code in the APP code area when the application program fails to be upgraded.
  • This application partitions the storage area of the IoT device, downloads the upgrade file by itself, and updates the application program based on the upgrade code stored in the corresponding partition without affecting the normal operation, so as to provide convenience for daily work.
  • APP Application, mobile phone software
  • IOT Internet of Things, Internet of Things
  • HEX file Intel HEX file
  • CRC Cyclic Redundancy Check, cyclic redundancy check
  • HTTP Hypertext Transfer Protocol, Hypertext Transfer Protocol
  • MQTT Message Queuing Telemetry Transport; message queue telemetry transmission.
  • FIG. 1 is a flow chart of steps of a method for remotely upgrading an Internet of Things device provided in an embodiment of the present application
  • Fig. 2 is a specific operation flow chart of the method for remotely upgrading an Internet of Things device provided in the embodiment of the present application;
  • FIG. 3 is a schematic partition diagram of a method for remotely upgrading an Internet of Things device provided in an embodiment of the present application
  • Fig. 4 is a structural block diagram of an apparatus for remotely upgrading an Internet of Things device provided in an embodiment of the present application.
  • the embodiment of this application provides a remote upgrade method for IoT devices. By partitioning the storage area of the IoT device, downloading the upgrade file by itself, and without affecting the normal operation, based on the upgrade code stored in the corresponding partition, the application Programs are updated to facilitate daily work.
  • a method for remotely upgrading an Internet of Things device comprising the following steps:
  • the IoT device downloads the update file of the installed application program from the service platform, and obtains the APP code in the update file;
  • the IoT device stores the APP code in the preset upgrade code area
  • IoT devices are equipped with bootloading area, APP code area and upgrade code area;
  • the bootloader area is used to store the bootloader code corresponding to the application
  • the APP code area is used to store the APP code corresponding to the application program
  • the upgrade code area is used to store the APP code in the update file
  • the APP code is the code that will change during the upgrade.
  • the embodiment of the present application provides a method for remotely upgrading an Internet of Things device, the method comprising the following steps:
  • the IoT device downloads the update file of the installed application program from the service platform, and obtains the APP code in the update file;
  • the IoT device stores the APP code in the preset upgrade code area
  • IoT devices are equipped with bootloading area, APP code area and upgrade code area;
  • the bootloader area is used to store the bootloader code corresponding to the application
  • the APP code area is used to store the APP code corresponding to the application program
  • the upgrade code area is used to store the APP code in the update file
  • the APP code is the code that will change during the upgrade.
  • the IoT device downloads the update file of the installed application program from the service platform, and before obtaining the APP code in the update file, the method also includes the following steps:
  • IoT devices regularly send the version information of their installed applications to the service platform through heartbeat reports;
  • the service platform compares the version information of the application program of the IoT device with the version information of the application program of the server;
  • the service platform sends an upgrade prompt to the IoT device; among them,
  • the upgrade prompt includes the upgrade URL and the latest version number of the application.
  • the IoT device downloads the update file of the installed application program from the service platform, and when obtaining the APP code in the update file, it also obtains the length of the APP code in the update file;
  • the IoT device verifies that the APP code in the upgrade code area is qualified, including the following steps:
  • the IoT device identifies the length of the APP code in the upgrade code area
  • the IoT device downloads the corresponding HEX file through the URL address issued by the service platform (IOT platform).
  • the IoT device discards the code of the Boot Loader part and writes the code of the APP part for the HEX file. Go to the upgrade code area. After the writing is completed, calculate the checksum of this part, and write the checksum, the length of the current upgrade code area and the special mark to the preset configuration area at the same time;
  • the Internet of Things device restarts and enters the Boot Load boot program through the program mechanism.
  • the boot program detects the special upgrade flag, if there is such a flag, first calculate the checksum of the upgrade area and compare it with the checksum of the configuration area. If they are consistent , start to copy the code from the upgrade code area to the APP area. After the copy is completed, clear the special mark in the configuration area, the length of the upgrade code, and the checksum, and then restart automatically to complete the upgrade process.
  • the method includes the following steps:
  • the application program is repaired based on the APP code in the APP code area.
  • the method also includes the following steps:
  • the IoT device After the IoT device obtains the APP code in the update file, it generates an upgrade mark information to its preset configuration area.
  • the application program is upgraded, and the method also includes the following steps:
  • the IoT device After the IoT device passes the verification of the APP code in the upgrade code area, identify whether there is tag information in the configuration area,
  • the application program is restarted, and the application program is upgraded based on the APP code in the upgrade code area.
  • one page of address space is reserved as the configuration area, which is used to configure relevant network device parameters and record the current upgrade status and information.
  • the IoT device downloads the corresponding HEX file through the URL address issued by the service platform (IOT platform), and the IoT device program discards the code of the Boot Loader part and writes the code of the APP Enter the upgrade code area;
  • the device internally completes the restart through the program mechanism and enters the Boot Load bootloader.
  • the bootloader detects the special upgrade flag, if there is such a flag, first calculate the checksum of the upgrade area and compare it with the checksum of the configuration area. If they are consistent, start Copy the code from the upgrade code area to the APP area. After the copy is completed, clear the special mark in the configuration area, the length of the upgrade code, and the checksum, and then restart automatically to complete the upgrade process.
  • Step 1 Perform program design and configure IoT devices:
  • Step 11 Locating the bootloader code to the bootloader area
  • Step 12 Locate the APP code to the APP code area
  • Step 13 Locate the configuration area to the last page of the IoT device storage area, which is used to store the upgrade special flag, length and CRC checksum of the upgrade code area.
  • Step 2 The IoT device reports a heartbeat packet to the service platform (IOT platform), and the service platform (IOT platform) detects the version number of the application program of the IoT device.
  • Step 3 The service platform (IOT platform) obtains the version number of the latest version of the application program on the HTTP server, compares the version number of the current IoT device, and the background prompts the user whether to start the upgrade:
  • Step 31 if the user rejects the upgrade, this upgrade is ignored;
  • Step 32 if the user starts the upgrade, the service platform (IOT platform) directly pushes the upgrade URL address link and the version number of the current application program to be upgraded to the online Internet of Things device to be upgraded with the MQTT message.
  • the service platform IOT platform
  • Step 4 The IoT device receives the pushed upgrade URL and version number, and sends an HTTP Get upgrade request to the server where the current URL is located.
  • Step 5 After receiving the request, the HTTP server returns the HEX length of the current firmware.
  • Step 6 The IoT device requests the download of the message body from the HTTP server, and starts to request the download of the binary message HEX of the firmware.
  • Step 7 The IoT device downloads the firmware and reports the current download progress to the service platform (IOT platform). If it is the boot loader area (Boot loader area), ignore and discard it. If it is the APP code area, write this part of the code into the upgrade code area.
  • Step 8 The IoT device synchronously calculates the checksum of the currently downloaded upgrade code area in blocks. When the last block is detected, the received upgrade code area length, checksum and special mark are written to the special address in the configuration area.
  • Step 9 The IoT device initiates the restart process through an internal mechanism.
  • Step 10 After the program starts, enter the Boot loader code segment, and the program checks whether there is a special mark for upgrading in the configuration area.
  • Step 11.1 If there is no such mark, it means that there is a power failure in step S7 or there is no application program to be upgraded, and the program jumps to the original version to continue running.
  • Step 11.2 If there is this mark, calculate the checksum of the upgrade code area.
  • Step 12 Compare the calculated upgrade code area checksum with the checksum recorded in the configuration area.
  • Step 13.1 if inconsistent, the application jumps to the original version and continues to run;
  • Step 13.2 If they are consistent, copy the upgrade content in the upgrade code area to the APP code area.
  • Step 14 After the copy is completed, compare the content of the upgrade code area and the APP area again:
  • Step 14.1 if inconsistent, jump to step S13.2;
  • Step 14.2 Erase the special mark, checksum and length of the upgrade in the configuration area, and the application completes the restart through the internal mechanism.
  • Step 15 The application program enters the boot loader area (Boot loader area), without this special mark, jumps to the code segment that has been upgraded, and the upgrade is successful.
  • the upgrade URL will be pushed in real time through the IOT platform.
  • the firmware update will be automatically completed without any manual intervention, while maintaining the original Configuration parameters, including IP, gateway and routing information remain unchanged;
  • the embodiment of the present application provides a remote upgrade device for IoT devices, which is based on the remote upgrade method for IoT devices mentioned in the first aspect, the device includes:
  • a storage area division module which is used to configure the bootloading area, APP code area and upgrade code area in the Internet of Things device;
  • An update file obtaining module which is used to download the update file of the installed application program from the service platform, and obtain the APP code in the update file;
  • a file management module which is used to download the update file of the installed application program from the service platform, and obtain the APP code in the update file;
  • a program upgrade module which is used to upgrade the application program after the APP code in the upgrade code area is verified to be qualified;
  • the bootloader area is used to store the bootloader code corresponding to the application
  • the APP code area is used to store the APP code corresponding to the application program
  • the upgrade code area is used to store the APP code in the update file
  • the APP code is the code that will change during the upgrade.
  • the IoT device downloads the corresponding HEX file through the URL address issued by the service platform (IOT platform).
  • the IoT device discards the code of the Boot Loader part and writes the code of the APP part for the HEX file. Go to the upgrade code area. After the writing is completed, calculate the checksum of this part, and write the checksum, the length of the current upgrade code area and the special mark to the preset configuration area at the same time;
  • the Internet of Things device restarts and enters the Boot Load boot program through the program mechanism.
  • the boot program detects the special upgrade flag, if there is such a flag, first calculate the checksum of the upgrade area and compare it with the checksum of the configuration area. If they are consistent , start to copy the code from the upgrade code area to the APP area. After the copy is completed, clear the special mark in the configuration area, the length of the upgrade code, and the checksum, and then restart automatically to complete the upgrade process.
  • the device also includes:
  • the version comparison module is used to periodically send the version information of the application program installed on the Internet of Things device to the service platform through the heartbeat report, and receive the version information of the application program of the Internet of Things device and the version information of the server application program by the service platform The comparison result obtained after the comparison;
  • the version comparison module is also used to receive an upgrade prompt sent by the service platform when the two version information comparisons are inconsistent; wherein,
  • the upgrade prompt includes the upgrade URL and the latest version number of the application.
  • program upgrade module is also used to identify the length of the APP code in the upgrade code area, compare the identified APP code in the upgrade code area with the length of the APP code in the update file, and verify if the lengths are consistent qualified.
  • the device also includes:
  • the program repair module is used for repairing the application program based on the APP code in the APP code area when the application program upgrade fails.

Abstract

一种物联网设备远程升级方法及装置,涉及物联网设备技术领域,该方法包括以下步骤:物联网设备从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码(S1);物联网设备将APP代码存储至预设的升级代码区(S2);待物联网设备对升级代码区中的APP代码验证合格后,对应用程序进行升级(S3)。通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。

Description

一种物联网设备远程升级方法及装置 技术领域
本申请涉及物联网设备技术领域,具体涉及一种物联网设备远程升级方法及装置。
背景技术
近年来,随着互联网的高速发展,在物联网设备部署以后,如果存在后续需求更新、代码缺陷等影响使用,势必会要升级固件程序。现有的升级方案,只能通过刷固件程序来完成程序更新。但是面对成千上万的设备,通过刷固件的方式,需去现场拆卸设备,升级成功后,还要重新配置包括网络IP等设备参数,该方案实现起来耗时耗力,很不现实,大大增大人力成本。
因此,提高设备升级的工作效率,急需一种物联网设备远程升级技术。
发明内容
本申请提供一种物联网设备远程升级方法,通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。
第一方面,本申请提供了一种物联网设备远程升级方法,所述方法包括以下步骤:
物联网设备从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码;
所述物联网设备将所述APP代码存储至预设的升级代码区;
待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级;其中,
所述物联网设备配置有引导加载区、APP代码区以及升级代码区;
所述引导加载区用于存储所述应用程序对应的引导加载程序代码;
所述APP代码区用于存储所述应用程序对应的所述APP代码;
所述升级代码区用于存储所述更新文件中的所述APP代码;
所述APP代码为升级时会发生变更的代码。
进一步的,所述物联网设备从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码之前,还包括以下步骤:
所述物联网设备将自身安装的应用程序的版本信息通过心跳报定期发送至所述服务平台;
所述服务平台将所述物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对;
当两个版本信息比对不一致时,所述服务平台向所述物联网设备发送升级提示;其中,
所述升级提示包括升级URL和应用程序最新版本号。
进一步的,所述物联网设备从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码时,还会获取所述更新文件中的APP代码的长度;
所述物联网设备对所述升级代码区中的所述APP代码验证合格,包括以下步骤:
所述物联网设备识别所述升级代码区中的所述APP代码的长度;
将识别出的所述升级代码区中的所述APP代码与所述更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
进一步的,当所述应用程序升级失败后,所述方法包括以下步骤:
基于所述APP代码区中的所述APP代码,对所述应用程序进行修复。
进一步的,所述方法还包括以下步骤:
所述物联网设备获取所述更新文件中的APP代码后,向自身预设的配置区生产一升级标记信息。
进一步的,待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级,还包括以下步骤:
待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,识别所述配置区是否存在所述标记信息,
当存在所述标记信息时,重启所述应用程序,基于所述升级代码区中的所述APP代码对所述应用程序进行升级。
第二方面,本申请提供了一种物联网设备远程升级装置,所述装置包括:
存储区域划分模块,其用于在所述物联网设备中配置引导加载区、APP代码区以及升级代码区;
更新文件获取模块,其用于从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码;
文件管理模块,其用于从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码;
程序升级模块,其用于待对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级;其中,
所述引导加载区用于存储所述应用程序对应的引导加载程序代码;
所述APP代码区用于存储所述应用程序对应的所述APP代码;
所述升级代码区用于存储所述更新文件中的所述APP代码;
所述APP代码为升级时会发生变更的代码。
进一步的,所述装置还包括:
版本比对模块,其用于将所述物联网设备安装的应用程序的版本信息通过心跳报定期发送至所述服务平台,并接收所述服务平台将所述物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对后获得的比对结果;
所述版本比对模块还用于当两个版本信息比对不一致时,接收所述服务平台发送的升级提示;其中,
所述升级提示包括升级URL和应用程序最新版本号。
进一步的,所述程序升级模块还用于识别所述升级代码区中的所述APP代码的长度,并将识别出的所述升级代码区中的所述APP代码与所述更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
进一步的,所述装置还包括:
程序修复模块,其用于当所述应用程序升级失败后,基于所述APP代码区中的所述APP代码,对所述应用程序进行修复。
本申请提供的技术方案带来的有益效果包括:
本申请通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。
附图说明
术语解释:
APP:Application,手机软件;
URL:Uniform Resource Locator,统一资源定位系统;
IOT:Internet of Things,物联网;
HEX文件:Intel HEX文件;
CRC:Cyclic Redundancy Check,循环冗余校验;
HTTP:Hypertext Transfer Protocol,超文本传输协议;
MQTT:Message Queuing Telemetry Transport;消息队列遥测传输。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例中提供的物联网设备远程升级方法的步骤流程图;
图2为本申请实施例中提供的物联网设备远程升级方法的具体操作流程图;
图3为本申请实施例中提供的物联网设备远程升级方法的分区示意图;
图4为本申请实施例中提供的物联网设备远程升级装置的结构框图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、 完整地描述,显然,所描述的实施例是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图对本申请的实施例作进一步详细说明。
本申请实施例提供一种物联网设备远程升级方法,通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。
为达到上述技术效果,本申请的总体思路如下:
一种物联网设备远程升级方法,该方法包括以下步骤:
S1、物联网设备从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码;
S2、物联网设备将APP代码存储至预设的升级代码区;
S3、待物联网设备对升级代码区中的APP代码验证合格后,对应用程序进行升级;其中,
物联网设备配置有引导加载区、APP代码区以及升级代码区;
引导加载区用于存储应用程序对应的引导加载程序代码;
APP代码区用于存储应用程序对应的APP代码;
升级代码区用于存储更新文件中的APP代码;
APP代码为升级时会发生变更的代码。
以下结合附图对本申请的实施例作进一步详细说明。
第一方面,参见图1至3所示,本申请实施例提供一种物联网设 备远程升级方法,该方法包括以下步骤:
S1、物联网设备从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码;
S2、物联网设备将APP代码存储至预设的升级代码区;
S3、待物联网设备对升级代码区中的APP代码验证合格后,对应用程序进行升级;其中,
物联网设备配置有引导加载区、APP代码区以及升级代码区;
引导加载区用于存储应用程序对应的引导加载程序代码;
APP代码区用于存储应用程序对应的APP代码;
升级代码区用于存储更新文件中的APP代码;
APP代码为升级时会发生变更的代码。
本申请实施例中,通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。
进一步的,物联网设备从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码之前,该方法还包括以下步骤:
物联网设备将自身安装的应用程序的版本信息通过心跳报定期发送至服务平台;
服务平台将物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对;
当两个版本信息比对不一致时,服务平台向物联网设备发送升级提示;其中,
升级提示包括升级URL和应用程序最新版本号。
进一步的,物联网设备从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码时,还会获取更新文件中的APP代码的长度;
具体的,物联网设备对升级代码区中的APP代码验证合格,包括以下步骤:
物联网设备识别升级代码区中的APP代码的长度;
将识别出的升级代码区中的APP代码与更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
在具体实施时,物联网设备是通过服务平台(IOT平台)下发的URL地址去下载对应的HEX文件,物联网设备针对HEX文件,将Boot Loader部分的代码丢弃,将APP部分的代码写入到升级代码区。写入完成后,计算该部分校验和,同时将该校验和、当前升级代码区长度以及特殊标记写入到预设的配置区;
然后物联网设备内部通过程序机制完成重启进入Boot Load引导程序,当引导程序检测升级特殊标记,如果有该标记,先计算升级区的校验和,并和配置区的校验和比较,如果一致,开始从升级代码区往APP区拷贝代码,拷贝完成后,清除配置区特殊标记、升级代码长度、校验和,然后自动重启,完成升级过程。
具体的,当应用程序升级失败后,该方法包括以下步骤:
基于APP代码区中的APP代码,对应用程序进行修复。
进一步的,该方法还包括以下步骤:
物联网设备获取更新文件中的APP代码后,向自身预设的配置区生产一升级标记信息。
进一步的,待物联网设备对升级代码区中的APP代码验证合格后,对应用程序进行升级,该方法还包括以下步骤:
待物联网设备对升级代码区中的APP代码验证合格后,识别配置区是否存在标记信息,
当存在标记信息时,重启应用程序,基于升级代码区中的APP代码对应用程序进行升级。
需要说明的是,本申请实施例在物联网设备代码程序设计阶段,先将部分稳定性功能,比如驱动、算法、flash读写部分代码全部编译到引导加载区(Boot Loader区),如果芯片空间足够大,只需将启动引导代码编译到引导加载区(Boot Loader区);
将上层应用和可能涉及修改的代码编译到APP代码区;
最后预留一页的地址空间做配置区,用于配置相关网络设备参数和记录当前升级状态和信息。
当启动升级时,物联网设备通过服务平台(IOT平台)下发的URL地址去下载对应的HEX文件,物联网设备程序将引导加载部分(Boot Loader部分)的代码丢弃,将APP部分的代码写入到升级代码区;
写入完成后,计算该部分校验和,同时将该校验和、当前升级代码区长度,和特殊标记写入到配置区;
然后设备内部通过程序机制完成重启进入Boot Load引导程序,当引导程序检测升级特殊标记,如果有该标记,先计算升级区的校验和,并和配置区的校验和比较,如果一致,开始从升级代码区往APP区拷贝代码,拷贝完成后,清除配置区特殊标记、升级代码长度、校验和,然后自动重启,完成升级过程。
需要说明的是,如说明书附图的图2所示,本申请实施例的具体操作流程如下:
步骤1:进行程序设计,并对物联网设备进行配置:
步骤11:将引导程序代码定位到引导加载区;
步骤12:将APP代码定位到APP代码区;
步骤13:将配置区定位到物联网设备存储区域的最后一页,该配置区用于存储升级特殊标记、长度和升级代码区CRC校验和。
步骤2:物联网设备上报心跳包给服务平台(IOT平台),服务平台(IOT平台)检测物联网设备的应用程序的版本号。
步骤3:服务平台(IOT平台)获取HTTP服务器上的最新版本的应用程序的版本号,对比当前物联网设备的版本号,后台提示用户是否启动升级:
步骤31:用户如果拒接升级,本次升级忽略;
步骤32:用户如果启动升级,服务平台(IOT平台)直接以MQTT报文向在线的需升级的物联网设备推送升级URL地址链接和当前待升级的应用程序的版本号。
步骤4:物联网设备收到推送过来的升级URL和版本号,向当前的URL所在的服务器发送HTTP Get升级请求。
步骤5:HTTP服务器收到请求后,返回当前固件HEX长度。
步骤6:物联网设备向HTTP服务器请求报文体下载,开始请求固件的二进制报文HEX下载。
步骤7:物联网设备下载固件,同时上报当前下载进度给服务平台(IOT平台),如果是引导加载区(Boot loader区),忽略丢弃,如果是APP代码区,将该部分代码写入到升级代码区。
步骤8:物联网设备同步分块计算当前下载的升级代码区校验和。当检测到最后一块时,将接收到的升级代码区长度,校验和以及特殊标记写入到配置区特殊地址。
步骤9:物联网设备通过内部机制启动重启流程。
步骤10:程序启动后,进入Boot loader代码段,程序检测配置区是否有升级的特殊标记。
步骤11.1:如果没有该标记,则表示步骤S7存在断电或者是无待升级的应用程序,程序跳转到原始版本继续运行。
步骤11.2:如果有该标记,计算升级代码区校验和。
步骤12:将计算获得的升级代码区校验和,与配置区记录的校验和比较。
步骤13.1:如果不一致,应用程序跳转到原始版本继续运行;
步骤13.2:如果一致,将升级代码区的升级内容拷贝到APP代码区。
步骤14:拷贝完成后,再次比较升级代码区和APP区内容是否一致:
步骤14.1:如果不一致,跳转到步骤S13.2;
步骤14.2:擦除配置区升级的特殊标记,校验和和长度,应用程序通过内部机制完成重启。
步骤15:应用程序进入引导加载区(Boot loader区),无该特殊标记,跳转到已升级的代码段,升级成功。
本申请物联网嵌入式设备发货后,根据实际需求,通过IOT平台实时的推送升级URL,物联网设备通过URL去下载固件程序后,自动完成固件更新,无需任何人工干预,同时保持原有的配置参数,包括IP、网关和路由信息不变;
另外,支持多台设备并行升级,充分利用MQTT强大的订阅和发布功能,同时利用HTTP的高并发,极大的缩减人工成本。
第二方面,参见图4所示,本申请实施例提供一种物联网设备远程升级装置,其基于第一方面提及的物联网设备远程升级方法,该装置包括:
存储区域划分模块,其用于在物联网设备中配置引导加载区、APP代码区以及升级代码区;
更新文件获取模块,其用于从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码;
文件管理模块,其用于从服务平台下载已安装的应用程序的更新文件,获取更新文件中的APP代码;
程序升级模块,其用于待对升级代码区中的APP代码验证合格后, 对应用程序进行升级;其中,
引导加载区用于存储应用程序对应的引导加载程序代码;
APP代码区用于存储应用程序对应的APP代码;
升级代码区用于存储更新文件中的APP代码;
APP代码为升级时会发生变更的代码。
本申请实施例中,通过对物联网设备的存储区域进行分区,自行下载升级文件,在不影响正常运作的前提下,基于在对应分区存储的升级代码,对应用程序进行更新,为日常工作提供便利。
在具体实施时,物联网设备是通过服务平台(IOT平台)下发的URL地址去下载对应的HEX文件,物联网设备针对HEX文件,将Boot Loader部分的代码丢弃,将APP部分的代码写入到升级代码区。写入完成后,计算该部分校验和,同时将该校验和、当前升级代码区长度以及特殊标记写入到预设的配置区;
然后物联网设备内部通过程序机制完成重启进入Boot Load引导程序,当引导程序检测升级特殊标记,如果有该标记,先计算升级区的校验和,并和配置区的校验和比较,如果一致,开始从升级代码区往APP区拷贝代码,拷贝完成后,清除配置区特殊标记、升级代码长度、校验和,然后自动重启,完成升级过程。
进一步的,该装置还包括:
版本比对模块,其用于将物联网设备安装的应用程序的版本信息通过心跳报定期发送至服务平台,并接收服务平台将物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对后获得的比对结果;
版本比对模块还用于当两个版本信息比对不一致时,接收服务平台发送的升级提示;其中,
升级提示包括升级URL和应用程序最新版本号。
进一步的,程序升级模块还用于识别升级代码区中的APP代码的长度,并将识别出的升级代码区中的APP代码与更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
进一步的,该装置还包括:
程序修复模块,其用于当应用程序升级失败后,基于APP代码区中的APP代码,对应用程序进行修复。
需要说明的是,在本申请中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所申请的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种物联网设备远程升级方法,其特征在于,所述方法包括以下步骤:
    物联网设备从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码;
    所述物联网设备将所述APP代码存储至预设的升级代码区;
    待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级;其中,
    所述物联网设备配置有引导加载区、APP代码区以及升级代码区;
    所述引导加载区用于存储所述应用程序对应的引导加载程序代码;
    所述APP代码区用于存储所述应用程序对应的所述APP代码;
    所述升级代码区用于存储所述更新文件中的所述APP代码;
    所述APP代码为升级时会发生变更的代码。
  2. 如权利要求1所述的物联网设备远程升级方法,其特征在于,所述物联网设备从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码之前,还包括以下步骤:
    所述物联网设备将自身安装的应用程序的版本信息通过心跳报定期发送至所述服务平台;
    所述服务平台将所述物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对;
    当两个版本信息比对不一致时,所述服务平台向所述物联网设备发送升级提示;其中,
    所述升级提示包括升级URL和应用程序最新版本号。
  3. 如权利要求1所述的物联网设备远程升级方法,其特征在于,所述物联网设备从服务平台下载已安装的应用程序的更新文件,获取 所述更新文件中的APP代码时,还会获取所述更新文件中的APP代码的长度;
    所述物联网设备对所述升级代码区中的所述APP代码验证合格,包括以下步骤:
    所述物联网设备识别所述升级代码区中的所述APP代码的长度;
    将识别出的所述升级代码区中的所述APP代码与所述更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
  4. 如权利要求1所述的物联网设备远程升级方法,其特征在于,当所述应用程序升级失败后,所述方法包括以下步骤:
    基于所述APP代码区中的所述APP代码,对所述应用程序进行修复。
  5. 如权利要求1所述的物联网设备远程升级方法,其特征在于,所述方法还包括以下步骤:
    所述物联网设备获取所述更新文件中的APP代码后,向自身预设的配置区生产一升级标记信息。
  6. 如权利要求5所述的物联网设备远程升级方法,其特征在于,待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级,还包括以下步骤:
    待所述物联网设备对所述升级代码区中的所述APP代码验证合格后,识别所述配置区是否存在所述标记信息,
    当存在所述标记信息时,重启所述应用程序,基于所述升级代码区中的所述APP代码对所述应用程序进行升级。
  7. 一种物联网设备远程升级装置,其特征在于,所述装置包括:
    存储区域划分模块,其用于在所述物联网设备中配置引导加载区、APP代码区以及升级代码区;
    更新文件获取模块,其用于从服务平台下载已安装的应用程序的 更新文件,获取所述更新文件中的APP代码;
    文件管理模块,其用于从服务平台下载已安装的应用程序的更新文件,获取所述更新文件中的APP代码;
    程序升级模块,其用于待对所述升级代码区中的所述APP代码验证合格后,对所述应用程序进行升级;其中,
    所述引导加载区用于存储所述应用程序对应的引导加载程序代码;
    所述APP代码区用于存储所述应用程序对应的所述APP代码;
    所述升级代码区用于存储所述更新文件中的所述APP代码;
    所述APP代码为升级时会发生变更的代码。
  8. 如权利要求7所述的物联网设备远程升级装置,其特征在于,所述装置还包括:
    版本比对模块,其用于将所述物联网设备安装的应用程序的版本信息通过心跳报定期发送至所述服务平台,并接收所述服务平台将所述物联网设备的应用程序的版本信息与服务器的应用程序的版本信息进行比对后获得的比对结果;
    所述版本比对模块还用于当两个版本信息比对不一致时,接收所述服务平台发送的升级提示;其中,
    所述升级提示包括升级URL和应用程序最新版本号。
  9. 如权利要求7所述的物联网设备远程升级装置,其特征在于:
    所述程序升级模块还用于识别所述升级代码区中的所述APP代码的长度,并将识别出的所述升级代码区中的所述APP代码与所述更新文件中的APP代码的长度进行比对,若长度一致则验证合格。
  10. 如权利要求7所述的物联网设备远程升级装置,其特征在于,所述装置还包括:
    程序修复模块,其用于当所述应用程序升级失败后,基于所述APP 代码区中的所述APP代码,对所述应用程序进行修复。
PCT/CN2021/104181 2021-05-19 2021-07-02 一种物联网设备远程升级方法及装置 WO2022241918A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110545579.X 2021-05-19
CN202110545579.XA CN113282316A (zh) 2021-05-19 2021-05-19 一种物联网设备远程升级方法及装置

Publications (1)

Publication Number Publication Date
WO2022241918A1 true WO2022241918A1 (zh) 2022-11-24

Family

ID=77279895

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/104181 WO2022241918A1 (zh) 2021-05-19 2021-07-02 一种物联网设备远程升级方法及装置

Country Status (2)

Country Link
CN (1) CN113282316A (zh)
WO (1) WO2022241918A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114322244B (zh) * 2021-09-09 2023-02-28 青岛海尔空调电子有限公司 程序升级方法、装置及多联机空调系统
CN114339634B (zh) * 2021-12-28 2023-05-02 武汉天喻信息产业股份有限公司 物联网设备数据短信发送方法、系统、设备及存储介质
CN114745267A (zh) * 2022-03-28 2022-07-12 杭州涂鸦信息技术有限公司 一种功能更新方法及相关装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002084484A2 (en) * 2001-04-18 2002-10-24 Domosys Corporation Method of remotely upgrading firmware in field-deployed devices
CN109189445A (zh) * 2018-10-12 2019-01-11 武汉微智创大科技有限公司 一种物联网设备程序升级的方法
CN110618830A (zh) * 2019-08-14 2019-12-27 恒鸿达科技有限公司 一种基于nbiot网络的远程升级方法和系统
CN111142907A (zh) * 2019-12-25 2020-05-12 声耕智能科技(西安)研究院有限公司 离线关键词识别系统分区升级方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376077A (zh) * 2018-02-11 2018-08-07 广东美的厨房电器制造有限公司 控制单元的升级方法和装置
CN108804118B (zh) * 2018-04-25 2023-06-09 顺丰科技有限公司 固件升级方法、设备及存储介质
CN110262820A (zh) * 2019-06-13 2019-09-20 陕西瑞迅电子信息技术有限公司 基于mqtt协议实现ota升级的方法、装置、系统与存储介质
CN112118313B (zh) * 2020-09-17 2023-04-18 紫光展锐(重庆)科技有限公司 一种终端设备远程升级的方法及相关装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002084484A2 (en) * 2001-04-18 2002-10-24 Domosys Corporation Method of remotely upgrading firmware in field-deployed devices
CN109189445A (zh) * 2018-10-12 2019-01-11 武汉微智创大科技有限公司 一种物联网设备程序升级的方法
CN110618830A (zh) * 2019-08-14 2019-12-27 恒鸿达科技有限公司 一种基于nbiot网络的远程升级方法和系统
CN111142907A (zh) * 2019-12-25 2020-05-12 声耕智能科技(西安)研究院有限公司 离线关键词识别系统分区升级方法

Also Published As

Publication number Publication date
CN113282316A (zh) 2021-08-20

Similar Documents

Publication Publication Date Title
WO2022241918A1 (zh) 一种物联网设备远程升级方法及装置
WO2017067448A1 (zh) 一种无线固件升级方法、系统及计算机存储介质
US6330715B1 (en) Method and apparatus for managing software in a network system
US9213537B2 (en) Robust firmware update with recovery logic
CN101778376A (zh) 一种实现固件无线更新的方法及装置
CA2414281C (en) System and method for updating and distributing information
RU2419839C2 (ru) Система и способ обновления программы для мобильного терминала с поддержкой ота
US9471300B2 (en) Wireless firmware upgrades to an alarm security panel
WO2013078951A1 (zh) 软件升级方法和系统
JP2005502971A (ja) ソフトウェアをアップデートする方法、装置、および、システム
TWI533216B (zh) 作業系統更新方法
US20040188511A1 (en) System to automatically process components on a device
US20120117557A1 (en) Method and system for upgrading wireless data card
CN1936844A (zh) 用于更新软件的方法和系统
CN111212121A (zh) 一种用于物联网设备的空中固件升级方法及系统
CN112416406B (zh) 终端设备升级方法、装置、终端设备和介质
CN103530150A (zh) 一种Linux操作系统远程更新的方法
CN112104501A (zh) 一种农机深松物联网终端设备的软件远程升级的方法
CN110874239A (zh) 一种电子设备的空中固件差分升级方法及装置
CN110597545A (zh) 一种基于ota组件的热补丁智能升级方法及系统
CN114840242A (zh) 一种电子设备的系统升级方法、装置及可读存储介质
CN110580167A (zh) 一种系统升级方法、智能设备及服务器
KR100729525B1 (ko) 펌웨어 업데이트 방법 및 시스템
CN112256283A (zh) 用于Android设备的应用版本管控方法及装置
CN115145596A (zh) 一种机器人升级包ota升级方法及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21940367

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE