WO2021007756A1 - Device update method and system, and first internet of things device and computer-readable medium - Google Patents

Device update method and system, and first internet of things device and computer-readable medium Download PDF

Info

Publication number
WO2021007756A1
WO2021007756A1 PCT/CN2019/096044 CN2019096044W WO2021007756A1 WO 2021007756 A1 WO2021007756 A1 WO 2021007756A1 CN 2019096044 W CN2019096044 W CN 2019096044W WO 2021007756 A1 WO2021007756 A1 WO 2021007756A1
Authority
WO
WIPO (PCT)
Prior art keywords
update data
internet
update
things device
data item
Prior art date
Application number
PCT/CN2019/096044
Other languages
French (fr)
Chinese (zh)
Inventor
藏迪
Original Assignee
西门子股份公司
西门子(中国)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 西门子股份公司, 西门子(中国)有限公司 filed Critical 西门子股份公司
Priority to PCT/CN2019/096044 priority Critical patent/WO2021007756A1/en
Priority to CN201980096245.XA priority patent/CN113826357A/en
Publication of WO2021007756A1 publication Critical patent/WO2021007756A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications

Definitions

  • the present invention relates to the field of communication technology, and in particular to a device update method and system, a first Internet of Things device and a computer-readable medium.
  • IoT devices With the continuous development and progress of the Internet of Things technology, various types of Internet of Things devices are widely used in industrial production, such as programmable logic controllers (PLC), conveyor belts, sensors, etc. In the process of using IoT devices, it is often necessary to update IoT devices. Updating IoT devices mainly includes updating the firmware of IoT devices or upgrading the software running on IoT devices. Multiple IoT devices located in the same network topology are updated.
  • PLC programmable logic controllers
  • Updating IoT devices mainly includes updating the firmware of IoT devices or upgrading the software running on IoT devices. Multiple IoT devices located in the same network topology are updated.
  • an update data package including multiple update data items is prepared in advance, and the update server sends the update data packet to each IoT device in the form of broadcast, and the IoT device receives the update data After the package, select the matching update data item from the update data package to upgrade the firmware or software.
  • the update data package since the update data package includes multiple update data items used to update different IoT devices, the update data package usually has a large amount of data, and the update server needs to broadcast In the form of sending update data packets to various IoT devices, the traffic load of the update server increases.
  • the device update method, system, first Internet of Things device and computer readable medium provided by the present invention can reduce the traffic load of the update server when updating the Internet of Things device.
  • an embodiment of the present invention provides a device update method, including:
  • a first Internet of Things device located in a network topology receives a first update data packet, wherein the first update data packet includes at least one update data item;
  • the target update data item is used to update the firmware of the first Internet of Things device or the software running on it;
  • first update data package includes the target update data item
  • use the target update data item to update the first Internet of Things device, and update the first Internet of Things device from the first update data package
  • the target update data item is deleted, and the second update data package is obtained;
  • the second update data packet includes at least one of the update data items, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
  • next Internet of Things device that needs to be updated is the second Internet of Things device, and the second update data packet is sent to the second Internet of Things device.
  • an embodiment of the present invention also provides a first Internet of Things device, including:
  • a data packet receiving module for receiving a first update data packet, wherein the first update data packet includes at least one update data item
  • a data packet detection module is used to detect whether the first update data packet received by the data packet receiving module includes a target update data item, wherein the target update data item is used to update the first object Update the firmware of networked devices or the software running on them;
  • a device update module configured to use the target update data item to update the first Internet of Things device when the data packet detection module determines that the first update data package includes the target update data item;
  • a data package update module for deleting the target update data item from the first update data package after the device update module updates the first Internet of Things device to obtain a second update data package ;
  • a first data packet sending module configured to include at least one of the new data items in the second update data packet obtained by the data packet update module, and there are IoT devices that need to be updated in the network topology In the case of, determine the next IoT device that needs to be updated as the second IoT device, and send the second update data packet to the second IoT device.
  • an embodiment of the present invention also provides another first Internet of Things device, including: at least one memory and at least one processor;
  • the at least one memory is used to store a machine-readable program
  • the at least one processor is configured to invoke the machine-readable program to execute the method provided in the first aspect.
  • an embodiment of the present invention also provides a device update system, including: at least two first Internet of Things devices provided in the second aspect or the third aspect and an update server;
  • the at least two first Internet of Things devices are connected in sequence in the same network topology, and the update server is connected to one of the first Internet of Things devices located at an end;
  • the update server is configured to send an update data packet including at least one update data item to the connected first Internet of Things device.
  • an embodiment of the present invention also provides a computer-readable medium having computer instructions stored on the computer-readable medium.
  • the processor executes the first The method provided by the aspect.
  • the first Internet of Things device After the first Internet of Things device receives the first update data packet, it detects whether the first update data packet includes the firmware for performing the firmware of the first Internet of Things device or the software running on the first Internet of Things device.
  • the updated target update data item if there is a target update data item in the first update data package, use the target update data item to update the first IoT device, and after the update is completed, the target update data item is changed from the first update data Delete from the package to obtain the second update data package, and then if the second update data package includes update data items and there are IoT devices that need to be updated in the network topology, determine the next IoT device that needs to be updated Is the second Internet of Things device, and sends the second update data packet to the second Internet of Things device.
  • the update data package that includes multiple update data items can be transmitted sequentially among the various IoT devices, and the IoT device that receives the update data packet can use the corresponding update data item in the update data package to update, in After the update is complete, delete the used update data items from the update data package, and then transmit the update data package to the next IoT device, so that each IoT device that needs to be updated can be updated with one update data package.
  • the update server only needs to send an update data packet to one IoT device once. Since the redundant load of the update server is reduced, the traffic load of the update server in the process of updating the IoT device can be reduced.
  • the method further includes:
  • the target update data item is not included in the first update data packet, it is determined whether there are IoT devices that need to be updated in the network topology, and if there are IoT devices that need to be updated, then
  • the next IoT device that needs to be updated is determined as the third IoT device, and the first update data packet is sent to the third IoT device.
  • the first update data packet is sent to the next one that needs to be updated.
  • the updated IoT device ensures that the update data packet can be transmitted to the IoT device that needs to be updated, thereby ensuring that the IoT device update process may proceed smoothly.
  • the update data item is determined Update the data item for the target.
  • the first update data packet includes at least one update data item, and each update data item includes a target device address.
  • the target device address is used to identify the Internet of Things where the update data item can be updated. equipment.
  • For each update data item after comparing the target device address included in the update data item with the device address of the first Internet of Things device, if the target device address included in the update data item is compared with the device address of the first Internet of Things device The address is the same, indicating that the update data item can be used to update the first Internet of Things device, and then the update data item is determined as the target update data item.
  • each update data item is a target update data item that can update the first Internet of Things device, ensuring that it can be accurately determined whether the first update data package includes target update data Item, and then the first Internet of Things device can accurately select the method for processing the first update data packet to ensure that the update process of the Internet of Things device can proceed normally.
  • the first Internet of Things device when the first Internet of Things device is updated with each target update data item, it can be implemented in the following manner:
  • the target update data item is used to update the update object.
  • the private key of the first IoT device verifies whether the security code matches the first IoT device, and verifies whether the first version number is higher than the second version number, only if the security code matches the first IoT device and the first
  • the target update data item is used to update the update object on the first Internet of Things device.
  • the legitimacy of the target update data item can be judged, and the security problems caused by the use of maliciously tampered or illegally created target update data items to update the IoT device can be avoided, so as to ensure the update of the IoT device safety.
  • the first version number With the second version number, it is possible to ensure that the IoT device is updated to an upgrade update, and to avoid the downgrade update of the IoT device due to human error putting low-version update data items into the update data package , which can ensure the reliability of updating the Internet of Things devices.
  • the second update data packet is sent to When the second IoT device is used, it can be implemented in the following ways:
  • the target update data item includes the next update device address, where the next update device address is defined when the update data package is created Yes, it is used to identify the next second IoT device that needs to be updated in the network topology. Therefore, after the first Internet of Things device is updated with the target update data packet, the next update device address can be obtained from the target update data packet, and then the second update data packet is sent to The second IoT device.
  • the update data packet is delivered to the next IoT device according to the address of the next update device included in the target update data item, so that the update data packet can be transmitted according to the predefined delivery path, ensuring that the update data packet can be transmitted to the need for update
  • the Internet of Things equipment and can make the update data package be transmitted to the Internet of Things equipment that needs to be updated as soon as possible, to ensure the efficiency of updating the Internet of Things equipment.
  • the target transmission path is a path connecting the first Internet of Things device and each fourth Internet of Things device in the network topology, and the first update data packet contains a path for each The update data item updated by the fourth Internet of Things device;
  • the fourth Internet of Things that can be updated with each update data item in the first update data packet is first determined from the network topology Device, and then determine the target transmission path connecting the first IoT device and each fourth IoT device, and then determine the fourth IoT device closest to the first IoT device in the target transmission path as the third IoT device , And then send the first update data packet to the third IoT device.
  • each fourth IoT device that needs to be updated based on each update data item included in the update data packet, and then determine a target transmission path that can connect the first IoT device and each fourth IoT device in the network topology, so that The update data packet is transmitted according to the target transmission path.
  • the update data packet passes through as few IoT devices as possible, which can shorten the update data packet transmission The time consumed, thereby improving the efficiency of updating IoT devices.
  • FIG. 1 is a schematic diagram of a device update system provided by an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a connection relationship of Internet of Things devices according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of another connection relationship of Internet of Things devices provided by an embodiment of the present invention.
  • FIG. 4 is a flowchart of a device update method provided by an embodiment of the present invention.
  • Figure 5 is a schematic structural diagram of an update data item provided by an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for updating IoT devices according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a second update data packet transmission method according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of a first update data packet transmission method according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of another device update method provided by an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of a linear topology according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of another device update system provided by an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of an update process of an Internet of Things device provided by an embodiment of the present invention.
  • FIG. 13 is a schematic diagram of a first Internet of Things device according to an embodiment of the present invention.
  • FIG. 14 is a schematic diagram of a first Internet of Things device including a second data packet sending module according to an embodiment of the present invention
  • 15 is a schematic diagram of another first Internet of Things device provided by an embodiment of the present invention.
  • 16 is a schematic diagram of still another first Internet of Things device according to an embodiment of the present invention.
  • FIG. 17 is a schematic diagram of still another first Internet of Things device according to an embodiment of the present invention.
  • FIG. 18 is a schematic diagram of a first Internet of Things device including a memory and a processor according to an embodiment of the present invention.
  • Update server 20 First Internet of Things device 30: Second Internet of Things device
  • Information matching unit 2034 Object update unit 2051: Address acquisition unit
  • the second sending unit 207 Memory 208: Processor
  • 1003 Internet of Things equipment 1004: Internet of Things equipment 1005: Internet of Things equipment
  • Update server 1102 Gateway 1103: Internet of Things equipment
  • Update management system 1203 Gateway 1204: Internet of Things equipment
  • 603 Use the private key of the first Internet of Things device to verify whether the security code matches the first Internet of Things device
  • the update server sends the update packet to an IoT device at the end
  • the Internet of Things device receiving the update data packet detects whether the update data packet includes a target update data item
  • the Internet of Things device uses the target update data item to update the update object
  • the IoT device deletes the target update data item from the update data package
  • the IoT device detects whether the update data package includes update data items
  • the Internet of Things device detects whether there is a second Internet of Things device/third Internet of Things device that needs to be updated
  • the IoT device sends the update packet to the second IoT device/the third IoT device
  • the current update server sends update data packets to each IoT device in the form of broadcast, but because the update data packet includes multiple update data items for updating multiple IoT devices, the update data packet Usually there is a large amount of data, so the update server needs to send an update data packet with a large amount of data to each Internet of Things device respectively, resulting in a large traffic load on the update server.
  • the Internet of Things device after an Internet of Things device receives an update data package, the Internet of Things device obtains the corresponding target update data item from the update data package to update its firmware or the software running on it, after the update is completed Delete the target update data item from the update data package, and then the IoT device will send the update data package to the next IoT device, and the next IoT device will update and package data in the same way as the IoT device Until all the IoT devices are updated, the update server only needs to send an update data packet to one IoT device once, and the update data packet can be delivered to each IoT device to be updated to update the IoT device. When updating IoT devices, the traffic load of the update server can be reduced.
  • the device update method, system, and first Internet of Things device provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that in each of the following embodiments, the first Internet of Things device, the second Internet of Things device, the third Internet of Things device, and the fourth Internet of Things device are Internet of Things devices in the same network topology, and each Internet of Things device is not There are differences between levels, and the network topology can be star topology, tree topology, line topology, ring topology, etc.
  • an embodiment of the present invention provides a device update system, including: an update server 10 and at least two first Internet of Things devices 20;
  • At least two first Internet of Things devices 20 are connected in sequence in the same network topology, and the update server 10 is connected to one first Internet of Things device 20 at the end;
  • the update server 10 is configured to send an update data packet including at least one update data item to the connected first Internet of Things device 20.
  • each first Internet of Things device 20 is connected in sequence in the same network topology, and the update server 10 is connected to a first Internet of Things device 20 at the end, therefore, for any first Internet of Things device 20
  • the Internet of Things device 20 if the first Internet of Things device 20 is directly connected to the update server 10, the first Internet of Things device 20 receives an update data packet from the update server 10. If the first Internet of Things device 20 is not connected to the update server 10 10 is directly connected, the first Internet of Things device 20 receives update data packets from other first Internet of Things devices 20 directly connected to it.
  • the first Internet of Things device 20 directly connected to the update server 10 refers to the Internet of Things device that is directly connected to the update server 10 without passing through other Internet of Things devices in the physical network.
  • the first Internet of Things device directly connected to the update server 10 refers to the Internet of Things device that needs to pass through one or more other Internet of Things devices to connect to the update service 20 in the physical network, and the two first things that are directly connected
  • the Internet of Things 20 refers to two Internet of Things devices that are directly connected without passing through other Internet of Things devices in the network topology. However, in the physical network, the two Internet of Things devices can be connected without passing through other Internet of Things devices. It can be connected via one or more other IoT devices.
  • any one of the first Internet of Things device 20 in order to facilitate the distinction between the update data packet received by the first Internet of Things device 20 and the update data after the first Internet of Things device 20 deletes the target update data item
  • the update data package received by the first Internet of Things device 20 is defined as the first update data package
  • the update data package after the first Internet of Things device 20 deletes the target update data item is defined as the second update data package.
  • the first Internet of Things device 20 After the first Internet of Things device 20 receives the first update data packet, according to the difference in the update data items included in the received first update data packet, the first Internet of Things device 20 A total of three different processing methods from A to C can be adopted as follows:
  • the first update data package includes a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, the first Internet of Things device 20 uses The target update data item is updated, and then the target update data item is deleted from the first update data package to obtain the second update data package.
  • the first Internet of Things device 20 can again take the following A-1 to A-3 has three processing methods:
  • the first IoT device 20 sets the second The update data packet is sent to the next second Internet of Things device 30 that needs to be updated.
  • the first Internet of Things device 20 sends the second update data packet to the second Internet of Things device 30, so that the second Internet of Things device 30 can use the same method to update.
  • the first IoT device 20 deletes the second update data packet, and the device update process is terminated. At this time, since there is no IoT device that needs to be updated in the network topology, after the first IoT device 20 deletes the second update data packet, the update of the IoT device is terminated.
  • the first Internet of Things device 20 deletes the second update data package, and the device update process is terminated. At this time, since there is no update data item in the second update data packet that can be used to update the Internet of Things device, there is no need to continue to transmit the empty second update data packet, so that the first Internet of Things device 20 transfers the second The update data package is deleted, and the update of the IoT device is terminated.
  • the first update data package does not include a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, and There are IoT devices that need to be updated in the network topology, and the first IoT device 20 sends the first update data packet to the next third IoT device 40 that needs to be updated.
  • the first update data package does not include the target update data item used to update the first Internet of Things device 20, it means that the first Internet of Things device 20 does not need to be updated this time.
  • the first Internet of Things device 20 directly sends the received first update data packet to the next third Internet of Things device 40 that needs to be updated for subsequent Internet of Things devices to update.
  • the first update data package does not include a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, and there is no need in the network topology
  • the first Internet of Things device 20 deletes the first update data packet, and the device update process is terminated.
  • the first update data packet still includes update data items, there is no need to continue to transmit the first update data packet, and the first IoT device 20 After the first update data packet is deleted, the update of the IoT device is terminated.
  • the second Internet of Things device 30 and the third Internet of Things device 40 are Internet of Things devices that need to be updated in the network topology, and the first thing in the network topology
  • the networked device 20 may be directly connected to the second Internet of Things device 30 and the third Internet of Things device 40, or may not be directly connected.
  • the first Internet of Things device 20 can directly send the second update data packet to the second Internet of Things device 30 or directly send the first update data packet to the third Internet of Things device 40.
  • the first Internet of Things device 20 needs to send the first update data packet or the second update data packet first. It is sent to the Internet of Things devices that do not need to be updated between the first Internet of Things device 20, the second Internet of Things device 30, and the third Internet of Things device 40 in the network topology, and the Internet of Things devices that do not need to update receive the first Internet of Things device. After the update data packet or the second update data packet, the first update data packet or the second update data packet is transferred to the second Internet of Things device 30 or the third Internet of Things device 40 according to the processing method B.
  • the first Internet of Things device 20 that has obtained the update data packet determines from the update data packet that it can Update the data item for the updated target, and delete the determined target update data item from the update data package after completing the update with the determined target update data item, and then send the update data package to the next first thing
  • the networked device 20 until there is no IoT device that needs to be updated in the network topology or the update data package no longer includes update data items.
  • the update data packet is transmitted between each first Internet of Things device 20, and each first Internet of Things device 20 obtains the required update data item from the update data packet for update, and will have used it after the update is completed.
  • the update data items of the update data items are deleted until the update of all the first IoT devices 20 that have update requirements is completed. Since the update server 10 only needs to send an update data packet once, the redundant load of the update server 10 is reduced, thereby reducing the update of the Internet of Things
  • the traffic load of the server 10 is updated during the installation process.
  • the at least two first IoT devices 20 connected in sequence may be located in various types of network topologies such as star topology, tree topology, line topology, ring topology and so on.
  • the transmission path of the update data packet can be determined by defining the parameters of the update data packet, and the transmission path of the update data packet is each first IoT device 20 connected in sequence.
  • the two themselves are composed of a plurality of first IoT devices 20 connected in sequence, except for the two first IoT devices in the ring topology. 20 connected together to form a ring.
  • the first Internet of Things device 20, the second Internet of Things device 30, and the third Internet of Things device in the embodiment of the present invention are located in the same network topology.
  • Which Internet of Things devices are included in the network topology can be predefined, from The update data packet sent by the update server is used to update the IoT devices in the network topology.
  • the network topology can be defined according to the application scenario:
  • the network topology includes all IoT devices included in an actual physical network.
  • the network topology includes all IoT devices of a certain type predefined in an actual physical network
  • the network topology includes a number of IoT devices predetermined in an actual physical network, wherein a device list can be formed according to identification information such as the device address and device name of each IoT device, and the update data item includes The identification information of the next IoT device to be updated.
  • the update data packet is transmitted between the devices, and the update data packet The number of updated data items is gradually reduced, which reduces the data transmission delay between IoT devices and improves the update efficiency of IoT devices.
  • the actual physical network can be a network composed of network equipment in a factory, a network composed of network equipment in a workshop of the factory, or a network of a production line in a workshop of the factory A network of devices.
  • the device type can be PLC, industrial host, etc.
  • the update server involved in each of the following method embodiments may be the aforementioned update server 10
  • the first IoT device involved in each of the following method embodiments may be the aforementioned first IoT device 20.
  • the second Internet of Things device involved in each method embodiment may be the aforementioned second Internet of Things device 30, and the third Internet of Things device involved in each method embodiment described below may be the aforementioned third Internet of Things device 40.
  • the first Internet of Things device determines whether to perform update processing according to the difference in the update data item in the received update data packet, and according to whether there are still Internet of Things devices that need to be updated in the network topology Decide whether to continue transmitting update packets.
  • the method may specifically include the following steps:
  • Step 401 Receive a first update data packet, where the first update data packet includes at least one update data item;
  • Step 402 Detect whether a target update data item is included in the first update data packet
  • Step 403 If there is a target update data item in the first update data packet, use the target update data item to update the first Internet of Things device;
  • Step 404 Delete the target update data item from the first update data package to obtain a second update data package
  • Step 405 If the second update data packet includes at least one update data item, and the IoT device that needs to be updated in the network topology, determine that the next IoT device that needs to be updated is the second IoT device, and Send the second update data packet to the second Internet of Things device.
  • the first update data package after receiving the first update data package, it is detected whether the first update data package includes a target for updating the firmware of the first Internet of Things device or the software running on the first Internet of Things device Update the data item. If there is a target update data item in the first update data package, use the target update data item to update the first Internet of Things device, and after the update is completed, remove each target update data item from the first update data package Delete to obtain the second update data packet, and then send the second update data packet to the second Internet of Things if the update data item is included in the second update data packet and there are IoT devices that need to be updated in the network topology equipment.
  • the update data package that includes multiple update data items can be transmitted sequentially among the various IoT devices, and the IoT device that receives the update data packet can use the corresponding update data item in the update data package to update, in After the update is complete, delete the used update data items from the update data package, and then transmit the update data package to the next IoT device, so that each IoT device that needs to be updated can be updated with one update data package.
  • the update server only needs to send an update data packet to one IoT device once. Since the redundant load of the update server is reduced, the traffic load of the update server in the process of updating the IoT device can be reduced.
  • the target update data item is used After the first Internet of Things device is updated, the first update data packet after deleting the target update data item is taken as the second update data packet, and then the second update data packet can be sent to the second Internet of Things device. Because the firmware of different IoT devices and the software running on them are different, the update data items used to update different IoT devices are also different. The updated data items that have been used are deleted from the update data package. The data volume of the update data packet is continuously reduced with the progress of the update data packet transmission process, thereby reducing the network bandwidth required to transmit the update data packet, and can increase the transmission rate of the update data packet, which is helpful to increase The efficiency of updating IoT devices.
  • the transmission of the second update data packet is stopped, and the current IoT device update ends.
  • the second update data packet is stopped at this time, and the current IoT device update ends.
  • step 402 detects whether the first update data packet includes a target update data item, if the middle of the first update data packet includes a target update data item, you can further Determine whether there is an IoT device that needs to be updated in the network topology. If there is an IoT device that needs to be updated in the network topology, determine the next IoT device that needs to be updated as the third IoT device, and then update the first The data packet is sent to the third IoT device.
  • the first update data packet is sent to the next one that needs to be updated.
  • the updated IoT device ensures that the update data packet can be transmitted to the IoT device that needs to be updated, thereby ensuring that the IoT device update process may proceed smoothly.
  • step 402 when step 402 detects whether the first update data package includes a target update data item, it may be detected whether each update data item included in the first update data package is The target update data item is used to determine whether the first update data packet includes the target update data item.
  • the target device address included in the update data item is acquired. If the acquired target device address is the same as the device address of the first Internet of Things device, then The update data item is determined to be a target update data item. After traversing all the update data items in the first update data package, if one update data item in the first update data package is determined as the target update data item, it is determined that the first update data package includes the target update data item, That is, it indicates that there is an update data item used to update the first Internet of Things device in the first update data package.
  • each update data item includes a target device address, and the target device address is used to identify the Internet of Things device that needs to be updated.
  • the Internet of Things device After an Internet of Things device receives the update packet, the Internet of Things device By detecting the target device address included in each update data item in the update data package, the device can determine whether the update data package includes the target update data item used to update the Internet of Things device, and then can determine the firmware and software Update or directly forward the obtained update data packet to the next IoT device. In this way, it is possible to update part of the Internet of Things devices in the network topology and to ensure the normal transmission of update data packets.
  • the target device address can be an IP address, a MAC address, and so on.
  • the structure of the update data item can be specifically as shown in Figure 5.
  • the update data item can also include a security code 501, a version number 503, update content 504, protocol information 505, status information 506, and The next update device address 507, etc., where the security code 501 is used to verify the update data item, the version number 503 is used to identify the version of the update content, the update content 504 is the specific update data, and the protocol information 505 is used to identify the network transmission Protocol, the status information 506 is used to identify the operating status of the Internet of Things device, and the next update device address 507 is used to identify the next Internet of Things device to receive an update packet.
  • the security code 501, the version number 503, and the next update device address 507 will be described in detail in subsequent embodiments.
  • the protocol information 505 may specifically be TFTP, SNMP, NFS, DNS, or BOOTP.
  • the target update data item needs to be updated according to the security code included in the target update data item. Security is verified, and it is necessary to verify whether the update process is an upgrade process according to the version number included in the target update data item. After passing the above two verifications, the target update data item is used to update the first Internet of Things device.
  • the method for updating the first Internet of Things device using the target update data item may include the following steps:
  • Step 601 Acquire a security code and a first version number included in a target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device, and the first version number Used to identify the version of the target update data item;
  • Step 602 Obtain the second version number of the update object corresponding to the target update data item on the first Internet of Things device, where the update object includes the firmware of the first Internet of Things device or software running on the Internet of Things;
  • Step 603 Use the private key of the first Internet of Things device to verify whether the security code matches the first Internet of Things device, if it is Y, go to step 604, if not, go to step 606;
  • Step 604 Determine whether the first version number is higher than the second version number, if it is Y, go to step 605, if not, go to step 606;
  • Step 605 Use the target update data item to update the update object
  • Step 606 End the current process.
  • the private key of the first Internet of Things device is first used to verify whether the security code included in the target update data item matches the first Internet of Things device, and only when the security code matches the first Internet of Things device Only when it matches can the target update data item be used to update the first IoT device, so as to avoid malicious tampering of the target update data item and cause abnormal operation of the updated IoT device, thereby ensuring the security and reliability of the update.
  • the security code included in the target update data item can be encrypted by the public key of the first Internet of Things device. If the private key of the first Internet of Things device can be used to successfully decrypt the security code, it means that the security code and the first If the IoT device matches, if the security code cannot be successfully decrypted by using the private key of the first IoT device, it means that the security code does not match the first IoT device.
  • the target update data item after determining that the security code included in the target update data item matches the first Internet of Things device, it can be further determined whether the first version number included in the target update data item is higher than the first Internet of Things device.
  • the second version number of the corresponding update object on the above only when the first version number is higher than the second version number, will the target update data item be used to update the update object on the first Internet of Things device, ensuring that the Internet of Things device
  • the update of the Internet of Things is an upgrade process to avoid downgrading or parallel updating of the Internet of Things devices due to operational errors, thereby ensuring the reliability of updating the Internet of Things devices.
  • the updating of the IoT device is essentially updating the firmware of the IoT device or the software program running on the IoT device, that is,
  • the update object is the firmware of the IoT device or the software program running on the IoT device.
  • the target update data item can include one or more update data sub-items, and each update data sub-item is used to update one update object, which is suitable for simultaneously updating multiple data on the same IoT device.
  • the structure of each update data sub-item has the structure shown in FIG. 5.
  • the method of sending the second update data packet to the second Internet of Things device may specifically include the following steps:
  • Step 701 Obtain the next update device address included in the target update data item, where the next update device address is used to identify the second Internet of Things device in the network topology;
  • Step 702 Send the second update data packet to the second Internet of Things device according to the acquired address of the next update device.
  • the target update data item includes the next update device address. After the target update data item is deleted from the first update data packet and the second update data packet is obtained, Obtain the next update device address in the target update data item, and the update device address is used to identify the next IoT device that needs to be updated in the network topology, and then determine the next IoT device that needs to be updated as the second thing In this way, the second update data packet can be sent to the second Internet of Things device conveniently according to the address of the next update device, so that the update data packet can be transmitted between the Internet of Things devices.
  • the method of sending the first update data packet to the third Internet of Things device may specifically include the following steps:
  • Step 801 Determine the target transmission path, where the target transmission path is a path connecting the first Internet of Things device and each fourth Internet of Things device in the network topology, and the first update data packet is used for each fourth Internet of Things device Update data items for updating;
  • Step 802 Determine a fourth Internet of Things device closest to the first Internet of Things device in the target transmission path as the third Internet of Things device;
  • Step 803 Send the first update data packet to the third Internet of Things device.
  • the target device address included in the update data item determines the fourth Internet of Things device in the network topology that can be updated with the update data item.
  • determine the path connecting the first IoT device and each fourth IoT device in the network topology as the target path and then set the target A fourth Internet of Things device closest to the first Internet of Things device in the path is determined to be the third Internet of Things device, and then the first update data packet can be sent to the determined third Internet of Things device.
  • the third Internet of Things device cannot be determined according to the target device address included in the target update data item.
  • the first IoT device in the target path closest to the first IoT device Fourth, the Internet of Things device is determined to be the third Internet of Things device, and then the first update data packet is sent to the third Internet of Things device.
  • the IoT devices in the same network topology when the IoT devices in the same network topology are updated, all the IoT devices in the network topology may not be updated, so the IoT devices located on the target transmission path may not only be
  • the first Internet of Things device and each fourth Internet of Things device that is, the target transmission path between the first Internet of Things device and the fourth Internet of Things device or between two fourth Internet of Things devices may have other things that do not need to be updated IoT devices.
  • the device updating method may include the following steps:
  • Step 901 The update server sends the update data packet to an IoT device at the end.
  • the linear topology includes IoT devices 1001 to 1005 connected in sequence
  • the update data packet includes update data items 1 to update Data item 4, where update data item 1 and update data item 2 are used to update the Internet of Things device 1001, update data item 3 is used to update the Internet of Things device 3, and update data item 4 is used to update the Internet of Things device 4 Update.
  • the update server first sends an update data packet to the Internet of Things device 1001.
  • Step 902 The IoT device that has received the update data packet detects whether the update data packet includes the target update data item, if it is Y, execute step 903, if not, execute step 908.
  • an Internet of Things device in the network topology receives an update data packet from an update server or other Internet of Things device
  • the Internet of Things device first detects whether there is any update data packet for itself.
  • the target update data item if the target update data item exists, it needs to update itself, and step 903 is executed accordingly. If the target update data item does not exist, the update data packet needs to be sent to the next IoT device, and the steps are executed accordingly 908.
  • the IoT device After the IoT device receives the update data packet, it can detect whether the target device address included in at least one update data item is the same as the device address of the IoT device in the update data packet, and if it exists, the update data packet is determined There is a target update data item in it, and the included update data item whose target device address is the same as the device address of the Internet of Things device is determined as the target update data item.
  • the IoT device 1001 receives the update data packet from the update server, it detects that the target device address included in the update data item 1 and the update data item 2 is the same as the device address of the IoT device 1001, and then updates the data item 1 and update data item 2 are determined to be the target update data item of the Internet of Things device 1001, and step 903 is executed accordingly.
  • the Internet of Things device 1002 receives the update data packet from the Internet of Things device 1001, since the target device address included in the update data item is not the same as the device address of the Internet of Things device 1002 in the update data packet, the Internet of Things device 1002 performs the steps 908.
  • Step 903 verify whether the security code included in the target update data item matches the IoT device, if it is Y, execute step 904, if not, execute step 906.
  • the private key of the IoT device is used to verify whether the security code included in the target update data item matches the IoT device, and if it matches, Step 904 is executed for the target update data item, and if there is no match, step 906 is executed for the target update data item.
  • the IoT device 1003 uses its private key to verify whether the security code included in the update data item 3 matches the IoT device 1003.
  • the verification result is that the security code included in the updated data item 3 matches the Internet of Things device 1003, and the Internet of Things device 1003 performs step 904 for the updated data item 3.
  • the IoT device 1004 determines the update data item 4 as its own target to update the data item, the IoT device 1004 uses its private key to verify whether the security code included in the update data item 4 matches the IoT device 1004, the verification result To update the security code included in the data item 4 does not match the Internet of Things device 1004, the Internet of Things device 1004 performs step 906 for the updated data item 4.
  • Step 904 verify whether the version number included in the target update data item is higher than the version number of the update object on the Internet of Things device, if it is Y, perform step 905, if not, perform step 906.
  • step 905 after verifying that the security code included in the target update data item matches the IoT device, determine the update object used for the update of the target update data item, and verify whether the version number included in the target update data item is If it is higher than the version number of the update object, step 905 is executed for the target update data item, otherwise, step 906 is executed for the target update data item.
  • the update data item 1 is used to update the firmware of the Internet of Things device 1001
  • the update data item 2 is used to update the software 1 on the Internet of Things device 1001
  • the version number included in the update data item 1 is higher than the version number of the firmware of the Internet of Things device 1001
  • the version number included in the update data item 2 is higher than the version number of the software 1
  • the Internet of Things device 1001 responds to the update data item 1 and update data Item 2 executes step 905.
  • the version number of the firmware of the Internet of Things device 1003 is obtained, and the version number of the firmware of the Internet of Things device 1003 is included in the update data item 3.
  • the comparison result is that the version number included in the updated data item 3 is lower than the version number of the firmware of the Internet of Things device 1003, and the Internet of Things device 1003 performs step 906 for the updated data item 3.
  • Step 905 The Internet of Things device uses the target update data item to update the update object.
  • the Internet of Things device uses the target update data item to update the update object.
  • the Internet of Things device 1001 uses update data item 1 to update the firmware of the Internet of Things device 1001
  • the Internet of Things device 1001 uses update data item 2 to update the software 1 on the Internet of Things device 1001.
  • Step 906 The IoT device deletes the target update data item from the update data package.
  • the target update data item for each determined target update data item, when it is determined that the security code included in the target update data item does not match the IoT device, or when the version number included in the target update data item is determined After it is lower than or equal to the version number of the update object on the IoT device, or after the target update data item has been used to update the corresponding update object, the target update data item is deleted from the update data package.
  • the Internet of Things device 1001 deletes the update data item 1 and the update data item 2 from the obtained update data package
  • the Internet of Things device 1003 deletes the update data item 3 from the obtained update data package
  • the Internet of Things device 1004 The update data item 4 will be deleted from the obtained update data package.
  • Step 907 The Internet of Things device detects whether the update data packet includes an update data item, if it is Y, execute step 908, if not, execute step 810.
  • step 908 for each Internet of Things device, if there is a target update data item in the update data packet received by the Internet of Things device, after the target update data item is deleted from the update data package, it is determined to update Whether there is at least one update data item in the data packet, if yes, go to step 908, if otherwise, go to step 910; if there is no target update data item in the update data packet received by the IoT device, it does not need to be deleted
  • the target is the step of updating data items. Therefore, there must be at least one update data item in the update data packet, and step 908 is executed at this time.
  • the Internet of Things device 1001 deletes update data item 1 and update data item 2 from the update data package, since the update data package also includes update data item 3 and update data item 4, the Internet of Things device 1001 executes steps 908.
  • the Internet of Things device 1002 does not perform an operation to delete the target update data item.
  • the update data package it obtains from the Internet of Things device 1001 includes update data item 3 and update data item 4, so the Internet of Things device 1002 performs step 908.
  • the Internet of Things device 1003 deletes the update data item 3 from the update data package, since the update data package also includes the update data item 4, the Internet of Things device 1003 executes step 908.
  • the IoT device 1004 deletes the update data item 4 from the update data package, since the update data package does not include any update data items, the IoT device 1004 executes step 910.
  • Step 908 The Internet of Things device detects whether the second Internet of Things device/third Internet of Things device that needs to be updated is stored, if it is Y, execute step 909, if not, execute step 910.
  • the Internet of Things device after the Internet of Things device deletes the target update data item from the update data package, if it is determined that the update data package also includes the update data item, the Internet of Things device determines whether there is still a need in the network topology For the second Internet of Things device to be updated, if yes, execute step 909; otherwise, execute step 910. After the Internet of Things device determines that the update data packet does not include the target update data item, the Internet of Things device determines whether there is a third Internet of Things device that needs to be updated in the network topology, and if so, execute step 909, otherwise execute step 910.
  • the Internet of Things device 1002 is the second Internet of Things device of the Internet of Things device 1001, so the Internet of Things device 1001 performs step 909 after determining that there is an update data item in the update data packet.
  • the Internet of Things device 1005 does not have a connected second Internet of Things device. Even if the Internet of Things device 1005 determines that there is an update data item in the update data packet, the Internet of Things device 1005 will perform step 910.
  • Step 909 The IoT device sends the update data packet to the second IoT device/third IoT device.
  • the IoT device determines that there is an update data item in the update data packet and there is a second IoT device/third IoT device that needs to be updated
  • the IoT device sends the update data packet to the second IoT device Device/third Internet of Things device
  • the second Internet of Things device/third Internet of Things device that receives the update data package will continue to update the Internet of Things device or transfer the update data package according to step 902 to step 909.
  • the Internet of Things device 1001 sends an update data packet to the Internet of Things device 1002, the Internet of Things device 1002 sends an update data packet to the Internet of Things device 1003, and the Internet of Things device 1003 sends an update data packet to the Internet of Things device 1004.
  • Step 910 The IoT device deletes the update data package, and this update ends.
  • the Internet of Things device when the Internet of Things device is at the end of the network topology, or the update data package no longer includes the update data item, the Internet of Things device deletes the empty update data packet. This update of the Internet of Things device End.
  • the update server 1101 is connected to the gateway 1102, the gateway 1102 is connected to the IoT device 1103, and the IoT device 1103 To 1107 are connected in sequence, and the Internet of Things device 1107 is connected to the gateway 1102.
  • the gateway 1102 sends the update data package 1108 to the Internet of Things device 1103.
  • the update data package 1108 includes information for updating the Internet of Things devices 1103 to 1107. Multiple update data items. As shown in Figure 11, the shading is used to represent the update data items included in the update data packet 1108. It can be seen that the update data packet 1108 sent by the gateway 1102 to the IoT device 1103 includes all the update data items. For example, the update data packet 1108 at this time The amount of data is 64K.
  • the IoT device 1103 After the IoT device 1103 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, and then deletes the update data item used to update the IoT device 1103 from the update data package 1108, Then, the update data packet 1108 is sent to the Internet of Things device 1104. As shown in FIG. 11, the update data items in the update data packet 1108 sent by the IoT device 1103 to the IoT device 1104 have been reduced, specifically it does not include the update data items used to update the IoT device 1103, such as this The data volume of the time update data packet 1108 is 50K.
  • the IoT device 1104 After the IoT device 1104 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1104, and then updates the data package 1108 Send to the Internet of Things device 1105. As shown in Figure 11, the update data package 1108 sent by the Internet of Things device 1104 to the Internet of Things device 1105 has further reduced the number of update data items in China, specifically excluding the updates used to update the Internet of Things device 1103 and the Internet of Things device 1104 The data item, for example, the data volume of the update data packet 1108 at this time is 40K.
  • the IoT device 1105 After the IoT device 1105 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1105, and then updates the data package 1108 Send to the Internet of Things device 1106.
  • the update data package 1108 sent by the Internet of Things device 1105 to the Internet of Things device 1106 has further reduced data items in China, specifically not including the update data items used to update the Internet of Things devices 1103 to 1105.
  • the data volume of the update data packet 1108 at this time is 30K.
  • the IoT device 1106 After the IoT device 1106 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1106, and then updates the data package 1108 Send to the Internet of Things device 1107.
  • the update data package 1108 sent by the Internet of Things device 1106 to the Internet of Things device 1107 has further reduced data items in China, specifically not including the update data items used to update the Internet of Things devices 1103 to 1106. For example, at this time, the data volume of the update data packet 1108 is 11K.
  • the IoT device 1107 After the IoT device 1107 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1106, and then updates the data package 1108 Send to gateway 1102. As shown in FIG. 11, the update data package 1108 sent by the Internet of Things device 1107 to the gateway 1102 does not include any update data items. For example, the data volume of the update data package 1108 at this time is 0K.
  • the update process involves the user 1201, the update management system 1202, the gateway 1203, and the IoT devices 1204 to 120n.
  • the specific design steps include :
  • the update management system 1202 transmits the update data packet to the gateway 1203;
  • S07 Send instruction information indicating that the update is complete to the gateway 1203.
  • the IoT device 1204 performs S03 to S06.
  • the IoT device 1204 performs S03 to S06 for the update data packet from the gateway 1203.
  • the rest of the IoT devices perform S03 to S06 for the update packet from the previous IoT device.
  • the IoT device 120n at the end performs S07 after performing S03 to S06 to notify the gateway 1203 that the IoT device update for the update data packet has been completed.
  • an embodiment of the present invention provides a first Internet of Things device 20, including:
  • a data packet detection module 202 is used to detect whether the first update data packet received by the data packet receiving module 201 includes a target update data item, wherein the target update data item is used to update the firmware of the first Internet of Things device 20 or The software running on it is updated;
  • a device update module 203 configured to use the target update data item to update the first Internet of Things device 20 when the data packet detection module 202 determines that the first update data package includes a target update data item;
  • a data package update module 204 configured to delete the target update data item from the first update data package after the device update module 203 updates the first Internet of Things device 20 to obtain a second update data package;
  • a first data packet sending module 205 is used to determine the next step when the second update data packet obtained by the data packet update module 204 includes at least one new data item, and there is an IoT device that needs to be updated in the network topology An Internet of Things device that needs to be updated is used as the second Internet of Things device 30, and the second update data packet is sent to the second Internet of Things device 30.
  • the data packet receiving module 201 can be used to perform step 401 in the above method embodiment
  • the data packet detection module 202 can be used to perform step 402 in the above method embodiment
  • the device update module 203 can be used to perform the above method
  • the data packet update module 204 can be used to execute step 404 in the above method embodiment
  • the first data packet sending module 205 can be used to execute step 405 in the above method embodiment.
  • the first Internet of Things device 20 further includes:
  • a second data packet sending module 206 is used to determine the next need when the data packet detection module 202 determines that the first update data packet does not include the target update data item, and there are IoT devices that need to be updated in the network topology
  • the Internet of Things device to be updated serves as the third Internet of Things device 40 and sends the first update data packet to the third Internet of Things device 40.
  • the data packet detection module 202 is used for each update data item included in the first update data packet, if the update data item is The included target device address is the same as the device address of the first Internet of Things device 20, and the update data item is determined as a target update data item.
  • the device update module 203 includes:
  • a first information obtaining unit 2031 is used to obtain the security code and the first version number included in the target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device 20, and the first The version number is used to identify the version of the target update data item;
  • a second information acquisition unit 2032 configured to acquire the second version number of the update object corresponding to the target update data item on the first Internet of Things device 20, where the update object includes the firmware or the thing of the first Internet of Things device 20 Software running on the Internet;
  • An information matching unit 2033 is configured to use the private key of the first Internet of Things device 20 to verify whether the security code acquired by the first information acquisition unit 2031 matches the first Internet of Things device 20, and to determine whether the first information acquisition unit 2031 acquires Whether the obtained first version number is higher than the second version number obtained by the second information obtaining unit 2032;
  • An object update unit 2034 for determining in the information matching unit 2033 that the security code included in the target update data item matches the first IoT device 20, and the first version number included in the target update data item is higher than the second version At the time of number, use the target update data item to update the update object.
  • the first information obtaining unit 2031 may be used to perform step 601 in the above method embodiment
  • the second information obtaining unit 2032 may be used to perform step 602 in the above method embodiment
  • the information matching unit 2033 may be used to perform
  • the object update unit 2034 may be used to execute step 605 and step 606 in the foregoing method embodiment.
  • the first data packet sending module 205 includes:
  • An address obtaining unit 2051 configured to obtain the next update device address included in the target update data item, where the next update device address is used to identify the third Internet of Things device 40 in the network topology;
  • a first sending unit 2052 is configured to send the second update data packet to the second Internet of Things device 30 according to the address of the next update device obtained by the address obtaining unit 2051.
  • the address obtaining unit 2051 may be used to perform step 701 in the foregoing method embodiment, and the first sending unit 2052 may be used to perform step 702 in the foregoing method embodiment.
  • the second data packet sending module 206 includes:
  • a path determination unit 2061 is used to determine a target transmission path, where the target transmission path is a path connecting the first Internet of Things device 20 and each fourth Internet of Things device in the network topology, and the first update data packet is used to An update data item for the fourth Internet of Things device to update;
  • a device screening unit 2062 configured to determine a fourth Internet of Things device closest to the first Internet of Things device 20 in the target transmission path determined by the path determination unit 2061 as the third Internet of Things device 40;
  • a second sending unit 2063 is configured to send the first update data packet to the third Internet of Things device 40 determined by the device screening unit 2062.
  • the path determining unit 2061 can be used to perform step 801 in the above method embodiment
  • the device screening unit 2062 can be used to perform step 802 in the above method embodiment
  • the second sending unit 2063 can be used to perform the above method implementation. Step 803 in the example.
  • an embodiment of the present invention provides a first Internet of Things device 20, including:
  • At least one memory 207 configured to store executable instructions
  • At least one processor 208 coupled with the at least one memory 207, when executing the executable instructions, is configured to:
  • a first Internet of Things device 20 located in a network topology receives a first update data packet, wherein the first update data packet includes at least one update data item;
  • the target update data item is used to update the firmware of the first Internet of Things device 20 or the software running on it;
  • the target update data item is used to update the first Internet of Things device 20, and all data items are updated from the first update data package.
  • the target update data item is deleted, and the second update data package is obtained;
  • the second update data packet includes at least one of the update data items, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
  • next Internet of Things device that needs to be updated is the second Internet of Things device 30, and the second update data packet is sent to the second Internet of Things device 30.
  • the at least one processor 208 is further configured to: when executing the executable instruction:
  • the target update data item is not included in the first update data packet, then determine whether there is an IoT device that needs to be updated in the network topology. If there is an IoT device that needs to be updated, determine the next IoT device that needs to be updated as the first The third Internet of Things device 40, and the first update data packet is sent to the third Internet of Things device 40.
  • the at least one processor 208 is further configured to: when executing the executable instruction:
  • the update data item is determined as the target update data item .
  • the at least one processor 208 is further configured to: when executing the executable instruction:
  • the target update data item is used to update the update object.
  • the at least one processor 208 is further configured to: when executing the executable instruction:
  • next update device address included in the target update data item where the next update device address is used to identify the second Internet of Things device 30 in the network topology;
  • the second update data packet is sent to the second Internet of Things device 30.
  • the at least one processor 208 is further configured to: when executing the executable instruction:
  • the target transmission path is a path connecting the first Internet of Things device 20 and each fourth Internet of Things device in the network topology, and there is a first update data packet for updating each fourth Internet of Things device
  • the updated data item
  • the first update data packet is sent to the third Internet of Things device 40.
  • the present invention also provides a computer-readable medium that stores instructions for causing a computer to execute the device update method described herein.
  • a system or device equipped with a storage medium may be provided, and the software program code for realizing the function of any one of the above embodiments is stored on the storage medium, and the computer (or CPU or MPU of the system or device) ) Read and execute the program code stored in the storage medium.
  • the program code itself read from the storage medium can realize the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present invention.
  • Examples of storage media used to provide program codes include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Magnetic tape, non-volatile memory card and ROM.
  • the program code can be downloaded from the server computer via a communication network.
  • the program code read from the storage medium is written to the memory provided in the expansion board inserted into the computer or to the memory provided in the expansion unit connected to the computer, and then the program code is based on The instructions cause the CPU installed on the expansion board or the expansion unit to perform part or all of the actual operations, so as to realize the function of any one of the above-mentioned embodiments.
  • the hardware unit can be implemented mechanically or electrically.
  • a hardware unit may include a permanent dedicated circuit or logic (such as a dedicated processor, FPGA or ASIC) to complete the corresponding operation.
  • the hardware unit may also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which may be temporarily set by software to complete corresponding operations.
  • the specific implementation mode mechanical method, or dedicated permanent circuit, or temporarily set circuit

Abstract

A device update method and system, and a first Internet of things device and a computer-readable medium. The device update method is applied to the first Internet of things device, and comprises: receiving a first update data packet (401); detecting whether the first update data packet comprises a target update data item (402); using the target update data item to update the first Internet of things device (403); deleting the target update data item from the first update data packet to obtain a second update data packet (404); and sending the second update data packet to a second Internet of things device (405). The traffic load of an update server can be reduced when an Internet of things device is updated.

Description

设备更新方法、系统及第一物联网设备和计算机可读介质Device update method, system, first internet of things device and computer readable medium 技术领域Technical field
本发明涉及通信技术领域,尤其涉及设备更新方法、系统及第一物联网设备和计算机可读介质。The present invention relates to the field of communication technology, and in particular to a device update method and system, a first Internet of Things device and a computer-readable medium.
背景技术Background technique
随着物联网技术的不断发展与进步,各种类型的物联网设备被广泛应用的工业生产,比如可编程逻辑控制器(Programmable Logic Controller,PLC)、传送带、传感器等。在物联网设备的使用过程中,经常需要对物联网设备进行更新,对物联网设备进行更新主要包括对物联网设备的固件进行更新或对物联网设备上运行的软件进行升级,而经常需要对位于同一网络拓扑中的多个物联网设备进行更新。With the continuous development and progress of the Internet of Things technology, various types of Internet of Things devices are widely used in industrial production, such as programmable logic controllers (PLC), conveyor belts, sensors, etc. In the process of using IoT devices, it is often necessary to update IoT devices. Updating IoT devices mainly includes updating the firmware of IoT devices or upgrading the software running on IoT devices. Multiple IoT devices located in the same network topology are updated.
目前,在对物联网设备进行更新时,预先准备包括有多个更新数据项的更新数据包,更新服务器通过广播的形式将更新数据包发送给各个物联网设备,物联网设备在接收到更新数据包后从更新数据包中选择相匹配的更新数据项对固件或软件进行升级。At present, when updating IoT devices, an update data package including multiple update data items is prepared in advance, and the update server sends the update data packet to each IoT device in the form of broadcast, and the IoT device receives the update data After the package, select the matching update data item from the update data package to upgrade the firmware or software.
针对目前对物联网设备进行更新的方法,由于更新数据包包括有用于对不同物联网设备进行更新的多个更新数据项,因此更新数据包通常具有较大的数据量,而更新服务器需要通过广播的形式向各个物联网设备发送更新数据包,导致更新服务器的流量负载加大。Regarding the current method of updating IoT devices, since the update data package includes multiple update data items used to update different IoT devices, the update data package usually has a large amount of data, and the update server needs to broadcast In the form of sending update data packets to various IoT devices, the traffic load of the update server increases.
发明内容Summary of the invention
有鉴于此,本发明提供的设备更新方法、系统及第一物联网设备和计算机可读介质,能够降低对物联网设备进行更新时更新服务器的流量负载。In view of this, the device update method, system, first Internet of Things device and computer readable medium provided by the present invention can reduce the traffic load of the update server when updating the Internet of Things device.
第一方面,本发明实施例提供了一种设备更新方法,包括:In the first aspect, an embodiment of the present invention provides a device update method, including:
位于一个网络拓扑中的一个第一物联网设备接收第一更新数据包,其中,所述第一更新数据包中包括有至少一个更新数据项;A first Internet of Things device located in a network topology receives a first update data packet, wherein the first update data packet includes at least one update data item;
检测所述第一更新数据包中是否包括有目标更新数据项,其中,所述目标更新数据项用于对所述第一物联网设备的固件或其上运行的软件进行更新;Detecting whether the first update data package includes a target update data item, where the target update data item is used to update the firmware of the first Internet of Things device or the software running on it;
若所述第一更新数据包中包括有所述目标更新数据项,则利用所述目标更新数据项对所述第一物联网设备进行更新,并从所述第一更新数据包中将所述目标更新数据项删除,获得 第二更新数据包;If the first update data package includes the target update data item, use the target update data item to update the first Internet of Things device, and update the first Internet of Things device from the first update data package The target update data item is deleted, and the second update data package is obtained;
若所述第二更新数据包中包括有至少一个所述更新数据项,则确定所述网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则If the second update data packet includes at least one of the update data items, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
确定下一个需要进行更新的物联网设备为第二物联网设备,并将所述第二更新数据包发送给所述第二物联网设备。It is determined that the next Internet of Things device that needs to be updated is the second Internet of Things device, and the second update data packet is sent to the second Internet of Things device.
第二方面,本发明实施例还提供了一种第一物联网设备,包括:In the second aspect, an embodiment of the present invention also provides a first Internet of Things device, including:
一个数据包接收模块,用于接收第一更新数据包,其中,所述第一更新数据包中包括有至少一个更新数据项;A data packet receiving module for receiving a first update data packet, wherein the first update data packet includes at least one update data item;
一个数据包检测模块,用于检测所述数据包接收模块接收到的所述第一更新数据包中是否包括有目标更新数据项,其中,所述目标更新数据项用于对所述第一物联网设备的固件或其上运行的软件进行更新;A data packet detection module is used to detect whether the first update data packet received by the data packet receiving module includes a target update data item, wherein the target update data item is used to update the first object Update the firmware of networked devices or the software running on them;
一个设备更新模块,用于在所述数据包检测模块确定所述第一更新数据包包括有所述目标更新数据项时,利用所述目标更新数据项对所述第一物联网设备进行更新;A device update module, configured to use the target update data item to update the first Internet of Things device when the data packet detection module determines that the first update data package includes the target update data item;
一个数据包更新模块,用于在所述设备更新模块对所述第一物联网设备进行更新之后,从所述第一更新数据包中将所述目标更新数据项删除,获得第二更新数据包;A data package update module for deleting the target update data item from the first update data package after the device update module updates the first Internet of Things device to obtain a second update data package ;
一个第一数据包发送模块,用于在所述数据包更新模块获得的所述第二更新数据包中包括有至少一个所述新数据项,且所述网络拓扑中存在需要更新的物联网设备的情况下,确定下一个需要进行更新的物联网设备作为第二物联网设备,并将所述第二更新数据包发送给所述第二物联网设备。A first data packet sending module, configured to include at least one of the new data items in the second update data packet obtained by the data packet update module, and there are IoT devices that need to be updated in the network topology In the case of, determine the next IoT device that needs to be updated as the second IoT device, and send the second update data packet to the second IoT device.
第三方面,本发明实施例还提供了另一种第一物联网设备,包括:至少一个存储器和至少一个处理器;In a third aspect, an embodiment of the present invention also provides another first Internet of Things device, including: at least one memory and at least one processor;
所述至少一个存储器,用于存储机器可读程序;The at least one memory is used to store a machine-readable program;
所述至少一个处理器,用于调用所述机器可读程序,执行上述第一方面所提供的方法。The at least one processor is configured to invoke the machine-readable program to execute the method provided in the first aspect.
第四方面,本发明实施例还提供了一种设备更新系统,包括:至少两个第二方面或第三方面所提供的第一物联网设备和一个更新服务器;In a fourth aspect, an embodiment of the present invention also provides a device update system, including: at least two first Internet of Things devices provided in the second aspect or the third aspect and an update server;
所述至少两个第一物联网设备在同一网络拓扑中依次相连接,且所述更新服务器与位于端部的一个所述第一物联网设备相连接;The at least two first Internet of Things devices are connected in sequence in the same network topology, and the update server is connected to one of the first Internet of Things devices located at an end;
所述更新服务器,用于向相连接的所述第一物联网设备发送包括有至少一个所述更新数据项的更新数据包。The update server is configured to send an update data packet including at least one update data item to the connected first Internet of Things device.
第五方面,本发明实施例还提供了一种计算机可读介质,所述计算机可读介质上存储有计算机指令,所述计算机指令在被处理器执行时,使所述处理器执行上述第一方面所提供的 方法。In a fifth aspect, an embodiment of the present invention also provides a computer-readable medium having computer instructions stored on the computer-readable medium. When the computer instructions are executed by a processor, the processor executes the first The method provided by the aspect.
由上述技术方案可知,第一物联网设备接收到第一更新数据包后,检测第一更新数据包中是否包括有用于对第一物联网设备的固件或第一物联网设备上运行的软件进行更新的目标更新数据项,如果第一更新数据包中存在目标更新数据项,则利用目标更新数据项对第一物联网设备进行更新,并在更新完成后将目标更新数据项从第一更新数据包中删除而获得第二更新数据包,之后在第二更新数据包包括有更新数据项且网络拓扑中存在需要进行更新的物联网设备的情况下,将下一个需要进行更新的物联网设备确定为第二物联网设备,并将第二更新数据包发送给第二物联网设备。由此可见,包括有多个更新数据项的更新数据包可以在各个物联网设备之间依次传输,接收到更新数据包的物联网设备可以利用更新数据包中相应的更新数据项进行更新,在更新完成后将已经使用的更新数据项从更新数据包中删除,之后将更新数据包传输给下一个物联网设备,从而利用一个更新数据包便可以对需要进行更新的各个物联网设备进行更新,更新服务器仅需要向一个物联网设备发送一次更新数据包,由于减少了更新服务器的冗余负载,从而可以降低更新物联网设备过程中更新服务器的流量负载。It can be seen from the above technical solution that after the first Internet of Things device receives the first update data packet, it detects whether the first update data packet includes the firmware for performing the firmware of the first Internet of Things device or the software running on the first Internet of Things device. The updated target update data item, if there is a target update data item in the first update data package, use the target update data item to update the first IoT device, and after the update is completed, the target update data item is changed from the first update data Delete from the package to obtain the second update data package, and then if the second update data package includes update data items and there are IoT devices that need to be updated in the network topology, determine the next IoT device that needs to be updated Is the second Internet of Things device, and sends the second update data packet to the second Internet of Things device. It can be seen that the update data package that includes multiple update data items can be transmitted sequentially among the various IoT devices, and the IoT device that receives the update data packet can use the corresponding update data item in the update data package to update, in After the update is complete, delete the used update data items from the update data package, and then transmit the update data package to the next IoT device, so that each IoT device that needs to be updated can be updated with one update data package. The update server only needs to send an update data packet to one IoT device once. Since the redundant load of the update server is reduced, the traffic load of the update server in the process of updating the IoT device can be reduced.
在第一种可能的实现方式中,结合上述的任一方面,在检测第一更新数据包中是否包括有目标更新数据项之后,还包括:In the first possible implementation manner, in combination with any of the above aspects, after detecting whether the first update data packet includes the target update data item, the method further includes:
若第一更新数据包中不包括目标更新数据项,则确定网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则If the target update data item is not included in the first update data packet, it is determined whether there are IoT devices that need to be updated in the network topology, and if there are IoT devices that need to be updated, then
确定下一个需要进行更新的物联网设备作为第三物联网设备,并将第一更新数据包发送给第三物联网设备。The next IoT device that needs to be updated is determined as the third IoT device, and the first update data packet is sent to the third IoT device.
在本发明实施例中,如果第一更新数据包中不存在目标更新数据项,在网络拓扑中仍存在需要进行更新的物联网设备的情况下,将第一更新数据包发送给下一个需要进行更新的物联网设备,保证可以将更新数据包传输给需要进行更新的物联网设备,从而保证物联网设备更新过程可能顺利进行。In the embodiment of the present invention, if there is no target update data item in the first update data packet, and there are still IoT devices that need to be updated in the network topology, the first update data packet is sent to the next one that needs to be updated. The updated IoT device ensures that the update data packet can be transmitted to the IoT device that needs to be updated, thereby ensuring that the IoT device update process may proceed smoothly.
在第二种可能的实现方式中,结合上述的任一方面或者第一种可能的实现方式,在检测第一更新数据包中是否包括有目标更新数据项时,可通过如下方式实现:In the second possible implementation manner, in combination with any of the above aspects or the first possible implementation manner, when detecting whether the first update data packet includes the target update data item, it can be implemented in the following manner:
针对所述第一更新数据包所包括的每一个所述更新数据项,如果该更新数据项所包括的目标设备地址与所述第一物联网设备的设备地址相同,则将该更新数据项确定为所述目标更新数据项。For each of the update data items included in the first update data packet, if the target device address included in the update data item is the same as the device address of the first Internet of Things device, then the update data item is determined Update the data item for the target.
在本发明实施例中,第一更新数据包中包括有至少一个更新数据项,每一个更新数据项 均包括有一个目标设备地址,目标设备地址用于标识其所在更新数据项可以更新的物联网设备。针对每一个更新数据项,将该更新数据项所包括的目标设备地址与第一物联网设备的设备地址进行比较后,如果该更新数据项所包括的目标设备地址与第一物联网设备的设备地址相同,说明可以利用该更新数据项对第一物联网设备进行更新,进而将该更新数据项确定为目标更新数据项。基于更新数据项所包括的目标设备地址来分辨各个更新数据项是否为可以对第一物联网设备进行更新的目标更新数据项,保证可以准确地确定第一更新数据包中是否包括有目标更新数据项,进而第一物联网设备可以准确地选择对第一更新数据包进行处理的方式,保证物联网设备更新过程可以正常进行。In the embodiment of the present invention, the first update data packet includes at least one update data item, and each update data item includes a target device address. The target device address is used to identify the Internet of Things where the update data item can be updated. equipment. For each update data item, after comparing the target device address included in the update data item with the device address of the first Internet of Things device, if the target device address included in the update data item is compared with the device address of the first Internet of Things device The address is the same, indicating that the update data item can be used to update the first Internet of Things device, and then the update data item is determined as the target update data item. Based on the target device address included in the update data item, distinguish whether each update data item is a target update data item that can update the first Internet of Things device, ensuring that it can be accurately determined whether the first update data package includes target update data Item, and then the first Internet of Things device can accurately select the method for processing the first update data packet to ensure that the update process of the Internet of Things device can proceed normally.
在第三种可能的实现方式中,结合上述的任一方面或者第一种可能的实现方式,在利用各个目标更新数据项对第一物联网设备进行更新时,可通过如下方式实现:In the third possible implementation manner, in combination with any of the above-mentioned aspects or the first possible implementation manner, when the first Internet of Things device is updated with each target update data item, it can be implemented in the following manner:
获取所述目标更新数据项所包括的安全代码和第一版本号,其中,所述安全代码用于验证所述目标更新数据项是否与所述第一物联网设备相匹配,所述第一版本号用于标识所述目标更新数据项的版本;Acquire the security code and the first version number included in the target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device, and the first version Number is used to identify the version of the target update data item;
获取所述第一物联网设备上的与所述目标更新数据项相对应的更新对象的第二版本号,其中,所述更新对象包括所述第一物联网设备的固件或所述物联网上运行的软件;Acquire the second version number of the update object corresponding to the target update data item on the first Internet of Things device, where the update object includes the firmware of the first Internet of Things device or the Internet of Things device Running software
利用所述第一物联网设备的私钥验证所述安全代码是否与所述第一物联网设备相匹配,并判断所述第一版本号是否高于所述第二版本号;Using the private key of the first Internet of Things device to verify whether the security code matches the first Internet of Things device, and to determine whether the first version number is higher than the second version number;
若所述安全代码与所述第一物联网设备相匹配,且所述第一版本号高于所述第二版本号,则利用所述目标更新数据项对所述更新对象进行更新。If the security code matches the first Internet of Things device, and the first version number is higher than the second version number, the target update data item is used to update the update object.
在本发明实施例中,首先获取目标更新数据项所包括的安全代码和第一版本号,并获取第一物联网设备上与目标更新数据项相对应的更新对象的第二版本号,之后利用第一物联网设备的私钥验证安全代码是否与第一物联网设备相匹配,并验证第一版本号是否高于第二版本号,仅有在安全代码与第一物联网设备相匹配且第一版本号高于第二版本号时才利用目标更新数据项对第一物联网设备上的更新对象进行更新。通过验证安全代码可以判断目标更新数据项的合法性,避免利用被恶意篡改或非法创建的目标更新数据项对物联网设备进行更新而带来的安全问题,从而可以保证对物联网设备进行更新的安全性。通过将第一版本号与第二版本号进行比较,可以保证对物联网设备进行更新为升级更新,避免由于人为失误将低版本的更新数据项放入更新数据包而导致物联网设备的降级更新,从而可以保证对物联网设备进行更新的可靠性。In the embodiment of the present invention, first obtain the security code and the first version number included in the target update data item, and obtain the second version number of the update object corresponding to the target update data item on the first Internet of Things device, and then use The private key of the first IoT device verifies whether the security code matches the first IoT device, and verifies whether the first version number is higher than the second version number, only if the security code matches the first IoT device and the first When the first version number is higher than the second version number, the target update data item is used to update the update object on the first Internet of Things device. By verifying the security code, the legitimacy of the target update data item can be judged, and the security problems caused by the use of maliciously tampered or illegally created target update data items to update the IoT device can be avoided, so as to ensure the update of the IoT device safety. By comparing the first version number with the second version number, it is possible to ensure that the IoT device is updated to an upgrade update, and to avoid the downgrade update of the IoT device due to human error putting low-version update data items into the update data package , Which can ensure the reliability of updating the Internet of Things devices.
在第四种可能的实现方式中,结合上述的任一方面、第一种可能的实现方式、第二种可能的实现方式或者第三种可能的实现方式,在将第二更新数据包发送给第二物联网设备时,可通过如下方式实现:In the fourth possible implementation manner, in combination with any of the above-mentioned aspects, the first possible implementation manner, the second possible implementation manner, or the third possible implementation manner, the second update data packet is sent to When the second IoT device is used, it can be implemented in the following ways:
获取所述目标更新数据项所包括的下一更新设备地址,其中,所述下一更新设备地址用于在所述网络拓扑中对所述第三物联网设备进行标识;Acquiring a next update device address included in the target update data item, where the next update device address is used to identify the third Internet of Things device in the network topology;
根据所述下一更新设备地址,将所述第二更新数据包发送给所述第二物联网设备。Send the second update data packet to the second Internet of Things device according to the address of the next update device.
在本发明实施例中,针对于第一更新数据包中存在目标更新数据项的情况,目标更新数据项中包括有下一更新设备地址,其中,下一个更新设备地址为更新数据包创建时定义的,其用于在网络拓扑中对下一个需要更新的第二物联网设备进行标识。因此,在利用目标更新数据包对第一物联网设备进行更新之后,可以从目标更新数据包中获取下一更新设备地址,进而根据获取到的下一更新设备地址将第二更新数据包发送给第二物联网设备。根据目标更新数据项所包括的下一更新设备地址将更新数据包传递给下一个物联网设备,使得更新数据包可以按照预先定义的传递路径进行传输,保证可以将更新数据包传输给需要进行更新的物联网设备,并能够使更新数据包尽快传输到各个需要进行更新的物联网设备,保证对物联网设备进行更新的效率。In the embodiment of the present invention, for the situation that the target update data item exists in the first update data packet, the target update data item includes the next update device address, where the next update device address is defined when the update data package is created Yes, it is used to identify the next second IoT device that needs to be updated in the network topology. Therefore, after the first Internet of Things device is updated with the target update data packet, the next update device address can be obtained from the target update data packet, and then the second update data packet is sent to The second IoT device. The update data packet is delivered to the next IoT device according to the address of the next update device included in the target update data item, so that the update data packet can be transmitted according to the predefined delivery path, ensuring that the update data packet can be transmitted to the need for update The Internet of Things equipment, and can make the update data package be transmitted to the Internet of Things equipment that needs to be updated as soon as possible, to ensure the efficiency of updating the Internet of Things equipment.
在第五种可能的实现方式中,结合上述第一种可能的实现方式,在将第一更新数据包发送给第三物联网设备时,可通过如下方式实现:In the fifth possible implementation manner, in combination with the foregoing first possible implementation manner, when the first update data packet is sent to the third Internet of Things device, it can be implemented in the following manner:
确定目标传输路径,其中,所述目标传输路径为所述网络拓扑中连接所述第一物联网设备与各个第四物联网设备的路径,所述第一更新数据包中存在用于对每一个所述第四物联网设备进行更新的所述更新数据项;Determine a target transmission path, where the target transmission path is a path connecting the first Internet of Things device and each fourth Internet of Things device in the network topology, and the first update data packet contains a path for each The update data item updated by the fourth Internet of Things device;
将所述目标传输路径中距所述第一物联网设备最近的一个所述第四物联网设备确定为所述第三物联网设备;Determining one of the fourth Internet of Things device closest to the first Internet of Things device in the target transmission path as the third Internet of Things device;
将所述第一更新数据包发送给所述第三物联网设备。Sending the first update data packet to the third Internet of Things device.
在本发明实施例中,针对第一更新数据包中不存在目标更新数据项的情况,首先从网络拓扑中确定出可以用第一更新数据包中的各个更新数据项进行更新的第四物联网设备,之后确定出连接第一物联网设备以及各个第四物联网设备的目标传输路径,之后将目标传输路径中距第一物联网设备最近的一个第四物联网设备确定为第三物联网设备,之后将第一更新数据包发送给第三物联网设备。基于更新数据包中包括的各个更新数据项确定需要进行更新的各个第四物联网设备,之后在网络拓扑中确定一条可以连接第一物联网设备以及各个第四物联网设备的目标传输路径,使得更新数据包按照该目标传输路径进行传输,在保证能够对各 个需要进行更新的物联网设备进行更新的前提下,使得更新数据包的经过的物联网设备尽可能少,从而可以缩短更新数据包传输所消耗的时间,进而提高对物联网设备进行更新的效率。In the embodiment of the present invention, in view of the situation that there is no target update data item in the first update data packet, the fourth Internet of Things that can be updated with each update data item in the first update data packet is first determined from the network topology Device, and then determine the target transmission path connecting the first IoT device and each fourth IoT device, and then determine the fourth IoT device closest to the first IoT device in the target transmission path as the third IoT device , And then send the first update data packet to the third IoT device. Determine each fourth IoT device that needs to be updated based on each update data item included in the update data packet, and then determine a target transmission path that can connect the first IoT device and each fourth IoT device in the network topology, so that The update data packet is transmitted according to the target transmission path. Under the premise of ensuring that each IoT device that needs to be updated can be updated, the update data packet passes through as few IoT devices as possible, which can shorten the update data packet transmission The time consumed, thereby improving the efficiency of updating IoT devices.
附图说明Description of the drawings
图1是本发明一个实施例提供的一种设备更新系统的示意图;FIG. 1 is a schematic diagram of a device update system provided by an embodiment of the present invention;
图2是本发明一个实施例提供的一种物联网设备连接关系的示意图;FIG. 2 is a schematic diagram of a connection relationship of Internet of Things devices according to an embodiment of the present invention;
图3是本发明一个实施例提供的另一种物联网设备连接关系的示意图;3 is a schematic diagram of another connection relationship of Internet of Things devices provided by an embodiment of the present invention;
图4是本发明一个实施例提供的一种设备更新方法的流程图;4 is a flowchart of a device update method provided by an embodiment of the present invention;
图5是本发明一个实施例提供的一种更新数据项的结构示意图;Figure 5 is a schematic structural diagram of an update data item provided by an embodiment of the present invention;
图6是本发明一个实施例提供的一种对物联网设备更新方法的流程图;FIG. 6 is a flowchart of a method for updating IoT devices according to an embodiment of the present invention;
图7是本发明一个实施例提供的一种第二更新数据包传输方法的流程图;FIG. 7 is a flowchart of a second update data packet transmission method according to an embodiment of the present invention;
图8是本发明一个实施例提供的一种第一更新数据包传输方法的流程图;FIG. 8 is a flowchart of a first update data packet transmission method according to an embodiment of the present invention;
图9是本发明一个实施例提供的另一种设备更新方法的流程图;FIG. 9 is a flowchart of another device update method provided by an embodiment of the present invention;
图10是本发明一个实施例提供的一种线型拓扑的示意图;FIG. 10 is a schematic diagram of a linear topology according to an embodiment of the present invention;
图11是本发明一个实施例提供的另一种设备更新系统的示意图;FIG. 11 is a schematic diagram of another device update system provided by an embodiment of the present invention;
图12是本发明一个实施例提供的一种物联网设备更新过程的示意图;FIG. 12 is a schematic diagram of an update process of an Internet of Things device provided by an embodiment of the present invention;
图13是本发明一个实施例提供的一种第一物联网设备的示意图;FIG. 13 is a schematic diagram of a first Internet of Things device according to an embodiment of the present invention;
图14是本发明一个实施例提供的一种包括第二数据包发送模块的第一物联网设备的示意图;14 is a schematic diagram of a first Internet of Things device including a second data packet sending module according to an embodiment of the present invention;
图15是本发明一个实施例提供的另一种第一物联网设备的示意图;15 is a schematic diagram of another first Internet of Things device provided by an embodiment of the present invention;
图16是本发明一个实施例提供的又一种第一物联网设备的示意图;16 is a schematic diagram of still another first Internet of Things device according to an embodiment of the present invention;
图17是本发明一个实施例提供的再一种第一物联网设备的示意图;FIG. 17 is a schematic diagram of still another first Internet of Things device according to an embodiment of the present invention;
图18是本发明一个实施例提供的一种包括存储器和处理器的第一物联网设备的示意图。FIG. 18 is a schematic diagram of a first Internet of Things device including a memory and a processor according to an embodiment of the present invention.
附图标记列表:List of reference signs:
10:更新服务器            20:第一物联网设备      30:第二物联网设备10: Update server 20: First Internet of Things device 30: Second Internet of Things device
40:第三物联网设备        201:数据包接收模块     202:数据包检测模块40: Third Internet of Things device 201: Data packet receiving module 202: Data packet detection module
203:设备更新模块         204:数据包更新模块     205:第一数据包发送模块203: Device update module 204: Data packet update module 205: First data packet sending module
206:第二数据包发送模块   2031:第一信息获取单元  2032:第二信息获取单元206: Second data packet sending module 2031: First information acquisition unit 2032: Second information acquisition unit
2033:信息匹配单元        2034:对象更新单元      2051:地址获取单元2033: Information matching unit 2034: Object update unit 2051: Address acquisition unit
2052:第一发送单元        2061:路径确定单元      2062:设备筛选单元2052: First sending unit 2061: Path determination unit 2062: Device screening unit
2063:第二发送单元         207:存储器             208:处理器2063: The second sending unit 207: Memory 208: Processor
501:安全代码              502:目标设备地址       503:版本号501: Security code 502: Target device address 503: Version number
504:更新内容              505:协议信息           506:状态信息504: Update content 505: Agreement information 506: Status information
507:下一更新设备地址      1001:物联网设备        1002:物联网设备507: Next update device address 1001: Internet of Things device 1002: Internet of Things device
1003:物联网设备           1004:物联网设备        1005:物联网设备1003: Internet of Things equipment 1004: Internet of Things equipment 1005: Internet of Things equipment
1101:更新服务器           1102:网关              1103:物联网设备1101: Update server 1102: Gateway 1103: Internet of Things equipment
1104:物联网设备           1105:物联网设备        1106:物联网设备1104: Internet of Things equipment 1105: Internet of Things equipment 1106: Internet of Things equipment
1107:物联网设备           1108:更新数据包        1201:用户1107: Internet of Things equipment 1108: Update data package 1201: User
1202:更新管理系统         1203:网关              1204:物联网设备1202: Update management system 1203: Gateway 1204: Internet of Things equipment
120n:物联网设备120n: IoT devices
401:接收第一更新数据包401: Receive the first update packet
402:检测第一更新数据包是否包括有目标更新数据项402: Detect whether the first update data package includes a target update data item
403:利用目标更新数据项对第一物联网设备进行更新403: Use the target update data item to update the first IoT device
404:从第一更新数据包中将目标更新数据项删除,获得第二更新数据包404: Delete the target update data item from the first update data package, and obtain the second update data package
405:将第二更新数据包发送给第二物联网设备405: Send the second update data packet to the second IoT device
601:获取目标更新数据项所包括的安全代码和第一版本号601: Obtain the security code and the first version number included in the target update data item
602:获取第一物联网设备上的与目标更新数据项相对应的更新对象的第二版本号602: Obtain the second version number of the update object corresponding to the target update data item on the first Internet of Things device
603:利用第一物联网设备的私钥验证安全代码是否与第一物联网设备相匹配603: Use the private key of the first Internet of Things device to verify whether the security code matches the first Internet of Things device
604:判断第一版本号是否高于第二版本号604: Determine whether the first version number is higher than the second version number
605:利用目标更新数据项对更新对象进行更新605: Use the target update data item to update the update object
606:结束当前流程606: End the current process
701:获取目标更新数据项所包括的下一更新设备地址701: Obtain the address of the next update device included in the target update data item
702:根据获取到的下一更新设备地址,将第二更新数据包发送给第二物联网设备702: According to the acquired address of the next update device, send the second update data packet to the second Internet of Things device
801:确定目标传输路径801: Determine the target transmission path
802:确定距第一物联网设备最近的一个第四物联网设备为第三物联网设备802: Determine the fourth IoT device closest to the first IoT device as the third IoT device
803:将第一更新数据包发送给第三物联网设备803: Send the first update packet to the third IoT device
901:更新服务器将更新数据包发送给端部的一个物联网设备901: The update server sends the update packet to an IoT device at the end
902:接收到更新数据包的物联网设备检测更新数据包中是否包括有目标更新数据项902: The Internet of Things device receiving the update data packet detects whether the update data packet includes a target update data item
903:验证目标更新数据项包括的安全代码是否与物联网设备相匹配903: Verify whether the security code included in the target update data item matches the IoT device
904:验证目标更新数据项所包括的版本号是否高于物联网设备上更新对象的版本号904: Verify whether the version number included in the target update data item is higher than the version number of the update object on the IoT device
905:物联网设备利用目标更新数据项对更新对象进行更新905: The Internet of Things device uses the target update data item to update the update object
906:物联网设备将目标更新数据项从更新数据包中删除906: The IoT device deletes the target update data item from the update data package
907:物联网设备检测更新数据包是否包括有更新数据项907: The IoT device detects whether the update data package includes update data items
908:物联网设备检测是否存下需要更新的第二物联网设备/第三物联网设备908: The Internet of Things device detects whether there is a second Internet of Things device/third Internet of Things device that needs to be updated
909:物联网设备将更新数据包发送给第二物联网设备/第三物联网设备909: The IoT device sends the update packet to the second IoT device/the third IoT device
910:物联网设备删除更新数据包,本次更新结束910: The Internet of Things device deletes the update data package, this update ends
具体实施方式Detailed ways
如前所述,目前更新服务器通过广播的形式向各个物联网设备发送更新数据包,但由于更新数据包中包括有用于对多个物联网设备进行更新的多个更新数据项,使得更新数据包通常具有较大的数据量,因此更新服务器需要分别向每一个物联网设备发送具有较大数据量的更新数据包,导致更新服务器的流量负载较大。As mentioned earlier, the current update server sends update data packets to each IoT device in the form of broadcast, but because the update data packet includes multiple update data items for updating multiple IoT devices, the update data packet Usually there is a large amount of data, so the update server needs to send an update data packet with a large amount of data to each Internet of Things device respectively, resulting in a large traffic load on the update server.
本发明实施例中,一个物联网设备在接收到更新数据包后,该物联网设备从更新数据包中获取相应的目标更新数据项对其固件或其上运行的软件进行更新,在更新完成之后将目标更新数据项从更新数据包中删除,之后该物联网设备将更新数据包发送给下一个物联网设备,下一个物联网设备将按照与该物联网设备相同的操作方式进行更新和数据包的传递,直至所有的物联网设备更新完毕,这样更新服务器仅需要向一个物联网设备发送一次更新数据包,更新数据包便可以依次传递到各个待更新物联网设备实现物联网设备的更新,从而在对物联网设备进行更新时可以降低更新服务器的流量负载。In the embodiment of the present invention, after an Internet of Things device receives an update data package, the Internet of Things device obtains the corresponding target update data item from the update data package to update its firmware or the software running on it, after the update is completed Delete the target update data item from the update data package, and then the IoT device will send the update data package to the next IoT device, and the next IoT device will update and package data in the same way as the IoT device Until all the IoT devices are updated, the update server only needs to send an update data packet to one IoT device once, and the update data packet can be delivered to each IoT device to be updated to update the IoT device. When updating IoT devices, the traffic load of the update server can be reduced.
下面结合附图对本发明实施例提供的设备更新方法、系统及第一物联网设备进行详细说明。需要说明的是,在下述各个实施例中,第一物联网设备、第二物联网设备、第三物联网设备以及第四物联网设备为同一网络拓扑中的物联网设备,各物联网设备不存在层级之间的区别,另外网络拓扑可以是星型拓扑、树型拓扑、线型拓扑、环型拓扑等。The device update method, system, and first Internet of Things device provided by the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that in each of the following embodiments, the first Internet of Things device, the second Internet of Things device, the third Internet of Things device, and the fourth Internet of Things device are Internet of Things devices in the same network topology, and each Internet of Things device is not There are differences between levels, and the network topology can be star topology, tree topology, line topology, ring topology, etc.
如图1所示,本发明实施例提供了一种设备更新系统,包括:一个更新服务器10和至少两个第一物联网设备20;As shown in FIG. 1, an embodiment of the present invention provides a device update system, including: an update server 10 and at least two first Internet of Things devices 20;
至少两个第一物联网设备20在同一网络拓扑中依次相连接,且更新服务器10与位于端部的一个第一物联网设备20相连接;At least two first Internet of Things devices 20 are connected in sequence in the same network topology, and the update server 10 is connected to one first Internet of Things device 20 at the end;
更新服务器10用于向相连接的第一物联网设备20发送包括有至少一个更新数据项的更新数据包。The update server 10 is configured to send an update data packet including at least one update data item to the connected first Internet of Things device 20.
在本发明实施例中,由于各个第一物联网设备20在同一网络拓扑中依次相连接,且更新 服务器10与位于端部的一个第一物联网设备20相连接,因此,针对任意一个第一物联网设备20,如果该第一物联网设备20与更新服务器10直接相连接,则该第一物联网设备20从更新服务器10接收更新数据包,如果该第一物联网设备20不与更新服务器10直接相连接,则该第一物联网设备20从与其直接相连接的其他第一物联网设备20接收更新数据包。In the embodiment of the present invention, since each first Internet of Things device 20 is connected in sequence in the same network topology, and the update server 10 is connected to a first Internet of Things device 20 at the end, therefore, for any first Internet of Things device 20 The Internet of Things device 20, if the first Internet of Things device 20 is directly connected to the update server 10, the first Internet of Things device 20 receives an update data packet from the update server 10. If the first Internet of Things device 20 is not connected to the update server 10 10 is directly connected, the first Internet of Things device 20 receives update data packets from other first Internet of Things devices 20 directly connected to it.
需要说明的是,在上述实施例中,与更新服务器10直接相连接的第一物联网设备20是指物理网络中不经过其他物联网设备而直接与更新服务器10相连接的物联网设备,不与更新服务器10直接相连接的第一物联网设备是指物理网络中需要经过一个或多个其他物联网设备而与更新服务去20相连接的物联网设备,直接相连接的两个第一物联网设备20是指在网络拓扑中不不经过其他物联网设备而直接相连接的两个物联网设备,但是在物理网络中这两个物联网设备可以不经过其他物联网设备直径相连接,也可以经过一个或多个其他物联网设备而相连接。It should be noted that in the above embodiment, the first Internet of Things device 20 directly connected to the update server 10 refers to the Internet of Things device that is directly connected to the update server 10 without passing through other Internet of Things devices in the physical network. The first Internet of Things device directly connected to the update server 10 refers to the Internet of Things device that needs to pass through one or more other Internet of Things devices to connect to the update service 20 in the physical network, and the two first things that are directly connected The Internet of Things 20 refers to two Internet of Things devices that are directly connected without passing through other Internet of Things devices in the network topology. However, in the physical network, the two Internet of Things devices can be connected without passing through other Internet of Things devices. It can be connected via one or more other IoT devices.
在下述实施例中,针对任意一个第一物联网设备20,为了便于分辨该第一物联网设备20所接收到的更新数据包和该第一物联网设备20删除目标更新数据项后的更新数据包,将该第一物联网设备20接收到的更新数据包定义为第一更新数据包,而将第一物联网设备20删除目标更新数据项后的更新数据包定义为第二更新数据包。In the following embodiments, for any one of the first Internet of Things device 20, in order to facilitate the distinction between the update data packet received by the first Internet of Things device 20 and the update data after the first Internet of Things device 20 deletes the target update data item The update data package received by the first Internet of Things device 20 is defined as the first update data package, and the update data package after the first Internet of Things device 20 deletes the target update data item is defined as the second update data package.
针对任意一个第一物联网设备20,在该第一物联网设备20接收到第一更新数据包之后,根据所接收到第一更新数据包所包括更新数据项的不同,该第一物联网设备20可以采取如下A至C共计三种不同的处理方式:For any first Internet of Things device 20, after the first Internet of Things device 20 receives the first update data packet, according to the difference in the update data items included in the received first update data packet, the first Internet of Things device 20 A total of three different processing methods from A to C can be adopted as follows:
A、如果第一更新数据包中包括有用于对该第一物联网设备20的固件或该第一物联网设备20上运行的软件进行更新的目标更新数据项,该第一物联网设备20利用目标更新数据项进行更新,之后从第一更新数据包中将目标更新数据项删除而获得第二更新数据包。A. If the first update data package includes a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, the first Internet of Things device 20 uses The target update data item is updated, and then the target update data item is deleted from the first update data package to obtain the second update data package.
在获得第二更新数据包后,根据网络拓扑中是否存在需要进行更新的物联网设备以及该第二更新数据包是否包括更新数据项,该第一物联网设备20又可以采取如下A-1至A-3共计三种处理方式:After obtaining the second update data packet, according to whether there is an Internet of Things device that needs to be updated in the network topology and whether the second update data packet includes an update data item, the first Internet of Things device 20 can again take the following A-1 to A-3 has three processing methods:
A-1、如图2所示,如果网络拓扑中存在需要进行更新的物联网设备,且该第二更新数据包中包括有至少一个更新数据项,则该第一物联网设备20将第二更新数据包发送给下一个需要进行更新的第二物联网设备30。此时,该第一物联网设备20将第二更新数据包发送给第二物联网设备30,使得第二物联网设备30可以采用相同的方法进行更新。A-1. As shown in Figure 2, if there is an IoT device that needs to be updated in the network topology, and the second update data packet includes at least one update data item, the first IoT device 20 sets the second The update data packet is sent to the next second Internet of Things device 30 that needs to be updated. At this time, the first Internet of Things device 20 sends the second update data packet to the second Internet of Things device 30, so that the second Internet of Things device 30 can use the same method to update.
A-2、如果网络拓扑中不存需要进行更新的物联网设备,该第一物联网设备20将第二更新数据包删除,设备更新过程终止。此时,由于网络拓扑中已经不存在需要进行更新的物联网设备,该第一物联网设备20将第二更新数据包删除后,终止对物联网设备进行更新。A-2. If there is no IoT device that needs to be updated in the network topology, the first IoT device 20 deletes the second update data packet, and the device update process is terminated. At this time, since there is no IoT device that needs to be updated in the network topology, after the first IoT device 20 deletes the second update data packet, the update of the IoT device is terminated.
A-3、如果第二更新数据包中不包括任何的更新数据项,该第一物联网设备20将第二更新数据包删除,设备更新过程终止。此时,由于第二更新数据包中已经没有可用于对物联网设备进行更新的更新数据项,无需继续再将空的第二更新数据包传输下去,从而该第一物联网设备20将第二更新数据包删除,终止对物联网设备进行更新。A-3. If the second update data package does not include any update data items, the first Internet of Things device 20 deletes the second update data package, and the device update process is terminated. At this time, since there is no update data item in the second update data packet that can be used to update the Internet of Things device, there is no need to continue to transmit the empty second update data packet, so that the first Internet of Things device 20 transfers the second The update data package is deleted, and the update of the IoT device is terminated.
B、如图3所示,如果第一更新数据包中不包括用于对该第一物联网设备20的固件或该第一物联网设备20上运行的软件进行更新的目标更新数据项,且网络拓扑中存在需要进行更新的物联网设备,该第一物联网设备20将第一更新数据包发送给下一个需要进行更新的第三物联网设备40。此时,由于第一更新数据包中不包括用于对该第一物联网设备20进行更新的目标更新数据项,说明本次物联网设备更新不需要对该第一物联网设备20进行更新,该第一物联网设备20直接将所接收到的第一更新数据包发送给下一个需要进行更新的第三物联网设备40,以供后续物联网设备进行更新。B. As shown in FIG. 3, if the first update data package does not include a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, and There are IoT devices that need to be updated in the network topology, and the first IoT device 20 sends the first update data packet to the next third IoT device 40 that needs to be updated. At this time, since the first update data package does not include the target update data item used to update the first Internet of Things device 20, it means that the first Internet of Things device 20 does not need to be updated this time. The first Internet of Things device 20 directly sends the received first update data packet to the next third Internet of Things device 40 that needs to be updated for subsequent Internet of Things devices to update.
C、如果第一更新数据包中不包括用于对该第一物联网设备20的固件或该第一物联网设备20上运行的软件进行更新的目标更新数据项,且网络拓扑中不存在需要进行更新的物联网设备,则该第一物联网设备20将第一更新数据包删除,设备更新过程终止。此时,由于网络拓扑中已经不存在需要进行更新的物联网设备,虽然第一更新数据包中仍包括有更新数据项,无需继续对第一更新数据包进行传输,该第一物联网设备20将第一更新数据包删除后,终止对物联网设备进行更新。C. If the first update data package does not include a target update data item for updating the firmware of the first Internet of Things device 20 or the software running on the first Internet of Things device 20, and there is no need in the network topology For the Internet of Things device that is updating, the first Internet of Things device 20 deletes the first update data packet, and the device update process is terminated. At this time, since there is no IoT device that needs to be updated in the network topology, although the first update data packet still includes update data items, there is no need to continue to transmit the first update data packet, and the first IoT device 20 After the first update data packet is deleted, the update of the IoT device is terminated.
需要说明的是,在上述处理方式A-1和处理方式B中,第二物联网设备30和第三物联网设备40为网络拓扑中需要进行更新的物联网设备,在网络拓扑中第一物联网设备20与第二物联网设备30和第三物联网设备40可以直接相连接,也可以不直接相连接。当网络拓扑中第一物联网设备20与第二物联网设备30和第三物联网设备40直接相连接时,第一物联网设备20可以直接将第二更新数据包发送给第二物联网设备30或直接将第一更新数据包发送给第三物联网设备40。当网络拓扑中第一物联网设备20与第二物联网设备30和第三物联网设备40不直接相连接时,第一物联网设备20需要先将第一更新数据包或第二更新数据包发送给网络拓扑中位于第一物联网设备20与第二物联网设备30和第三物联网设备40之间的不需要进行更新的物联网设备,不需要进行更新的物联网设备接收到第一更新数据包或第二更新数据包后会按照处理方式B将第一更新数据包或第二更新数据包传递给第二物联网设备30或第三物联网设备40。It should be noted that in the above processing method A-1 and processing method B, the second Internet of Things device 30 and the third Internet of Things device 40 are Internet of Things devices that need to be updated in the network topology, and the first thing in the network topology The networked device 20 may be directly connected to the second Internet of Things device 30 and the third Internet of Things device 40, or may not be directly connected. When the first Internet of Things device 20 is directly connected to the second Internet of Things device 30 and the third Internet of Things device 40 in the network topology, the first Internet of Things device 20 can directly send the second update data packet to the second Internet of Things device 30 or directly send the first update data packet to the third Internet of Things device 40. When the first Internet of Things device 20 is not directly connected to the second Internet of Things device 30 and the third Internet of Things device 40 in the network topology, the first Internet of Things device 20 needs to send the first update data packet or the second update data packet first. It is sent to the Internet of Things devices that do not need to be updated between the first Internet of Things device 20, the second Internet of Things device 30, and the third Internet of Things device 40 in the network topology, and the Internet of Things devices that do not need to update receive the first Internet of Things device. After the update data packet or the second update data packet, the first update data packet or the second update data packet is transferred to the second Internet of Things device 30 or the third Internet of Things device 40 according to the processing method B.
在本发明实施例所提供的设备更新系统中,更新服务器10将更新数据包发送给一个第一物联网设备20之后,获取到更新数据包的第一物联网设备20从更新数据包中确定可以对其进行更新的目标更新数据项,并在利用确定出的目标更新数据项完成更新后将确定出的目标 更新数据项从更新数据包中删除,之后将更新数据包发送给下一个第一物联网设备20,直至网络拓扑中不存在需要进行更新的物联网设备或更新数据包中不再包括更新数据项。由此可见,更新数据包在各个第一物联网设备20之间传输,各个第一物联网设备20从更新数据包中获取所需的更新数据项进行更新,并在更新完成之后将已经使用过的更新数据项删除,直至将全部有更新需求的第一物联网设备20更新完成,由于更新服务器10仅需要发送一次更新数据包,减少了更新服务器10的冗余负载,从而可以降低更新物联网设备过程中更新服务器10的流量负载。In the device update system provided by the embodiment of the present invention, after the update server 10 sends the update data packet to a first Internet of Things device 20, the first Internet of Things device 20 that has obtained the update data packet determines from the update data packet that it can Update the data item for the updated target, and delete the determined target update data item from the update data package after completing the update with the determined target update data item, and then send the update data package to the next first thing The networked device 20 until there is no IoT device that needs to be updated in the network topology or the update data package no longer includes update data items. It can be seen that the update data packet is transmitted between each first Internet of Things device 20, and each first Internet of Things device 20 obtains the required update data item from the update data packet for update, and will have used it after the update is completed. The update data items of the update data items are deleted until the update of all the first IoT devices 20 that have update requirements is completed. Since the update server 10 only needs to send an update data packet once, the redundant load of the update server 10 is reduced, thereby reducing the update of the Internet of Things The traffic load of the server 10 is updated during the installation process.
需要说明的是,依次相连接的至少两个第一物联网设备20可以位于星型拓扑、树型拓扑、线型拓扑、环型拓扑等各种类型的网络拓扑中。对于星型拓扑和树型拓扑,可以通过定义更新数据包的参数来确定更新数据包的传输路径,更新数据包的传输路径即为依次相连的各个第一物联网设备20。对于线型拓扑和环型拓扑,由于两者均不存在分支,所以两者本身就是由依次相连接的多个第一物联网设备20构成,只是环型拓扑中首尾两个第一物联网设备20连接在一起构成了环状。It should be noted that the at least two first IoT devices 20 connected in sequence may be located in various types of network topologies such as star topology, tree topology, line topology, ring topology and so on. For the star topology and the tree topology, the transmission path of the update data packet can be determined by defining the parameters of the update data packet, and the transmission path of the update data packet is each first IoT device 20 connected in sequence. For the linear topology and the ring topology, since neither branch exists, the two themselves are composed of a plurality of first IoT devices 20 connected in sequence, except for the two first IoT devices in the ring topology. 20 connected together to form a ring.
另外需要说明的是,本发明实施例中第一物联网设备20、第二物联网设备30和第三物联网设备位于同一网络拓扑中,该网络拓扑中包括哪些物联网设备可预先定义,从更新服务器发出的更新数据包用于对该网络拓扑中的物联网设备进行更新。具体实施时,可根据应用场景对网络拓扑定义:In addition, it should be noted that the first Internet of Things device 20, the second Internet of Things device 30, and the third Internet of Things device in the embodiment of the present invention are located in the same network topology. Which Internet of Things devices are included in the network topology can be predefined, from The update data packet sent by the update server is used to update the IoT devices in the network topology. During specific implementation, the network topology can be defined according to the application scenario:
比如:该网络拓扑中包括一个实际的物理网络中所包括的所有物联网设备。For example, the network topology includes all IoT devices included in an actual physical network.
再比如:该网络拓扑中包括一个实际的物理网络中预先定义的某种类型的所有物联网设备;Another example: the network topology includes all IoT devices of a certain type predefined in an actual physical network;
又比如:该网络拓扑中包括一个实际的物理网络中预先确定的若干个物联网设备,其中可依据各个物联网设备的设备地址、设备名称等标识信息形成一个设备列表,在更新数据项中包括下一个要更新的物联网设备的标识信息。For another example: the network topology includes a number of IoT devices predetermined in an actual physical network, wherein a device list can be formed according to identification information such as the device address and device name of each IoT device, and the update data item includes The identification information of the next IoT device to be updated.
上述几种方式仅为示例,在具体实施时,只要预先定义了需要更新的物联网设备的网络拓扑,在物联网设备更新过程中,更新数据包在设备之间传送,并且更新数据包中的更新数据项逐渐减少,降低了物联网设备间的数据传输时延,提高了物联网设备的更新效率。The above several methods are only examples. In the specific implementation, as long as the network topology of the IoT device that needs to be updated is defined in advance, during the updating process of the IoT device, the update data packet is transmitted between the devices, and the update data packet The number of updated data items is gradually reduced, which reduces the data transmission delay between IoT devices and improves the update efficiency of IoT devices.
上述描述中,实际的物理网络可以是一个工厂的网络设备组成的网络,也可以是该工厂的一个车间中的网络设备组成的网络,抑或是该工厂中的一个车间中的一个生产线上的网络设备组成的网络。上述描述中,对于预先定义设备类型的网络拓扑,该设备类型可以是PLC、工业主机等。In the above description, the actual physical network can be a network composed of network equipment in a factory, a network composed of network equipment in a workshop of the factory, or a network of a production line in a workshop of the factory A network of devices. In the above description, for a network topology with a predefined device type, the device type can be PLC, industrial host, etc.
下面介绍本发明实施例提供的设备更新方法,该方法可由前述的第一物联网设备20来执行。如无特征声明,下述各个方法实施例中涉及的更新服务器可为前述的更新服务器10,下述各个方法实施例中涉及的第一物联网设备可为前述的第一物联网设备20,下述各个方法实施例中涉及的第二物联网设备可为前述的第二物联网设备30,下述各个方法实施例中涉及的第三物联网设备可为前述的第三物联网设备40。The following describes the device update method provided by the embodiment of the present invention, which may be executed by the aforementioned first Internet of Things device 20. If there is no feature statement, the update server involved in each of the following method embodiments may be the aforementioned update server 10, and the first IoT device involved in each of the following method embodiments may be the aforementioned first IoT device 20. The second Internet of Things device involved in each method embodiment may be the aforementioned second Internet of Things device 30, and the third Internet of Things device involved in each method embodiment described below may be the aforementioned third Internet of Things device 40.
本发明实施例提供的设备更新方法中,第一物联网设备根据所接收到更新数据包中更新数据项的不同决定是否进行更新处理,并根据网络拓扑中是否还存在需要进行更新的物联网设备决定是否继续传输更新数据包。如图4所示,该方法具体可以包括如下步骤:In the device update method provided by the embodiment of the present invention, the first Internet of Things device determines whether to perform update processing according to the difference in the update data item in the received update data packet, and according to whether there are still Internet of Things devices that need to be updated in the network topology Decide whether to continue transmitting update packets. As shown in Figure 4, the method may specifically include the following steps:
步骤401:接收第一更新数据包,其中,第一更新数据包中包括有至少一个更新数据项;Step 401: Receive a first update data packet, where the first update data packet includes at least one update data item;
步骤402:检测第一更新数据包中是否包括有目标更新数据项;Step 402: Detect whether a target update data item is included in the first update data packet;
步骤403:若第一更新数据包中存在目标更新数据项,利用目标更新数据项对第一物联网设备进行更新;Step 403: If there is a target update data item in the first update data packet, use the target update data item to update the first Internet of Things device;
步骤404:从第一更新数据包中将目标更新数据项删除,获得第二更新数据包;Step 404: Delete the target update data item from the first update data package to obtain a second update data package;
步骤405:若第二更新数据包中包括有至少一个更新数据项,且网络拓扑中需要进行更新的物联网设备,则确定下一个需要进行的更新的物联网设备为第二物联网设备,并将第二更新数据包发送给第二物联网设备。Step 405: If the second update data packet includes at least one update data item, and the IoT device that needs to be updated in the network topology, determine that the next IoT device that needs to be updated is the second IoT device, and Send the second update data packet to the second Internet of Things device.
在本发明实施例中,在接收到第一更新数据包后,检测第一更新数据包中是否包括有用于对第一物联网设备的固件或第一物联网设备上运行的软件进行更新的目标更新数据项,如果第一更新数据包中存在目标更新数据项,则利用目标更新数据项对第一物联网设备进行更新,并在更新完成后将各个目标更新数据项从第一更新数据包中删除而获得第二更新数据包,之后在第二更新数据包中包括有更新数据项且网络拓扑中存在需要进行更新的物联网设备的情况下,将第二更新数据包发送给第二物联网设备。由此可见,包括有多个更新数据项的更新数据包可以在各个物联网设备之间依次传输,接收到更新数据包的物联网设备可以利用更新数据包中相应的更新数据项进行更新,在更新完成后将已经使用的更新数据项从更新数据包中删除,之后将更新数据包传输给下一个物联网设备,从而利用一个更新数据包便可以对需要进行更新的各个物联网设备进行更新,更新服务器仅需要向一个物联网设备发送一次更新数据包,由于减少了更新服务器的冗余负载,从而可以降低更新物联网设备过程中更新服务器的流量负载。In the embodiment of the present invention, after receiving the first update data package, it is detected whether the first update data package includes a target for updating the firmware of the first Internet of Things device or the software running on the first Internet of Things device Update the data item. If there is a target update data item in the first update data package, use the target update data item to update the first Internet of Things device, and after the update is completed, remove each target update data item from the first update data package Delete to obtain the second update data packet, and then send the second update data packet to the second Internet of Things if the update data item is included in the second update data packet and there are IoT devices that need to be updated in the network topology equipment. It can be seen that the update data package that includes multiple update data items can be transmitted sequentially among the various IoT devices, and the IoT device that receives the update data packet can use the corresponding update data item in the update data package to update, in After the update is complete, delete the used update data items from the update data package, and then transmit the update data package to the next IoT device, so that each IoT device that needs to be updated can be updated with one update data package. The update server only needs to send an update data packet to one IoT device once. Since the redundant load of the update server is reduced, the traffic load of the update server in the process of updating the IoT device can be reduced.
在本发明实施例中,如果第一更新数据包中存在用于对第一物联网设备的固件或第一物联网设备上所运行的软件进行更新的目标更新数据项,在利用目标更新数据项对第一物联网设备进行更新之后,从将删除目标更新数据项后的第一更新数据包作为第二更新数据包,之 后可以将第二更新数据包发送给第二物联网设备。由于不同物联网设备的固件以及其上所运行的软件不同,因此用于对不同物联网设备进行更新的更新数据项也各不相同,将已经使用过的更新数据项从更新数据包中删除,使得更新数据包的数据量随更新数据包传输过程的进行而不断减小,从而可以减小传输更新数据包所需的网络带宽,并可以提升对更新数据包进行传输的速率,有助于提升对物联网设备进行更新的效率。In the embodiment of the present invention, if there is a target update data item used to update the firmware of the first Internet of Things device or the software running on the first Internet of Things device in the first update data package, the target update data item is used After the first Internet of Things device is updated, the first update data packet after deleting the target update data item is taken as the second update data packet, and then the second update data packet can be sent to the second Internet of Things device. Because the firmware of different IoT devices and the software running on them are different, the update data items used to update different IoT devices are also different. The updated data items that have been used are deleted from the update data package. The data volume of the update data packet is continuously reduced with the progress of the update data packet transmission process, thereby reducing the network bandwidth required to transmit the update data packet, and can increase the transmission rate of the update data packet, which is helpful to increase The efficiency of updating IoT devices.
在本发明实施例中,如果网络拓扑中已经不存在需要进行更新的物联网设备,则停止对第二更新数据包进行传输,本次物联网设备更新结束。另外,如果第二更新数据包中已经没有用于对物联网设备进行更新的更新数据项,即使网络拓扑中存在需要进行更新的物联网设备,也无需再将不包括更新数据项的第二更新数据包传输给其他物联网设备,此时停止对第二更新数据包进行传输,本次物联网设备更新结束。In the embodiment of the present invention, if there is no IoT device that needs to be updated in the network topology, the transmission of the second update data packet is stopped, and the current IoT device update ends. In addition, if there is no update data item used to update the IoT device in the second update data package, even if there is an IoT device that needs to be updated in the network topology, there is no need to include the second update that does not include the update data item. When the data packet is transmitted to other IoT devices, the second update data packet is stopped at this time, and the current IoT device update ends.
可选地,在图4所示设备更新方法的基础上,步骤402检测第一更新数据包是否包括有目标更新数据项后,如果第一个更新数据包中部包括目标更新数据项,则可以进一步确定网络拓扑中是否存在需要进行更新的物联网设备,如果网络拓扑中存在需要进行更新的物联网设备,则确定下一个需要进行更新的物联网设备作为第三物联网设备,之后将第一更新数据包发送给第三物联网设备。Optionally, on the basis of the device update method shown in FIG. 4, after step 402 detects whether the first update data packet includes a target update data item, if the middle of the first update data packet includes a target update data item, you can further Determine whether there is an IoT device that needs to be updated in the network topology. If there is an IoT device that needs to be updated in the network topology, determine the next IoT device that needs to be updated as the third IoT device, and then update the first The data packet is sent to the third IoT device.
在本发明实施例中,如果第一更新数据包中不存在目标更新数据项,在网络拓扑中仍存在需要进行更新的物联网设备的情况下,将第一更新数据包发送给下一个需要进行更新的物联网设备,保证可以将更新数据包传输给需要进行更新的物联网设备,从而保证物联网设备更新过程可能顺利进行。In the embodiment of the present invention, if there is no target update data item in the first update data packet, and there are still IoT devices that need to be updated in the network topology, the first update data packet is sent to the next one that needs to be updated. The updated IoT device ensures that the update data packet can be transmitted to the IoT device that needs to be updated, thereby ensuring that the IoT device update process may proceed smoothly.
可选地,在图4所示设备更新方法的基础上,步骤402检测第一更新数据包是否包括有目标更新数据项时,可以检测第一更新数据包所包括的每一个更新数据项是否为目标更新数据项,进而来确定第一更新数据包是否包括有目标更新数据项。Optionally, on the basis of the device update method shown in FIG. 4, when step 402 detects whether the first update data package includes a target update data item, it may be detected whether each update data item included in the first update data package is The target update data item is used to determine whether the first update data packet includes the target update data item.
具体地,针对第一更新数据包所包括的每一个更新数据项,获取该更新数据项所包括的目标设备地址,如果获取到的目标设备地址与第一物联网设备的设备地址相同,则将该更新数据项确定为一个目标更新数据项。在遍历第一更新数据包中的所有更新数据项之后,如果将第一更新数据包中的一个更新数据项确定为目标更新数据项,则确定第一更新数据包中包括有目标更新数据项,即说明第一更新数据包中存在用于对第一物联网设备进行更新的更新数据项。Specifically, for each update data item included in the first update data packet, the target device address included in the update data item is acquired. If the acquired target device address is the same as the device address of the first Internet of Things device, then The update data item is determined to be a target update data item. After traversing all the update data items in the first update data package, if one update data item in the first update data package is determined as the target update data item, it is determined that the first update data package includes the target update data item, That is, it indicates that there is an update data item used to update the first Internet of Things device in the first update data package.
在本发明实施例中,每一个更新数据项中均包括有目标设备地址,该目标设备地址用于标识需要被更新的物联网设备,当一个物联网设备接收到更新数据包之后,该物联网设备通过检测更新数据包中各个更新数据项所包括的目标设备地址,便可以确定更新数据包中是否 包括有用于对该物联网设备进行更新的目标更新数据项,进而可以决定对固件、软件进行更新或直接将获取到的更新数据包转发给下一个物联网设备。这样,既可以实现对网络拓扑中的部分物联网设备进行更新,又可以保证更新数据包的正常传输。In the embodiment of the present invention, each update data item includes a target device address, and the target device address is used to identify the Internet of Things device that needs to be updated. After an Internet of Things device receives the update packet, the Internet of Things device By detecting the target device address included in each update data item in the update data package, the device can determine whether the update data package includes the target update data item used to update the Internet of Things device, and then can determine the firmware and software Update or directly forward the obtained update data packet to the next IoT device. In this way, it is possible to update part of the Internet of Things devices in the network topology and to ensure the normal transmission of update data packets.
需要说明的是,目标设备地址可以是IP地址、MAC地址等。另外,更新数据项的结构具体可以如图5所示,除了可以包括目标设备地址502外,更新数据项还可以包括安全代码501、版本号503、更新内容504、协议信息505、状态信息506和下一更新设备地址507等,其中,安全代码501用于对更新数据项进行验证,版本号503用于标识更新内容的版本,更新内容504为具体的更新数据,协议信息505用于标识网络传输协议,状态信息506用于标识物联网设备的运行状态,下一更新设备地址507用于标识下一个接收更新数据包的物联网设备。安全代码501、版本号503和下一更新设备地址507在后续实施例中会进行详细说明,协议信息505具体可以是TFTP、SNMP、NFS、DNS或BOOTP等。It should be noted that the target device address can be an IP address, a MAC address, and so on. In addition, the structure of the update data item can be specifically as shown in Figure 5. In addition to the target device address 502, the update data item can also include a security code 501, a version number 503, update content 504, protocol information 505, status information 506, and The next update device address 507, etc., where the security code 501 is used to verify the update data item, the version number 503 is used to identify the version of the update content, the update content 504 is the specific update data, and the protocol information 505 is used to identify the network transmission Protocol, the status information 506 is used to identify the operating status of the Internet of Things device, and the next update device address 507 is used to identify the next Internet of Things device to receive an update packet. The security code 501, the version number 503, and the next update device address 507 will be described in detail in subsequent embodiments. The protocol information 505 may specifically be TFTP, SNMP, NFS, DNS, or BOOTP.
可选地,在图4所示设备更新方法的基础上,步骤403利用目标更新数据项对第一物联网设备进行更新之前,需要根据目标更新数据项所包括的安全代码对目标更新数据项的安全性进行验证,并需要根据目标更新数据项所包括的版本号验证更新过程是否为升级过程,在通过上述两种验证之后再利用目标更新数据项对第一物联网设备进行更新。如图6所示,利用目标更新数据项对第一物联网设备进行更新的方法可以包括如下步骤:Optionally, on the basis of the device update method shown in FIG. 4, before step 403 uses the target update data item to update the first Internet of Things device, the target update data item needs to be updated according to the security code included in the target update data item. Security is verified, and it is necessary to verify whether the update process is an upgrade process according to the version number included in the target update data item. After passing the above two verifications, the target update data item is used to update the first Internet of Things device. As shown in FIG. 6, the method for updating the first Internet of Things device using the target update data item may include the following steps:
步骤601:获取目标更新数据项所包括的安全代码和第一版本号,其中,所述安全代码用于验证目标更新数据项是否与所述第一物联网设备相匹配,所述第一版本号用于标识该目标更新数据项的版本;Step 601: Acquire a security code and a first version number included in a target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device, and the first version number Used to identify the version of the target update data item;
步骤602:获取第一物联网设备上的与目标更新数据项相对应的更新对象的第二版本号,其中,更新对象包括第一物联网设备的固件或物联网上运行的软件;Step 602: Obtain the second version number of the update object corresponding to the target update data item on the first Internet of Things device, where the update object includes the firmware of the first Internet of Things device or software running on the Internet of Things;
步骤603:利用第一物联网设备的私钥验证安全代码是否与第一物联网设备相匹配,如果是Y,执行步骤604,如果否N,执行步骤606;Step 603: Use the private key of the first Internet of Things device to verify whether the security code matches the first Internet of Things device, if it is Y, go to step 604, if not, go to step 606;
步骤604:判断第一版本号是否高于第二版本号,如果是Y,执行步骤605,如果否N,执行步骤606;Step 604: Determine whether the first version number is higher than the second version number, if it is Y, go to step 605, if not, go to step 606;
步骤605:利用目标更新数据项对更新对象进行更新;Step 605: Use the target update data item to update the update object;
步骤606:结束当前流程。Step 606: End the current process.
在本发明实施例中,首先利用第一物联网设备的私钥来验证目标更新数据项所包括的安全代码是否与第一物联网设备相匹配,仅有在安全代码与第一物联网设备相匹配时才可以利用目标更新数据项对第一物联网设备进行更新,避免目标更新数据项被恶意篡改而导致更新后物联网设备出现运行异常,从而可以保证更新的安全性和可靠性。In the embodiment of the present invention, the private key of the first Internet of Things device is first used to verify whether the security code included in the target update data item matches the first Internet of Things device, and only when the security code matches the first Internet of Things device Only when it matches can the target update data item be used to update the first IoT device, so as to avoid malicious tampering of the target update data item and cause abnormal operation of the updated IoT device, thereby ensuring the security and reliability of the update.
更进一步地,目标更新数据项所包括的安全代码可以由第一物联网设备的公钥加密,如果利用第一物联网设备的私钥可以成功对安全代码进行解密,则说明安全代码与第一物联网设备相匹配,如果利用第一物联网设备的私钥无法成功对安全代码进行解密,则说明安全代码与第一物联网设备不匹配。Furthermore, the security code included in the target update data item can be encrypted by the public key of the first Internet of Things device. If the private key of the first Internet of Things device can be used to successfully decrypt the security code, it means that the security code and the first If the IoT device matches, if the security code cannot be successfully decrypted by using the private key of the first IoT device, it means that the security code does not match the first IoT device.
在本发明实施例中,在确定目标更新数据项所包括的安全代码与第一物联网设备相匹配之后,可以进一步判断目标更新数据项所包括的第一版本号是否高于第一物联网设备上相应更新对象的第二版本号,仅有在第一版本号高于第二版本号时才会利用目标更新数据项对第一物联网设备上的更新对象进行更新,保证了对物联网设备的更新为升级过程,避免由于操作失误对物联网设备进行降级或平级更新,进而保证了对物联网设备进行更新的可靠性。In the embodiment of the present invention, after determining that the security code included in the target update data item matches the first Internet of Things device, it can be further determined whether the first version number included in the target update data item is higher than the first Internet of Things device The second version number of the corresponding update object on the above, only when the first version number is higher than the second version number, will the target update data item be used to update the update object on the first Internet of Things device, ensuring that the Internet of Things device The update of the Internet of Things is an upgrade process to avoid downgrading or parallel updating of the Internet of Things devices due to operational errors, thereby ensuring the reliability of updating the Internet of Things devices.
需要说明的是,在上述各个实施例以及后续各个实施例中,所述的对物联网设备进行更新在本质上是对物联网设备的固件或物联网设备上所运行的软件程序进行更新,即更新对象为物联网设备的固件或物联网设备上所运行的软件程序。在判断第一版本号是否高于第二版本号时,即为判断目标更新数据项中更新内容对应的版本是否高于更新对象现有的版本。It should be noted that in each of the above-mentioned embodiments and subsequent embodiments, the updating of the IoT device is essentially updating the firmware of the IoT device or the software program running on the IoT device, that is, The update object is the firmware of the IoT device or the software program running on the IoT device. When determining whether the first version number is higher than the second version number, it is to determine whether the version corresponding to the update content in the target update data item is higher than the existing version of the update object.
另外需要说明的是,目标更新数据项可以包括有一个或多个更新数据子项,每个更新数据子项用于对一个更新对象进行更新,以适用于同时对同一物联网设备上的多个软件程序或者物联网设备的固件和软件程序进行更新的需求。另外,每一个更新数据子项的结构均具有图5所示的结构。In addition, it should be noted that the target update data item can include one or more update data sub-items, and each update data sub-item is used to update one update object, which is suitable for simultaneously updating multiple data on the same IoT device. The software program or the need for updating the firmware and software program of the IoT device. In addition, the structure of each update data sub-item has the structure shown in FIG. 5.
可选地,在图4所示设备更新方法的基础上,步骤405将第二更新数据包发送给第二物联网设备时,首先需要确定下一个接收更新数据包的第二物联网设备。如图7所示,将第二更新数据包发送给第二物联网设备的方法具体可以包括如下步骤:Optionally, based on the device update method shown in FIG. 4, when the second update data packet is sent to the second IoT device in step 405, it is first necessary to determine the next second IoT device to receive the update data packet. As shown in FIG. 7, the method of sending the second update data packet to the second Internet of Things device may specifically include the following steps:
步骤701:获取目标更新数据项所包括的下一更新设备地址,其中,下一更新设备地址用于在网络拓扑中对第二物联网设备进行标识;Step 701: Obtain the next update device address included in the target update data item, where the next update device address is used to identify the second Internet of Things device in the network topology;
步骤702:根据获取到的下一更新设备地址,将第二更新数据包发送给第二物联网设备。Step 702: Send the second update data packet to the second Internet of Things device according to the acquired address of the next update device.
在本发明实施例中,目标更新数据项中均包括有下一更新设备地址这一项信息,在从第一更新数据包中将目标更新数据项删除而获得第二更新数据包之后,可以从目标更新数据项中获取下一更新设备地址,而该更新设备地址用于标识网络拓扑中下一个需要进行更新的物联网设备,进而将该下一个需要进行更新的物联网设备确定为第二物联网设备,这样便可以方便地根据下一更新设备地址将第二更新数据包发送给第二物联网设备,实现更新数据包在物联网设备之间传输。In the embodiment of the present invention, the target update data item includes the next update device address. After the target update data item is deleted from the first update data packet and the second update data packet is obtained, Obtain the next update device address in the target update data item, and the update device address is used to identify the next IoT device that needs to be updated in the network topology, and then determine the next IoT device that needs to be updated as the second thing In this way, the second update data packet can be sent to the second Internet of Things device conveniently according to the address of the next update device, so that the update data packet can be transmitted between the Internet of Things devices.
可选地,在将第一更新数据包发送给第三物联网设备时,由于第一更新数据包中不存在目标更新数据项,所以无法根据目标更新数据项中的下一更新设备地址来确定下一个需要进 行更新的物联网设备,此时需要根据第一更新数据包中各个更新数据项所对应的物联网设备来确定更新数据包的传输路径,进而根据确定出的传输路径来确定第三物联网设备。如图8所示,将第一更新数据包发送给第三物联网设备的方法具体可以包括如下步骤:Optionally, when the first update data packet is sent to the third Internet of Things device, since there is no target update data item in the first update data packet, it cannot be determined according to the next update device address in the target update data item The next IoT device that needs to be updated. At this time, it is necessary to determine the transmission path of the update data packet according to the IoT device corresponding to each update data item in the first update data packet, and then determine the third according to the determined transmission path IoT devices. As shown in FIG. 8, the method of sending the first update data packet to the third Internet of Things device may specifically include the following steps:
步骤801:确定目标传输路径,其中,目标传输路径为网络拓扑中连接第一物联网设备与各个第四物联网设备的路径,第一更新数据包中存在用于对每一个第四物联网设备进行更新的更新数据项;Step 801: Determine the target transmission path, where the target transmission path is a path connecting the first Internet of Things device and each fourth Internet of Things device in the network topology, and the first update data packet is used for each fourth Internet of Things device Update data items for updating;
步骤802:将目标传输路径中距第一物联网设备最近的一个第四物联网设备确定为第三物联网设备;Step 802: Determine a fourth Internet of Things device closest to the first Internet of Things device in the target transmission path as the third Internet of Things device;
步骤803:将第一更新数据包发送给第三物联网设备。Step 803: Send the first update data packet to the third Internet of Things device.
在本发明实施例中,在确定第一更新数据包中不存在用于对第一物联网设备进行更新的目标更新数据项后,针对第一更新数据包中包括的每一个更新数据项,根据该更新数据项所包括的目标设备地址来确定网络拓扑中可以利用该更新数据项进行更新的第四物联网设备。在确定出第一更新数据包中每一个更新数据项所对应的第四物联网设备之后,确定网络拓扑中连接第一物联网设备以及各个第四物联网设备的路径为目标路径,之后将目标路径中距第一物联网设备最近的一个第四物联网设备确定为第三物联网设备,之后便可以将第一更新数据包发送给所确定出的第三物联网设备。In the embodiment of the present invention, after it is determined that there is no target update data item for updating the first Internet of Things device in the first update data packet, for each update data item included in the first update data packet, according to The target device address included in the update data item determines the fourth Internet of Things device in the network topology that can be updated with the update data item. After determining the fourth IoT device corresponding to each update data item in the first update data packet, determine the path connecting the first IoT device and each fourth IoT device in the network topology as the target path, and then set the target A fourth Internet of Things device closest to the first Internet of Things device in the path is determined to be the third Internet of Things device, and then the first update data packet can be sent to the determined third Internet of Things device.
由于第一更新数据包中不包括用于对第一物联网设备进行更新的目标更新数据项,因此无法根据目标更新数据项所包括的目标设备地址来确定第三物联网设备。此时,分别确定第一更新数据包中每一个更新数据项所对应的第四物联网设备,之后确定出一个可以连接第一物联网设备以及各个第四物联网设备的目标传输路径,使得更新数据包可以按照目标传输路径依次传输到各个第四物联网设备,为了将第一更新数据包传输给下一个需要进行更新的物联网设备,将目标路径中距第一物联网设备最近的一个第四物联网设备确定为第三物联网设备,进而将第一更新数据包发送给该第三物联网设备。Since the first update data package does not include a target update data item for updating the first Internet of Things device, the third Internet of Things device cannot be determined according to the target device address included in the target update data item. At this time, respectively determine the fourth IoT device corresponding to each update data item in the first update data packet, and then determine a target transmission path that can connect the first IoT device and each fourth IoT device, so that the update The data packet can be transmitted to each fourth IoT device in turn according to the target transmission path. In order to transmit the first update data packet to the next IoT device that needs to be updated, the first IoT device in the target path closest to the first IoT device Fourth, the Internet of Things device is determined to be the third Internet of Things device, and then the first update data packet is sent to the third Internet of Things device.
在本发明实施例中,在对同一网络拓扑中的物联网设备进行更新时,可能并不会对网络拓扑中的所有物联网设备进行更新,因此位于目标传输路径上的物联网设备可能不仅是第一物联网设备和各个第四物联网设备,即目标传输路径上在第一物联网设备与第四物联网设备之间或两个第四物联网设备之间可能会存在不需要进行更新的其他物联网设备。In the embodiment of the present invention, when the IoT devices in the same network topology are updated, all the IoT devices in the network topology may not be updated, so the IoT devices located on the target transmission path may not only be The first Internet of Things device and each fourth Internet of Things device, that is, the target transmission path between the first Internet of Things device and the fourth Internet of Things device or between two fourth Internet of Things devices may have other things that do not need to be updated IoT devices.
下面以对线型拓扑中的物联网设备进行更新为例,对本发明实施例所提供的设备更新方法作进一步详细说明,如图9所示,该方法可以包括如下步骤:Taking the updating of the Internet of Things devices in the linear topology as an example, the device updating method provided in the embodiment of the present invention will be described in further detail. As shown in FIG. 9, the method may include the following steps:
步骤901:更新服务器将更新数据包发送给端部的一个物联网设备。Step 901: The update server sends the update data packet to an IoT device at the end.
在本发明实施例中,如图10所示的线型拓扑,该线型拓扑中包括有依次相连接的物联网设备1001至物联网设备1005,更新数据包中包括有更新数据项1至更新数据项4,其中,更新数据项1和更新数据项2用于对物联网设备1001进行更新,更新数据项3用于对物联网设备3进行更新,更新数据项4用于对物联网设备4进行更新。在开始对物联网设备进行更新时,更新服务器首先将更新数据包发送给物联网设备1001。In the embodiment of the present invention, as shown in FIG. 10, the linear topology includes IoT devices 1001 to 1005 connected in sequence, and the update data packet includes update data items 1 to update Data item 4, where update data item 1 and update data item 2 are used to update the Internet of Things device 1001, update data item 3 is used to update the Internet of Things device 3, and update data item 4 is used to update the Internet of Things device 4 Update. When starting to update the Internet of Things device, the update server first sends an update data packet to the Internet of Things device 1001.
步骤902:接收到更新数据包的物联网设备检测更新数据包中是否包括有目标更新数据项,如果是Y,执行步骤903,如果否N,执行步骤908。Step 902: The IoT device that has received the update data packet detects whether the update data packet includes the target update data item, if it is Y, execute step 903, if not, execute step 908.
在本发明实施例中,网络拓扑中的一个物联网设备接收到来自更新服务器或其他物联网设备的更新数据包后,该物联网设备首先检测更新数据包中是否有用于对其自身进行更新的目标更新数据项,如果目标更新数据项存在则需要对其自身进行更新,相应地执行步骤903,如果目标更新数据项不存在则需要将更新数据包发送给下一个物联网设备,相应地执行步骤908。具体地,物联网设备在接收到更新数据包之后,可以检测更新数据包中是否存在至少一个更新数据项所包括的目标设备地址与该物联网设备的设备地址相同,如果存在则确定更新数据包中存在目标更新数据项,且将所包括目标设备地址与该物联网设备的设备地址相同的更新数据项确定为目标更新数据项。In the embodiment of the present invention, after an Internet of Things device in the network topology receives an update data packet from an update server or other Internet of Things device, the Internet of Things device first detects whether there is any update data packet for itself. The target update data item, if the target update data item exists, it needs to update itself, and step 903 is executed accordingly. If the target update data item does not exist, the update data packet needs to be sent to the next IoT device, and the steps are executed accordingly 908. Specifically, after the IoT device receives the update data packet, it can detect whether the target device address included in at least one update data item is the same as the device address of the IoT device in the update data packet, and if it exists, the update data packet is determined There is a target update data item in it, and the included update data item whose target device address is the same as the device address of the Internet of Things device is determined as the target update data item.
例如,物联网设备1001在接收到来自更新服务器的更新数据包后,检测到更新数据项1和更新数据项2所包括的目标设备地址与物联网设备1001的设备地址相同,进而将更新数据项1和更新数据项2确定为物联网设备1001的目标更新数据项,相应地执行步骤903。物联网设备1002在接收到来自物联网设备1001的更新数据包后,由于更新数据包中没有更新数据项所包括的目标设备地址与物联网设备1002的设备地址相同,进而物联网设备1002执行步骤908。For example, after the IoT device 1001 receives the update data packet from the update server, it detects that the target device address included in the update data item 1 and the update data item 2 is the same as the device address of the IoT device 1001, and then updates the data item 1 and update data item 2 are determined to be the target update data item of the Internet of Things device 1001, and step 903 is executed accordingly. After the Internet of Things device 1002 receives the update data packet from the Internet of Things device 1001, since the target device address included in the update data item is not the same as the device address of the Internet of Things device 1002 in the update data packet, the Internet of Things device 1002 performs the steps 908.
步骤903:验证目标更新数据项包括的安全代码是否与物联网设备相匹配,如果是Y,执行步骤904,如果否N,执行步骤906。Step 903: verify whether the security code included in the target update data item matches the IoT device, if it is Y, execute step 904, if not, execute step 906.
在本发明实施例中,当物联网设备确定出目标更新数据项之后,利用该物联网设备的私钥验证该目标更新数据项所包括的安全代码是否与该物联网设备相匹配,如果匹配则针对该目标更新数据项执行步骤904,如果不匹配则针对该目标更新数据项执行步骤906。In the embodiment of the present invention, after the IoT device determines the target update data item, the private key of the IoT device is used to verify whether the security code included in the target update data item matches the IoT device, and if it matches, Step 904 is executed for the target update data item, and if there is no match, step 906 is executed for the target update data item.
例如,物联网设备1003在将更新数据项3确定为其自身的目标更新数据项之后,物联网设备1003利用其私钥验证更新数据项3所包括的安全代码是否与物联网设备1003相匹配,验证结果为更新数据项3所包括的安全代码与物联网设备1003相匹配,则物联网设备1003针对更新数据项3执行步骤904。物联网设备1004在将更新数据项4确定为其自身的目标更新数据项之后,物联网设备1004利用其私钥验证更新数据项4所包括的安全代码是否与物联 网设备1004相匹配,验证结果为更新数据项4所包括的安全代码与物联网设备1004不匹配,则物联网设备1004针对更新数据项4执行步骤906。For example, after the IoT device 1003 determines the update data item 3 as its own target update data item, the IoT device 1003 uses its private key to verify whether the security code included in the update data item 3 matches the IoT device 1003. The verification result is that the security code included in the updated data item 3 matches the Internet of Things device 1003, and the Internet of Things device 1003 performs step 904 for the updated data item 3. After the IoT device 1004 determines the update data item 4 as its own target to update the data item, the IoT device 1004 uses its private key to verify whether the security code included in the update data item 4 matches the IoT device 1004, the verification result To update the security code included in the data item 4 does not match the Internet of Things device 1004, the Internet of Things device 1004 performs step 906 for the updated data item 4.
步骤904:验证目标更新数据项所包括的版本号是否高于物联网设备上更新对象的版本号,如果是Y,执行步骤905,如果否N,执行步骤906。Step 904: verify whether the version number included in the target update data item is higher than the version number of the update object on the Internet of Things device, if it is Y, perform step 905, if not, perform step 906.
在本发明实施例中,在验证目标更新数据项所包括的安全代码与物联网设备相匹配后,确定目标更新数据项用于更新的更新对象,并验证目标更新数据项所包括的版本号是否高于更新对象的版本号,如果是则针对该目标更新数据项执行步骤905,否则针对该目标更新数据项执行步骤906。In the embodiment of the present invention, after verifying that the security code included in the target update data item matches the IoT device, determine the update object used for the update of the target update data item, and verify whether the version number included in the target update data item is If it is higher than the version number of the update object, step 905 is executed for the target update data item, otherwise, step 906 is executed for the target update data item.
例如,在确定出更新数据项1用于对物联网设备1001固件进行更新,更新数据项2用于对物联网设备1001上的软件1进行更新后,获取物联网设备1001固件的版本号和软件1的版本号,并将物联网设备1001固件的版本号与更新数据项1所包括的版本号进行比较,将软件1的版本号与更新数据项2所包括的版本号进行比较,比较结果为更新数据项1所包括的版本号高于物联网设备1001固件的版本号,更新数据项2所包括的版本号高于软件1的版本号,则物联网设备1001针对更新数据项1和更新数据项2执行步骤905。For example, after determining that the update data item 1 is used to update the firmware of the Internet of Things device 1001, and the update data item 2 is used to update the software 1 on the Internet of Things device 1001, obtain the version number and software of the Internet of Things device 1001 firmware 1 and compare the version number of the IoT device 1001 firmware with the version number included in the update data item 1, and compare the version number of the software 1 with the version number included in the update data item 2, and the comparison result is The version number included in the update data item 1 is higher than the version number of the firmware of the Internet of Things device 1001, and the version number included in the update data item 2 is higher than the version number of the software 1, and the Internet of Things device 1001 responds to the update data item 1 and update data Item 2 executes step 905.
又例如,在确定出更新数据项3用于对物联网设备1003的固件进行更新后,获取物联网设备1003固件的版本号,并将物联网设备1003固件的版本号与更新数据项3所包括的版本号进行比较,比较结果为更新数据项3所包括的版本号低于物联网设备1003固件的版本号,则物联网设备1003针对更新数据项3执行步骤906。For another example, after it is determined that the update data item 3 is used to update the firmware of the Internet of Things device 1003, the version number of the firmware of the Internet of Things device 1003 is obtained, and the version number of the firmware of the Internet of Things device 1003 is included in the update data item 3. The comparison result is that the version number included in the updated data item 3 is lower than the version number of the firmware of the Internet of Things device 1003, and the Internet of Things device 1003 performs step 906 for the updated data item 3.
步骤905:物联网设备利用目标更新数据项对更新对象进行更新。Step 905: The Internet of Things device uses the target update data item to update the update object.
在本发明实施例中,在确定目标更新数据项所包括的版本号高于物联网设备上更新对象的版本号之后,物联网设备利用目标更新数据项对更新对象进行更新。In the embodiment of the present invention, after determining that the version number included in the target update data item is higher than the version number of the update object on the Internet of Things device, the Internet of Things device uses the target update data item to update the update object.
例如,物联网设备1001利用更新数据项1对物联网设备1001的固件进行更新,物联网设备1001利用更新数据项2对物联网设备1001上的软件1进行更新。For example, the Internet of Things device 1001 uses update data item 1 to update the firmware of the Internet of Things device 1001, and the Internet of Things device 1001 uses update data item 2 to update the software 1 on the Internet of Things device 1001.
步骤906:物联网设备将目标更新数据项从更新数据包中删除。Step 906: The IoT device deletes the target update data item from the update data package.
在本发明实施例中,针对确定出的每一个目标更新数据项,在确定该目标更新数据项所包括的安全代码与物联网设备不匹配,或者在确定该目标更新数据项所包括的版本号低于或等于物联网设备上更新对象的版本号,或者已经利用该目标更新数据项对相应的更新对象进行更新之后,将该目标更新数据项从更新数据包中删除。In the embodiment of the present invention, for each determined target update data item, when it is determined that the security code included in the target update data item does not match the IoT device, or when the version number included in the target update data item is determined After it is lower than or equal to the version number of the update object on the IoT device, or after the target update data item has been used to update the corresponding update object, the target update data item is deleted from the update data package.
例如,物联网设备1001从获取到的更新数据包中将更新数据项1和更新数据项2删除,物联网设备1003将从获取到的更新数据包中将更新数据项3删除,物联网设备1004将从获取到的更新数据包中将更新数据项4删除。For example, the Internet of Things device 1001 deletes the update data item 1 and the update data item 2 from the obtained update data package, the Internet of Things device 1003 deletes the update data item 3 from the obtained update data package, and the Internet of Things device 1004 The update data item 4 will be deleted from the obtained update data package.
步骤907:物联网设备检测更新数据包是否包括有更新数据项,如果是Y,执行步骤908,如果否N,执行步骤810。Step 907: The Internet of Things device detects whether the update data packet includes an update data item, if it is Y, execute step 908, if not, execute step 810.
在本发明实施例中,针对每一个物联网设备,如果该物联网设备所接收到的更新数据包中存在目标更新数据项,则在将目标更新数据项从更新数据包中删除后,判断更新数据包中是否还存在至少一个更新数据项,如果是则执行步骤908,如果否则执行步骤910;如果该物联网设备所接收到的更新数据包中不存在目标更新数据项,则不需要经过删除目标更新数据项的步骤,因此更新数据包中必然存在至少一个更新数据项,此时执行步骤908。In the embodiment of the present invention, for each Internet of Things device, if there is a target update data item in the update data packet received by the Internet of Things device, after the target update data item is deleted from the update data package, it is determined to update Whether there is at least one update data item in the data packet, if yes, go to step 908, if otherwise, go to step 910; if there is no target update data item in the update data packet received by the IoT device, it does not need to be deleted The target is the step of updating data items. Therefore, there must be at least one update data item in the update data packet, and step 908 is executed at this time.
例如,物联网设备1001在将更新数据项1和更新数据项2从更新数据包中删除后,由于更新数据包中还包括有更新数据项3和更新数据项4,因此物联网设备1001执行步骤908。物联网设备1002没有进行删除目标更新数据项的操作,其从物联网设备1001获取到的更新数据包中包括有更新数据项3和更新数据项4,因此物联网设备1002执行步骤908。物联网设备1003在将更新数据项3从更新数据包中删除后,由于更新数据包中还包括有更新数据项4,因此物联网设备1003执行步骤908。物联网设备1004在将更新数据项4从更新数据包中删除后,由于更新数据包已经不包括任何更新数据项,因此物联网设备1004执行步骤910。For example, after the Internet of Things device 1001 deletes update data item 1 and update data item 2 from the update data package, since the update data package also includes update data item 3 and update data item 4, the Internet of Things device 1001 executes steps 908. The Internet of Things device 1002 does not perform an operation to delete the target update data item. The update data package it obtains from the Internet of Things device 1001 includes update data item 3 and update data item 4, so the Internet of Things device 1002 performs step 908. After the Internet of Things device 1003 deletes the update data item 3 from the update data package, since the update data package also includes the update data item 4, the Internet of Things device 1003 executes step 908. After the IoT device 1004 deletes the update data item 4 from the update data package, since the update data package does not include any update data items, the IoT device 1004 executes step 910.
步骤908:物联网设备检测是否存下需要更新的第二物联网设备/第三物联网设备,如果是Y,执行步骤909,如果否N,执行步骤910。Step 908: The Internet of Things device detects whether the second Internet of Things device/third Internet of Things device that needs to be updated is stored, if it is Y, execute step 909, if not, execute step 910.
在本发明实施例中,物联网设备在将目标更新数据项从更新数据包中删除后,如果确定更新数据包中还包括有更新数据项后,该物联网设备确定网络拓扑中是否还存在需要进行更新的第二物联网设备,如果是则执行步骤909,否则执行步骤910。物联网设备在确定更新数据包中不包括目标更新数据项后,该物联网设备确定网络拓扑中是否还存在需要进行更新的第三物联网设备,如果是则执行步骤909,否则执行步骤910。In the embodiment of the present invention, after the Internet of Things device deletes the target update data item from the update data package, if it is determined that the update data package also includes the update data item, the Internet of Things device determines whether there is still a need in the network topology For the second Internet of Things device to be updated, if yes, execute step 909; otherwise, execute step 910. After the Internet of Things device determines that the update data packet does not include the target update data item, the Internet of Things device determines whether there is a third Internet of Things device that needs to be updated in the network topology, and if so, execute step 909, otherwise execute step 910.
例如,物联网设备1002为物联网设备1001的第二物联网设备,因此物联网设备1001在确定更新数据包中存在更新数据项之后执行步骤909。物联网设备1005没有相连接的第二物联网设备,即使物联网设备1005确定更新数据包中存在更新数据项,物联网设备1005也会执行步骤910。For example, the Internet of Things device 1002 is the second Internet of Things device of the Internet of Things device 1001, so the Internet of Things device 1001 performs step 909 after determining that there is an update data item in the update data packet. The Internet of Things device 1005 does not have a connected second Internet of Things device. Even if the Internet of Things device 1005 determines that there is an update data item in the update data packet, the Internet of Things device 1005 will perform step 910.
步骤909:物联网设备将更新数据包发送给第二物联网设备/第三物联网设备。Step 909: The IoT device sends the update data packet to the second IoT device/third IoT device.
在本发明实施例中,物联网设备确定更新数据包中存在更新数据项且存在需要更新的第二物联网设备/第三物联网设备后,物联网设备将更新数据包发送给第二物联网设备/第三物联网设备,接收到更新数据包的第二物联网设备/第三物联网设备将按照步骤902至步骤909继续进行物联网设备更新或更新数据包的传递。In the embodiment of the present invention, after the IoT device determines that there is an update data item in the update data packet and there is a second IoT device/third IoT device that needs to be updated, the IoT device sends the update data packet to the second IoT device Device/third Internet of Things device, the second Internet of Things device/third Internet of Things device that receives the update data package will continue to update the Internet of Things device or transfer the update data package according to step 902 to step 909.
例如,物联网设备1001将更新数据包发送给物联网设备1002,物联网设备1002将更新 数据包发送给物联网设备1003,物联网设备1003将更新数据包发送给物联网设备1004。For example, the Internet of Things device 1001 sends an update data packet to the Internet of Things device 1002, the Internet of Things device 1002 sends an update data packet to the Internet of Things device 1003, and the Internet of Things device 1003 sends an update data packet to the Internet of Things device 1004.
步骤910:物联网设备删除更新数据包,本次更新结束。Step 910: The IoT device deletes the update data package, and this update ends.
在本发明实施例中,当物联网设备处于网络拓扑的末端,或者更新数据包中已经不包括更新数据项时,物联网设备将空的更新数据包删除,本次对物联网设备进行的更新结束。In the embodiment of the present invention, when the Internet of Things device is at the end of the network topology, or the update data package no longer includes the update data item, the Internet of Things device deletes the empty update data packet. This update of the Internet of Things device End.
下面结合附图对更新数据包在物联网设备之间的传输过程进行进一步说明,如图11所示,更新服务器1101与网关1102相连接,网关1102与物联网设备1103相连接,物联网设备1103至1107依次顺序相连接,物联网设备1107与网关1102相连接。The transmission process of update data packets between IoT devices will be further described below with reference to the drawings. As shown in Figure 11, the update server 1101 is connected to the gateway 1102, the gateway 1102 is connected to the IoT device 1103, and the IoT device 1103 To 1107 are connected in sequence, and the Internet of Things device 1107 is connected to the gateway 1102.
更新服务器1101将更新数据包1108发送给网关1102之后,网关1102将更新数据包1108发送给物联网设备1103,此时更新数据包1108中包括有分别用于对物联网设备1103至1107进行更新的多个更新数据项。如图11所示,阴影用于表征更新数据包1108所包括的更新数据项,可见网关1102发送给物联网设备1103的更新数据包1108包括有全部的更新数据项,比如此时更新数据包1108的数据量为64K。After the update server 1101 sends the update data package 1108 to the gateway 1102, the gateway 1102 sends the update data package 1108 to the Internet of Things device 1103. At this time, the update data package 1108 includes information for updating the Internet of Things devices 1103 to 1107. Multiple update data items. As shown in Figure 11, the shading is used to represent the update data items included in the update data packet 1108. It can be seen that the update data packet 1108 sent by the gateway 1102 to the IoT device 1103 includes all the update data items. For example, the update data packet 1108 at this time The amount of data is 64K.
物联网设备1103在接收到更新数据包1108后,利用更新数据包1108中相应的更新数据项进行更新,之后将用于对物联网设备1103进行更新的更新数据项从更新数据包1108中删除,之后将更新数据包1108发送给物联网设备1104。如图11所示,物联网设备1103发送给物联网设备1104的更新数据包1108中的更新数据项已经变少,具体为不包括用于对物联网设备1103进行更新的更新数据项,比如此时更新数据包1108的数据量为50K。After the IoT device 1103 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, and then deletes the update data item used to update the IoT device 1103 from the update data package 1108, Then, the update data packet 1108 is sent to the Internet of Things device 1104. As shown in FIG. 11, the update data items in the update data packet 1108 sent by the IoT device 1103 to the IoT device 1104 have been reduced, specifically it does not include the update data items used to update the IoT device 1103, such as this The data volume of the time update data packet 1108 is 50K.
物联网设备1104在接收到更新数据包1108后,利用更新数据包1108中相应的更新数据项进行更新,之后将用于对物联网设备1104进行更新的更新数据项删除,之后将更新数据包1108发送给物联网设备1105。如图11所示,物联网设备1104发送给物联网设备1105的更新数据包1108中国的更新数据项进一步变少,具体为不包括用于对物联网设备1103和物联网设备1104进行更新的更新数据项,比如此时更新数据包1108的数据量为40K。After the IoT device 1104 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1104, and then updates the data package 1108 Send to the Internet of Things device 1105. As shown in Figure 11, the update data package 1108 sent by the Internet of Things device 1104 to the Internet of Things device 1105 has further reduced the number of update data items in China, specifically excluding the updates used to update the Internet of Things device 1103 and the Internet of Things device 1104 The data item, for example, the data volume of the update data packet 1108 at this time is 40K.
物联网设备1105在接收到更新数据包1108后,利用更新数据包1108中相应的更新数据项进行更新,之后将用于对物联网设备1105进行更新的更新数据项删除,之后将更新数据包1108发送给物联网设备1106。如图11所示,物联网设备1105发送给物联网设备1106的更新数据包1108中国的更新数据项进一步变少,具体为不包括用于对物联网设备1103至1105进行更新的更新数据项,比如此时更新数据包1108的数据量为30K。After the IoT device 1105 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1105, and then updates the data package 1108 Send to the Internet of Things device 1106. As shown in Figure 11, the update data package 1108 sent by the Internet of Things device 1105 to the Internet of Things device 1106 has further reduced data items in China, specifically not including the update data items used to update the Internet of Things devices 1103 to 1105. For example, the data volume of the update data packet 1108 at this time is 30K.
物联网设备1106在接收到更新数据包1108后,利用更新数据包1108中相应的更新数据项进行更新,之后将用于对物联网设备1106进行更新的更新数据项删除,之后将更新数据包1108发送给物联网设备1107。如图11所示,物联网设备1106发送给物联网设备1107的更 新数据包1108中国的更新数据项进一步变少,具体为不包括用于对物联网设备1103至1106进行更新的更新数据项,比如此时更新数据包1108的数据量为11K。After the IoT device 1106 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1106, and then updates the data package 1108 Send to the Internet of Things device 1107. As shown in Figure 11, the update data package 1108 sent by the Internet of Things device 1106 to the Internet of Things device 1107 has further reduced data items in China, specifically not including the update data items used to update the Internet of Things devices 1103 to 1106. For example, at this time, the data volume of the update data packet 1108 is 11K.
物联网设备1107在接收到更新数据包1108后,利用更新数据包1108中相应的更新数据项进行更新,之后将用于对物联网设备1106进行更新的更新数据项删除,之后将更新数据包1108发送给网关1102。如图11所示,物联网设备1107发送给网关1102的更新数据包1108已经不包括任何的更新数据项,比如此时更新数据包1108的数据量为0K。After the IoT device 1107 receives the update data package 1108, it uses the corresponding update data item in the update data package 1108 to update, then deletes the update data item used to update the IoT device 1106, and then updates the data package 1108 Send to gateway 1102. As shown in FIG. 11, the update data package 1108 sent by the Internet of Things device 1107 to the gateway 1102 does not include any update data items. For example, the data volume of the update data package 1108 at this time is 0K.
下面结合附图对物联网设备进行更新的过程进行进一步说明,如图12所示,该更新过程涉及用户1201、更新管理系统1202、网关1203以及物联网设备1204至120n,具体设计的操作步骤包括:The following describes the process of updating IoT devices with reference to the drawings. As shown in Figure 12, the update process involves the user 1201, the update management system 1202, the gateway 1203, and the IoT devices 1204 to 120n. The specific design steps include :
S01:用户1201将更新数据包上传至更新管理系统1202;S01: The user 1201 uploads the update data package to the update management system 1202;
S02:更新管理系统1202将更新数据包传输给网关1203;S02: The update management system 1202 transmits the update data packet to the gateway 1203;
S03:验证与更新数据包所包括的安全代码进行匹配;S03: Verify and match the security code included in the update data package;
S04:利用更新数据包中对应于当前物联网设备的更新数据项进行软件和固件升级;S04: Use the update data item corresponding to the current IoT device in the update data package to upgrade the software and firmware;
S05:将对应于当前物联网设备的更新数据项从更新数据包中删除;S05: Delete the update data item corresponding to the current Internet of Things device from the update data package;
S06:将剩余的更新数据包发送给下一个物联网设备;S06: Send the remaining update data packets to the next IoT device;
S07:向网关1203发送指示更新完成的指示信息。S07: Send instruction information indicating that the update is complete to the gateway 1203.
需要说明的是,针对物联网设备1204至120n中的每一个物联网设备,该物联网设备均执行S03至S06,不同的是物联网设备1204针对来自网关1203的更新数据包执行S03至S06,而其余的物联网设备针对来自上一个物联网设备的更新数据包执行S03至S06。另外,处于末端的物联网设备120n在执行S03至S06后执行S07,以通知网关1203针对该更新数据包所进行的物联网设备更新已经完成。It should be noted that for each of the IoT devices 1204 to 120n, the IoT device performs S03 to S06. The difference is that the IoT device 1204 performs S03 to S06 for the update data packet from the gateway 1203. The rest of the IoT devices perform S03 to S06 for the update packet from the previous IoT device. In addition, the IoT device 120n at the end performs S07 after performing S03 to S06 to notify the gateway 1203 that the IoT device update for the update data packet has been completed.
如图13所示,本发明一个实施例提供了一种第一物联网设备20,包括:As shown in FIG. 13, an embodiment of the present invention provides a first Internet of Things device 20, including:
一个数据包接收模块201,用于接收第一更新数据包,其中,第一更新数据包中包括有至少一个更新数据项;A data packet receiving module 201 for receiving a first update data packet, where the first update data packet includes at least one update data item;
一个数据包检测模块202,用于检测数据包接收模块201接收到的第一更新数据包中是否包括有目标更新数据项,其中,目标更新数据项用于对第一物联网设备20的固件或其上运行的软件进行更新;A data packet detection module 202 is used to detect whether the first update data packet received by the data packet receiving module 201 includes a target update data item, wherein the target update data item is used to update the firmware of the first Internet of Things device 20 or The software running on it is updated;
一个设备更新模块203,用于在数据包检测模块202确定第一更新数据包包括有目标更新数据项时,利用目标更新数据项对第一物联网设备20进行更新;A device update module 203, configured to use the target update data item to update the first Internet of Things device 20 when the data packet detection module 202 determines that the first update data package includes a target update data item;
一个数据包更新模块204,用于在设备更新模块203对第一物联网设备20进行更新之后,从第一更新数据包中将目标更新数据项删除,获得第二更新数据包;A data package update module 204, configured to delete the target update data item from the first update data package after the device update module 203 updates the first Internet of Things device 20 to obtain a second update data package;
一个第一数据包发送模块205,用于在数据包更新模块204获得的第二更新数据包中包括有至少一个新数据项,且网络拓扑中存在需要更新的物联网设备的情况下,确定下一个需要进行更新的物联网设备作为第二物联网设备30,并将第二更新数据包发送给第二物联网设备30。A first data packet sending module 205 is used to determine the next step when the second update data packet obtained by the data packet update module 204 includes at least one new data item, and there is an IoT device that needs to be updated in the network topology An Internet of Things device that needs to be updated is used as the second Internet of Things device 30, and the second update data packet is sent to the second Internet of Things device 30.
在本发明实施例中,数据包接收模块201可用于执行上述方法实施例中的步骤401,数据包检测模块202可用于执行上述方法实施例中的步骤402,设备更新模块203可用于执行上述方法实施例中的步骤403,数据包更新模块204可用于执行上述方法实施例中的步骤404,第一数据包发送模块205可用于执行上述方法实施例中的步骤405。In the embodiment of the present invention, the data packet receiving module 201 can be used to perform step 401 in the above method embodiment, the data packet detection module 202 can be used to perform step 402 in the above method embodiment, and the device update module 203 can be used to perform the above method In step 403 in the embodiment, the data packet update module 204 can be used to execute step 404 in the above method embodiment, and the first data packet sending module 205 can be used to execute step 405 in the above method embodiment.
可选地,在图13所示第一物联网设备20的基础上,如图14所示,该第一物联网设备20进一步包括:Optionally, based on the first Internet of Things device 20 shown in FIG. 13, as shown in FIG. 14, the first Internet of Things device 20 further includes:
一个第二数据包发送模块206,用于在数据包检测模块202确定第一更新数据包中不包括目标更新数据项,且网络拓扑中存在需要更新的物联网设备的情况下,确定下一个需要进行更新的物联网设备作为第三物联网设备40,并将第一更新数据包发送给第三物联网设备40。A second data packet sending module 206 is used to determine the next need when the data packet detection module 202 determines that the first update data packet does not include the target update data item, and there are IoT devices that need to be updated in the network topology The Internet of Things device to be updated serves as the third Internet of Things device 40 and sends the first update data packet to the third Internet of Things device 40.
可选地,在图13或图14所示第一物联网设备20的基础上,数据包检测模块202用于针对第一更新数据包所包括的每一个更新数据项,如果该更新数据项所包括的目标设备地址与第一物联网设备20的设备地址相同,则将该更新数据项确定为一个目标更新数据项。Optionally, on the basis of the first Internet of Things device 20 shown in FIG. 13 or FIG. 14, the data packet detection module 202 is used for each update data item included in the first update data packet, if the update data item is The included target device address is the same as the device address of the first Internet of Things device 20, and the update data item is determined as a target update data item.
可选地,在图13或图14所示第一物联网设备20的基础上,如图15所示,设备更新模块203包括:Optionally, on the basis of the first IoT device 20 shown in FIG. 13 or FIG. 14, as shown in FIG. 15, the device update module 203 includes:
一个第一信息获取单元2031,用于获取目标更新数据项所包括的安全代码和第一版本号,其中,安全代码用于验证目标更新数据项是否与第一物联网设备20相匹配,第一版本号用于标识目标更新数据项的版本;A first information obtaining unit 2031 is used to obtain the security code and the first version number included in the target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device 20, and the first The version number is used to identify the version of the target update data item;
一个第二信息获取单元2032,用于获取第一物联网设备20上的与目标更新数据项相对应的更新对象的第二版本号,其中,更新对象包括第一物联网设备20的固件或物联网上运行的软件;A second information acquisition unit 2032, configured to acquire the second version number of the update object corresponding to the target update data item on the first Internet of Things device 20, where the update object includes the firmware or the thing of the first Internet of Things device 20 Software running on the Internet;
一个信息匹配单元2033,用于利用第一物联网设备20的私钥验证第一信息获取单元2031获取到的安全代码是否与第一物联网设备20相匹配,并判断第一信息获取单元2031获取到的第一版本号是否高于第二信息获取单元2032获取到的第二版本号;An information matching unit 2033 is configured to use the private key of the first Internet of Things device 20 to verify whether the security code acquired by the first information acquisition unit 2031 matches the first Internet of Things device 20, and to determine whether the first information acquisition unit 2031 acquires Whether the obtained first version number is higher than the second version number obtained by the second information obtaining unit 2032;
一个对象更新单元2034,用于在信息匹配单元2033确定目标更新数据项所包括的安全代码与第一物联网设备20相匹配,且目标更新数据项所包括的第一版本号高于第二版本号时, 利用目标更新数据项对更新对象进行更新。An object update unit 2034, for determining in the information matching unit 2033 that the security code included in the target update data item matches the first IoT device 20, and the first version number included in the target update data item is higher than the second version At the time of number, use the target update data item to update the update object.
在本发明实施例中,第一信息获取单元2031可用于执行上述方法实施例中的步骤601,第二信息获取单元2032可用于执行上述方法实施例中的步骤602,信息匹配单元2033可用于执行上述方法实施例中的步骤603和步骤604,对象更新单元2034可用于执行上述方法实施例中的步骤605和步骤606。In the embodiment of the present invention, the first information obtaining unit 2031 may be used to perform step 601 in the above method embodiment, the second information obtaining unit 2032 may be used to perform step 602 in the above method embodiment, and the information matching unit 2033 may be used to perform In step 603 and step 604 in the foregoing method embodiment, the object update unit 2034 may be used to execute step 605 and step 606 in the foregoing method embodiment.
可选地,在图13所示第一物联网设备20的基础上,如图16所示,第一数据包发送模块205包括:Optionally, based on the first Internet of Things device 20 shown in FIG. 13, as shown in FIG. 16, the first data packet sending module 205 includes:
一个地址获取单元2051,用于获取目标更新数据项所包括的下一更新设备地址,其中,下一更新设备地址用于在网络拓扑中对第三物联网设备40进行标识;An address obtaining unit 2051, configured to obtain the next update device address included in the target update data item, where the next update device address is used to identify the third Internet of Things device 40 in the network topology;
一个第一发送单元2052,用于根据地址获取单元2051获取到的下一更新设备地址,将第二更新数据包发送给第二物联网设备30。A first sending unit 2052 is configured to send the second update data packet to the second Internet of Things device 30 according to the address of the next update device obtained by the address obtaining unit 2051.
在本发明实施例中,地址获取单元2051,可用于执行上述方法实施例中的步骤701,第一发送单元2052可用于执行上述方法实施例中的步骤702。In the embodiment of the present invention, the address obtaining unit 2051 may be used to perform step 701 in the foregoing method embodiment, and the first sending unit 2052 may be used to perform step 702 in the foregoing method embodiment.
可选地,在图14所示第一物联网设备20的基础上,如图17所示,第二数据包发送模块206包括:Optionally, on the basis of the first Internet of Things device 20 shown in FIG. 14, as shown in FIG. 17, the second data packet sending module 206 includes:
一个路径确定单元2061,用于确定目标传输路径,其中,目标传输路径为网络拓扑中连接第一物联网设备20与各个第四物联网设备的路径,第一更新数据包中存在用于对每一个第四物联网设备进行更新的更新数据项;A path determination unit 2061 is used to determine a target transmission path, where the target transmission path is a path connecting the first Internet of Things device 20 and each fourth Internet of Things device in the network topology, and the first update data packet is used to An update data item for the fourth Internet of Things device to update;
一个设备筛选单元2062,用于将路径确定单元2061确定出的目标传输路径中距第一物联网设备20最近的一个第四物联网设备确定为第三物联网设备40;A device screening unit 2062, configured to determine a fourth Internet of Things device closest to the first Internet of Things device 20 in the target transmission path determined by the path determination unit 2061 as the third Internet of Things device 40;
一个第二发送单元2063,用于将第一更新数据包发送给设备筛选单元2062确定出的第三物联网设备40。A second sending unit 2063 is configured to send the first update data packet to the third Internet of Things device 40 determined by the device screening unit 2062.
在本发明实施例中,路径确定单元2061可用于执行上述方法实施例中的步骤801,设备筛选单元2062可用于执行上述方法实施例中的步骤802,第二发送单元2063可用于执行上述方法实施例中的步骤803。In the embodiment of the present invention, the path determining unit 2061 can be used to perform step 801 in the above method embodiment, the device screening unit 2062 can be used to perform step 802 in the above method embodiment, and the second sending unit 2063 can be used to perform the above method implementation. Step 803 in the example.
如图18所示,本发明一个实施例提供了一种第一物联网设备20,包括:As shown in FIG. 18, an embodiment of the present invention provides a first Internet of Things device 20, including:
至少一个存储器207,被配置为存储可执行指令;At least one memory 207, configured to store executable instructions;
至少一个处理器208,与所述至少一个存储器207耦合,当执行所述可执行指令时,被配置为:At least one processor 208, coupled with the at least one memory 207, when executing the executable instructions, is configured to:
位于一个网络拓扑中的一个第一物联网设备20接收第一更新数据包,其中,所述第一更 新数据包中包括有至少一个更新数据项;A first Internet of Things device 20 located in a network topology receives a first update data packet, wherein the first update data packet includes at least one update data item;
检测所述第一更新数据包中是否包括有目标更新数据项,其中,所述目标更新数据项用于对所述第一物联网设备20的固件或其上运行的软件进行更新;Detecting whether the first update data package includes a target update data item, where the target update data item is used to update the firmware of the first Internet of Things device 20 or the software running on it;
若所述第一更新数据包中包括有所述目标更新数据项,则利用所述目标更新数据项对所述第一物联网设备20进行更新,并从所述第一更新数据包中将所述目标更新数据项删除,获得第二更新数据包;If the target update data item is included in the first update data package, the target update data item is used to update the first Internet of Things device 20, and all data items are updated from the first update data package. The target update data item is deleted, and the second update data package is obtained;
若所述第二更新数据包中包括有至少一个所述更新数据项,则确定所述网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则If the second update data packet includes at least one of the update data items, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
确定下一个需要进行更新的物联网设备为第二物联网设备30,并将所述第二更新数据包发送给所述第二物联网设备30。It is determined that the next Internet of Things device that needs to be updated is the second Internet of Things device 30, and the second update data packet is sent to the second Internet of Things device 30.
可选地,在图18所示第一物联网设备20的基础上,所述至少一个处理器208进一步在执行所述可执行指令时,被配置为:Optionally, based on the first Internet of Things device 20 shown in FIG. 18, the at least one processor 208 is further configured to: when executing the executable instruction:
若第一更新数据包中不包括目标更新数据项,则确定网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则确定下一个需要进行更新的物联网设备作为第三物联网设备40,并将第一更新数据包发送给第三物联网设备40。If the target update data item is not included in the first update data packet, then determine whether there is an IoT device that needs to be updated in the network topology. If there is an IoT device that needs to be updated, determine the next IoT device that needs to be updated as the first The third Internet of Things device 40, and the first update data packet is sent to the third Internet of Things device 40.
可选地,在图18所示第一物联网设备20的基础上,所述至少一个处理器208进一步在执行所述可执行指令时,被配置为:Optionally, based on the first Internet of Things device 20 shown in FIG. 18, the at least one processor 208 is further configured to: when executing the executable instruction:
针对第一更新数据包所包括的每一个更新数据项,如果该更新数据项所包括的目标设备地址与第一物联网设备20的设备地址相同,则将该更新数据项确定为目标更新数据项。For each update data item included in the first update data packet, if the target device address included in the update data item is the same as the device address of the first Internet of Things device 20, then the update data item is determined as the target update data item .
可选地,在图18所示第一物联网设备20的基础上,所述至少一个处理器208进一步在执行所述可执行指令时,被配置为:Optionally, based on the first Internet of Things device 20 shown in FIG. 18, the at least one processor 208 is further configured to: when executing the executable instruction:
获取目标更新数据项所包括的安全代码和第一版本号,其中,安全代码用于验证目标更新数据项是否与第一物联网设备20相匹配,第一版本号用于标识目标更新数据项的版本;Acquire the security code and the first version number included in the target update data item, where the security code is used to verify whether the target update data item matches the first Internet of Things device 20, and the first version number is used to identify the target update data item version;
获取第一物联网设备20上的与目标更新数据项相对应的更新对象的第二版本号,其中,更新对象包括第一物联网设备20的固件或物联网上运行的软件;Acquiring the second version number of the update object corresponding to the target update data item on the first Internet of Things device 20, where the update object includes the firmware of the first Internet of Things device 20 or software running on the Internet of Things;
利用第一物联网设备20的私钥验证安全代码是否与第一物联网设备20相匹配,并判断第一版本号是否高于第二版本号;Use the private key of the first Internet of Things device 20 to verify whether the security code matches the first Internet of Things device 20, and determine whether the first version number is higher than the second version number;
若安全代码与第一物联网设备20相匹配,且第一版本号高于第二版本号,则利用目标更新数据项对更新对象进行更新。If the security code matches the first Internet of Things device 20, and the first version number is higher than the second version number, the target update data item is used to update the update object.
可选地,在图18所示第一物联网设备20的基础上,所述至少一个处理器208进一步在执行所述可执行指令时,被配置为:Optionally, based on the first Internet of Things device 20 shown in FIG. 18, the at least one processor 208 is further configured to: when executing the executable instruction:
获取目标更新数据项所包括的下一更新设备地址,其中,下一更新设备地址用于在网络拓扑中对第二物联网设备30进行标识;Acquire the next update device address included in the target update data item, where the next update device address is used to identify the second Internet of Things device 30 in the network topology;
根据下一更新设备地址,将第二更新数据包发送给第二物联网设备30。According to the next update device address, the second update data packet is sent to the second Internet of Things device 30.
可选地,在图18所示第一物联网设备20的基础上,所述至少一个处理器208进一步在执行所述可执行指令时,被配置为:Optionally, based on the first Internet of Things device 20 shown in FIG. 18, the at least one processor 208 is further configured to: when executing the executable instruction:
确定目标传输路径,其中,目标传输路径为网络拓扑中连接第一物联网设备20与各个第四物联网设备的路径,第一更新数据包中存在用于对每一个第四物联网设备进行更新的更新数据项;Determine the target transmission path, where the target transmission path is a path connecting the first Internet of Things device 20 and each fourth Internet of Things device in the network topology, and there is a first update data packet for updating each fourth Internet of Things device The updated data item;
将目标传输路径中距第一物联网设备20最近的一个第四物联网设备确定为第三物联网设备40;Determine a fourth Internet of Things device closest to the first Internet of Things device 20 in the target transmission path as the third Internet of Things device 40;
将第一更新数据包发送给第三物联网设备40。The first update data packet is sent to the third Internet of Things device 40.
本发明还提供了一种计算机可读介质,存储用于使一计算机执行如本文所述的设备更新方法的指令。具体地,可以提供配有存储介质的系统或者装置,在该存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机(或CPU或MPU)读出并执行存储在存储介质中的程序代码。The present invention also provides a computer-readable medium that stores instructions for causing a computer to execute the device update method described herein. Specifically, a system or device equipped with a storage medium may be provided, and the software program code for realizing the function of any one of the above embodiments is stored on the storage medium, and the computer (or CPU or MPU of the system or device) ) Read and execute the program code stored in the storage medium.
在这种情况下,从存储介质读取的程序代码本身可实现上述实施例中任何一项实施例的功能,因此程序代码和存储程序代码的存储介质构成了本发明的一部分。In this case, the program code itself read from the storage medium can realize the function of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present invention.
用于提供程序代码的存储介质实施例包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD+RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机上下载程序代码。Examples of storage media used to provide program codes include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), Magnetic tape, non-volatile memory card and ROM. Alternatively, the program code can be downloaded from the server computer via a communication network.
此外,应该清楚的是,不仅可以通过执行计算机所读出的程序代码,而且可以通过基于程序代码的指令使计算机上操作的操作系统等来完成部分或者全部的实际操作,从而实现上述实施例中任意一项实施例的功能。In addition, it should be clear that not only the program code read by the computer can be executed, but also some or all of the actual operations can be completed by the operating system operating on the computer through instructions based on the program code, so as to realize the above-mentioned embodiments. Function of any one of the embodiments.
此外,可以理解的是,将由存储介质读出的程序代码写到插入计算机内的扩展板中所设置的存储器中或者写到与计算机相连接的扩展单元中设置的存储器中,随后基于程序代码的指令使安装在扩展板或者扩展单元上的CPU等来执行部分和全部实际操作,从而实现上述实施例中任一实施例的功能。In addition, it can be understood that the program code read from the storage medium is written to the memory provided in the expansion board inserted into the computer or to the memory provided in the expansion unit connected to the computer, and then the program code is based on The instructions cause the CPU installed on the expansion board or the expansion unit to perform part or all of the actual operations, so as to realize the function of any one of the above-mentioned embodiments.
需要说明的是,上述各流程和各系统结构图中不是所有的步骤和模块都是必须的,可以根据实际的需要忽略某些步骤或模块。各步骤的执行顺序不是固定的,可以根据需要进行调 整。上述各实施例中描述的系统结构可以是物理结构,也可以是逻辑结构,即,有些模块可能由同一物理实体实现,或者,有些模块可能分由多个物理实体实现,或者,可以由多个独立设备中的某些部件共同实现。It should be noted that not all steps and modules in the above-mentioned processes and system structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed, and can be adjusted as needed. The system structure described in the foregoing embodiments may be a physical structure or a logical structure. That is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by multiple physical entities. Some components in independent devices are implemented together.
以上各实施例中,硬件单元可以通过机械方式或电气方式实现。例如,一个硬件单元可以包括永久性专用的电路或逻辑(如专门的处理器,FPGA或ASIC)来完成相应操作。硬件单元还可以包括可编程逻辑或电路(如通用处理器或其它可编程处理器),可以由软件进行临时的设置以完成相应操作。具体的实现方式(机械方式、或专用的永久性电路、或者临时设置的电路)可以基于成本和时间上的考虑来确定。In the above embodiments, the hardware unit can be implemented mechanically or electrically. For example, a hardware unit may include a permanent dedicated circuit or logic (such as a dedicated processor, FPGA or ASIC) to complete the corresponding operation. The hardware unit may also include programmable logic or circuits (such as general-purpose processors or other programmable processors), which may be temporarily set by software to complete corresponding operations. The specific implementation mode (mechanical method, or dedicated permanent circuit, or temporarily set circuit) can be determined based on cost and time considerations.
上文通过附图和优选实施例对本发明进行了详细展示和说明,然而本发明不限于这些已揭示的实施例,基与上述多个实施例本领域技术人员可以知晓,可以组合上述不同实施例中的代码审核手段得到本发明更多的实施例,这些实施例也在本发明的保护范围之内。The present invention has been shown and described in detail through the drawings and preferred embodiments above. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the above different embodiments can be combined. The code review method in, obtains more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.

Claims (15)

  1. 设备更新方法,其特征在于,包括:The device update method is characterized in that it includes:
    位于一个网络拓扑中的一个第一物联网设备(20)接收第一更新数据包,其中,所述第一更新数据包中包括有至少一个更新数据项;A first Internet of Things device (20) located in a network topology receives a first update data packet, wherein the first update data packet includes at least one update data item;
    检测所述第一更新数据包中是否包括有目标更新数据项,其中,所述目标更新数据项用于对所述第一物联网设备(20)的固件或其上运行的软件进行更新;Detecting whether the first update data package includes a target update data item, wherein the target update data item is used to update the firmware of the first Internet of Things device (20) or the software running on it;
    若所述第一更新数据包中包括有所述目标更新数据项,则If the first update data packet includes the target update data item, then
    利用所述目标更新数据项对所述第一物联网设备(20)进行更新;Update the first Internet of Things device (20) by using the target update data item;
    从所述第一更新数据包中将所述目标更新数据项删除,获得第二更新数据包;Delete the target update data item from the first update data package to obtain a second update data package;
    若所述第二更新数据包中包括有至少一个所述更新数据项,则确定所述网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则If the second update data packet includes at least one of the update data items, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
    确定下一个需要进行更新的物联网设备为第二物联网设备(30),并将所述第二更新数据包发送给所述第二物联网设备(30)。It is determined that the next Internet of Things device that needs to be updated is the second Internet of Things device (30), and the second update data packet is sent to the second Internet of Things device (30).
  2. 根据权利要求1所述的方法,其特征在于,在所述检测所述第一更新数据包中是否包括有目标更新数据项之后,还包括:The method according to claim 1, wherein after the detecting whether the first update data packet includes a target update data item, the method further comprises:
    若所述第一更新数据包中不包括所述目标更新数据项,则确定所述网络拓扑中是否存在需要更新的物联网设备,若存在需要更新的物联网设备,则If the target update data item is not included in the first update data packet, it is determined whether there is an IoT device that needs to be updated in the network topology, and if there is an IoT device that needs to be updated, then
    确定下一个需要进行更新的物联网设备作为第三物联网设备(40),并将所述第一更新数据包发送给所述第三物联网设备(40)。The next Internet of Things device that needs to be updated is determined as the third Internet of Things device (40), and the first update data packet is sent to the third Internet of Things device (40).
  3. 根据权利要求1或2所述的方法,其特征在于,所述检测所述第一更新数据包中是否包括有目标更新数据项,包括:The method according to claim 1 or 2, wherein the detecting whether a target update data item is included in the first update data packet comprises:
    针对所述第一更新数据包所包括的每一个所述更新数据项,如果该更新数据项所包括的目标设备地址与所述第一物联网设备(20)的设备地址相同,则将该更新数据项确定为所述目标更新数据项。For each of the update data items included in the first update data packet, if the target device address included in the update data item is the same as the device address of the first Internet of Things device (20), the update The data item is determined as the target update data item.
  4. 根据权利要求1或2所述的方法,其特征在于,所述利用所述目标更新数据项对所述第一物联网设备(20)进行更新,包括:The method according to claim 1 or 2, wherein said updating said first Internet of Things device (20) using said target update data item comprises:
    获取所述目标更新数据项所包括的安全代码和第一版本号,其中,所述安全代码用于验证所述目标更新数据项是否与所述第一物联网设备(20)相匹配,所述第一版本号用于标识所述目标更新数据项的版本;Acquire the security code and the first version number included in the target update data item, wherein the security code is used to verify whether the target update data item matches the first Internet of Things device (20), and The first version number is used to identify the version of the target update data item;
    获取所述第一物联网设备(20)上的与所述目标更新数据项相对应的更新对象的第二版本号,其中,所述更新对象包括所述第一物联网设备(20)的固件或所述物联网上运行的软件;Acquire the second version number of the update object corresponding to the target update data item on the first Internet of Things device (20), wherein the update object includes the firmware of the first Internet of Things device (20) Or software running on the Internet of Things;
    利用所述第一物联网设备(20)的私钥验证所述安全代码是否与所述第一物联网设备(20)相匹配,并判断所述第一版本号是否高于所述第二版本号;Use the private key of the first Internet of Things device (20) to verify whether the security code matches the first Internet of Things device (20), and determine whether the first version number is higher than the second version number;
    若所述安全代码与所述第一物联网设备(20)相匹配,且所述第一版本号高于所述第二版本号,则利用所述目标更新数据项对所述更新对象进行更新。If the security code matches the first Internet of Things device (20), and the first version number is higher than the second version number, use the target update data item to update the update object .
  5. 根据权利要求1至4中任一所述的方法,其特征在于,所述将所述第二更新数据包发送给所述第二物联网设备(30),包括:The method according to any one of claims 1 to 4, wherein the sending the second update data packet to the second Internet of Things device (30) comprises:
    获取所述目标更新数据项所包括的下一更新设备地址,其中,所述下一更新设备地址用于在所述网络拓扑中对所述第二物联网设备(30)进行标识;Acquiring the next update device address included in the target update data item, where the next update device address is used to identify the second Internet of Things device (30) in the network topology;
    根据所述下一更新设备地址,将所述第二更新数据包发送给所述第二物联网设备(30)。According to the next update device address, the second update data packet is sent to the second Internet of Things device (30).
  6. 根据权利要求2所述的方法,其特征在于,所述将所述第一更新数据包发送给所述第三物联网设备(40),包括:The method according to claim 2, wherein the sending the first update data packet to the third Internet of Things device (40) comprises:
    确定目标传输路径,其中,所述目标传输路径为所述网络拓扑中连接所述第一物联网设备(20)与各个第四物联网设备的路径,所述第一更新数据包中存在用于对每一个所述第四物联网设备进行更新的所述更新数据项;Determine a target transmission path, where the target transmission path is a path connecting the first Internet of Things device (20) and each fourth Internet of Things device in the network topology, and the first update data packet contains information for The update data item for updating each of the fourth Internet of Things device;
    将所述目标传输路径中距所述第一物联网设备(20)最近的一个所述第四物联网设备确定为所述第三物联网设备(40);Determining one of the fourth IoT devices closest to the first IoT device (20) in the target transmission path as the third IoT device (40);
    将所述第一更新数据包发送给所述第三物联网设备(40)。The first update data packet is sent to the third Internet of Things device (40).
  7. 第一物联网设备(20),其特征在于,包括:The first Internet of Things device (20) is characterized in that it comprises:
    一个数据包接收模块(201),用于接收第一更新数据包,其中,所述第一更新数据包中包括有至少一个更新数据项;A data packet receiving module (201) for receiving a first update data packet, wherein the first update data packet includes at least one update data item;
    一个数据包检测模块(202),用于检测所述数据包接收模块(201)接收到的所述第一更新数据包中是否包括有目标更新数据项,其中,所述目标更新数据项用于对所述第一物联网设备(20)的固件或其上运行的软件进行更新;A data packet detection module (202) for detecting whether the first update data packet received by the data packet receiving module (201) includes a target update data item, wherein the target update data item is used for Updating the firmware of the first Internet of Things device (20) or the software running on it;
    一个设备更新模块(203),用于在所述数据包检测模块(202)确定所述第一更新数据包包括有所述目标更新数据项时,利用所述目标更新数据项对所述第一物联网设备(20)进行更新;A device update module (203) is configured to use the target update data item to compare the first update data item when the data packet detection module (202) determines that the first update data packet includes the target update data item. IoT devices (20) are updated;
    一个数据包更新模块(204),用于在所述设备更新模块(203)对所述第一物联网设备(20)进行更新之后,从所述第一更新数据包中将所述目标更新数据项删除,获得第二更新数据包;A data package update module (204) for updating the target data from the first update data package after the device update module (203) updates the first Internet of Things device (20) Item is deleted, and the second update data package is obtained;
    一个第一数据包发送模块(205),用于在所述数据包更新模块(204)获得的所述第二更新数据包中包括有至少一个所述新数据项,且所述网络拓扑中存在需要更新的物联网设备的 情况下,确定下一个需要进行更新的物联网设备作为第二物联网设备(30),并将所述第二更新数据包发送给所述第二物联网设备(30)。A first data packet sending module (205), configured to include at least one of the new data items in the second update data packet obtained by the data packet update module (204), and the network topology exists In the case of an Internet of Things device that needs to be updated, determine the next Internet of Things device that needs to be updated as the second Internet of Things device (30), and send the second update data packet to the second Internet of Things device (30) ).
  8. 根据权利要求7所述的第一物联网设备(20),其特征在于,进一步包括:The first Internet of Things device (20) according to claim 7, further comprising:
    一个第二数据包发送模块(206),用于在所述数据包检测模块(202)确定所述第一更新数据包中不包括所述目标更新数据项,且所述网络拓扑中存在需要更新的物联网设备的情况下,确定下一个需要进行更新的物联网设备作为第三物联网设备(40),并将所述第一更新数据包发送给所述第三物联网设备(40)。A second data packet sending module (206) is used to determine that the first update data packet does not include the target update data item and that there is a need to update the network topology when the data packet detection module (202) determines In the case of the Internet of Things device, determine the next Internet of Things device to be updated as the third Internet of Things device (40), and send the first update data packet to the third Internet of Things device (40).
  9. 根据权利要求7或8所述的第一物联网设备(20),其特征在于,The first Internet of Things device (20) according to claim 7 or 8, characterized in that:
    所述数据包检测模块(202),用于针对所述第一更新数据包所包括的每一个所述更新数据项,如果该更新数据项所包括的目标设备地址与所述第一物联网设备(20)的设备地址相同,则将该更新数据项确定为一个所述目标更新数据项。The data packet detection module (202) is configured to, for each of the update data items included in the first update data packet, if the target device address included in the update data item and the first Internet of Things device (20) If the device addresses are the same, the update data item is determined as one of the target update data items.
  10. 根据权利要求7或8所述的第一物联网设备(20),其特征在于,所述设备更新模块(203)包括:The first Internet of Things device (20) according to claim 7 or 8, wherein the device update module (203) comprises:
    一个第一信息获取单元(2031),用于获取所述目标更新数据项所包括的安全代码和第一版本号,其中,所述安全代码用于验证所述目标更新数据项是否与所述第一物联网设备(20)相匹配,所述第一版本号用于标识所述目标更新数据项的版本;A first information acquisition unit (2031) for acquiring the security code and the first version number included in the target update data item, wherein the security code is used to verify whether the target update data item is the same as the first version number An Internet of Things device (20) matches, and the first version number is used to identify the version of the target update data item;
    一个第二信息获取单元(2032),用于获取所述第一物联网设备(20)上的与所述目标更新数据项相对应的更新对象的第二版本号,其中,所述更新对象包括所述第一物联网设备(20)的固件或所述物联网上运行的软件;A second information acquisition unit (2032), configured to acquire the second version number of the update object corresponding to the target update data item on the first Internet of Things device (20), wherein the update object includes Firmware of the first Internet of Things device (20) or software running on the Internet of Things;
    一个信息匹配单元(2033),用于利用所述第一物联网设备(20)的私钥验证所述第一信息获取单元(2031)获取到的所述安全代码是否与所述第一物联网设备(20)相匹配,并判断所述第一信息获取单元(2031)获取到的所述第一版本号是否高于所述第二信息获取单元(2032)获取到的所述第二版本号;An information matching unit (2033) for verifying whether the security code acquired by the first information acquisition unit (2031) is consistent with the first Internet of Things device (20) using the private key The device (20) matches, and determines whether the first version number acquired by the first information acquisition unit (2031) is higher than the second version number acquired by the second information acquisition unit (2032) ;
    一个对象更新单元(2034),用于在所述信息匹配单元(2033)确定所述目标更新数据项所包括的所述安全代码与所述第一物联网设备(20)相匹配,且所述目标更新数据项所包括的所述第一版本号高于所述第二版本号时,利用所述目标更新数据项对所述更新对象进行更新。An object update unit (2034) for determining, in the information matching unit (2033), that the security code included in the target update data item matches the first Internet of Things device (20), and the When the first version number included in the target update data item is higher than the second version number, the target update data item is used to update the update object.
  11. 根据权利要求7至10中任一所述的第一物联网设备(20),其特征在于,所述第一数据包发送模块(205)包括:The first Internet of Things device (20) according to any one of claims 7 to 10, wherein the first data packet sending module (205) comprises:
    一个地址获取单元(2051),用于获取所述目标更新数据项所包括的下一更新设备地址,其中,所述下一更新设备地址用于在所述网络拓扑中对所述第三物联网设备(40)进行标识;An address acquisition unit (2051) for acquiring the address of the next update device included in the target update data item, where the address of the next update device is used to compare the third Internet of Things address in the network topology Equipment (40) for identification;
    一个第一发送单元(2052),用于根据所述地址获取单元(2051)获取到的所述下一更新设备地址,将所述第二更新数据包发送给所述第二物联网设备(30)。A first sending unit (2052), configured to send the second update data packet to the second Internet of Things device (30) according to the address of the next update device acquired by the address acquisition unit (2051) ).
  12. 根据权利要求8所述的第一物联网设备(20),其特征在于,所述第二数据包发送模块(206)包括:The first Internet of Things device (20) according to claim 8, wherein the second data packet sending module (206) comprises:
    一个路径确定单元(2061),用于确定目标传输路径,其中,所述目标传输路径为所述网络拓扑中连接所述第一物联网设备(20)与各个第四物联网设备的路径,所述第一更新数据包中存在用于对每一个所述第四物联网设备进行更新的所述更新数据项;A path determination unit (2061) for determining a target transmission path, where the target transmission path is a path connecting the first IoT device (20) and each fourth IoT device in the network topology, so The first update data packet contains the update data item used to update each of the fourth Internet of Things device;
    一个设备筛选单元(2062),用于将所述路径确定单元(2061)确定出的所述目标传输路径中距所述第一物联网设备(20)最近的一个所述第四物联网设备确定为所述第三物联网设备(40);A device screening unit (2062) for determining the fourth Internet of Things device that is closest to the first Internet of Things device (20) in the target transmission path determined by the path determination unit (2061) Is the third Internet of Things device (40);
    一个第二发送单元(2063),用于将所述第一更新数据包发送给所述设备筛选单元(2062)确定出的所述第三物联网设备(40)。A second sending unit (2063) is configured to send the first update data packet to the third Internet of Things device (40) determined by the device screening unit (2062).
  13. 第一物联网设备(20),其特征在于,包括:至少一个存储器(207)和至少一个处理器(208);The first Internet of Things device (20) is characterized by comprising: at least one memory (207) and at least one processor (208);
    所述至少一个存储器(207),用于存储机器可读程序;The at least one memory (207) is used to store machine-readable programs;
    所述至少一个处理器(208),用于调用所述机器可读程序,执行权利要求1至6中任一所述的方法。The at least one processor (208) is configured to invoke the machine-readable program to execute the method according to any one of claims 1 to 6.
  14. 设备更新系统,其特征在于,包括:一个更新服务器(10)和至少两个权利要求7至13中任一所述的第一物联网设备(20);The device update system is characterized by comprising: an update server (10) and at least two first Internet of Things devices (20) according to any one of claims 7 to 13;
    所述至少两个第一物联网设备(20)在同一网络拓扑中依次相连接,且所述更新服务器(10)与位于端部的一个所述第一物联网设备(20)相连接;The at least two first Internet of Things devices (20) are sequentially connected in the same network topology, and the update server (10) is connected to one of the first Internet of Things devices (20) located at the end;
    所述更新服务器(10),用于向相连接的所述第一物联网设备(20)发送包括有至少一个所述更新数据项的更新数据包。The update server (10) is configured to send an update data packet including at least one update data item to the connected first Internet of Things device (20).
  15. 计算机可读介质,其特征在于,所述计算机可读介质上存储有计算机指令,所述计算机指令在被处理器执行时,使所述处理器执行权利要求1至6中任一所述的方法。A computer-readable medium, wherein computer instructions are stored on the computer-readable medium, and when the computer instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 6 .
PCT/CN2019/096044 2019-07-15 2019-07-15 Device update method and system, and first internet of things device and computer-readable medium WO2021007756A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2019/096044 WO2021007756A1 (en) 2019-07-15 2019-07-15 Device update method and system, and first internet of things device and computer-readable medium
CN201980096245.XA CN113826357A (en) 2019-07-15 2019-07-15 Device updating method and system, first Internet of things device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/096044 WO2021007756A1 (en) 2019-07-15 2019-07-15 Device update method and system, and first internet of things device and computer-readable medium

Publications (1)

Publication Number Publication Date
WO2021007756A1 true WO2021007756A1 (en) 2021-01-21

Family

ID=74210113

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/096044 WO2021007756A1 (en) 2019-07-15 2019-07-15 Device update method and system, and first internet of things device and computer-readable medium

Country Status (2)

Country Link
CN (1) CN113826357A (en)
WO (1) WO2021007756A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114401190A (en) * 2021-12-24 2022-04-26 卡斯柯信号有限公司 Trackside security platform data updating method and system based on data compression algorithm

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009633A (en) * 2006-01-27 2007-08-01 华为技术有限公司 A data transfer method and transfer system with the route information
CN101374072A (en) * 2007-08-24 2009-02-25 西门子公司 Method for updating configuration of electric force monitoring apparatus, electric force monitoring apparatus and energy management system
CN101907998A (en) * 2010-08-17 2010-12-08 中兴通讯股份有限公司 Update system and method of embedded systems
CN107332909A (en) * 2017-07-03 2017-11-07 中兴通讯股份有限公司 A kind of method and device for realizing data transfer
CN109362122A (en) * 2018-09-12 2019-02-19 中国科学院计算技术研究所 The transmission dispatching method and system of communication data in a kind of low-power consumption wide area network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009633A (en) * 2006-01-27 2007-08-01 华为技术有限公司 A data transfer method and transfer system with the route information
CN101374072A (en) * 2007-08-24 2009-02-25 西门子公司 Method for updating configuration of electric force monitoring apparatus, electric force monitoring apparatus and energy management system
CN101907998A (en) * 2010-08-17 2010-12-08 中兴通讯股份有限公司 Update system and method of embedded systems
CN107332909A (en) * 2017-07-03 2017-11-07 中兴通讯股份有限公司 A kind of method and device for realizing data transfer
CN109362122A (en) * 2018-09-12 2019-02-19 中国科学院计算技术研究所 The transmission dispatching method and system of communication data in a kind of low-power consumption wide area network

Also Published As

Publication number Publication date
CN113826357A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
US10360018B2 (en) Update control apparatus, software update system, and update control method
US11443042B2 (en) Blockchain-based software version data management system and establishing method thereof
US8159972B2 (en) Network management apparatus and switching apparatus
CN109995866B (en) Distributed file verification method and device, computer device and storage medium
US10581849B2 (en) Data packet transmission method, data packet authentication method, and server thereof
US20190123908A1 (en) Arithmetic Device, Authentication System, and Authentication Method
KR20140023902A (en) System and method for automatic configuration of master/slave devices on a network
US20170359844A1 (en) Switching-on method, base station, base station controller, switching-on system and storage medium
US11075927B2 (en) Fraud detection electronic control unit, electronic control unit, and non-transitory recording medium in which computer program is described
US10735308B2 (en) Attestation based routing
CN110166299B (en) SDN controller configuration recovery method and device
CN111104282A (en) Node processing method and device based on block chain
CN107145562A (en) A kind of method of data synchronization, apparatus and system
WO2021007756A1 (en) Device update method and system, and first internet of things device and computer-readable medium
WO2020010906A1 (en) Method and device for operating system (os) batch installation, and network device
US20160105348A1 (en) Mep configuration method and network device
US11368994B1 (en) Process for managing reconnections of devices in a network
KR20130018397A (en) System and method for performing commands from a remote source
US10402282B1 (en) Assisted device recovery
CN110602732B (en) Wireless configuration parameter synchronization method, device, network equipment and computer readable storage medium
WO2022257927A1 (en) Key burning method and apparatus, electronic device board card, and storage medium
US20170324562A1 (en) Recovery agents and recovery plans over networks
US20220058259A1 (en) Information processing device, verification system, and information processing method
JP2017147695A (en) Ethernet switch device
WO2013178034A1 (en) Cloud service deployment method and system

Legal Events

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

Ref document number: 19937482

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19937482

Country of ref document: EP

Kind code of ref document: A1