Upgrading method and device for Internet of things equipment, electronic equipment and storage medium

文档序号:152879 发布日期:2021-10-26 浏览:23次 中文

阅读说明:本技术 一种物联设备的升级方法、装置、电子设备及存储介质 (Upgrading method and device for Internet of things equipment, electronic equipment and storage medium ) 是由 李迅 陈小雷 谢海军 张清华 谢堂健 李伟民 于 2021-06-30 设计创作,主要内容包括:本发明实施例公开了一种物联设备的升级方法、装置、电子设备及存储介质。该方法包括:当检测到存在物联设备的升级程序时,根据升级程序确定至少一个待更新程序层以及对应的程序层升级信息;其中,多个程序层的程序共同构成物联设备的全部软件应用程序;根据各待更新程序层以及对应的程序层升级信息,向物联设备发送升级通知;响应于物联设备的升级确认指令,将升级程序发送至与各待更新程序层的程序层升级信息所匹配的存储地址,以使物联设备进行各待更新程序层的升级。该方法可以在物联设备进行OTA升级时,减少需要的升级量,从而减少升级时长,升级空间的占用,以及需要擦除的芯片空间。(The embodiment of the invention discloses an upgrading method and device of an internet of things device, an electronic device and a storage medium. The method comprises the following steps: when the existence of an upgrading program of the Internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program; the programs of the plurality of program layers jointly form all software application programs of the Internet of things equipment; sending an upgrade notification to the equipment of the Internet of things according to each program layer to be updated and corresponding program layer upgrade information; and responding to an upgrading confirmation instruction of the equipment of the Internet of things, and sending the upgrading program to the storage address matched with the upgrading information of the program layer to be updated so that the equipment of the Internet of things can upgrade the program layer to be updated. The method can reduce the required upgrading amount when OTA upgrading is carried out on the Internet of things equipment, thereby reducing the upgrading time, the occupation of the upgrading space and the chip space required to be erased.)

1. An upgrading method for an internet of things device is characterized by comprising the following steps:

when the existence of an upgrading program of the Internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information;

and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending the upgrade program to a storage address matched with the program layer upgrade information of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

2. The method of claim 1, wherein the program layer comprises: the device comprises a hardware driving layer, a software common layer, a parameter layer, a device function layer and a system base layer;

sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information, wherein the upgrade notification comprises:

when the program layer to be updated is the device function layer, determining at least one device function to be updated in the device function layer and corresponding device function updating information according to the program layer updating information;

and sending an upgrade notification to the equipment of the internet of things according to the equipment function to be updated and the corresponding equipment function upgrade information.

3. The method according to claim 1, wherein sending an upgrade notification to the internet of things device according to each program layer to be updated and corresponding program layer upgrade information comprises:

acquiring equipment information of the Internet of things equipment;

and when the upgrading program is determined to be the program to be upgraded matched with the equipment of the internet of things according to the equipment information and the program layer upgrading information, sending an upgrading notice to the equipment of the internet of things according to each program layer to be upgraded and the corresponding program layer upgrading information.

4. The method of claim 1, wherein the program layer upgrade information comprises: program layer identification, program layer occupied space and program layer preset storage address;

sending the upgrading program to a storage address matched with the program layer upgrading information of each program layer to be updated, wherein the storage address comprises:

when the space amount occupied by the program layer is less than or equal to the space amount corresponding to the preset program layer storage address, sending the upgrading program to the preset program layer storage address matched with the program layer designated by each program layer identifier;

when the space occupied by the program layer is larger than the space corresponding to the preset storage address of the program layer, the upgrading program is sent to a target storage address behind the preset storage address of all the program layers;

informing the target storage address corresponding to the program layer appointed by each program layer identification of the internet of things equipment so as to update the preset storage address of the program layer of the internet of things equipment; alternatively, the first and second electrodes may be,

when the space occupied by the program layer is larger than the space corresponding to the preset storage address of the program layer, the upgrading program is sent to the starting address of the preset storage address of the program layer matched with the program layer appointed by each program layer identification;

determining a pre-increased storage address exceeding a preset storage address of a designated program layer of the program layer identifier according to the difference value between the space occupied by the program layer and the space corresponding to the preset storage address of the program layer;

and informing the internet of things equipment, wherein the program layer mark designates a program layer and then the program layer carries out local movement according to the pre-increased storage address.

5. The method of claim 1, wherein the program layer comprises: upgrading the backup layer;

sending the upgrading program to a storage address matched with the program layer upgrading information of each program layer to be updated so as to enable the internet of things equipment to upgrade each program layer to be updated, wherein the upgrading process comprises the following steps:

and sending the upgrading program to the upgrading backup layer, informing the Internet of things equipment to verify the upgrading program, and locally moving the upgrading program passing the verification in the upgrading backup layer to a storage address matched with the upgrading information of the program layer of each program layer to be updated.

6. The method according to claim 1, wherein sending the upgrade program to a storage address matched with the program layer upgrade information of each program layer to be updated so as to enable the internet of things device to perform upgrade of each program layer to be updated comprises:

acquiring current programs corresponding to the program layers to be updated in the internet of things equipment;

carrying out differential processing on the upgrading program and the current program to obtain a differential program;

and sending the differential program to a storage address matched with the program layer upgrading information of each program layer to be updated, so that the Internet of things equipment carries out differential upgrading on each program layer to be updated.

7. The method according to claim 1, before sending the upgrade program to the memory address matched with the program layer upgrade information of each program layer to be updated in response to an upgrade confirmation instruction of the internet of things device, further comprising:

and acquiring the occupied space amount corresponding to the current programs of the plurality of program layers by the Internet of things equipment, and setting preset storage addresses of the program layers.

8. An upgrading device of an internet of things device is characterized by comprising:

the system comprises a program layer information determining module, a program layer updating module and a program layer updating module, wherein the program layer information determining module is used for determining at least one program layer to be updated and corresponding program layer updating information according to an upgrading program when the existence of the upgrading program of the internet of things equipment is detected; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

the upgrading notification sending module is used for sending upgrading notifications to the equipment of the internet of things according to the program layers to be updated and the corresponding program layer upgrading information;

and the upgrading program sending module is used for responding to an upgrading confirmation instruction of the equipment of the internet of things and sending the upgrading program to the storage address matched with the upgrading information of the program layer of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

9. An electronic device, comprising:

one or more processors;

a storage device for storing one or more programs,

when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.

10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.

Technical Field

The embodiment of the invention relates to the field of intelligent internet of things equipment, in particular to an upgrading method and device of the internet of things equipment, electronic equipment and a storage medium.

Background

With the development of the internet of things technology, intelligent internet of things equipment becomes more and more. The intelligent internet of things device usually needs Technology upgrade, so Over-the-Air Technology (OTA) is a necessary skill of the intelligent internet of things device.

In the prior art, the OTA upgrading scheme of the intelligent Internet of things device is to directly perform whole package upgrading when judging that a program needs to be upgraded. The whole package upgrading mode has the following problems: it needs to consume long time for upgrading, occupies too large upgrading space, and needs to erase large chip space for upgrading.

Disclosure of Invention

The embodiment of the invention provides an upgrading method and device of an internet of things device, an electronic device and a storage medium, which can improve the upgrading speed and reduce the chip erasing times and erasing space.

In a first aspect, an embodiment of the present invention provides an upgrading method for an internet of things device, where the method includes:

when the existence of an upgrading program of the Internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information;

and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending the upgrade program to a storage address matched with the program layer upgrade information of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

In a second aspect, an embodiment of the present invention further provides an upgrading apparatus for an internet of things device, where the apparatus includes:

the system comprises a program layer information determining module, a program layer updating module and a program layer updating module, wherein the program layer information determining module is used for determining at least one program layer to be updated and corresponding program layer updating information according to an upgrading program when the existence of the upgrading program of the internet of things equipment is detected; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

the upgrading notification sending module is used for sending upgrading notifications to the equipment of the internet of things according to the program layers to be updated and the corresponding program layer upgrading information;

and the upgrading program sending module is used for responding to an upgrading confirmation instruction of the equipment of the internet of things and sending the upgrading program to the storage address matched with the upgrading information of the program layer of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

In a third aspect, an embodiment of the present invention further provides an internet of things device, where the device includes:

one or more processors;

a storage device for storing one or more programs,

when the one or more programs are executed by the one or more processors, the one or more processors implement the method for upgrading the internet of things device according to any embodiment of the invention.

In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for upgrading an internet of things device according to any embodiment of the present invention.

The technical scheme of the embodiment of the invention determines at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program when the existence of the upgrading program of the Internet of things equipment is detected; the programs of the plurality of program layers jointly form all software application programs of the Internet of things equipment; sending an upgrade notification to the equipment of the Internet of things according to each program layer to be updated and corresponding program layer upgrade information; and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending an upgrade program to a storage address matched with the upgrade information of the program layer of each program layer to be updated so that the equipment of the internet of things can upgrade each program layer to be updated, thereby solving the problem of OTA upgrade of the equipment of the internet of things, reducing the required upgrade amount when the equipment of the internet of things is upgraded by OTA, and further reducing the upgrade time, the occupation of the upgrade space and the effect of the chip space required to be erased.

Drawings

Fig. 1a is a flowchart of an upgrading method for an internet of things device according to an embodiment of the present invention;

fig. 1b is a schematic diagram illustrating program layer division of all software applications of an internet of things device according to an embodiment of the present invention;

fig. 2a is a flowchart of an upgrading method for an internet of things device according to a second embodiment of the present invention;

fig. 2b is a flowchart of an upgrading method for an internet of things device according to a second embodiment of the present invention;

fig. 3 is a schematic structural diagram of an upgrading apparatus of an internet of things device according to a third embodiment of the present invention;

fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.

Example one

Fig. 1a is a flowchart of an upgrading method for an internet of things device according to an embodiment of the present invention, where this embodiment is applicable to a case of performing OTA upgrade on an internet of things device, and the method may be executed by an upgrading apparatus for an internet of things device, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in an electronic device such as a server or a cloud computing terminal, as shown in fig. 1a, and the method specifically includes:

and step 110, when the existence of the upgrading program of the internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program.

The internet of things equipment can be equipment for communicating through the internet of things. For example, the internet of things device may be a device that needs to obtain the OTA program download through the internet of things technology in the cloud. Illustratively, the internet of things device may be a water heater. The upgrading program can be a corresponding program when the function of the internet of things equipment is upgraded based on the current function.

In the embodiment of the present invention, the upgrade program may be a part of programs in all software applications corresponding to the internet of things device when the internet of things device implements all functions. Specifically, in the embodiment of the present invention, all software applications may be divided according to definition or use of software layers, and the like, so as to generate programs corresponding to different program layers. The upgrade program may be a program corresponding to one or more program layers. Wherein, the programs of a plurality of program layers can jointly form all the software applications of the internet of things device.

In an optional implementation manner of the embodiment of the present invention, fig. 1b is a schematic diagram of program layer division of all software applications of an internet of things device according to an embodiment of the present invention. As shown in fig. 1b, the program layer of the internet of things device includes: a hardware driver layer, a software common layer, a parameter layer, a device function layer, and a system base layer. The hardware driving layer is mainly a bottom hardware driving program of a bottom plate of the internet of things equipment, such as a bottom hardware driving program of a single chip microcomputer, and the upgrading probability is very low. The software common layer is mainly a program of the software common part. For example, the software common layer may be a program corresponding to a charged Erasable Programmable read only memory (EEPROM) or a temperature detection device provided in the water heater. The probability of program upgrade at the software common layer is also low. The parameter layer mainly stores parameter data required in the operation process of the Internet of things equipment, such as the size of an E2PROM in a water heater, default set temperature and the like. The parameter layer can be parameter data required by the operation of the internet of things equipment. The parameter layer has upgrading requirements, the space occupied by the parameter layer is usually small, and all parameters in the equipment of the internet of things can be upgraded synchronously during upgrading. The device function layer may be a program layer corresponding to the implementation of the functions of the internet of things device. The device function layer may be formed by a plurality of device functions, each device function may be independent, and may be upgraded separately for one of the device functions, and the specific upgrade manner may be the same as that of the program layer. The system base layer can be responsible for the normal operation of the whole equipment in the internet of things. For example, the system base layer may include an initialization call of hardware, an actual operation of the system, and a call execution of each device function.

In the embodiment of the present invention, the manner of determining the program layer to be updated and the corresponding program layer upgrade information may be various. For example, the upgrade program may have identification information of a program layer to be updated and program layer upgrade information; or, the upgrade program may be compiled to obtain the identification information of the program layer to be updated, the program layer upgrade information, and the like. The program layer upgrade information may be additional information when the program layer is upgraded. For example, the program layer upgrade information may be information that interprets or introduces the upgrade program. Optionally, the program layer upgrade information may include: program layer identification, the amount of space occupied by the program layer, the preset storage address of the program layer, the version number of the upgrading program and the like. The program layer preset storage address may include a program layer preset storage start address and an end address.

And step 120, sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and the corresponding program layer upgrade information.

The cloud end can send an upgrade notification to the equipment of the internet of things to inform the program layer needing to be upgraded and related upgrade information of the equipment of the internet of things, so that the equipment of the internet of things can be upgraded when being prepared for upgrading, and the current equipment function of the equipment of the internet of things is optimized.

In an optional implementation manner of the embodiment of the present invention, sending an upgrade notification to an internet of things device according to each program layer to be updated and corresponding program layer upgrade information includes: when the program layer to be updated is the device function layer, determining at least one device function to be updated in the device function layer and corresponding device function updating information according to the program layer updating information; and sending an upgrade notification to the equipment of the Internet of things according to the equipment function to be updated and the corresponding equipment function upgrade information.

In order to further reduce the upgrade amount and increase the upgrade speed, the device function layer may have a plurality of programs corresponding to the device functions, and each device function may be upgraded separately. When the device function layer is upgraded, the upgrading may be performed according to the device function. Specifically, the program layer upgrade information may have related information of the function of the device to be updated. For example, the program layer upgrade information may include identification information of the device function to be updated, device function upgrade information, and the like. The device function upgrading information may include a device function identifier, a device function occupied space amount, a device function preset storage address, a version number of the upgrading program, and the like. The device function preset storage address may include a start address and an end address.

The cloud end can send an upgrade notification to the equipment of the internet of things to inform the equipment of the functions of the equipment of the internet of things needing to be upgraded and related upgrade information, so that the equipment of the internet of things can be upgraded conveniently when the equipment of the internet of things is ready for upgrading, and the current equipment function of the equipment of the internet of things is optimized.

In an optional implementation manner of the embodiment of the present invention, sending an upgrade notification to an internet of things device according to each program layer to be updated and corresponding program layer upgrade information includes: acquiring equipment information of the Internet of things equipment; and when the upgrading program is determined to be the program to be upgraded matched with the equipment of the internet of things according to the equipment information and the program layer upgrading information, sending an upgrading notice to the equipment of the internet of things according to each program layer to be upgraded and the corresponding program layer upgrading information.

The device information may be the model of the internet of things device, chip information used by the internet of things device, information of all software applications, and the like. Specifically, the device information may include a model of the single chip, storage address information of each program layer or each device function in the memory, Subscriber Identity Module (SIM) information, a version number of a current software application, and the like.

Before sending the upgrade notification to the internet of things device, it may be determined whether the upgrade program is a program to be upgraded that matches the internet of things device. Specifically, the device information may be compared with the program layer upgrade information or the device function upgrade information, and whether the upgrade program is the program to be upgraded that is matched with the internet of things device is determined according to the comparison result.

For example, the version number of the current software application program of the device information may be compared with the version number of the upgrade program in the program layer upgrade information or the device function upgrade information, and when the version corresponding to the version number of the upgrade program is a version after the version number of the current software application program, it is determined to send an upgrade notification to the equipment of the internet of things. Or, the program layer upgrading information or the device function upgrading information may include the model of the single chip microcomputer and/or SIM information. When the single chip microcomputer model and/or the SIM information in the program layer upgrading information or the equipment function upgrading information is consistent with the single chip microcomputer model and/or the SIM information in the equipment information of the equipment of the internet of things, the upgrading program can be determined to be suitable for the equipment of the internet of things. And then, whether an upgrade notification is sent to the Internet of things equipment is determined through comparison of the version numbers.

And step 130, responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending the upgrade program to the storage address matched with the upgrade information of the program layer to be updated so that the equipment of the internet of things can upgrade the program layer to be updated.

When the internet of things device receives the upgrade notification, the internet of things device can wait for the upgrade confirmation instruction of the user. For example, the internet of things device may send an upgrade notification to the user through an intelligent terminal such as a mobile phone, and the user may confirm the upgrade. The internet of things equipment can respond to the cloud according to the upgrading confirmation instruction of the user. Or the cloud end can directly send the upgrade notification to the user through the intelligent terminal and obtain the upgrade confirmation instruction of the user.

In the embodiment of the present invention, the program layer upgrade information may include a program layer preset storage address, and the upgrade program may be directly sent to the program layer preset storage address matched with the program layer to be updated in the internet of things device. When the program of the equipment of the internet of things is upgraded, the program of the preset storage address of the program layer to be updated can be upgraded, the programs of other program layers do not need to be upgraded, the upgrading amount can be obviously reduced, the upgrading speed is improved, the space of a memory in the equipment of the internet of things, which needs to be erased, can be reduced, and the erasing times are reduced.

Correspondingly, when the device function needs to be upgraded is a certain device function in the device function layers, the device function upgrading information may include a device function preset storage address, and the upgrading program may be directly sent to the storage address matched with the device function to be updated in the internet of things device. When the program of the equipment of the internet of things is upgraded, the program of the preset storage address of the function of the equipment to be updated can be upgraded, the program of the function of other equipment does not need to be upgraded, the upgrading amount can be further reduced, the occupation of a network link is saved, the upgrading speed is further improved, and the space and the times of erasing are reduced.

In an alternative implementation of the embodiment of the present invention, as shown in fig. 1b, the program layer includes: upgrading the backup layer; sending the upgrading program to a storage address matched with the program layer upgrading information of each program layer to be updated so as to enable the internet of things equipment to upgrade each program layer to be updated, wherein the upgrading process comprises the following steps: and sending the upgrading program to an upgrading backup layer, informing the Internet of things equipment to verify the upgrading program, and locally moving the upgrading program passing the verification in the upgrading backup layer to a storage address matched with the upgrading information of the program layer of each program layer to be updated.

As shown in fig. 1b, the upgrade backup layer may be a program layer responsible for performing cache backup on the upgrade program. Specifically, the upgrade program may be cached in the upgrade backup layer. The equipment of the internet of things can verify the upgrading program in the upgrading backup layer, and the upgrading is carried out after the verification is finished. The upgrading program can be upgraded without acquiring the upgrading program through upgrading layering, so that a user can acquire the upgrading program while using a product, the time of using the internet of things equipment by the user when the upgrading program is downloaded is reduced, and the user experience is improved. Meanwhile, after the cache of the upgrading program is checked, the upgrading program is started to upgrade to the appointed storage address, so that the upgrading speed is further increased, and the experience of noninductive upgrading can be basically achieved. And the upgrading program is stored in the upgrading backup layer after upgrading is finished, if the problem exists in the Internet of things equipment in the later period, the flashing upgrading can be carried out again, and an additional backup function is provided for the upgrading program.

According to the technical scheme of the embodiment, when the existence of the upgrading program of the internet of things equipment is detected, at least one program layer to be updated and corresponding program layer upgrading information are determined according to the upgrading program; the programs of the plurality of program layers jointly form all software application programs of the Internet of things equipment; sending an upgrade notification to the equipment of the Internet of things according to each program layer to be updated and corresponding program layer upgrade information; and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending an upgrade program to a storage address matched with the upgrade information of the program layer of each program layer to be updated so that the equipment of the internet of things can upgrade each program layer to be updated, the problem of OTA (over the air) upgrade of the equipment of the internet of things is solved, and the reduction of the required upgrade amount is realized, thereby reducing the upgrade duration, the occupation of the upgrade space and the effect of the chip space required to be erased.

Example two

Fig. 2a is a flowchart of an upgrading method for an internet of things device according to a second embodiment of the present invention. The present embodiment is a further refinement of the above technical solutions, and the technical solutions in the present embodiment may be combined with various alternatives in one or more of the above embodiments. Specifically, the method comprises the following steps:

in an optional implementation manner of the embodiment of the present invention, the program layer upgrade information includes: program layer identification, program layer occupied space and program layer preset storage address;

sending the upgrading program to a storage address matched with the program layer upgrading information of each program layer to be updated, wherein the method comprises the following steps:

when the space occupied by the program layer is less than or equal to the space corresponding to the preset storage address of the program layer, the upgrading program is sent to the preset storage address of the program layer matched with the program layer specified by each program layer identifier;

when the space occupied by the program layer is larger than the space corresponding to the preset storage address of the program layer, the upgrading program is sent to a target storage address behind the preset storage address of all the program layers;

informing the target storage address corresponding to the program layer appointed by each program layer identification of the internet of things equipment so as to update the preset storage address of the program layer by the internet of things equipment; alternatively, the first and second electrodes may be,

when the occupied space amount of the program layer is larger than the space amount corresponding to the preset storage address of the program layer, the upgrading program is sent to the initial address of the preset storage address of the program layer matched with the program layer appointed by each program layer identification;

determining a pre-increased storage address exceeding a preset storage address of a program layer designated by a program layer identifier according to the difference value between the space occupied by the program layer and the space corresponding to the preset storage address of the program layer;

and informing the internet of things equipment, and enabling the program layer mark to designate the program layer and then the program layer to perform local movement according to the pre-increased storage address.

As shown in fig. 2a, the upgrading method for the internet of things device provided by the second embodiment of the present invention can be refined as follows:

step 210, when it is detected that there is an upgrade program of the internet of things device, determining at least one program layer to be updated and corresponding program layer upgrade information according to the upgrade program.

Wherein the programs of the plurality of program layers jointly form all software applications of the internet of things device. The program layer comprises: the system comprises a hardware driving layer, a software public layer, a parameter layer, a device function layer, a system base layer and an upgrading backup layer.

And step 220, when the program layer to be updated is the device function layer, determining at least one device function to be updated in the device function layer and corresponding device function updating information according to the program layer updating information.

Step 230, sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information; and/or sending an upgrade notification to the equipment of the internet of things according to the equipment function to be updated and the corresponding equipment function upgrade information.

In an optional implementation manner of the embodiment of the present invention, sending an upgrade notification to an internet of things device includes: acquiring equipment information of the Internet of things equipment; and when the upgrading program is determined to be the program to be upgraded matched with the equipment of the internet of things according to the equipment information, the program layer upgrading information and/or the equipment function upgrading information, sending an upgrading notice to the equipment of the internet of things.

And step 240, responding to an upgrade confirmation instruction of the equipment of the internet of things, sending the upgrade program to the upgrade backup layer, informing the equipment of the internet of things to verify the upgrade program, and locally moving the upgrade program passing the verification in the upgrade backup layer to a storage address matched with the upgrade information of the program layer of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

In an optional implementation manner of the embodiment of the present invention, the program layer upgrade information includes: program layer identification, program layer occupation space and program layer preset storage address. The amount of space occupied by the program layer may be the amount of space occupied by the program layer required for upgrading the program, and specifically, may be the size of the upgraded program.

In an optional implementation manner of the embodiment of the present invention, sending the upgrade program to the storage address matched with the program layer upgrade information of each program layer to be updated, or notifying the internet of things device to locally move the upgrade program that passes the verification in the upgrade backup layer to the storage address matched with the program layer upgrade information of each program layer to be updated includes:

when the space occupied by the program layer is less than or equal to the space corresponding to the preset storage address of the program layer, the upgrading program is sent to the preset storage address of the program layer matched with the program layer specified by each program layer identifier;

when the space occupied by the program layer is larger than the space corresponding to the preset storage address of the program layer, the upgrading program is sent to a target storage address behind the preset storage address of all the program layers; informing the target storage address corresponding to the program layer appointed by each program layer identification of the internet of things equipment so as to update the preset storage address of the program layer by the internet of things equipment; alternatively, the first and second electrodes may be,

when the occupied space amount of the program layer is larger than the space amount corresponding to the preset storage address of the program layer, the upgrading program is sent to the initial address of the preset storage address of the program layer matched with the program layer appointed by each program layer identification; determining a pre-increased storage address exceeding a preset storage address of a program layer designated by a program layer identifier according to the difference value between the space occupied by the program layer and the space corresponding to the preset storage address of the program layer; and informing the internet of things equipment, and enabling the program layer mark to designate the program layer and then the program layer to perform local movement according to the pre-increased storage address.

Specifically, in the embodiment of the present invention, each device function in each program layer or each device function layer has a preset storage address. The problem of space reservation can be considered when the preset storage address is set, but if the space reservation is too large, the space occupied by the preset storage address is too large, which is not beneficial to the normal operation of the chip; if the space reservation is too small, the space amount required by the upgrading program exceeds the space amount corresponding to the preset storage address, so that the upgrading program cannot be normally stored in the preset storage address.

In order to solve the above problem, an embodiment of the present invention provides a method for determining a storage manner of an upgrade program according to a relationship between an amount of space occupied by the upgrade program and an amount of space corresponding to a preset storage address.

When the space amount occupied by the program layer is less than or equal to the space amount corresponding to the preset storage address of the program layer, namely the upgrading program can be normally stored in the preset storage address, the upgrading program can be directly sent to the preset storage address of the program layer matched with the program layer specified by each program layer identifier.

Specifically, when the amount of space occupied by the program layer is less than or equal to the amount of space corresponding to the preset program layer storage address, the upgrade program may be cached in the upgrade backup layer, the internet of things device is notified to perform upgrade program verification, and after the verification is passed, the upgrade program is locally moved to the preset program layer storage address matched with the program layer specified by the program layer identifier. In this case, the internet-of-things device may be used to determine the amount of space.

When the space amount occupied by the program layer is larger than the space amount corresponding to the preset storage address of the program layer, that is, the upgrade program cannot be normally stored in the preset storage address, any one of the following two solutions can be adopted.

The first one is: sending the upgrading program to a target storage address behind the preset storage addresses of all the program layers; and informing the target storage address corresponding to the program layer appointed by each program layer identifier of the internet of things equipment so as to update the preset storage address of the program layer by the internet of things equipment. Specifically, the preset storage address may be updated to a destination storage address after all the program layers are stored. The content in the current preset storage address corresponding to the program layer appointed by the program layer identification can be erased, so that the occupied space is reduced, and other contents are stored.

Specifically, when the amount of space occupied by the program layer is greater than the amount of space corresponding to the preset storage address of the program layer, the upgrade program may be cached in the upgrade backup layer, the internet of things device is notified to perform upgrade program verification, and after the verification is passed, the upgrade program is locally moved to the target storage address corresponding to the program layer specified by the program layer identifier, and the preset storage address of the program layer is updated. At this time, the internet of things device can judge the size of the space and determine the destination storage address.

The second method is as follows: sending the upgrading program to the starting address of the program layer preset storage address matched with the program layer appointed by each program layer identification; determining a pre-increased storage address exceeding a preset storage address of a program layer designated by a program layer identifier according to the difference value between the space occupied by the program layer and the space corresponding to the preset storage address of the program layer; and informing the internet of things equipment, and enabling the program layer mark to designate the program layer and then the program layer to perform local movement according to the pre-increased storage address.

The pre-increased storage address may be a storage address that needs to be increased when the size of the upgrade program exceeds the amount of space corresponding to the preset storage address. For example, the size of the upgrade program is 3.5KB, the amount of space corresponding to the preset memory address is 3KB, and the pre-added memory address may be a memory address with 0.5KB of space after the preset memory address. That is, the program layers after the program layer identification specifies the program layer can all be moved backward, giving up an amount of space of 0.5 KB. The internet of things equipment can locally preset the updating of the storage address at the moment, so that the program calling is facilitated.

Specifically, when the amount of space occupied by the program layer is greater than the amount of space corresponding to the preset program storage address of the program layer, the upgrade program may be cached in the upgrade backup layer, the internet of things device is notified to perform upgrade program verification, after the verification is passed, the upgrade program is locally moved to the starting address of the preset program storage address of the program layer matched with the program layer specified by the program layer identifier, and the program layer after the program layer identifier specifies the program layer is locally moved according to the pre-increased storage address. At this time, the internet-of-things device can judge the size of the space and determine the pre-increased storage address. Since the local moving speed is much faster than the program downloading speed from the cloud, the second mode does not significantly affect the upgrading speed.

The technical scheme of the embodiment of the invention solves the problem that the existing preset storage address can not meet the requirement of normal storage of the upgrading program through the first or second mode, and can normally store the upgrading program without influencing the upgrading speed. When the upgrade program is a device function in the device function layer, the same method as described above may be used to compare the space amount between the upgrade program and the preset storage address, and determine the specific storage method of the upgrade program, which is not described herein again.

On the basis of the foregoing embodiment, optionally, before sending the upgrade program to the storage address matched with the program layer upgrade information of each program layer to be updated in response to the upgrade confirmation instruction of the internet of things device, the method further includes: and acquiring the occupied space amount corresponding to the current programs of the plurality of program layers by the Internet of things equipment, and setting preset storage addresses of the program layers.

The internet of things equipment can preset the storage address according to the occupied space corresponding to the current program of the program layer, can accurately erase and write the program only aiming at a certain preset storage address, realizes program upgrading of a certain program layer, reduces the erasing amount and the writing amount during program upgrading, and improves the upgrading speed.

Specifically, for each device function in each program layer or device function layer, when the occupied space amount is less than 1KB, the preset storage address allocation principle is set according to 1KB, so that the program shoe-cleaning can be facilitated during upgrading, and the reserved space amount can be reserved with subsequent program upgrading, thereby facilitating upgrading. When the device function occupies a small space, the device function and other device functions can be divided into the same preset storage address, so that the purpose of saving space can be achieved. When the occupied space of the equipment function is large, the preset storage address can be divided independently, independent upgrade is facilitated, and influence on other equipment functions is avoided.

For example, table 1 is an exemplary preset storage address setting table of the internet of things device for each program layer (except the device function layer); table 2 is an exemplary preset storage address setting table of the internet of things device for each device function in the device function layers.

TABLE 1

TABLE 2

As shown in tables 1 and 2, the internet of things device may determine the preset storage address according to the mode that the occupied space amount is less than 1KB and the calculation is performed according to 1KB, so as to conveniently reserve the space. As shown in table 2, the preset memory addresses of the device functions that occupy a smaller amount of space can be merged, thereby saving space.

On the basis of the foregoing embodiment, optionally, sending the upgrade program to the storage address matched with the program layer upgrade information of each program layer to be updated, so that the internet of things device performs upgrade on each program layer to be updated, where the upgrade method includes: acquiring current programs corresponding to the program layers to be updated in the internet of things equipment; carrying out differential processing on the upgrading program and the current program to obtain a differential program; and sending the differential program to a storage address matched with the program layer upgrading information of each program layer to be updated so as to enable the Internet of things equipment to carry out differential upgrading on each program layer to be updated.

The difference processing may be content difference comparison between the current program and the upgraded program. The difference program may be a program that requires modification of the current program, as determined by the upgrade program. Specifically, the difference program may be a program that needs to be added or deleted in the current program. The differential upgrade may be a modification based on the current program according to the differential program, so that the current program is updated to the upgrade program.

In the embodiment of the invention, the differential program can be differentially upgraded aiming at each program layer or each equipment function, so that the differential upgrading of all software application programs can be avoided, the content needing to be upgraded and updated can be further reduced, the upgrading speed is improved, and the program content needing to be erased and written is reduced.

According to the technical scheme of the embodiment, when the existence of the upgrading program of the internet of things equipment is detected, at least one program layer to be updated and corresponding program layer upgrading information are determined according to the upgrading program; when the program layer to be updated is the device function layer, determining at least one device function to be updated in the device function layer and corresponding device function updating information according to the program layer updating information; sending an upgrade notification to the equipment of the Internet of things according to each program layer to be updated and corresponding program layer upgrade information; and/or sending an upgrade notification to the equipment of the internet of things according to the equipment function to be updated and the corresponding equipment function upgrade information; and responding to an upgrade confirmation instruction of the equipment of the internet of things, sending the upgrade program to the upgrade backup layer, informing the equipment of the internet of things to verify the upgrade program, and locally moving the upgrade program passing the verification in the upgrade backup layer to a storage address matched with the upgrade information of the program layer of each program layer to be updated, so that the equipment of the internet of things upgrades the program layers to be updated, the problem of program upgrade of the equipment of the internet of things is solved, and the effects of improving the upgrade speed, reducing the program erasing and writing amount and backing up the upgrade program to facilitate exception handling are realized.

Fig. 2b is a flowchart of an upgrading method for an internet of things device according to a second embodiment of the present invention, and as shown in fig. 2b, a using process of the upgrading method for the internet of things device according to the second embodiment of the present invention may be:

when the cloud detects that the internet of things device needs to be upgraded, the specific device function in the program layer or the device function which needs to be upgraded can be determined. For example, the determination may be based on a program layer identifier or a device function identifier in the upgrade program. Compiling the upgrading program, analyzing the space occupied by the upgrading program, and determining a program layer to be upgraded or a preset storage address corresponding to the equipment function. And determining the storage mode of the upgrading program according to the comparison relation between the occupied space amount and the space amount corresponding to the preset storage address. And packaging the upgrading program and the corresponding upgrading information, uploading the upgrading program and the corresponding upgrading information to a server, and finishing upgrading preparation by the server. The program can be upgraded through the Internet of things equipment through the intelligent terminal, and the equipment information of the Internet of things equipment is obtained. And comparing the equipment information with the upgrading information to determine whether the upgrading program is a program which needs to be upgraded for the Internet of things equipment. For example, it may be determined whether the upgrade information is consistent with information in the device information, such as the information may be a single chip microcomputer model and/or SIM information. And when the information is consistent, comparing the version numbers of the programs, and when the version corresponding to the version number of the upgrading program is a version behind the version number of the current software application program, determining that the upgrading program is a program which needs to be upgraded by the equipment of the internet of things. The internet of things equipment can acquire the packaged upgrading program in the server, and store the upgrading program in the upgrading backup layer for verification. The internet of things device can verify whether each frame of the data packet and the whole data packet have an exception through checking, for example, Cyclic Redundancy Check (CRC). When the verification is passed, the Internet of things equipment can upgrade the upgrading program to the corresponding storage address according to the determined storage mode and carry out upgrading verification. And when the upgrading is verified to be free of problems, determining that the upgrading is successful.

The technical scheme of the embodiment of the invention solves the problem of overlarge upgrade package of the equipment of the Internet of things, changes the original upgrade mode of the whole data package into the upgrade of a single program layer or a single equipment function, improves the upgrade efficiency, reduces the space occupation of the data package, and simultaneously reduces the erasing and writing times of the memory space of the singlechip. And when backup upgrading is carried out, the occupied space can be greatly reduced. Compared with the prior art, the method needs to store the whole data packet, only a certain upgraded program layer or a program corresponding to the device function needs to be stored, and space is saved.

The differential upgrade in the embodiment of the present invention is not directed to the differential case of the entire data packet, nor to the differential case of the entire data packet performed according to the data volume, but is directed to a certain program layer or device function, and is embodied by a part of the data packet. If the problem exists after upgrading, the problem is that only one device function exists, and the whole device application cannot be influenced.

EXAMPLE III

Fig. 3 is a schematic structural diagram of an upgrading apparatus of an internet of things device according to a third embodiment of the present invention. With reference to fig. 3, the apparatus comprises: a program layer information determining module 310, an upgrade notification transmitting module 320, and an upgrade program transmitting module 330. Wherein:

the program layer information determining module 310 is configured to determine, when it is detected that an upgrade program of the internet of things device exists, at least one program layer to be updated and corresponding program layer upgrade information according to the upgrade program; the programs of the plurality of program layers jointly form all software application programs of the Internet of things equipment;

the upgrade notification sending module 320 is configured to send an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information;

the upgrade program sending module 330 is configured to send, in response to an upgrade confirmation instruction of the internet of things device, the upgrade program to the storage address matched with the program layer upgrade information of each program layer to be updated, so that the internet of things device performs upgrade on each program layer to be updated.

Optionally, the program layer includes: the device comprises a hardware driving layer, a software common layer, a parameter layer, a device function layer and a system base layer;

the upgrade notification sending module 320 includes:

the device function information determining unit is used for determining at least one device function to be updated in the device function layer and corresponding device function upgrading information according to the program layer upgrading information when the program layer to be updated is the device function layer;

and the upgrade notification sending unit is used for sending an upgrade notification to the equipment of the internet of things according to the equipment function to be updated and the corresponding equipment function upgrade information.

Optionally, the upgrade notification sending module 320 includes:

the equipment information acquisition unit is used for acquiring equipment information of the Internet of things equipment;

and the upgrading notification sending unit is used for sending upgrading notifications to the equipment of the internet of things according to the program layers to be updated and the corresponding program layer upgrading information when the upgrading program is determined to be the program to be upgraded matched with the equipment of the internet of things according to the equipment information and the program layer upgrading information.

Optionally, the program layer upgrade information includes: program layer identification, program layer occupied space and program layer preset storage address;

the upgrade program sending module 330 is specifically configured to:

when the space occupied by the program layer is less than or equal to the space corresponding to the preset storage address of the program layer, the upgrading program is sent to the preset storage address of the program layer matched with the program layer specified by each program layer identifier;

when the space occupied by the program layer is larger than the space corresponding to the preset storage address of the program layer, the upgrading program is sent to a target storage address behind the preset storage address of all the program layers;

informing the target storage address corresponding to the program layer appointed by each program layer identification of the internet of things equipment so as to update the preset storage address of the program layer by the internet of things equipment; alternatively, the first and second electrodes may be,

when the occupied space amount of the program layer is larger than the space amount corresponding to the preset storage address of the program layer, the upgrading program is sent to the initial address of the preset storage address of the program layer matched with the program layer appointed by each program layer identification;

determining a pre-increased storage address exceeding a preset storage address of a program layer designated by a program layer identifier according to the difference value between the space occupied by the program layer and the space corresponding to the preset storage address of the program layer;

and informing the internet of things equipment, and enabling the program layer mark to designate the program layer and then the program layer to perform local movement according to the pre-increased storage address.

Optionally, the program layer includes: upgrading the backup layer;

the upgrade program transmitting module 330 includes:

and the upgrading program sending unit is used for sending the upgrading program to the upgrading backup layer, informing the Internet of things equipment to verify the upgrading program, and locally moving the upgrading program passing the verification in the upgrading backup layer to a storage address matched with the upgrading information of the program layer of each program layer to be updated.

Optionally, the upgrade program sending module 330 includes:

the current program acquisition unit is used for acquiring current programs corresponding to the program layers to be updated in the internet of things equipment;

the differential program determining unit is used for carrying out differential processing on the upgrading program and the current program to obtain a differential program;

and the differential program sending unit is used for sending the differential program to the storage address matched with the program layer upgrading information of each program layer to be updated so as to enable the Internet of things equipment to carry out differential upgrading on each program layer to be updated.

Optionally, the apparatus further includes:

and the preset storage address acquisition module is used for acquiring the occupied space amount corresponding to the current programs of the program layers and the preset storage address of the program layer, which is set by the equipment of the internet of things, before the upgrading program is sent to the storage address matched with the program layer upgrading information of each program layer to be updated in response to the upgrading confirmation instruction of the equipment of the internet of things.

The upgrading device of the internet of things equipment provided by the embodiment of the invention can execute the upgrading method of the internet of things equipment provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.

Example four

Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention, and as shown in fig. 4, the electronic device includes:

one or more processors 510, one processor 510 being illustrated in FIG. 4;

a memory 520;

the apparatus may further include: an input device 530 and an output device 540.

The processor 510, the memory 520, the input device 530 and the output device 540 of the apparatus may be connected by a bus or other means, and fig. 4 illustrates the connection by a bus as an example.

The memory 520, which is a non-transitory computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to an upgrading method of an internet of things device in the embodiment of the present invention (for example, the program layer information determining module 310, the upgrading notification transmitting module 320, and the upgrading program transmitting module 330 shown in fig. 3). The processor 510 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 520, namely, implementing the upgrading method of the internet of things device of the above method embodiment, namely:

when the existence of an upgrading program of the Internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information;

and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending the upgrade program to a storage address matched with the program layer upgrade information of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

The memory 520 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 520 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 520 may optionally include memory located remotely from processor 510, which may be connected to a terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input device 530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 540 may include a display device such as a display screen.

EXAMPLE five

Fifth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for upgrading an internet of things device, according to a fifth embodiment of the present invention:

when the existence of an upgrading program of the Internet of things equipment is detected, determining at least one program layer to be updated and corresponding program layer upgrading information according to the upgrading program; the programs of the plurality of program layers jointly form all software applications of the Internet of things equipment;

sending an upgrade notification to the equipment of the internet of things according to each program layer to be updated and corresponding program layer upgrade information;

and responding to an upgrade confirmation instruction of the equipment of the internet of things, and sending the upgrade program to a storage address matched with the program layer upgrade information of each program layer to be updated so as to upgrade each program layer to be updated by the equipment of the internet of things.

Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:应用升级方法、装置、计算机设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!