Upgrading method and related equipment of Internet of Things terminal equipment
Through a hierarchical and distributed two-way verification mechanism and the distribution method of supervised equipment, the problems of low security and efficiency in the OTA upgrade process of IoT devices are solved, and high security and efficient OTA upgrades are achieved.
Patent Information
- Application Number
- CN202011060564.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-30
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-09-30
AI Technical Summary
There are security problems during the OTA upgrade process of IoT devices. Potential attackers can crack or tamper with the issued application/firmware code. The traditional two-way connection upgrade method is inefficient and difficult to adapt to the batch upgrade of large-scale IoT devices.
Using a hierarchical and distributed two-way verification mechanism, the supervision equipment and server are selected in the LAN for two-way verification. After issuing the upgrade file, each terminal device performs verification value and identity verification, and only upgrades the file after the verification is passed. Replace, reduce the number of bidirectional connections and improve the upgrade speed.
It realizes high security and high efficiency of OTA upgrades in IoT devices, reduces the number of two-way connections between servers and terminal devices, improves the upgrade speed, and promptly detects terminal devices that have been tampered or compromised.
Smart Images

Figure CN114362981B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of Internet of Things, and in particular to an upgrade method for an Internet of Things terminal device and related equipment. Background Art
[0002] For IoT devices, the hardware cannot be changed after leaving the factory. In order to expand its capabilities and make up for vulnerabilities, application and firmware upgrades are very necessary. The traditional upgrade method requires IoT devices to leave physical interfaces on the hardware, and the devices are connected on site via cables to upgrade the applications and firmware. The traditional method is time-consuming and labor-intensive. With the expansion of the scale of the IoT, this method is no longer feasible. Therefore, more and more IoT devices choose the Over-The-Air (OTA) upgrade method.
[0003] The OTA upgrade method only retains the wireless communication interface on the IoT device side to upgrade the program. The server sends the new application / firmware to the IoT terminal device through wireless communication. The terminal device replaces the old code with the new application / firmware code to complete the upgrade.
[0004] During the OTA upgrade process, since data is transmitted wirelessly in the air, anyone can receive the data for analysis. Anyone can try to send their own data in the same frequency band to interfere with or imitate the OTA upgrade, which means that potential attackers can try to crack the issued application / firmware code or inject illegal applications / firmware into the terminal device. Therefore, security in OTA upgrades is particularly important.
[0005] In some cases, in order to improve the security of OTA upgrades, the server and the terminal device are required to establish a one-to-one two-way connection, which makes the upgrade process slow and inefficient. Summary of the invention
[0006] In view of this, the present disclosure proposes an upgrade method for an Internet of Things terminal device and related equipment.
[0007] In a first aspect of the present disclosure, a method for upgrading an IoT terminal device is provided, which is applied to a server and includes:
[0008] Determine a supervisory device and perform two-way authentication with the supervisory device;
[0009] In response to the two-way verification being passed, a first upgrade instruction is sent to the supervisory device or the terminal device, wherein the first upgrade instruction includes an encrypted upgrade file, server identity information and a first verification value.
[0010] Optionally, if the supervisory device is a gateway device in an Internet of Things system, performing two-way verification with the supervisory device includes:
[0011] Sending a second upgrade instruction to the supervision device, wherein the second upgrade instruction includes encrypted server identity certification information;
[0012] receiving first confirmation information returned by the supervisory device, wherein the first confirmation information includes encrypted supervisory device identity certification information;
[0013] The first confirmation information is decrypted and the identity certification information of the supervisory device is verified.
[0014] Optionally, the method for upgrading the Internet of Things terminal device further includes:
[0015] receiving second confirmation information returned by the supervisory device, wherein the second confirmation information includes the encrypted supervisory device identity information and the terminal device identity information and the second verification value returned by each terminal device;
[0016] Comparing the first verification value and the second verification value;
[0017] If the first verification value and the second verification value are consistent, sending a first upgrade completion confirmation message to the supervision device;
[0018] If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device is recorded and a first warning message is output.
[0019] Optionally, if the supervisory device is a terminal device in an Internet of Things system, determining the supervisory device and performing two-way verification with the supervisory device includes:
[0020] Sending a third upgrade instruction and a campaign instruction to at least two terminal devices in at least one local area network, wherein the third upgrade instruction includes encrypted server identity information, and the campaign instruction is used to enable the at least two terminal devices in the at least one local area network to campaign for a supervisory device;
[0021] Receive third confirmation information returned by the terminal device running for the supervisory device and fourth confirmation information of at least one terminal device among the non-supervisory devices in the at least one local area network, wherein the third confirmation information includes encrypted terminal device identity certification information of the terminal device running for the supervisory device, and the fourth confirmation information includes encrypted terminal device identity certification information of the terminal device running for the supervisory device received by at least one terminal device among the non-supervisory devices;
[0022] Decrypting the third confirmation information and the fourth confirmation information and comparing the terminal device identity information in the third confirmation information and the fourth confirmation information;
[0023] In response to the terminal device identity verification being passed, the terminal device running to become the supervisory device is determined as the supervisory device.
[0024] Optionally, sending a second upgrade instruction to the supervision device includes:
[0025] The over-the-air download technology is used to send the second upgrade instruction in a multicast form to the supervisory devices that have passed the two-way verification.
[0026] A second aspect of the present disclosure provides an upgrade method for an Internet of Things terminal device, which is applied to a supervisory device and includes:
[0027] Two-way authentication with the server;
[0028] In response to the two-way verification being passed, receiving a first upgrade instruction sent by the server, wherein the second upgrade instruction includes an encrypted upgrade file, server identity information, and a first verification value;
[0029] Decrypting the first upgrade instruction and verifying the server identity information;
[0030] If the server identity information is verified and the supervisory device is a gateway device in the Internet of Things system, a fourth upgrade instruction is sent to the terminal device in the local area network to which the supervisory device belongs. The fourth upgrade instruction includes the encrypted upgrade file, the server identity information, the supervisory device identity information and the first verification value.
[0031] Optionally, if the supervisory device is a gateway device in an Internet of Things system, performing two-way verification with the server includes:
[0032] receiving a second upgrade instruction initiated by the server, wherein the second upgrade instruction includes encrypted server identity authentication information;
[0033] Decrypting the second upgrade instruction and verifying the server identity information;
[0034] If the server identity information is verified, first confirmation information is returned to the server, where the first confirmation information includes the encrypted supervision device identity information.
[0035] Optionally, the method for upgrading the Internet of Things terminal device further includes:
[0036] Receiving fifth confirmation information returned by each terminal device in the local area network to which the supervision device belongs, the fifth confirmation information including the encrypted terminal device identity certification information and the second verification value;
[0037] Decrypting the fifth confirmation information and verifying the terminal device identity information;
[0038] If the terminal device identity information is verified, second confirmation information is returned to the server, wherein the second confirmation information includes the encrypted supervision device identity information and the terminal device identity information and second verification value returned by each terminal device in the local area network to which the supervision device belongs.
[0039] Optionally, after the terminal device identity information is verified, the process further includes:
[0040] Comparing the first verification value and the second verification value;
[0041] If the first verification value and the second verification value are consistent, returning second confirmation information to the server;
[0042] If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device is recorded, and a second warning message is returned to the server.
[0043] Optionally, the second confirmation information also includes the first verification value received by the supervisory device in an encrypted form for verification by the server.
[0044] Optionally, the method for upgrading the Internet of Things terminal device further includes:
[0045] Receiving first upgrade completion confirmation information sent by the server;
[0046] According to the first upgrade completion confirmation information, second upgrade completion confirmation information is sent to the corresponding terminal device.
[0047] A third aspect of the present disclosure provides an upgrade method for an IoT terminal device, which is applied to the terminal device and includes:
[0048] Receiving a first upgrade instruction sent by the server or a fourth upgrade instruction sent by the supervisory device, wherein the first upgrade instruction includes an encrypted upgrade file, server identity information, and a first verification value, and the fourth upgrade instruction includes an encrypted upgrade file, server identity information, supervisory device identity information, and a first verification value;
[0049] decrypting the first upgrade instruction and verifying the server identity information, or decrypting the fourth upgrade instruction and verifying the server identity information and the supervisory device identity information;
[0050] In response to the identity verification being passed, calculating a second verification value and comparing the first verification value with the second verification value;
[0051] In response to the first verification value and the second verification value being consistent with each other, upgrading is performed according to the upgrade file.
[0052] Optionally, the method for upgrading the Internet of Things terminal device further includes:
[0053] Return fifth confirmation information to the supervision device, wherein the fifth confirmation information includes the encrypted terminal device identity certification information and the second verification value.
[0054] Optionally, after the first verification value and the second verification value are verified to be consistent, the method further includes:
[0055] determining whether second upgrade completion confirmation information sent by the supervisory device is received;
[0056] If the second upgrade completion confirmation information is received, upgrading is performed according to the upgrade file;
[0057] If the second upgrade completion confirmation information is not received, the upgrade is not performed.
[0058] Optionally, the method for upgrading the Internet of Things terminal device further includes:
[0059] Receiving a third upgrade instruction and a campaign instruction sent by the server, wherein the third upgrade instruction includes encrypted server identity authentication information;
[0060] Broadcasting first election information to other terminal devices in the local area network, and receiving second election information broadcasted by other terminal devices in the local area network;
[0061] Comparing the first campaign information with the second campaign information;
[0062] If the first election information is greater than the second election information, third confirmation information of the election to become the supervisory device is sent to the server, wherein the third confirmation information includes encrypted terminal device identity certification information;
[0063] If the first election information is smaller than the second election information, fourth confirmation information of other terminal devices running for the supervisory device is sent to the server, wherein the fourth confirmation information includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device;
[0064] If the first campaign information is equal to the second campaign information, the first campaign information is randomly increased or decreased and the increased or decreased first campaign information is broadcast again.
[0065] A fourth aspect of the present disclosure provides a server, including:
[0066] a communication unit, used for communicating with the supervision device;
[0067] a memory for storing a set of instructions; and
[0068] At least one processor is configured to execute the set of instructions to perform the method described in the first aspect.
[0069] A fifth aspect of the present disclosure provides a monitoring device, comprising:
[0070] A communication unit, used for communicating with a server and a terminal device;
[0071] a memory for storing a set of instructions; and
[0072] At least one processor is configured to execute the set of instructions to perform the method described in the second aspect.
[0073] A sixth aspect of the present disclosure provides a terminal device, including:
[0074] a communication unit, used for communicating with the supervision device;
[0075] a memory for storing a set of instructions; and
[0076] At least one processor is configured to execute the set of instructions to perform the method described in the third aspect.
[0077] A seventh aspect of the present disclosure provides an Internet of Things system, including:
[0078] The server described in the fourth aspect;
[0079] At least one monitoring device according to the fifth aspect; and
[0080] At least one terminal device according to the sixth aspect;
[0081] Wherein, the server and the terminal device complete communication through the supervision device. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] In order to more clearly illustrate the technical solutions in the present disclosure or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only for the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0083] Figure 1An exemplary structural diagram of the Internet of Things system provided by the present disclosure;
[0084] Figure 2 An exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0085] Figure 3 Another exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0086] Figure 4 Another exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0087] Figure 5 Another exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0088] Figure 6 An exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0089] Figure 7 Another exemplary flowchart of the method for upgrading the IoT terminal device provided by the present disclosure;
[0090] Figure 8 A more specific schematic diagram of the hardware structure of an electronic device of a server provided in this embodiment;
[0091] Fig. 9 A schematic diagram of the electronic device hardware structure of a more specific monitoring device provided in this embodiment;
[0092] Fig.10 A schematic diagram of the electronic device hardware structure of a more specific terminal device provided in this embodiment. DETAILED DESCRIPTION
[0093] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0094] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The words "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0095] Figure 1 FIG. 1 shows an exemplary structural diagram of the Internet of Things system provided by the present disclosure. Figure 1 As shown, the Internet of Things system 100 includes a server 102 , a supervisory device 104 and a terminal device 106 .
[0096] The server 102 is a device that initiates OTA upgrades. The user publishes the code file (upgrade file) that needs to be updated and upgraded to the server 102, performs the update operation, and the server 102 performs the specific upgrade release work. Optionally, the server 102 can be a separate server or a server cluster.
[0097] The server 102 may store server identity information (eg, server certificate), which may be fixed or updated periodically, or may be provided by the publisher each time the server is updated or upgraded.
[0098] The server 102 can store encryption keys. If an asymmetric encryption method is used, the server 102 can store a server private key, which is one of the key pairs of the asymmetric encryption of the server 102. The server private key can be a fixed private key, or a series of private keys set for each supervisory device 104 (the private keys corresponding to each supervisory device 104 are different), or can be updated and changed in a pre-agreed manner. The server 102 can also store the supervisory device public key of each supervisory device 104, which is used to decrypt the encrypted information sent by the supervisory device 104.
[0099] The supervisory device 104 is responsible for the intermediate link of the two-way verification. Optionally, the supervisory device 104 can be a dedicated gateway or a selected terminal device 106.
[0100] The supervisory device 104 can store unchangeable, unique supervisory device identity information (for example, a supervisory device certificate). This supervisory device identity information can be pre-burned into the supervisory device or provided by a Physical Unclonable Function (PUF) device in the supervisory device 104.
[0101] The supervisory device 104 can store encryption keys. If an asymmetric encryption method is used, the server 102 can store a supervisory device private key, which is one of the key pairs of asymmetric encryption. The supervisory device private key of each supervisory device 104 is different. The supervisory device private key can be fixed or updated according to an agreed method. The supervisory device 104 can also store the server public key of the server 102, which is used to decrypt the encrypted information sent by the server 102. The supervisory device 104 can also store the terminal device public key of each terminal device 106, which is used to decrypt the encrypted information sent by each terminal device 106.
[0102] The terminal device 106 is the underlying IoT device node.
[0103] The terminal device 106 can store unchangeable, unique terminal device identity information (for example, a terminal device certificate). This terminal device identity information can be pre-burned into the terminal device or provided by a PUF device in the terminal device 106.
[0104] The terminal device 106 can store an encryption key. If an asymmetric encryption method is used, the terminal device 106 can store a terminal device private key, which is one of the key pairs of asymmetric encryption. The terminal device private key of each terminal device 106 is different. The private key can be fixed or changed in an agreed manner. The terminal device 106 can also store the supervisory device public key of the supervisory device 104, which is used to decrypt the encrypted information sent by the supervisory device 104. The terminal device 106 can also store the server public key of the server 102, which is used to decrypt the information encrypted by the server 102 and forwarded by the supervisory device 104. For different terminal devices 106 in the same local area network, the same or different terminal device private keys can be used.
[0105] The supervision device 104 and the server 102 are connected via a network. The terminal device 106 is generally connected to the server 102 via a dedicated or universal gateway. The terminal devices 106 connected to the same gateway form a local area network. There may be one or more supervision devices 104 in a local area network. In some cases, one supervision device 104 is preferred to reduce the number of two-way connections that the server 102 needs to establish with the supervision device 104. In the case of using a universal gateway, the terminal devices 106 in the same local area network can communicate with each other directly or through the gateway. Therefore, in this scenario, if one of the terminal devices 106 is selected as the supervision device 104, the supervision device 104 and the terminal device 106 can communicate with each other directly or through the gateway.
[0106] In some embodiments, each device in the Internet of Things system 100 (e.g., server 102, supervisory device 104, terminal device 106) stores corresponding sensitive information (e.g., identity information, encryption key), which can be stored in the secure storage area of each device and can be encrypted when stored. Generally, each device only stores its own identity information and its own private key, as well as the public keys of other devices, and does not store the private keys of other devices. In some embodiments, if one or more of the terminal devices 106 are selected as supervisory devices 104, the terminal device 106 needs to store two pairs of keys in advance, wherein the first key pair is shared by each terminal device 106 in the same local area network, that is, the first key pair of each terminal device 106 in the same local area network is the same, and the second key pair is an independent and unique key pair of each terminal device, which is used as a supervisory device key when the terminal device 106 competes to become a supervisory device 104.
[0107] Figure 2 An exemplary flow chart of the method for upgrading an IoT terminal device provided by the present disclosure is shown, and an exemplary working process of the method 200 for upgrading an IoT terminal device when a dedicated gateway is used as the supervisory device 104 is provided.
[0108] Generally, each connection established between the server 102 and the monitoring device 104 can initiate an upgrade for all terminal devices 106 in a local area network.
[0109] like Figure 2 As shown, in the device verification stage 202, the following steps are mainly performed.
[0110] The server 102 sends a second upgrade instruction 2002 to the supervisory device 104, along with server identity information (eg, server certificate), and all information is encrypted using the supervisory device public key.
[0111] The supervisory device 104 decrypts with the supervisory device private key, verifies the server identity information, and then replies with a first confirmation message 2004 to the server 102 to confirm the connection. The first confirmation message 2004 includes the supervisory device identity information (eg, supervisory device certificate), and all information is encrypted with the server public key.
[0112] The server 102 uses the server private key to decrypt and verify the identity information of the supervisory device.
[0113] After the verification is passed, a two-way reliable connection between the server 102 and the supervision device 104 is established, thereby ensuring the communication security between the server and the supervision device.
[0114] like Figure 2 As shown, in the upgrade file distribution stage 204, the following steps are mainly performed.
[0115] The server 102 issues a first upgrade instruction 2006 to the supervisory device 104. The first upgrade instruction 2006 includes an upgrade file, a first check value, server identity information, and may also include a distribution instruction. All information is encrypted with the supervisory device public key. In some embodiments, the first check value may be calculated according to a preset check value algorithm. The specific calculation method may be SHA-1, SHA-2, MD5, etc. Optionally, the first check value may be calculated based on the relevant information of the upgrade file. Of course, in some embodiments, it may also be calculated based on the server identity information, or it may be calculated based on all the information in the first upgrade instruction 2006, etc. The specific data used to calculate the check value may be selected as needed.
[0116] The supervision device 104 uses the supervision device private key to decrypt and verify the server identity information. After the verification is passed, the fourth upgrade instruction 2008 is sent to each terminal device 106 in the local area network to which the supervision device 104 belongs, so as to distribute the upgrade file to be distributed, the first verification value, and the server identity information to each terminal device 106 in the local area network to which the supervision device 104 belongs, and at the same time attach the supervision device identity information and encrypt it using the terminal device public key.
[0117] At this point, the upgrade file distribution process is completed.
[0118] like Figure 2 As shown, in the upgrade confirmation stage 206, the following steps are mainly performed.
[0119] The terminal device 106 uses the terminal device private key to decrypt, verify the server identity information, the supervision device identity information, and obtain the upgrade file, calculate the second verification value of the upgrade file, and compare it with the received first verification value.
[0120] As an optional embodiment, in a one-way verification scheme, if the two check values are consistent, the upgrade can be confirmed at this point.
[0121] Each terminal device 106 returns fifth confirmation information 2010 to the supervisory device, so as to send the calculated second verification value and the terminal device identity information to the supervisory device 104 and encrypt them with the supervisory device public key.
[0122] The supervisory device 104 checks the terminal device identity information of each terminal device 106 , and compares the second verification value returned by each terminal device 106 with the first verification value received by the supervisory device 104 from the server 102 .
[0123] In some embodiments, after the terminal device identity information is verified and the verification value is consistent, the supervision device 104 sends a second confirmation message 2012 to the server, so as to send the aggregated terminal device identity information and the second verification value of each terminal device 106, the first verification value received by the supervision device 104 from the server 102, and the supervision device identity information back to the server 102 for confirmation after encryption.
[0124] Optionally, the server 102 verifies the terminal device identity information and the second verification value and the supervisory device identification information of each terminal device 106 and replies with the first upgrade completion confirmation instruction 2014 to the supervisory device 104; otherwise, the identity information of the terminal device with error is recorded, and a first warning message is sent to the supervisory device 104 or a designated device to remind relevant personnel that there is a security problem in the system.
[0125] The supervisory device 104 sends a second upgrade completion confirmation instruction 2016 to each terminal device 106 according to the first upgrade completion confirmation instruction 2014 of the server 102, or the result of its own verification of the verification value. Otherwise, it records the terminal device identity information and sends a second warning message to the server 102 to report the error.
[0126] At this point, the upgrade process is completed.
[0127] It should be noted that all the encryption processes mentioned above use asymmetric encryption. In fact, a hybrid encryption method can also be used, that is, encrypt the information with a random symmetric key, and then encrypt the symmetric key with asymmetric encryption, and attach the asymmetric encrypted symmetric key when transmitting the information.
[0128] It should also be noted that all the above asymmetric encryption / decryption processes rely on the public key and private key stored in the device. For an asymmetric encryption process, the sender and receiver can use a fixed key pair that is determined in advance, or a key pair that changes according to a pre-agreed rule, such as attaching time and other indication information to the information, and the receiving party determines the required decryption key based on these indication information using a pre-agreed method.
[0129] In addition, the above-mentioned process of verifying the certificate information can be to compare the certificate information / certificate verification value with the certificate / certificate verification value white list stored in itself (for the terminal device 106 and the supervision device 104, it needs to be burned and fixed in advance; for the server 102, it needs to be registered under manual supervision when the terminal device 106 is installed and deployed), or it can be that a certain specific rule is contained in the certificate information, or it can be a combination of the above two methods.
[0130] It should also be noted that, in this embodiment, the supervisory device 104 is a dedicated gateway. In some embodiments, when the terminal device 106 is deployed, under manual supervision, the certificate information of the dedicated gateway is added to the supervisory device certificate whitelist of the terminal device 106, and the certificate information of the terminal device 106 is added one by one to the terminal device certificate whitelist of the supervisory device 104. At the same time, when the terminal device 106 is deployed, under manual supervision, the unified terminal device public key of the terminal device 106 is stored in the supervisory device 104, or the terminal device public key corresponding to the terminal device private key of each terminal device 106 is stored one by one in the supervisory device 104.
[0131] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention adopts a hierarchical and distributed two-way verification OTA upgrade security verification mechanism, which selects a supervisory device in a local area network and performs two-way verification between the server and the supervisory device to confirm the legitimacy of both parties. At the same time, after the upgrade file is issued, each terminal device calculates the verification value and verifies the identity, and each terminal device sends the calculated verification value to the supervisory device, and the supervisory device confirms these verification values by itself or to the server. After confirmation, the upgrade file replaces the old file. This technical solution has the high security of the two-way verification mechanism and improves the speed of OTA upgrades by a hierarchical and distributed method.
[0132] The upgrade method of the IoT terminal device provided by the embodiment of the present disclosure splits the ordinary two-way authentication into two levels: server-supervisory device, supervisory device-terminal device. Two-way authentication is adopted between the server and the supervisory device; the supervisory device is a dedicated gateway, which generally has more computing and storage resources, sufficient power supply, and is more trustworthy (better protected). Therefore, the supervisory device is regarded as the center, and each terminal device in the local area network reports its own information one by one for two-way confirmation. In this way, the ends of the two-way confirmation are distributed to the gateway, which improves the overall speed.
[0133] Figure 3 Another exemplary flow chart of the method for upgrading an IoT terminal device provided by the present disclosure is shown, and an exemplary working process of the method 300 for upgrading an IoT terminal device when the terminal device is used as the supervisory device 104 is provided.
[0134] In some embodiments, each terminal device 106 belonging to the same local area network stores the same first terminal device key pair, including a first terminal device private key and a corresponding first terminal device public key, and each terminal device 106 may also have its own independent second terminal device key pair, including a second terminal device private key and a corresponding second terminal device public key.
[0135] Each connection to the server can initiate an upgrade for some or all nodes in a local area network.
[0136] like Figure 3 As shown, in the device selection and verification stage 302, the following steps are mainly performed.
[0137] The server 102 sends a third upgrade instruction 3002 with a server certificate to the terminal device 106 to be upgraded in the local area network; and sends a campaign instruction 3004 to all terminal devices 106, and all information is encrypted with a public key common to the terminal devices (the first terminal device public key).
[0138] All terminal devices 106 that receive the election instructions broadcast their first election information encrypted with the terminal device's universal public key (first terminal device public key) in the local area network in turn (so that each terminal device can decrypt it with its own first terminal device private key) and the terminal device certificate encrypted with the server public key (so that other terminal devices can only record the ciphertext but cannot decrypt it).
[0139] Optionally, the first campaign information is information used to select a supervisory device, which may be an indicator related to computing power of the terminal device 106, or power information of the terminal device 106, or a trust indicator of the terminal device 106, etc. For example, the first campaign information may be the remaining battery power information of the terminal device 106.
[0140] Each terminal device 106 can compare its first election information with the second election information received from other terminal devices 106. If its first election information is the same as a certain second election information received, the value of its first election information is randomly increased or decreased and then broadcasted. In this way, each terminal device 106 can know whose election information has the largest value (including the terminal device with the largest election information itself), as well as its corresponding terminal device certificate encrypted with the server public key.
[0141] The terminal device 106 with the largest campaign information regards itself as the supervisory device 104, and its terminal device certificate is the supervisory device certificate.
[0142] Optionally, the terminal device 106 with the largest election information uses its own terminal device independent private key (second terminal device private key) as the supervisory device private key, and its own terminal device independent public key (second terminal device public key) as the supervisory device public key, and then uses the supervisory device public key and the supervisory device certificate information encrypted with the server public key to encrypt the supervisory device public key with the terminal device universal public key (second terminal device private key) and broadcast them to other terminal devices 106 in the local area network.
[0143] The supervisory device 104 reports the selected result (third confirmation information 3006) to the server 102, attaching its own supervisory device certificate information encrypted with the server public key. At least one terminal device 106 (which can be selected according to a pre-agreed method, such as the terminal device 106 with the second highest election information) that is not a supervisory device also reports the selected result (fourth confirmation information 3008) to the server 102, attaching the supervisory device certificate of the supervisory device 104 it identified encrypted with the server public key, and its own terminal device certificate encrypted with the server public key.
[0144] After receiving the above-mentioned at least two messages, the server 102 confirms that the same terminal device is the supervisory device 104, and then sends a confirmation result (the sixth confirmation message 3010 and the seventh confirmation message 3012, both of which include the supervisory device certificate encrypted with the server public key) to the supervisory device 104 and other terminal devices 106, and attaches the server certificate information as verification. As mentioned above, each terminal device 106 can know whose election information is the largest and its corresponding terminal device certificate encrypted with the server public key, so here the server 102 can compare the supervisory device certificate information encrypted with the server public key in the at least two messages received to see if they are consistent.
[0145] At this point, the supervisory device 104 is selected and the two-way authentication between the server 102 and the supervisory device 104 is completed.
[0146] like Figure 3 As shown, in the upgrade file distribution stage 304, the following steps are mainly performed.
[0147] The server 102 sends a first upgrade instruction 3014 to all terminal devices 106 to be upgraded and the supervision device 104, including an upgrade file, a first verification value of the upgrade file, and a server certificate, which is encrypted with the terminal device universal public key (the first terminal device public key).
[0148] After the terminal device 106 to be upgraded and the supervision device 104 decrypt with the terminal device universal private key (first terminal device private key), they calculate the second verification value of the upgrade file and compare it with the first verification value.
[0149] like Figure 3 As shown, in the upgrade confirmation stage 306, the following steps are mainly performed.
[0150] The terminal device 106 to be upgraded encrypts the second verification value and its own terminal device certificate encrypted with the server public key with the terminal device's universal public key (first terminal device public key) (fifth confirmation information 3016) and sends it to the supervision device 104. After summarizing, the supervision device 104 sends the second confirmation information 3018 (if the supervision device 104 is also to be upgraded, it can be attached with the second verification value calculated by itself and the supervision device certificate information) to the server 102 for verification.
[0151] After the server 102 verifies that the file is correct, it sends a first upgrade completion confirmation instruction 3020 with its own server certificate information to all the terminal devices 106 to be upgraded and the supervisory device 104. After the terminal devices 106 to be upgraded and the supervisory device 104 are confirmed, they can implement the upgrade behavior of replacing the old file with the upgraded file.
[0152] Optionally, the device to be upgraded may also encrypt the second verification value and the terminal device certificate information encrypted with the server public key with the public key of the supervisory device and send them to the supervisory device 104 .
[0153] Optionally, the monitoring device 104 may also compare the aggregated second verification value of each terminal device 106 with the first verification value received by itself, thereby finding an error, terminating the upgrade immediately and reporting it to the server 102 .
[0154] In some embodiments, whenever the monitoring device 104 or the terminal device 106 detects an error, the relevant information should be immediately reported to the server 102; whenever the server 102 detects or receives error information, it should record and issue an alarm.
[0155] It should be noted that all the encryption processes mentioned above are asymmetric encryption by default. In fact, a hybrid encryption method can also be used, that is, a random symmetric key is used to encrypt information, and then the symmetric key is encrypted with an asymmetric encryption method, and the asymmetric key encrypted with asymmetric encryption is attached when the information is transmitted. The related technology belongs to the known technology.
[0156] It should also be noted that all the above asymmetric encryption / decryption processes rely on the public key and private key stored in the device. For an asymmetric encryption process, the sender and receiver can use a fixed key pair determined in advance, or a key pair that changes according to a pre-agreed rule, such as attaching time and other indication information to the information, and the receiving party determines the required decryption key according to the pre-agreed method based on these indication information. The relevant technology belongs to the known technology.
[0157] In addition, the process of verifying the certificate information can be to compare the certificate information / certificate verification value with the white list of certificates / certificate verification values stored by itself (for terminal devices and monitoring devices, it needs to be burned and fixed in advance; for servers, it needs to be registered under manual supervision when installing and deploying terminal devices), or the certificate information may contain a certain specific rule, or it may be a combination of the above two methods. The related technology belongs to the known technology.
[0158] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention adopts a hierarchical and distributed two-way verification OTA upgrade security verification mechanism, which selects a supervisory device in a local area network and performs two-way verification between the server and the supervisory device to confirm the legitimacy of both parties. At the same time, after the upgrade file is issued, each terminal device calculates the verification value and verifies the identity, and each terminal device sends the calculated verification value to the supervisory device, and the supervisory device confirms these verification values by itself or to the server. After confirmation, the upgrade file replaces the old file. This technical solution has the high security of the two-way verification mechanism and improves the speed of OTA upgrades by a hierarchical and distributed method.
[0159] In the upgrade method for the IoT terminal device provided in this embodiment, there is no dedicated gateway to serve as a supervisory device, so a terminal device needs to be selected to serve as a supervisory device. The supervisory device used by the terminal device should not know the certificate information of other terminal devices, and vice versa. Therefore, certificate information encrypted by the server public key is used as a substitute, which can be compared and distinguished, but cannot be parsed. In addition, the supervisory device used by the terminal device is not as trustworthy as a dedicated gateway. In addition to aggregating information sent by other terminal devices, other information is multicast or unicast directly to the terminal device through the server as much as possible. The supervisory device can only reject the upgrade by itself but cannot confirm the upgrade by itself.
[0160] For general OTA upgrade solutions, the terminal device only locally verifies the received upgrade file and identity information such as the server certificate / signature, and the security depends entirely on the server information not being leaked. For this reason, the upgrade method for the IoT terminal device provided in the present invention adopts a two-way verification. The terminal device needs to seek verification from the supervisory device for the data it receives, and the supervisory device seeks verification from the server.
[0161] For some two-way verification OTA upgrade solutions, the server needs to establish a two-way connection with each device to be upgraded one by one, and the upgrade speed is slow, which is not suitable for batch upgrades of a large number of IoT devices. For this reason, the upgrade method of the IoT terminal device provided by the present invention divides the two-way verification into two levels, and the supervisory device summarizes and seeks verification from the server, which greatly improves the upgrade speed.
[0162] In some existing solutions, the wireless connection between the server and the terminal device is easily hacked during the period of physical isolation, and is difficult to be detected after reconnection; for this reason, the upgrade method of the IoT terminal device provided by the present invention monitors the upgrade process through a stably connected supervision device during the upgrade, and can inspect the reconnected device.
[0163] It can be seen that the upgrade method of the Internet of Things terminal device provided by the present invention has achieved the security equivalent to the two-way verification OTA upgrade method. At the same time, the upgrade method of the Internet of Things terminal device provided by the present invention has the verification process decentralized to the terminal device and supervision device level. The number of two-way connections that the server needs to establish is reduced from the number of terminal devices to the number of local area networks of the supervision devices. The server can initiate OTA upgrades in the form of multicast, and the upgrade speed is significantly higher than the ordinary two-way verification OTA upgrade method (an upgrade method in which the server and the terminal device establish a one-to-one connection). In addition, by adopting the upgrade method of the Internet of Things terminal device provided by the present invention, tampered or hacked terminal devices can be discovered in time, even if the terminal device is attacked while offline.
[0164] The upgrade method of the IoT terminal device provided by the present disclosure adopts two-way verification. To implement an illegal upgrade, it is necessary to crack the server certificate information, server encryption key, certificate information of the terminal device to be attacked, and encryption key of the terminal device to be attacked. To decipher the source file, it is necessary to crack at least the terminal device decryption key. If you want to prevent the illegal upgrade from being discovered, you also need to cut off the data link between the gateway or terminal device and the legitimate server.
[0165] The upgrade method for IoT terminal devices provided by the present invention splits the two-way verification between the terminal device and the server into two-way verification between the supervisory device and the server, and between the terminal device and the supervisory device. The security is equivalent to that of the direct two-way verification between the terminal device and the server. However, the hierarchical and distributed solution of the present solution greatly reduces the number of two-way connections that the server needs to manage. OTA upgrades can still be performed in multicast rather than all at once, which improves the speed of OTA upgrades for a large number of IoT devices.
[0166] Figure 4 An exemplary flowchart of the method for upgrading an IoT terminal device provided by the present disclosure is shown.
[0167] like Figure 4 As shown, the upgrade method 400 of the Internet of Things terminal device is applied to the server 102 and the supervisory device 104 is a gateway device. The method 400 includes:
[0168] Step 402: Sending a second upgrade instruction 2002 to the supervision device 104, wherein the second upgrade instruction 2002 includes encrypted server identity information (e.g., server certificate); optionally, the encryption method may be symmetric encryption, asymmetric encryption, or hybrid encryption;
[0169] Step 404: receiving the first confirmation information 2004 returned by the supervisory device 104, wherein the first confirmation information 2004 includes encrypted supervisory device identity information (eg, supervisory device certificate);
[0170] Step 406: decrypting the first confirmation information 2004 and verifying the identity information of the supervisory device;
[0171] Step 408: If the identity verification information of the supervisory device passes, a first upgrade instruction 2006 is sent to the supervisory device 104, wherein the first upgrade instruction 2006 includes an encrypted upgrade file, the server identity verification information and a first check value. Optionally, the check value can be calculated based on the upgrade file, and the method used to calculate the check value can be SHA-1, SHA-2, MD5, etc.
[0172] In addition, if the identity verification information of the supervisory device fails, the upgrade can be stopped.
[0173] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention ensures the security between the server and the supervisory device by establishing a two-way secure connection between the server and the supervisory device; at the same time, by allowing the supervisory device to distribute upgrade files to the terminal device, compared with the server directly sending upgrade files to the terminal device, the number of two-way connections is reduced and the upgrade speed is improved.
[0174] In some embodiments, the method 400 for upgrading the IoT terminal device further includes:
[0175] Step 410: receiving the second confirmation information 2012 returned by the supervisory device 104, wherein the second confirmation information 2012 includes the encrypted supervisory device identity information and the terminal device identity information (e.g., terminal device certificate) returned by each terminal device 106 and a second verification value; optionally, the second verification value is calculated by the terminal device 106 according to the received upgrade file;
[0176] Step 412: Compare the first verification value and the second verification value;
[0177] Step 414: If the first verification value and the second verification value are consistent, a first upgrade completion confirmation message 2014 is sent to the monitoring device 104;
[0178] Step 416: If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device 106 is recorded and a first warning message is output.
[0179] In this embodiment, in addition to verifying the identity information, the verification value is compared. When the verification value is inconsistent, a first warning message is issued, so that security problems can be quickly discovered and corresponding processing can be carried out in time.
[0180] Optionally, sending a first upgrade instruction to the supervision device 104 includes:
[0181] By adopting Over-The-Air (OTA) technology, the first upgrade instruction 2006 is sent in a multicast form to the supervisory devices whose identity information has been verified, thereby improving the upgrade speed.
[0182] In some implementations, if the supervisory device 104 is a terminal device 106 in the IoT system 100, determining the supervisory device 104 and performing a two-way verification with the supervisory device 104 includes:
[0183] Sending a third upgrade instruction 3002 and a campaign instruction 3004 to at least two terminal devices 106 in at least one local area network, wherein the third upgrade instruction 3002 includes encrypted server identity information, and the campaign instruction 3004 is used to enable the at least two terminal devices 106 in the at least one local area network to campaign for the supervisory device 104;
[0184] Receive third confirmation information 3006 returned by the terminal device running for the supervisory device 104 and fourth confirmation information 3008 of at least one terminal device 106 among the non-supervisory devices in the at least one local area network, wherein the third confirmation information 3006 includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device, and the fourth confirmation information 3008 includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device received by at least one terminal device among the non-supervisory devices;
[0185] Decrypt the third confirmation information 3006 and the fourth confirmation information 3008 and compare the terminal device identity information in the third confirmation information 3006 and the fourth confirmation information 3008;
[0186] In response to the terminal device identity verification being passed, the terminal device running to become the supervisory device is determined as the supervisory device 104 .
[0187] Figure 5 An exemplary flowchart of the method for upgrading an IoT terminal device provided by the present disclosure is shown.
[0188] like Figure 5 As shown, the upgrade method 500 of the Internet of Things terminal device is applied to the supervisory device 104 and the supervisory device 104 is a gateway device in the Internet of Things system 100, including:
[0189] Step 502: receiving a second upgrade instruction 2002 initiated by the server, wherein the second upgrade instruction 2002 includes encrypted server identity information;
[0190] Step 504: decrypt the second upgrade instruction 2002 and verify the server identity information;
[0191] Step 506: If the server identity verification information passes, the first confirmation information 2004 is returned to the server 102, and the first confirmation information 2004 includes the encrypted supervision device identity verification information;
[0192] Step 508: receiving a first upgrade instruction 2006 sent by the server 102, wherein the first upgrade instruction 2006 includes an encrypted upgrade file, the server identity information and a first verification value;
[0193] Step 510: decrypting the first upgrade instruction 2006 and verifying the server identity information;
[0194] Step 512: If the server identity information is verified, a fourth upgrade instruction 2008 is sent to the terminal device 106 in the local area network to which the supervisory device belongs. The fourth upgrade instruction 2008 includes the encrypted upgrade file, the server identity information, the supervisory device identity information and the first verification value.
[0195] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention ensures the security between the server and the supervisory device by establishing a two-way secure connection between the server and the supervisory device; at the same time, by allowing the supervisory device to distribute upgrade files to the terminal device, compared with the server directly sending upgrade files to the terminal device, the number of two-way connections is reduced and the upgrade speed is improved.
[0196] In some embodiments, the method 500 for upgrading the IoT terminal device further includes:
[0197] Step 514: receiving the fifth confirmation information 2010 returned by each terminal device 106 in the local area network to which the supervisory device belongs, wherein the fifth confirmation information 2010 includes the encrypted terminal device identity information and the second verification value;
[0198] Step 516: decrypt the fifth confirmation information 2010 and verify the terminal device identity information;
[0199] Step 518: If the terminal device identity information is verified, a second confirmation message 2012 is returned to the server 102. The second confirmation message 2012 includes the encrypted supervision device identity information and the terminal device identity information and the second verification value returned by each terminal device 106 in the local area network to which the supervision device belongs.
[0200] In this embodiment, in addition to verifying the identity information, the second verification value is used to compare the verification value. When the verification value is inconsistent, a first warning message is issued, so that security issues can be quickly discovered and corresponding processing can be performed in time.
[0201] In some embodiments, the method 500 for upgrading the IoT terminal device further includes:
[0202] Step 520: receiving the first upgrade completion confirmation message 2014 sent by the server 102;
[0203] Step 522: According to the first upgrade completion confirmation information 2014 , second upgrade completion confirmation information 2016 is sent to the corresponding terminal device 106 .
[0204] In this embodiment, the second upgrade completion confirmation information 2016 is fed back to the terminal device 106 so that the terminal device confirms that the upgrade is completed safely.
[0205] In some embodiments, after the terminal device identity information is verified, the following steps may also be included:
[0206] Comparing the first verification value and the second verification value;
[0207] If the first verification value and the second verification value are consistent, a second confirmation message 2012 is returned to the server 102;
[0208] If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device 106 is recorded, and a second warning message is returned to the server 102.
[0209] In this embodiment, in addition to verifying the identity information, the verification value is compared. When the verification value is inconsistent, a second warning message is issued, so that security problems can be quickly discovered and corresponding processing can be carried out in time.
[0210] Optionally, the second confirmation information 2012 may also include the first verification value received by the supervision device 104 in an encrypted form, so as to be checked by the server 102 .
[0211] Figure 6 An exemplary flowchart of the method for upgrading an IoT terminal device provided by the present disclosure is shown.
[0212] like Figure 6 As shown, the upgrade method 600 of the Internet of Things terminal device is applied to the terminal device 106 and the supervision device 104 is a gateway device in the Internet of Things system 100, including:
[0213] Step 602: receiving a fourth upgrade instruction 2008 sent by the supervisory device 104, wherein the fourth upgrade instruction 2008 includes an encrypted upgrade file, server identity information, supervisory device identity information, and a first verification value;
[0214] Step 604: decrypting the fourth upgrade instruction 2008 and verifying the server identity information and the supervisory device identity information;
[0215] Step 606: If both the server identity information and the supervisory device identity information are verified, a second verification value is calculated and the first verification value and the second verification value are compared;
[0216] Step 608: If the first check value and the second check value are consistent, then the upgrade is performed according to the upgrade file. In addition, if the first check value and the second check value are inconsistent, then the upgrade is not performed.
[0217] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention ensures the security between the server and the supervisory device by establishing a two-way secure connection between the server and the supervisory device; at the same time, by allowing the supervisory device to distribute the upgrade file to the terminal device, compared with the server directly sending the upgrade file to the terminal device, the number of two-way connections is reduced and the upgrade speed is improved; in addition, the security of the upgrade file is guaranteed by comparing the verification value.
[0218] In some embodiments, the method 600 for upgrading the IoT terminal device further includes:
[0219] Step 610: Return the fifth confirmation information 210 to the supervision device 104, wherein the fifth confirmation information 210 includes the encrypted terminal device identity information and the second verification value.
[0220] In this embodiment, by providing a second verification value for comparing the verification value, when the verification value is inconsistent, a warning message can be issued, so that security issues can be quickly discovered and corresponding processing can be performed in a timely manner.
[0221] In some embodiments, after the first verification value and the second verification value are verified to be consistent, the method further includes:
[0222] Determine whether the second upgrade completion confirmation message 2016 sent by the supervision device 104 is received;
[0223] If the second upgrade completion confirmation message 2016 is received, the upgrade is performed according to the upgrade file;
[0224] If the second upgrade completion confirmation message 2016 is not received, the upgrade is not performed.
[0225] In this embodiment, the upgrade is performed only when the second upgrade completion confirmation information 2016 is received, which further ensures the security of the upgrade.
[0226] Figure 7 An exemplary flowchart of the method for upgrading an IoT terminal device provided by the present disclosure is shown.
[0227] like Figure 7 As shown, the upgrade method 700 of the Internet of Things terminal device is applied to the terminal device 106 and the supervision device 104 is a terminal device in the Internet of Things system 100, including:
[0228] Step 702: receiving a first upgrade instruction sent by a server, wherein the first upgrade instruction includes an encrypted upgrade file, server identity information, and a first verification value;
[0229] Step 704: decrypting the first upgrade instruction and verifying the server identity information;
[0230] Step 706: In response to the server identity verification being passed, a second verification value is calculated and the first verification value and the second verification value are compared;
[0231] Step 708: In response to the first verification value and the second verification value being consistent with each other, upgrading is performed according to the upgrade file.
[0232] It can be seen from the above embodiments that the upgrade method of the Internet of Things terminal device provided by the present invention ensures the security between the server and the supervisory device by establishing a two-way secure connection between the server and the supervisory device; at the same time, the upgrade speed is improved by allowing the supervisory device to summarize the confirmation information of the terminal device; in addition, the security of the upgrade file is guaranteed by comparing the verification value.
[0233] In some embodiments, reference Figure 3 , the method 700 further includes:
[0234] Receiving a third upgrade instruction 3002 and a campaign instruction 3004 sent by the server 102, wherein the third upgrade instruction 3002 includes encrypted server identity authentication information;
[0235] Broadcasting the first election information to other terminal devices 106 in the local area network, and receiving the second election information broadcasted by other terminal devices 106 in the local area network;
[0236] Comparing the first campaign information with the second campaign information;
[0237] If the first election information is greater than the second election information, the third confirmation information 3006 of the election to become the supervisory device is sent to the server 102, wherein the third confirmation information 3006 includes the encrypted terminal device identity certification information;
[0238] If the first election information is smaller than the second election information, fourth confirmation information 3008 of other terminal devices running for the supervisory device is sent to the server 102, wherein the fourth confirmation information 3008 includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device.
[0239] If the first campaign information is equal to the second campaign information, the first campaign information is randomly increased or decreased and the increased or decreased first campaign information is broadcast again until the supervisory device 104 is selected.
[0240] It should be noted that each method embodiment of the present disclosure can be executed by a single device, such as a computer or server. The method of this embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only execute one or more steps in the method of the present disclosure, and the multiple devices will interact with each other to complete the described method.
[0241] The embodiment of the present disclosure further provides a server, comprising: a communication unit for communicating with a supervision device; a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions to perform the method 400.
[0242] Figure 8 A more specific server electronic device hardware structure diagram provided in this embodiment is shown, and the server 800 may include: a processor 802, a memory 804, an input / output interface 806, a communication interface 808, and a bus 810. The processor 802, the memory 804, the input / output interface 806, and the communication interface 808 are connected to each other through the bus 810 in the device.
[0243] The processor 802 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure.
[0244] The memory 804 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 804 can store an operating system and other application programs. When the technical solution provided by the embodiment of the present disclosure is implemented by software or firmware, the relevant program code is stored in the memory 804 and called and executed by the processor 802.
[0245] The input / output interface 806 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0246] The communication interface 808 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0247] The bus 810 comprises a pathway for transmitting information between the various components of the device (eg, the processor 802, the memory 804, the input / output interface 806, and the communication interface 808).
[0248] It should be noted that, although the above device only shows the processor 802, the memory 804, the input / output interface 806, the communication interface 808 and the bus 810, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0249] The embodiment of the present disclosure also provides a supervision device, which includes: a communication unit for communicating with a server and a terminal device; a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions to perform the method 500.
[0250] Fig. 9 A schematic diagram of the electronic device hardware structure of a more specific monitoring device provided in this embodiment is shown, and the monitoring device 900 may include: a processor 902, a memory 904, an input / output interface 906, a communication interface 908, and a bus 910. The processor 902, the memory 904, the input / output interface 906, and the communication interface 908 are connected to each other in communication within the device through the bus 910.
[0251] The processor 902 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure.
[0252] The memory 904 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 904 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present disclosure is implemented by software or firmware, the relevant program code is stored in the memory 904 and is called and executed by the processor 902.
[0253] The input / output interface 906 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0254] The communication interface 908 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0255] The bus 910 comprises a pathway for transmitting information between the various components of the device (eg, the processor 902 , the memory 904 , the input / output interface 906 , and the communication interface 908 ).
[0256] It should be noted that, although the above device only shows the processor 902, the memory 904, the input / output interface 906, the communication interface 908 and the bus 910, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0257] The embodiment of the present disclosure also provides a terminal device, which includes: a communication unit for communicating with a supervisory device; a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions to perform the method 600 or the method 700.
[0258] Fig.10 The electronic device hardware structure diagram of a more specific terminal device provided in this embodiment is shown, and the terminal device 1000 may include: a processor 1002, a memory 1004, an input / output interface 1006, a communication interface 1008 and a bus 1010. The processor 1002, the memory 1004, the input / output interface 1006 and the communication interface 1008 are connected to each other through the bus 1010 in the device.
[0259] The processor 1002 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present disclosure.
[0260] The memory 1004 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1004 may store an operating system and other application programs. When the technical solution provided by the embodiment of the present disclosure is implemented by software or firmware, the relevant program code is stored in the memory 1004 and is called and executed by the processor 1002.
[0261] The input / output interface 1006 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0262] The communication interface 1008 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0263] The bus 1010 comprises a pathway for transmitting information between the various components of the device (eg, the processor 1002, the memory 1004, the input / output interface 1006, and the communication interface 1008).
[0264] It should be noted that, although the above device only shows the processor 1002, the memory 1004, the input / output interface 1006, the communication interface 1008 and the bus 1010, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present disclosure, and does not necessarily include all the components shown in the figure.
[0265] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0266] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present disclosure as described above, which are not provided in detail for the sake of simplicity.
[0267] In addition, to simplify the description and discussion, and in order not to obscure the present disclosure, known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the devices may be shown in the form of block diagrams to avoid obscuring the present disclosure, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present disclosure will be implemented (i.e., these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the present disclosure may be implemented without these specific details or with variations in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0268] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0269] The present disclosure is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for upgrading an IoT terminal device, applied to a server, comprising: Determine a supervisory device and perform two-way authentication with the supervisory device; In response to the two-way verification being passed, a first upgrade instruction is sent to the supervision device and the terminal device to be upgraded, wherein the first upgrade instruction includes an encrypted upgrade file, server identity information and a first verification value; After calculating the verification value and verifying the identity of the received upgrade file, the terminal device sends the verification value to the monitoring device, which then reconfirms the verification value by itself or with the server; If the supervisory device is a terminal device in an Internet of Things system, determining the supervisory device and performing two-way verification with the supervisory device includes: Sending a third upgrade instruction and a campaign instruction to at least two terminal devices in at least one local area network, wherein the third upgrade instruction includes encrypted server identity information, and the campaign instruction is used to enable the at least two terminal devices in the at least one local area network to campaign for a supervisory device; Receive third confirmation information returned by the terminal device running for the supervisory device and fourth confirmation information of at least one terminal device among the non-supervisory devices in the at least one local area network, wherein the third confirmation information includes encrypted terminal device identity certification information of the terminal device running for the supervisory device, and the fourth confirmation information includes encrypted terminal device identity certification information of the terminal device running for the supervisory device received by at least one terminal device among the non-supervisory devices; Decrypting the third confirmation information and the fourth confirmation information and comparing the terminal device identity information in the third confirmation information and the fourth confirmation information; In response to the terminal device identity verification being passed, the terminal device running to become the supervisory device is determined as the supervisory device.
2. The method according to claim 1, wherein: If the supervisory device is a gateway device in an Internet of Things system, performing two-way verification with the supervisory device includes: Sending a second upgrade instruction to the supervision device, wherein the second upgrade instruction includes encrypted server identity certification information; receiving first confirmation information returned by the supervisory device, wherein the first confirmation information includes encrypted supervisory device identity certification information; The first confirmation information is decrypted and the identity certification information of the supervisory device is verified.
3. The method according to claim 2, wherein: The method further comprises: receiving second confirmation information returned by the supervisory device, wherein the second confirmation information includes the encrypted supervisory device identity information and the terminal device identity information and the second verification value returned by each terminal device; Comparing the first verification value and the second verification value; If the first verification value and the second verification value are consistent, sending a first upgrade completion confirmation message to the supervision device; If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device is recorded and a first warning message is output.
4. The method according to any one of claims 1 to 3, wherein: Sending a first upgrade instruction to the supervision device includes: The first upgrade instruction is sent in a multicast manner to the supervisory devices that have passed the two-way verification by using the over-the-air download technology.
5. An upgrade method for an IoT terminal device, applied to a supervisory device, comprising: Two-way authentication with the server; In response to the two-way verification being passed, receiving a first upgrade instruction sent by the server, the first upgrade instruction including an encrypted upgrade file, server identity information, and a first verification value; Decrypting the first upgrade instruction and verifying the server identity information; If the server identity information is verified and the supervisory device is a gateway device in the Internet of Things system, a fourth upgrade instruction is sent to a terminal device in the local area network to which the supervisory device belongs, wherein the fourth upgrade instruction includes the encrypted upgrade file, the server identity information, the supervisory device identity information and the first check value; After calculating the verification value and verifying the identity of the received upgrade file, the terminal device sends the verification value to the monitoring device, which then reconfirms the verification value by itself or with the server; If the supervisory device is a terminal device of the Internet of Things system, the supervisory device is determined by the following method: The server sends a third upgrade instruction and a campaign instruction to at least two terminal devices in at least one local area network, wherein the third upgrade instruction includes encrypted server identity information, and the campaign instruction is used to enable the at least two terminal devices in the at least one local area network to campaign for a supervisory device; The server receives third confirmation information returned by the terminal device running for the supervisory device and fourth confirmation information of at least one terminal device among the non-supervisory devices in the at least one local area network, wherein the third confirmation information includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device, and the fourth confirmation information includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device received by at least one terminal device among the non-supervisory devices; The server decrypts the third confirmation information and the fourth confirmation information and compares the terminal device identity information in the third confirmation information and the fourth confirmation information; In response to the terminal device identity verification being successful, the server determines the terminal device running to become the supervisory device as the supervisory device.
6. The method according to claim 5, wherein: If the supervisory device is a gateway device in an IoT system, the two-way verification with the server includes: receiving a second upgrade instruction initiated by the server, wherein the second upgrade instruction includes encrypted server identity authentication information; Decrypting the second upgrade instruction and verifying the server identity information; If the server identity information is verified, first confirmation information is returned to the server, where the first confirmation information includes the encrypted supervision device identity information.
7. The method according to claim 5, wherein: The method further comprises: Receiving fifth confirmation information returned by each terminal device in the local area network to which the supervision device belongs, the fifth confirmation information including the encrypted terminal device identity certification information and the second verification value; Decrypting the fifth confirmation information and verifying the terminal device identity information; If the terminal device identity information is verified, second confirmation information is returned to the server, wherein the second confirmation information includes the encrypted supervision device identity information and the terminal device identity information and second verification value returned by each terminal device in the local area network to which the supervision device belongs.
8. The method according to claim 7, wherein: After the terminal device identity verification information is verified, the method further includes: Comparing the first verification value and the second verification value; If the first verification value and the second verification value are consistent, returning second confirmation information to the server; If the first verification value and the second verification value are inconsistent, the terminal device identity information of the inconsistent terminal device is recorded, and a second warning message is returned to the server.
9. The method according to claim 7, wherein: The second confirmation information also includes the first verification value received by the supervisory device in an encrypted form for verification by the server.
10. The method according to claim 7, wherein: The method further comprises: Receiving first upgrade completion confirmation information sent by the server; According to the first upgrade completion confirmation information, second upgrade completion confirmation information is sent to the corresponding terminal device.
11. A method for upgrading an IoT terminal device, applied to the terminal device, comprising: Receiving a first upgrade instruction sent by a server, wherein the first upgrade instruction includes an encrypted upgrade file, server identity information, and a first verification value; Decrypting the first upgrade instruction and verifying the server identity information; In response to the identity verification being passed, calculating a second verification value and comparing the first verification value with the second verification value; After calculating the verification value and verifying the identity of the received upgrade file, the terminal device sends the verification value to the monitoring device, which then reconfirms the verification value by itself or with the server; The method further comprises: Receiving a third upgrade instruction and a campaign instruction sent by the server, wherein the third upgrade instruction includes encrypted server identity authentication information; Broadcasting first election information to other terminal devices in the local area network, and receiving second election information broadcasted by other terminal devices in the local area network; Comparing the first campaign information with the second campaign information; If the first election information is greater than the second election information, third confirmation information of the election to become the supervisory device is sent to the server, wherein the third confirmation information includes encrypted terminal device identity certification information; If the first election information is smaller than the second election information, fourth confirmation information of other terminal devices running for the supervisory device is sent to the server, wherein the fourth confirmation information includes the encrypted terminal device identity certification information of the terminal device running for the supervisory device; If the first campaign information is equal to the second campaign information, the first campaign information is randomly increased or decreased and the increased or decreased first campaign information is broadcast again.
12. The method according to claim 11, wherein: The method further comprises: Return fifth confirmation information to the supervision device, wherein the fifth confirmation information includes the encrypted terminal device identity certification information and the second verification value.
13. The method according to claim 12, wherein: After the first verification value and the second verification value are verified to be consistent, the method further includes: determining whether second upgrade completion confirmation information sent by the supervisory device is received; If the second upgrade completion confirmation information is received, upgrading is performed according to the upgrade file; If the second upgrade completion confirmation information is not received, the upgrade is not performed.
14. A server, comprising: a communication unit, used for communicating with the supervision device; a memory for storing a set of instructions; as well as At least one processor is configured to execute the set of instructions to perform the method according to any one of claims 1 to 4.
15. A monitoring device comprising: A communication unit, used for communicating with a server and a terminal device; a memory for storing a set of instructions; as well as At least one processor is configured to execute the set of instructions to perform the method according to any one of claims 5 to 10.
16. A terminal device, comprising: a communication unit, used for communicating with the supervision device; a memory for storing a set of instructions; as well as At least one processor is configured to execute the set of instructions to perform the method according to any one of claims 11 to 13.
17. An Internet of Things system, comprising: The server as claimed in claim 14; at least one surveillance device as claimed in claim 15; as well as At least one terminal device as claimed in claim 16; Wherein, the server and the terminal device complete communication through the supervision device.
