WO2021203384A1 - 设备升级的方法、装置及存储介质 - Google Patents

设备升级的方法、装置及存储介质 Download PDF

Info

Publication number
WO2021203384A1
WO2021203384A1 PCT/CN2020/084052 CN2020084052W WO2021203384A1 WO 2021203384 A1 WO2021203384 A1 WO 2021203384A1 CN 2020084052 W CN2020084052 W CN 2020084052W WO 2021203384 A1 WO2021203384 A1 WO 2021203384A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
local
downstream
upgrade
directly connected
Prior art date
Application number
PCT/CN2020/084052
Other languages
English (en)
French (fr)
Inventor
陈成斌
陈洪晶
李佳
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN202080005231.5A priority Critical patent/CN112771497A/zh
Priority to PCT/CN2020/084052 priority patent/WO2021203384A1/zh
Publication of WO2021203384A1 publication Critical patent/WO2021203384A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • This application relates to the technical field of software upgrades, and in particular to a method, device and storage medium for equipment upgrade.
  • the existing application APP upgrade plan is as follows: real-time monitoring of the connection status of the drone and the remote control and whether the status needs to be upgraded; when the upgrade conditions are met, each triggers the upgrade process in the module , That is, download the appropriate firmware upgrade package from the server, and transmit it to the corresponding drone and remote control in turn; after the transmission is completed, the drone and remote control are upgraded separately, and receive push notifications from the drone and remote control. Upgrade progress. If new devices are added to the drone or remote control, and multiple devices need to be upgraded at the same time, the APP needs to be transmitted and upgraded in sequence.
  • the above APP upgrade solution is not suitable for the upgrade of devices with complex topologies, and cannot be selectively upgraded according to user needs, nor is it suitable for upgrading new requirements: the number of upgraded devices is large, the upgrade solution needs to maintain scalability, and it can be plugged and unplugged at any time. .
  • this application provides a device upgrade method, device, and storage medium.
  • this application provides a device upgrade method, which includes:
  • the relevant upgrade information of the target device to be upgraded is obtained from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current version information of the device.
  • the local downstream equipment includes equipment directly connected to the local and/or equipment connected indirectly;
  • the upgrade package of the corresponding version of the target device and the identity information of the target device are transmitted to the local downstream device, so that the local downstream device can update the version corresponding to the target device according to the identity information of the target device
  • the upgrade package is transmitted to the target device, so that the target device obtains the upgrade package of the corresponding version
  • the target device After the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade according to the upgrade package of the corresponding version of the target device.
  • the present application provides an apparatus for upgrading equipment, the apparatus includes: a memory, a processor, and a communication circuit, the memory and the communication circuit are respectively connected to the processor;
  • the memory is used to store a computer program
  • the processor is used to execute the computer program and when executing the computer program, implement the following steps:
  • the relevant upgrade information of the target device to be upgraded is obtained from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current version information of the device.
  • the local downstream equipment includes equipment directly connected to the local and/or equipment connected indirectly;
  • controlling the communication circuit to download the upgrade package of the corresponding version of the target device According to the current version information of the target device, controlling the communication circuit to download the upgrade package of the corresponding version of the target device;
  • the target device After the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade according to the upgrade package of the corresponding version of the target device.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for upgrading the device as described above .
  • the embodiments of the present application provide a method, a device and a storage medium for device upgrade.
  • the relevant upgrade information of the target device to be upgraded is obtained from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current version information of the device, the local downstream device includes the device directly connected to the local and/or the device connected indirectly; according to the current version information of the target device, download all
  • the upgrade package of the corresponding version of the target device; the upgrade package of the corresponding version of the target device and the identity information of the target device are transmitted to the local downstream device, so that the local downstream device is based on the identity of the target device
  • the information transmits the upgrade package of the corresponding version of the target device to the target device, so that the target device obtains the upgrade package of the corresponding version; when the target device obtains the upgrade package of the corresponding version, the target device is controlled according to The upgrade package of the corresponding version of the target device is upgraded.
  • the identity information and current version information of the target device to be upgraded are obtained from the relevant upgrade information of the local downstream device, and the upgrade of the corresponding version of the target device is downloaded according to the current version information of the target device Package, which transmits the upgrade package of the corresponding version of the target device and the identity information of the target device to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the target device, so that the target device obtains the upgrade package of the corresponding version ;
  • the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade.
  • the target device selected by the user and directly connected to the local and/or indirectly connected to the user can be upgraded according to the user’s needs. It is suitable for the upgrading of equipment with complex topological structure, and also provides technical support for the new requirements of upgrading "the number of upgraded equipment is large, the upgrade plan needs to maintain scalability, and the equipment can be plugged and unplugged at any time”.
  • FIG. 1 is a schematic flowchart of an embodiment of a device upgrade method according to the present application
  • FIG. 2 is a schematic diagram of an application scenario of the first method of device upgrade according to this application.
  • FIG. 3 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • Figure 4 is a schematic diagram of the application process of the method for device upgrade of the present application in the remote control and UAV system;
  • FIG. 5 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 6 is a schematic diagram of a device registration and transmission registration in the method for device upgrade of this application.
  • FIG. 7 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 8 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 9 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 10 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 11 is a schematic diagram of another application scenario of the device upgrade method of this application.
  • FIG. 12 is a schematic structural diagram of an embodiment of an apparatus for upgrading equipment of the present application.
  • Existing consumer drones have a simple topology, usually standard upgrade modules: drones and remote controls; the upgrade plan is: real-time monitoring of the connection status of drones and remote controls and whether they need to be upgraded; compliant When the condition is upgraded, the upgrade process of the drone and the remote control is triggered.
  • the above-mentioned upgrade scheme is not suitable for the upgrading of equipment with complex topology, and cannot selectively upgrade the equipment according to the needs of users, nor is it suitable for upgrading new requirements. "The number of upgraded equipment is large, the upgrade scheme needs to maintain scalability, and can cope with the plugging and unplugging of equipment at any time.” .
  • the embodiment of the application obtains the relevant upgrade information of the target device to be upgraded from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current status of the device.
  • Version information, the local downstream devices include devices directly connected to the local device and/or devices connected indirectly; according to the current version information of the target device, download the upgrade package corresponding to the version of the target device;
  • the upgrade package of the corresponding version and the identity information of the target device are transmitted to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the local downstream device according to the identity information of the target device.
  • the target device enables the target device to obtain the upgrade package of the corresponding version; when the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade according to the upgrade package of the corresponding version of the target device.
  • the identity information and current version information of the target device to be upgraded are obtained from the relevant upgrade information of the local downstream device, and the upgrade of the corresponding version of the target device is downloaded according to the current version information of the target device Package, which transmits the upgrade package of the corresponding version of the target device and the identity information of the target device to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the target device, so that the target device obtains the upgrade package of the corresponding version ;
  • the target device is controlled to upgrade.
  • the target device selected by the user and directly connected to the local and/or indirectly connected to the user can be upgraded according to the user’s needs. It is suitable for the upgrading of equipment with complex topological structure, and also provides technical support for the new requirements of upgrading "the number of upgraded equipment is large, the upgrade plan needs to maintain scalability, and the equipment can be plugged and unplugged at any time”.
  • Fig. 1 is a schematic flowchart of an embodiment of a device upgrade method according to the present application, and the method includes:
  • Step S101 According to the detected user's target device selection operation, obtain relevant upgrade information of the target device to be upgraded from the relevant upgrade information of the local downstream device, the relevant upgrade information including the identity information of the device and the current version of the device Information, the local downstream device includes a device directly connected to the local device and/or a device connected indirectly.
  • the local downstream device includes more than one device directly connected to the local device; also includes more than one device indirectly connected to the local device; also includes more than one device directly connected to the local device and the device indirectly connected to the local device.
  • More than one device that is, the method of this embodiment may be suitable for upgrading a device with a simple topology, and also for upgrading a device with a complex topology.
  • the target device to be upgraded includes the device directly connected to the local device and/or the device connected indirectly, that is, the target device may include more than one device directly connected to the local device; it also includes more than one device directly connected to the local device; It also includes more than one device directly connected to the local area and more than one device connected indirectly to the local area.
  • the number of target devices is more than one, for example: one target device, two target devices, three target devices, and so on.
  • a plurality of devices are organized into a tree structure according to the connection relationship to generate a device tree, the local (or client) is the root node of the device tree, and the devices on the device tree are divided into intermediate devices and /Or a leaf device, the intermediate device is downwardly connected to a downstream device (including a directly connected downstream device and/or an indirectly connected downstream device), and the leaf device has no downstream device downward.
  • the application APP represents the local (user terminal) and is the root node of the device tree.
  • the device tree also includes a remote control, an aircraft (drone) directly connected to the remote control, known peripherals, Unknown peripherals, known mount 1, known mount 2, unknown mount 1 directly connected to the aircraft; remote control and aircraft are intermediate devices, known peripherals, unknown peripherals, known mount 1, already Known mount 2 and unknown mount 1 are leaf devices;
  • the remote control is an intermediate device directly connected to the local area, and the aircraft is an intermediate device directly connected to the local area;
  • the directly connected upstream device is also the upstream device directly connected to the unknown peripheral;
  • the aircraft is the upstream device directly connected to the known mount 1, and the upstream device directly connected to the known mount 2, and it is also the upstream device directly connected to the unknown mount.
  • the remote control is an upstream device that is indirectly connected to a known mount 1, is also an upstream device that is indirectly connected to a known mount 2, and is also an upstream device that is indirectly connected to an unknown mount 1;
  • unknown peripherals, known mount 1, known mount 2, and unknown mount 1 are leaf devices that are indirectly connected to the local device.
  • the identity information of the device may be information used to identify the identity of the device, the type of the device, etc., to distinguish different devices and/or each device, such as a unique identification code, a device identification code, an IP address, and so on.
  • the current version information of the device may be the version information of the application currently used by the device. According to the current version information of the device and the latest version information of the device, it can be preliminarily determined whether the device needs to be upgraded and the version information that needs to be downloaded. For example, the current version of the application of device 1 is V1, and the latest version of the application of device 1 is V2. It is preliminarily determined that device 1 needs to be upgraded. The final upgrade depends on whether the user chooses. Upgrade. If device 1 has been used more recently, you can choose to upgrade.
  • the relevant upgrade information of the local downstream device (that is, the identity information of the device and the current version information of the device) is stored locally, and there are many ways to obtain it.
  • the local user inputs the identity information of the device and the current version information of the device; or, locally The identity information and the starting version information of the device are pre-existing.
  • the device is upgraded, the current version information of the device is correspondingly modified; or, the upgrade time is pre-appointed, and the connected device pushes its own identity information and current version information to the local at that time ; Or, pre-appoint the upgrade time and connect to the relevant device at the upgrade time; or, the connected device pushes its own identity information and current version information to the local at predetermined time intervals; etc.
  • the user selects the target device that needs to be upgraded. In this way, the target device can be upgraded according to the user's needs.
  • Step S102 Download an upgrade package of the corresponding version of the target device according to the current version information of the target device.
  • the upgrade package of the corresponding version of the target device can be downloaded from the server.
  • the version of the upgrade package of the application program of the device 1 on the server is V1 and V2, and according to the current version of the application program of the device 1 is V1, it is determined to download the upgrade package corresponding to the version V2 of the target device.
  • the version of the upgrade package of the application program of the device 1 on the server is V1, V2, and V3.
  • the current version of the application program of the device 1 is V1, it is determined to download the upgrade package corresponding to the version V3 of the target device.
  • Step S103 The upgrade package of the corresponding version of the target device and the identity information of the target device are transmitted to the local downstream device, so that the local downstream device will transfer the target device to the target device according to the identity information of the target device.
  • the upgrade package of the corresponding version is transmitted to the target device, so that the target device obtains the upgrade package of the corresponding version.
  • the local downstream equipment includes equipment directly connected to the local and/or indirectly connected equipment
  • the target equipment to be upgraded includes equipment directly connected to the local and/or indirectly connected equipment
  • the upgrade package of the corresponding version of the target device is combined with
  • the identity information of the target device is transmitted to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the target device according to the identity information of the target device, and specifically transmits
  • device 2 For example: if it is transferred from device 1 to device 2, and device 2 needs to be upgraded (that is, the identity information of the target device has device 2), then device 2 obtains the corresponding upgrade package (device 2 does not need to be upgraded, so this step is ignored), and then All interfaces of device 2 that can be connected to other devices send the upgrade package of the corresponding version of the target device and the identity information of the target device (because device 2 has already obtained the corresponding upgrade package, when device 2 continues to transmit, the upgrade package of the corresponding version of device 2 can be sent And the identity information of the device 2 is deleted), if the interface is connected to a downstream device, the downstream device can receive the upgrade package corresponding to the target device version and the identity information of the target device. If the interface is not connected to the downstream device, it will be transmitted to This ends.
  • device 2 can detect which interfaces are connected to downstream devices, device 2 does not need to be upgraded, and sends the upgrade package of the target device's corresponding version to the interface where device 2 is connected to the downstream device.
  • the identity information of the target device if you transfer from device 1 to device 2, device 2 can detect which interfaces are connected to downstream devices, device 2 does not need to be upgraded, and sends the upgrade package of the target device's corresponding version to the interface where device 2 is connected to the downstream device. The identity information of the target device.
  • device 2 saves the identity information of the downstream device of device 2, and device 2 will send targeted information to the device according to the identity information of the downstream device of device 2 and the identity information of the target device.
  • Directly connected downstream devices that is, downstream devices that have a direct or indirect connection with the target device transmit, but not to all directly connected downstream devices.
  • Step S104 After the target device obtains the upgrade package of the corresponding version, control the target device to upgrade according to the upgrade package of the corresponding version of the target device.
  • the embodiment of the application obtains the relevant upgrade information of the target device to be upgraded from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current status of the device.
  • Version information the local downstream device includes devices directly connected to the local device and/or devices connected indirectly; according to the current version information of the target device, downloading the upgrade package corresponding to the target device's version; uploading the target device
  • the upgrade package of the corresponding version and the identity information of the target device are transmitted to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the local downstream device according to the identity information of the target device.
  • the target device enables the target device to obtain the upgrade package of the corresponding version; when the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade according to the upgrade package of the corresponding version of the target device.
  • the identity information and current version information of the target device to be upgraded are obtained from the relevant upgrade information of the local downstream device, and the upgrade of the corresponding version of the target device is downloaded according to the current version information of the target device Package, which transmits the upgrade package of the corresponding version of the target device and the identity information of the target device to the local downstream device, so that the local downstream device transmits the upgrade package of the corresponding version of the target device to the target device, so that the target device obtains the upgrade package of the corresponding version ;
  • the target device is controlled to upgrade.
  • the target device selected by the user and directly connected to the local and/or indirectly connected to the user can be upgraded according to the user’s needs. It is suitable for the upgrading of equipment with complex topological structure, and also provides technical support for the new requirements of upgrading "the number of upgraded equipment is large, the upgrade plan needs to maintain scalability, and the equipment can be plugged and unplugged at any time”.
  • the interface on the device may be connected to the downstream device, or may not be connected to the downstream device; it may be connected to the downstream device during this period of time, and the downstream device may not be connected to the downstream device in another period of time; it may be connected to the device locally.
  • the distance is too far, and the user has no way to figure out the connection between the devices; it is possible that the situation is urgent or special equipment is plugged and unplugged at any time; etc., in order to enable the user to select the target device in a targeted manner when selecting the target device, steps Before S101, it also includes:
  • Step S105 Obtain the relevant upgrade information of the local downstream device.
  • the relevant upgrade information of the local downstream device can be obtained through a heartbeat packet.
  • the heartbeat packet is a self-defined command word that is periodically notified to the other party of its own state between the device and the local, and is sent at a certain time interval, similar to a heartbeat, so it is called a heartbeat packet. That is, each connected device pushes a heartbeat packet to the local, so that the local device updates the relevant upgrade information of the local downstream device according to whether the heartbeat packet pushed by each device exists. In this way, the local does not need to pay attention to each device.
  • the connection status of the equipment can meet the new requirements of the upgrade.
  • each device can be organized to form an upgrade management list in the local APP, including the identity information of each device, whether each device needs to be upgraded, and the latest version that can be upgraded. And notify the user; update the upgrade management list according to the update pushed by the heartbeat package of each device; add a new heartbeat package, add the relevant upgrade information of the corresponding device, and delete the corresponding device when the heartbeat package expires. Relevant upgrade information); users can select the target device they need to upgrade to form a list of upgrades, and trigger the upgrade with one click.
  • step S105 may specifically include: sub-step S1051 and sub-step S1052.
  • Sub-step S1051 Obtain the registration command of the local downstream device, the registration command is sent by the local downstream device to register with the upstream device directly connected and/or indirectly connected with the local downstream device.
  • Sub-step S1052 Obtain the relevant upgrade information of the local downstream device through the registration command of the local downstream device.
  • the local downstream device may register with the upstream device directly connected to the local downstream device, for example: when the local downstream device is a leaf device, it may register directly with the local; another example: sequentially with the local
  • the connected devices are device 1, device 2, and device 3.
  • Device 3 registers with device 2, device 2 registers with device 1, and device 1 registers locally; among them, when device 2 registers with device 1, its registration command can be one And carry the relevant upgrade information of the device 3.
  • its registration command can also carry the relevant upgrade information of the device 3 and the device 2.
  • the local downstream device may also register with the upstream device indirectly connected with the local downstream device, for example: register with the upstream device indirectly connected with the local downstream device, if the upstream device is not local, no Send a response message and continue forwarding it directly to the upstream device until it is forwarded locally.
  • the local feedback response message informs the downstream device that it has received the registration command locally and obtains the relevant upgrade information of the downstream device.
  • the local downstream device may also register with the upstream device directly connected and indirectly connected with the local downstream device. For example: first register with the upstream device directly connected to the local downstream device, and after the registration is successful, register with the upstream device indirectly connected to the local downstream device until it is forwarded to the local, and the local feedback response message . In this way, each device can obtain relevant upgrade information of all its downstream devices, and provide technical support for subsequent purposeful and targeted forwarding.
  • the registration command includes a device registration command and/or a transfer registration command
  • the device registration command is the device registration of the local downstream device with the upstream device directly connected to the local downstream device.
  • the registration command sent, the transmission registration command is a registration command sent by the local downstream device to transmit and register with the upstream device directly connected and indirectly connected with the local downstream device.
  • it may further include: controlling the local downstream device to send the local downstream device to the upstream device directly connected to the local downstream device.
  • the device registration command enables the upstream device directly connected to the local downstream device to obtain the relevant upgrade information of the local downstream device.
  • the process of device registration may be: generating a registration data packet in a predetermined format; controlling the local downstream device to send the registration data packet to an upstream device directly connected to the local downstream device; controlling the and The upstream device directly connected to the local downstream device receives the registration data packet.
  • controlling the local downstream device to send a device registration command to an upstream device directly connected to the local downstream device further includes: controlling the local downstream device to a downstream device connected to the local at a predetermined time interval.
  • the upstream device directly connected to the device sends the device registration command.
  • the upgrade solution needs to maintain scalability and be able to handle the plugging and unplugging of equipment at any time.
  • the local downstream device before obtaining the registration command of the local downstream device in sub-step S1051, it may further include: controlling the local downstream device to directly connect to the upstream device directly connected to the local downstream device and indirectly The connected upstream device sends a transmission registration command, so that each of the local downstream devices obtains relevant upgrade information of all its downstream devices.
  • the local downstream device is controlled to send a transmission registration command to the upstream device directly connected to the local downstream device and the upstream device indirectly connected at a predetermined time interval.
  • controlling the local downstream device to send a transmission registration command to the upstream device directly connected to the local downstream device and the indirectly connected upstream device may also include: successfully registering with the device Then, the local downstream device is controlled to send a transmission registration command to the upstream device directly connected to the local downstream device and the upstream device indirectly connected.
  • the process of transferring registration may be: generating a registration data packet in a predetermined format; controlling the local downstream device to send the registration data packet to the upstream device directly connected to the local downstream device and the upstream device indirectly connected Send until it is sent to the local; control the local to return a response data packet to the downstream device directly connected to the local.
  • the data content of the registration data packet includes the command identification code, the device name, the device identification code, the device type, and the directly connected upstream device identification code.
  • the command identification code includes a device registration command identification code or a transmission registration command identification code.
  • step S102 may specifically include: downloading an upgrade package of the corresponding version of the target device according to the detected upgrade trigger operation of the user and the current version information of the target device. For example, after the user selects the target device to be upgraded and forms the list that needs to be upgraded, the upgrade is triggered with one click, and based on the detected upgrade trigger operation of the user and the current version information of the target device, download the corresponding version of the target device Upgrade package.
  • step S103 it may further include: sending a transmission preparation command to the target device.
  • the relevant upgrade information of the local downstream devices and the connection relationship between the local downstream devices are stored in the local in advance.
  • the content of the preparation transmission command includes the identity information of the device, whether the device itself is upgraded, and whether the downstream device of the device is upgraded. In this way, on the one hand, the device can be prepared for upgrade, and on the other hand, the local downstream device can be targeted and purposefully transmitted to the target device with the upgrade package corresponding to the version of the target device.
  • the content of the prepared transmission command is: device A, device A is upgraded (that is, device A is the target device), and the downstream device of device A is upgraded; device B , Device B is not upgraded, and the downstream device of device B is upgraded; Device C, device C is upgraded (ie, device C is the target device), and the downstream device of device C is not available; device D, device D is upgraded (ie, device D is the target device), No downstream equipment of equipment D.
  • device A When the upgrade package of the corresponding version of the target device is transmitted to device A, because device A is upgraded, device A obtains the upgrade package of the corresponding version of device A, and then forwards the upgrade package of the corresponding version of the target device to devices B and C directly connected to device A ; After device B receives, because device B is not upgraded, but the downstream device of device B is upgraded, device B directly forwards device D connected to device B; after device C receives, because device C is upgraded, device C has no downstream device ( That is, device C is a leaf device), device C obtains the upgrade package of the corresponding version of device C, and no longer forwards it; after device D receives it, because device D is upgraded, device D has no downstream devices, and device D obtains the upgrade package of the corresponding version of device D , No longer repost.
  • step S104 the controlling the target device to upgrade according to the upgrade package of the corresponding version of the target device may further include: sending an upgrade trigger command to the downstream device directly connected to the local device;
  • the downstream devices directly connected to the local device respectively trigger the target device so that the target device is upgraded according to the upgrade package of the corresponding version of the target device.
  • the method may further include: receiving the upgrade progress pushed by the downstream device directly connected to the local device until the upgrade of the target device is completed.
  • the number of the target devices is more than two, and the details of step S103 are specifically described below.
  • Step S103 the transmission of the upgrade package of the corresponding version of the target device and the identity information of the target device to the local downstream device may include: sub-step S1031 and sub-step S1032.
  • Sub-step S1031 Parallel transmission of two or more upgrade packages of the corresponding versions of the target device and the identity information of the target device to the downstream device directly connected to the local device.
  • Sub-step S1032 According to the identity information of the target device, control the downstream device directly connected to the local device to perform a matching operation, so that the target device obtains the upgrade package of the corresponding version, and each of the local downstream devices The device saves the identity information of the downstream device.
  • the target device to be upgraded can be divided into the following situations: the first target device includes the target leaf device (the target device does not need to forward the upgrade package after receiving the corresponding version), and the second target device includes the target intermediate device (target After the device receives the upgrade package of the corresponding version, it determines whether it needs to be forwarded according to whether its downstream device needs to be upgraded), the third type of target device includes the target leaf device and the target intermediate device, and the above-mentioned first and second situations can be combined Carry out implementation.
  • the target device includes a target leaf device, which can be divided into two situations: the first type of target device is a downstream device directly connected to the local device (the target device directly receives the upgrade package of the corresponding version of the local device), and the second type The target device is a downstream device indirectly connected to the local device (the intermediate device between the target device and the local device needs to be transferred to the target device so that the target device can receive the upgrade package of the corresponding version).
  • the target device includes the target intermediate device, which can also be divided into four cases: the first is that the target device is a downstream device directly connected to the local, and the downstream device of the target device does not need to be upgraded (the target device directly receives the local The target device does not need to be transferred).
  • the second is that the target device is a downstream device directly connected to the local device, and the downstream device of the target device needs to be upgraded (the target device directly receives the local corresponding version Upgrade package, the target device needs to continue to transfer to its downstream device),
  • the third type of target device is the downstream device that is indirectly connected to the local, and the downstream device of the target device does not need to be upgraded (intermediate device transfer between the target device and the local is required To the target device, the target device can receive the upgrade package of the corresponding version, and the target device does not need to be transferred).
  • the fourth type of target device is the downstream device indirectly connected to the local device. The downstream device of the target device needs to be upgraded (the target device and The intermediate device between the locals is transferred to the target device, the target device can receive the upgrade package of the corresponding version, and the target device needs to continue to transfer to its downstream device).
  • the target device includes a target leaf device, and the target device is a downstream device directly connected to the local device.
  • Sub-step S1032 may include: determining that the target device includes the target leaf device according to the identity information of the target device, and The target leaf device includes the downstream device directly connected to the local, and the downstream device that is not connected to the downstream device of the leaf device; controlling the downstream device directly connected to the local to obtain the upgrade package of the corresponding version, and stop forwarding.
  • the target device includes a target leaf device, and the target device is a downstream device indirectly connected to the local device.
  • Sub-step S1032 may include: determining that the target device includes the target leaf device according to the identity information of the target device, and An intermediate device is included between the target leaf device and the downstream device directly connected to the local device. The intermediate device is connected to the downstream device, and the leaf device is not connected to the downstream device; controls the downstream device directly connected to the local device. And the intermediate device forward the upgrade package of the corresponding version to the target leaf device; control the target leaf device to obtain the upgrade package of the corresponding version, and stop forwarding.
  • the target device includes a target intermediate device, and the target device is a downstream device directly connected to the local device.
  • Sub-step S1032 may include: determining that the target device includes the target intermediate device according to the identity information of the target device, and The target intermediate device is directly connected to the downstream device directly connected to the local device, and the intermediate device is downwardly connected to the downstream device; the downstream device directly connected to the local device is controlled to forward the upgrade package of the corresponding version to the target intermediate device ; Control the target intermediate device to obtain the upgrade package of the corresponding version.
  • the downstream device of the target device does not need to be upgraded, and the controlling the target intermediate device to obtain the upgrade package of the corresponding version also includes: if the target device does not include the downstream device of the target intermediate device, controlling the target The intermediate device obtains the upgrade package of the corresponding version and stops forwarding it.
  • the downstream device of the target device needs to be upgraded, and the controlling the target intermediate device to obtain the upgrade package of the corresponding version further includes: if the target device also includes the target downstream device of the target intermediate device, controlling the target The intermediate device obtains the upgrade package of the corresponding version, and forwards the upgrade package of the corresponding version to the downstream device of the target intermediate device until forwarding to the target downstream device; controls the target downstream device to obtain the upgrade package of the corresponding version.
  • the target device includes a target intermediate device, and the target device is a downstream device indirectly connected to the local device.
  • Sub-step S1032 may include: determining that the target device includes the target intermediate device according to the identity information of the target device, and The target intermediate device and the downstream device directly connected to the local area include an intermediate device, and the intermediate device is downwardly connected to the downstream device; the downstream device directly connected to the local area and the intermediate device are controlled to upgrade the corresponding version The package is forwarded to the target intermediate device; the target intermediate device is controlled to obtain the upgrade package of the corresponding version.
  • the downstream device of the target device does not need to be upgraded.
  • the controlling the target intermediate device to obtain the upgrade package of the corresponding version also includes: if the target device does not include the downstream device of the target intermediate device, controlling the target The intermediate device obtains the upgrade package of the corresponding version and stops forwarding it.
  • the downstream device of the target device needs to be upgraded, and the controlling the target intermediate device to obtain the upgrade package of the corresponding version further includes: if the target device also includes the target downstream device of the target intermediate device, controlling the target The intermediate device obtains the upgrade package of the corresponding version, and forwards the upgrade package of the corresponding version to the downstream device of the target intermediate device until forwarding to the target downstream device; controls the target downstream device to obtain the upgrade package of the corresponding version.
  • FIG. 4 is a schematic diagram of the application process of the device upgrade method of the present application in the remote control and UAV system, including the following steps:
  • the device pushes the heartbeat package (including the related upgrade information of the device) to the local APP through registration, and organizes the devices of the drone locally to form an upgrade management list in the local APP.
  • the content of the upgrade management list can include Whether each device needs to be upgraded (determined according to the current version information of the device and the latest upgradeable version corresponding to the device), the latest upgradeable version corresponding to the device, and notify the user of it;
  • the local APP does not need to pay attention to the connection status of each device, but only needs to update the upgrade management list according to whether the heartbeat packet push of each device exists;
  • the local APP After the local APP receives the user-triggered upgrade operation, it downloads the upgrade package of the corresponding version of the target device in the list according to the user's need to upgrade list;
  • the local APP sends the preparation transmission command to the target devices in the list to be upgraded in parallel, and transmits the upgrade package to these target devices in parallel, without the need for sequential transmission and upgrade;
  • the local APP After the transmission of the upgrade package of the corresponding version of all target devices to be upgraded is completed, the local APP sends an upgrade trigger command to the downstream device directly connected to the local (also called direct downstream device), and the direct downstream device triggers the upgrade list separately
  • the target device in the device is upgraded internally, and the local APP receives the upgrade progress pushed by the direct downstream device until the upgrade of all target devices is completed.
  • the device pushes heartbeat packets through registration, which can organize multiple devices to solve the new requirements of device upgrades.
  • the number of upgrade devices is large, the upgrade plan needs to maintain scalability, and it can handle the plugging and unplugging of devices at any time.
  • a typical upgrade scenario for consumer-grade drones is shown in Figure 5, and a typical upgrade scenario for industry-grade drones is shown in Figure 2.
  • Both upgrade topological diagrams present a tree structure, and the embodiments of this application are collectively referred to as a device tree.
  • the local APP is the root node of the device tree; each device is a tree node; the device without downstream devices is a leaf device (leaf node); the device with downstream devices is an intermediate device (intermediate node).
  • the remote control is an intermediate device, and the aircraft is a leaf device.
  • the remote control and the aircraft are both intermediate devices, and the peripherals and mounts are leaf devices.
  • Device registration can be: the downstream device registers with the directly connected upstream device (direct upstream device), so that each device node knows the existence of its directly connected downstream device (direct downstream device); transmission registration can be: device registration is successful Later, the downstream device registers with the directly connected upstream device (direct upstream device) and indirectly connected upstream device (indirect upstream device), so that each device node knows the existence of all its downstream devices. Both of these registrations are sent by the downstream device to the upstream device in the form of a heartbeat packet, that is, at a frequency of 1 Hz.
  • the device will be added to the local APP upgrade management list; if the heartbeat packet of a downstream device has timed out, it will exceed a certain period of time (for example: specific implementation) The time can be 5 seconds)
  • the local APP has not received the heartbeat packet for registration of the downstream device, and the local APP considers that the device is not connected, and the local APP removes the device from the upgrade management list. Therefore, the method of "pushing the heartbeat package for registration" makes the local APP need not care about the connection status of each device, can achieve the scalability of the upgrade plan, and can cope with the plugging and unplugging of the device at any time.
  • the contents of the local APP upgrade management list may include: device type, device ID, status of whether the device needs to be upgraded, and the latest version of the device on the server.
  • the status of whether to upgrade is the comparison between the current version of the device and the latest version on the server. If the current version of the device is smaller, it needs to be upgraded, otherwise, it is not necessary to upgrade.
  • the downstream device C After the downstream device C successfully registers with the device of the upstream device B, the downstream device C sends a registration data packet in the specified format to the upstream device B (the difference between the registration command id and the device Registered registration command id); after the upstream device B receives it, it only feeds back the response data packet to the downstream device C; at the same time, the upstream device B forwards the registration data packet of the downstream device C to the root node A; after the root node A receives it, Only the response data packet is fed back to device B. After this process is over, it is deemed that the downstream device C has successfully registered for transmission to the direct upstream device and the indirect upstream device.
  • step 2 update the upgrade management list of the local APP according to the heartbeat package pushed for registration.
  • step 3 the user can select the target device that he needs to upgrade to form a list to be upgraded, and trigger the upgrade with one click. It should be noted here that the user selects the target device that can be upgraded from the upgrade management list of the local APP. If the device is already the latest version of the device, the interface is grayed out and the user cannot select it. After forming the list to be upgraded, the user clicks one key to upgrade. In step 4, download the upgrade package of the corresponding version of the target device in the list to be upgraded.
  • step 5 the local APP transfers the upgrade package corresponding to the target device in parallel to the target device in the list to be upgraded.
  • the APP upgrades the devices one by one, and transmits and upgrades sequentially.
  • the local APP sends a transmission preparation command in parallel to the target devices in the list to be upgraded, and then transmits the Upgrade package of the target device. If multiple target devices are included in the upgrade list, the above process is parallel.
  • the specific implementation of sending the prepare transmission command can be seen in Figures 7-11.
  • commonly used upgrade scenarios can include: scenario one, local APP upgrades a device alone; scenario two, local APP Upgrade all devices; Scenario 3: Local APP upgrades a certain leaf device in all devices; Scenario 4: Local APP upgrades an intermediate device in all devices; Scenario 5: Local APP upgrades a certain group of devices in all devices.
  • the local APP serves as the root node of the device tree, and sends a transmission preparation command downward.
  • the preparation transmission command in the embodiment of this application is different from the preparation transmission command of the consumer-grade UAV APP upgrade solution, and requires two more flag parameters. For the command format of the preparation transmission command in this embodiment, see Table 2.
  • Table 2 The command data format of the command to be transmitted
  • Scenario 1 The local APP upgrades a certain device alone (as shown in Figure 7, the target device to be upgraded includes the B device, the B device is a leaf device, and the B device is directly connected to the local device).
  • the value of the prepared transmission command can be seen in Table 3.
  • Scenario 2 Local APP upgrades all devices (as shown in Figure 8, the target devices to be upgraded include B device, C device, D device, E device, and F device; B device and C device are intermediate devices, D device, E device, and F device The device is a leaf device; the B device is directly connected to the local device, the C device is directly connected to the B device, the D device is directly connected to the B device; the E device and the F device are directly connected to the C device), the value of the prepared transmission command can be seen in Table 4 .
  • Scenario 3 The local APP upgrades a certain leaf device in all devices (as shown in Figure 9, the target device to be upgraded includes the E device, which is a leaf device that is indirectly connected to the local device; the E device and the local device include intermediate devices, respectively It is B device and C device), the value of the command to be transmitted can be seen in Table 5.
  • Scenario 4 The local APP upgrades an intermediate device in all devices (as shown in Figure 10, the target device to be upgraded includes the C device, which is an intermediate device that is indirectly connected to the local device; the intermediate device B device is included between the C device and the local device ), see Table 6 for the value of the command to be transmitted.
  • Scenario 5 The local APP upgrades a certain group of devices in all devices (as shown in Figure 11, the target devices to be upgraded include C device, E device and F device.
  • C device is an intermediate device that is indirectly connected to the local device, and E device and F device are Leaf devices that are indirectly connected to the local device; the E device and the F device are downstream devices directly connected to the C device, and the intermediate device B device is included between the C device and the local device.
  • the value of the prepared transmission command can be seen in Table 7.
  • Table 7 The value of the prepare transmission command in scenario 5
  • the local APP After the preparation for transmission command is successfully sent, the local APP transmits the upgrade package to the target device that needs to be upgraded; the device that does not need to be upgraded only participates in the process of transferring the upgrade package. Since the actual physical link between the local APP and each target device that needs to be upgraded is different, the transmission method may also be different, so I won't repeat it here.
  • step 6 The local APP sends an upgrade trigger command to the direct downstream device, and the direct downstream device will trigger the target device in the list to be upgraded to perform internal upgrade, and the local APP receives the direct downstream device. The upgrade progress pushed by the device until the end of the upgrade.
  • the target device that needs to be upgraded becomes a node of the device tree by means of device registration and transmission registration, and the local APP is the root node of the device tree.
  • the local APP will add the device to the upgrade management list according to the heartbeat packet used for registration of the device; if the device If it is removed, the local APP deletes the device from the upgrade management list according to the timeout of the heartbeat packet for registration of the device.
  • the local APP can implement the upgrade of the device, and can conveniently handle the plugging and unplugging of the device, while maintaining the scalability of the upgrade solution.
  • the local APP will send upgrade instructions to these target devices in the device tree in parallel and transmit upgrade packages to these target devices in parallel according to the upgrade list formed by the user's selection.
  • the local APP also triggers the internal upgrade of these target devices. Therefore, users only need to select the target device that needs to be upgraded, and they can upgrade with one click.
  • parallel transmission replaces the sequential transmission upgrade in the existing scheme, which can greatly reduce the upgrade time in the case of multiple devices.
  • the local APP can well meet the new upgrade requirements "large number of upgraded equipment, maintain scalability, and be able to handle the plugging and unplugging of equipment at any time", so as to achieve the upgrade of industry-level drones.
  • FIG 12 is a schematic structural diagram of an embodiment of the device upgrade apparatus of the present application. It should be noted that the device of this embodiment can execute the steps in the above device upgrade method. For a detailed description of related content, please refer to the above The relevant content of the equipment upgrade method will not be repeated here.
  • the device 100 includes a memory 1, a processor 2, and a communication circuit 3, and the memory 1 and the communication circuit 3 are connected to the processor 2 respectively.
  • the processor 2 may be a micro control unit, a central processing unit, or a digital signal processor, and so on.
  • the memory 1 can be a Flash chip, a read-only memory, a magnetic disk, an optical disk, a U disk or a mobile hard disk, etc.
  • the communication circuit 3 can be used for the device to communicate with the outside, and can also be used for the communication between itself and the processor 2 and the communication between the memory 1 and the processor 2.
  • the memory 1 is used to store a computer program; the processor 2 is used to execute the computer program and when the computer program is executed, the following steps are implemented:
  • the relevant upgrade information of the target device to be upgraded is obtained from the relevant upgrade information of the local downstream device.
  • the relevant upgrade information includes the identity information of the device and the current version information of the device.
  • the local downstream device includes a device directly connected to the local device and/or a device connected indirectly; according to the current version information of the target device, the communication circuit is controlled to download the upgrade package of the corresponding version of the target device; and the communication is controlled
  • the circuit transmits the upgrade package of the corresponding version of the target device and the identity information of the target device to the local downstream device, so that the local downstream device converts the version corresponding to the target device according to the identity information of the target device
  • the upgrade package is transmitted to the target device so that the target device obtains the upgrade package of the corresponding version; when the target device obtains the upgrade package of the corresponding version, the target device is controlled to upgrade according to the corresponding version of the target device The package is upgraded.
  • the processor when the processor executes the computer program, it implements the following steps: acquiring the relevant upgrade information of the local downstream device.
  • the processor executes the computer program, the following steps are implemented: obtaining the relevant upgrade information of the local downstream device through a heartbeat packet.
  • the processor when the processor executes the computer program, it implements the following steps: obtaining a registration command of the local downstream device, where the registration command is that the local downstream device directly connects to the local downstream device And/or sent by an indirectly connected upstream device for registration; obtaining the relevant upgrade information of the local downstream device through the registration command of the local downstream device.
  • the registration command includes a device registration command and/or a transfer registration command
  • the device registration command is a registration command sent by the local downstream device to the upstream device directly connected to the local downstream device for device registration
  • the transmission registration command is a registration command sent by the local downstream device to perform transmission registration to the upstream device directly connected and indirectly connected with the local downstream device.
  • the processor when the processor executes the computer program, it implements the following steps: controlling the local downstream device to send the device registration command to the upstream device directly connected to the local downstream device, so that the The upstream device directly connected to the local downstream device obtains relevant upgrade information of the local downstream device.
  • the processor when the processor executes the computer program, it implements the following steps: generating a registration data packet in a predetermined format; controlling the local downstream device to send the registration data packet to a device directly connected to the local downstream device Sent by an upstream device; controlling the upstream device directly connected to the local downstream device to receive the registration data packet.
  • the processor when the processor executes the computer program, it implements the following steps: controlling the local downstream device to send a transmission registration command to the upstream device directly connected to the local downstream device and the upstream device indirectly connected to Make each of the local downstream devices obtain relevant upgrade information of all its own downstream devices.
  • the processor when the processor executes the computer program, it implements the following steps: after the device is successfully registered, it controls the local downstream device to directly connect to the upstream device directly connected to the local downstream device and the indirect connected device.
  • the upstream device sends a transfer registration command.
  • the processor when the processor executes the computer program, it implements the following steps: generating a registration data packet in a predetermined format; controlling the local downstream device to send the registration data packet to a device directly connected to the local downstream device The upstream device and the indirectly connected upstream device send until it is sent to the local; control the local to return a response data packet to the downstream device directly connected to the local.
  • the data content of the registration data packet includes the command identification code, the device name, the device identification code, the device type, and the directly connected upstream device identification code.
  • the command identification code includes a device registration command identification code or a transmission registration command identification code.
  • the processor when the processor executes the computer program, it implements the following steps: according to the detected upgrade trigger operation of the user and the current version information of the target device, control the communication circuit to download the corresponding target device Version upgrade package.
  • the processor when the processor executes the computer program, it implements the following steps: controlling the communication circuit to send a transmission preparation command to the target device.
  • the content of the preparation transmission command includes the identity information of the device, whether the device itself is upgraded, and whether the downstream device of the device is upgraded.
  • the processor executes the computer program, the following steps are implemented: informing the communication circuit to send an upgrade trigger command to the downstream device directly connected to the local; and triggering respectively through the downstream device directly connected to the local.
  • the target device enables the target device to upgrade according to the upgrade package of the corresponding version of the target device.
  • the number of the target devices is more than two, and when the processor executes the computer program, the following steps are implemented: control the communication circuit to convert more than two upgrade packages of the corresponding versions of the target devices and all The identity information of the target device is transmitted in parallel to the downstream device directly connected to the local device; according to the identity information of the target device, the downstream device directly connected to the local device is controlled to perform a matching operation, so that the target device obtains Corresponding to the version of the upgrade package, each device in the local downstream device stores the identity information of the downstream device.
  • the processor executes the computer program, the following steps are implemented: according to the identity information of the target device, it is determined that the target device includes a target leaf device, and the target leaf device includes a direct connection with the local The downstream device of the leaf device is not connected downstream; the downstream device directly connected to the local is controlled to obtain the upgrade package of the corresponding version and stop forwarding.
  • the processor executes the computer program, the following steps are implemented: according to the identity information of the target device, it is determined that the target device includes a target leaf device, and the target leaf device is directly connected to the local
  • the downstream devices include intermediate devices, the intermediate devices are connected downstream with downstream devices, and the leaf devices are not connected downstream; the downstream devices directly connected to the local device and the intermediate devices are controlled to convert the corresponding version
  • the upgrade package of is forwarded to the target leaf device; the target leaf device is controlled to obtain the upgrade package of the corresponding version and stop forwarding.
  • the processor executes the computer program, the following steps are implemented: according to the identity information of the target device, it is determined that the target device includes a target intermediate device, and the target intermediate device is directly connected to the local The downstream device is directly connected, and the intermediate device is downwardly connected to the downstream device; the downstream device directly connected to the local device is controlled to forward the upgrade package of the corresponding version to the target intermediate device; the target intermediate device is controlled to obtain the corresponding version Upgrade package.
  • the processor executes the computer program, the following steps are implemented: according to the identity information of the target device, it is determined that the target device includes a target intermediate device, and the target intermediate device is directly connected to the local
  • the downstream devices include intermediate devices, which are connected downstream with downstream devices; control the downstream devices directly connected to the local and the intermediate devices to forward the upgrade package of the corresponding version to the target intermediate device; control The target intermediate device obtains the upgrade package of the corresponding version.
  • the processor implements the following steps when executing the computer program: if the target device also includes a target downstream device of the target intermediate device, control the target intermediate device to obtain the upgrade package of the corresponding version, and Forward the upgrade package of the corresponding version to the downstream device of the target intermediate device until it is forwarded to the target downstream device; control the target downstream device to obtain the upgrade package of the corresponding version.
  • the processor implements the following steps when executing the computer program: if the target device does not include the downstream device of the target intermediate device, control the target intermediate device to obtain the upgrade package of the corresponding version, and stop Forward.
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for upgrading the device as described in any one of the preceding items. .
  • the relevant content please refer to the relevant content section above, which will not be repeated here.
  • the computer-readable storage medium may be an internal storage unit of the above-mentioned device upgrading apparatus, such as a hard disk or a memory.
  • the computer-readable storage medium may also be an external storage device, such as an equipped plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, and so on.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种设备升级的方法、装置及存储介质,该方法包括:根据检测到的用户的目标设备选择操作,获取目标设备的身份信息和目标设备的当前版本信息;根据目标设备的当前版本信息,下载目标设备的升级包;将目标设备的升级包和目标设备的身份信息向本地的下游设备传输,使本地的下游设备将目标设备的升级包传输至目标设备,使目标设备获取升级包;控制目标设备根据升级包进行升级。

Description

设备升级的方法、装置及存储介质 技术领域
本申请涉及软件升级技术领域,尤其涉及一种设备升级的方法、装置及存储介质。
背景技术
现有消费级无人机,其拓扑结构十分简单,升级模块少,大多数是标准的升级模块:无人机和遥控器。
在这种简单的场景下,现有的应用程序APP升级方案如下:实时监测无人机和遥控器两者的连接状态和是否需要升级的状态;符合升级条件时,各自触发模块内的升级流程,即把合适的固件升级包从服务器上下载下来,依次传输给对应的无人机和遥控器;传输完成后,使无人机和遥控器分别升级,并接收无人机和遥控器推送的升级进度。若无人机或遥控器上新增设备,需要同时升级多个设备时,APP需要依次传输和升级。
上述APP升级方案不适合拓扑结构复杂的设备的升级,无法根据用户的需求使设备选择性升级,也不适合升级新需求:升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔。
发明内容
基于此,本申请提供一种设备升级的方法、装置及存储介质。
第一方面,本申请提供了一种设备升级的方法,所述方法包括:
根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;
根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包;
将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;
当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
第二方面,本申请提供一种设备升级的装置,所述装置包括:存储器、处理器以及通信电路,所述存储器和所述通信电路分别与所述处理器连接;
所述存储器用于存储计算机程序;
所述处理器用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:
根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;
根据所述目标设备的当前版本信息,控制所述通信电路下载所述目标设备对应版本的升级包;
控制所述通信电路将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;
当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
第三方面,本申请提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上所述的设备升级的方法。
本申请实施例提供了一种设备升级的方法、装置及存储介质,根据检测到 的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包;将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。由于根据检测到的用户的选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的身份信息和当前版本信息,根据目标设备的当前版本信息下载所述目标设备对应版本的升级包,将目标设备对应版本的升级包和目标设备的身份信息向本地的下游设备传输,使本地的下游设备将目标设备对应版本的升级包传输至目标设备,使目标设备获取对应版本的升级包;当目标设备获取到对应版本的升级包后,控制目标设备进行升级,通过这种方式,能够按照用户的需求对用户选择的、与本地直接连接的和/或间接连接的目标设备进行升级,适合拓扑结构复杂的设备的升级,也为升级新需求“升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔”提供技术支持。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请设备升级的方法一实施例的流程示意图;
图2是本申请设备升级的方法一应用场景的示意图;
图3是本申请设备升级的方法另一应用场景的示意图;
图4是本申请设备升级的方法在遥控器和无人机***中的应用一流程示意图;
图5是本申请设备升级的方法又一应用场景的示意图;
图6是本申请设备升级的方法中一设备注册和传输注册的示意图;
图7是本申请设备升级的方法又一应用场景的示意图;
图8是本申请设备升级的方法又一应用场景的示意图;
图9是本申请设备升级的方法又一应用场景的示意图;
图10是本申请设备升级的方法又一应用场景的示意图;
图11是本申请设备升级的方法又一应用场景的示意图;
图12是本申请设备升级的装置一实施例的结构示意图;
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
现有消费级无人机,其拓扑结构简单,通常是标准的升级模块:无人机和遥控器;升级方案是:实时监测无人机和遥控器的连接状态和是否需要升级的状态;符合升级条件时,触发无人机和遥控器的升级流程。上述升级方案不适合拓扑结构复杂的设备的升级,无法根据用户的需求使设备选择性升级,也不适合升级新需求“升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔”。
本申请实施例根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;根据所述目标设备的当前版本信息, 下载所述目标设备对应版本的升级包;将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。由于根据检测到的用户的选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的身份信息和当前版本信息,根据目标设备的当前版本信息下载所述目标设备对应版本的升级包,将目标设备对应版本的升级包和目标设备的身份信息向本地的下游设备传输,使本地的下游设备将目标设备对应版本的升级包传输至目标设备,使目标设备获取对应版本的升级包;当目标设备获取到对应版本的升级包后,控制目标设备进行升级,通过这种方式,能够按照用户的需求对用户选择的、与本地直接连接的和/或间接连接的目标设备进行升级,适合拓扑结构复杂的设备的升级,也为升级新需求“升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔”提供技术支持。
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
参见图1,图1是本申请设备升级的方法一实施例的流程示意图,所述方法包括:
步骤S101:根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备。
在本实施例中,本地的下游设备包括与本地直接连接的一个以上的设备;也包括与本地间接连接的一个以上的设备;也包括与本地直接连接的一个以上的设备、与本地间接连接的一个以上的设备,即本实施例的方法可以适用于拓扑结构简单的设备的升级,也适用于拓扑结构复杂的设备的升级。对应地,待升级的目标设备包括与本地直接连接的设备和/或间接连接的设备,即目标设备可以包括与本地直接连接的一个以上的设备;也包括与本地间接连接的一个以上的设备;也包括与本地直接连接的一个以上的设备、与本地间接连接的一 个以上的设备。目标设备的数量是一个以上,例如:一个目标设备,两个目标设备,三个目标设备,等等。
在一实施例中,多个设备根据连接关系被组织成树状结构而生成设备树,本地(或用户端)为所述设备树的根节点,所述设备树上的设备分为中间设备和/或叶子设备,所述中间设备向下连接有下游设备(包括直接连接的下游设备和/或间接连接的下游设备),所述叶子设备向下没有下游设备。
如图2所示,应用程序APP代表本地(用户端),且为设备树的根节点,该设备树还包括遥控器,与遥控器直接连接的飞机(无人机)、已知外设、未知外设,与飞机直接连接的已知挂载1、已知挂载2、未知挂载1;遥控器和飞机为中间设备,已知外设、未知外设、已知挂载1、已知挂载2、未知挂载1为叶子设备;遥控器是与本地直接连接的中间设备,飞机是与本地间接连接的中间设备;遥控器是与飞机直接连接的上游设备、也是与已知外设直接连接的上游设备、也是与未知外设直接连接的上游设备;飞机是与已知挂载1直接连接的上游设备、也是与已知挂载2直接连接的上游设备、也是与未知挂载1直接连接的上游设备;遥控器是与已知挂载1间接连接的上游设备、也是与已知挂载2间接连接的上游设备、也是与未知挂载1间接连接的上游设备;已知外设、未知外设、已知挂载1、已知挂载2、未知挂载1是与本地间接连接的叶子设备。
设备的身份信息可以是用于标识设备身份、设备类型等,以区分不同设备和/或每个设备的信息,例如唯一识别码、设备识别码、IP地址,等等。例如:设备1、设备2、设备3。设备的当前版本信息可以是设备当前所使用的应用程序的版本信息。根据设备的当前版本信息和设备的最新版本信息,即可初步确定该设备是否需要升级以及需要下载的版本信息。例如,设备1的应用程序的当前版本是V1,设备1的应用程序的最新版本是V2,初步确定设备1需要升级,最终是否升级依据用户是否选择,如果设备1最近使用不多,可以暂且不升级,如果设备1最近使用较多,可以选择升级。
本地的下游设备的相关升级信息(即设备的身份信息和设备的当前版本信息)保存在本地,其获取方式很多,例如:在本地用户输入设备的身份信息和设备的当前版本信息;或者,本地预先有设备的身份信息和开始的版本信息, 每当设备升级,对应修改该设备的当前版本信息;或者,预先约定升级时间,连接的设备在该时间向本地推送自己的身份信息和当前版本信息;或者,预先约定升级时间,在升级时间连接上相关设备;或者,连接的设备以预定的时间间隔向本地推送自己的身份信息和当前版本信息;等等。
用户对需要升级的目标设备进行选择,通过这种方式,能够按照用户的需求对目标设备进行升级。
步骤S102:根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包。
根据所述目标设备的当前版本信息,可以从服务器下载所述目标设备对应版本的升级包。
例如,服务器上设备1的应用程序的升级包的版本有V1和V2,根据设备1的应用程序的当前版本是V1,确定下载所述目标设备对应版本V2的升级包。
又如:服务器上设备1的应用程序的升级包的版本有V1、V2和V3,根据设备1的应用程序的当前版本是V1,确定下载所述目标设备对应版本V3的升级包。
步骤S103:将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包。
本地的下游设备包括与本地直接连接的设备和/或间接连接的设备,待升级的目标设备包括与本地直接连接的设备和/或间接连接的设备,将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,具体传输方式和传输细节可以有很多种,只要最后使所述本地的下游设备将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包即可。
例如:如果从设备1传输到设备2,设备2需要升级(即目标设备的身份信息有设备2),则设备2获取对应的升级包(设备2不需要升级,则该步骤 忽略),然后向设备2所有可以连接其他设备的接口发送目标设备对应版本的升级包和所述目标设备的身份信息(因为设备2已经获取对应的升级包,设备2继续传输时可以将设备2对应版本的升级包和所述设备2的身份信息删除),如果接口连接有下游设备,该下游设备即可接收到目标设备对应版本的升级包和所述目标设备的身份信息,如果接口没有连接下游设备,传输到此结束。
又如:如果从设备1传输到设备2,设备2能够检测到哪些接口连接有下游设备,设备2不需要升级,向设备2连接有下游设备的接口发送目标设备对应版本的升级包和所述目标设备的身份信息。
又如:如果从设备1传输到设备2,设备2保存有设备2的下游设备的身份信息,设备2根据设备2的下游设备的身份信息、所述目标设备的身份信息,有针对性地向直接连接的下游设备(即与目标设备有直接或间接连接关系的下游设备)传输,而不会向所有直接连接的下游设备传输。
步骤S104:当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
本申请实施例根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包;将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。由于根据检测到的用户的选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的身份信息和当前版本信息,根据目标设备的当前版本信息下载所述目标设备对应版本的升级包,将目标设备对应版本的升级包和目标设备的身份信息向本地的下游设备传输,使本地的下游设备将目标设备对应版本的升级包传输至目标设备,使目标设备获取对应版本的升级包;当目标设备获取到对应版本的升级包后,控制目标设备进行升级,通过这种方式,能 够按照用户的需求对用户选择的、与本地直接连接的和/或间接连接的目标设备进行升级,适合拓扑结构复杂的设备的升级,也为升级新需求“升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔”提供技术支持。
通常情况下,设备上的接口可能连接有下游设备,也可能没有连接下游设备;有可能在这段时间内连接有下游设备,在另一时间段内没有连接下游设备;有可能本地与设备之间距离太远,用户也没有办法弄清楚设备之间的连接情况;有可能情况紧急或特殊设备随时插拔;等等,为了使用户选择目标设备时能够有针对性地选择到目标设备,步骤S101之前,还包括:
步骤S105:获取所述本地的下游设备的相关升级信息。
具体地,可以通过心跳包获取所述本地的下游设备的相关升级信息。本实施例中,心跳包就是在设备和本地定时通知对方自己状态的一个自己定义的命令字,按照一定的时间间隔发送,类似于心跳,所以叫做心跳包。即每个连接的设备向本地推送心跳包,使本地根据每个设备推送的心跳包是否存在,来更新所述本地的下游设备的相关升级信息,通过这种方式,能够使本地无需关注每个设备的连接状态,能够满足升级新需求“升级方案需要保持扩展性、能够应对设备随时插拔”。
进一步,通过心跳包推送的方式,可以把各个设备组织起来,在本地APP形成一份升级管理列表,包括每个设备的身份信息、每个设备的是否需要升级的状态、可升级的最新版本,并且将之通知到用户;根据每个设备的心跳包推送的更新,来更新升级管理列表;新增心跳包,则新增对应的设备的相关升级信息,心跳包超时,则删除对应的设备的相关升级信息);用户可以从中选择自己需要升级的目标设备形成需升级列表,并且一键触发升级。
在一实施例中,步骤S105具体可以包括:子步骤S1051和子步骤S1052。
子步骤S1051:获取所述本地的下游设备的注册命令,所述注册命令是所述本地的下游设备向与所述本地的下游设备直接连接和/或间接连接的上游设备进行注册而发送的。
子步骤S1052:通过所述本地的下游设备的注册命令获取所述本地的下游设备的相关升级信息。
所述本地的下游设备可以向与所述本地的下游设备直接连接的上游设备 进行注册,例如:当所述本地的下游设备是叶子设备时,可以直接向本地进行注册;又如:与本地依次连接的设备分别是设备1、设备2以及设备3,设备3向设备2进行注册,设备2向设备1注册,设备1向本地注册;其中,设备2向设备1注册时,其注册命令可以一并携带上设备3的相关升级信息,同样设备1向本地注册时,其注册命令可以一并携带上设备3、设备2的相关升级信息。
所述本地的下游设备也可以向与所述本地的下游设备间接连接的上游设备进行注册,例如:向与所述本地的下游设备间接连接的上游设备进行注册,如果该上游设备不是本地,不发响应消息,直接继续向上游设备转发,直到转发至本地,本地反馈响应消息,告知下游设备在本地已经收到注册命令,获得该下游设备的相关升级信息。
所述本地的下游设备也可以向与所述本地的下游设备直接连接和间接连接的上游设备进行注册。例如:先向与所述本地的下游设备直接连接的上游设备进行注册,该注册成功后,再向与所述本地的下游设备间接连接的上游设备进行注册,直到转发至本地,本地反馈响应消息。通过这种方式,能够使每个设备获得自己所有下游设备的相关升级信息,为后续有目的性、有针对性的转发提供技术支持。
在一实施方式中,所述注册命令包括设备注册命令和/或传输注册命令,所述设备注册命令是所述本地的下游设备向与所述本地的下游设备直接连接的上游设备进行设备注册而发送的注册命令,所述传输注册命令所述本地的下游设备向与所述本地的下游设备直接连接和间接连接的上游设备进行传输注册而发送的注册命令。
在一实施方式中,子步骤S1051所述获取所述本地的下游设备的注册命令之前,还可以包括:控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令,以使与所述本地的下游设备直接连接的上游设备获取所述本地的下游设备的相关升级信息。
具体地,设备注册的过程可以是:生成预定格式的注册数据包;控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备发送;控制所述与所述本地的下游设备直接连接的上游设备接收所述注册 数据包。
其中,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送设备注册命令,还包括:以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令。
通过上述方式,能够满足升级新需求“升级方案需要保持扩展性、能够应对设备随时插拔”。
在另一实施方式中,子步骤S1051所述获取所述本地的下游设备的注册命令之前,还可以包括:控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,以使所述本地的下游设备中每个设备获取自己所有下游设备的相关升级信息。其中,以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
在一具体实施方式中,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,还可以包括:在所述设备注册成功后,控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
具体地,传输注册的过程可以是:生成预定格式的注册数据包;控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送,直到发送至所述本地;控制所述本地向与所述本地直接连接的下游设备返回应答数据包。
其中,所述注册数据包的数据内容包括命令识别码、设备名称、设备识别码、设备类型以及直接连接的上游设备识别码。
其中,所述命令识别码包括设备注册命令识别码或传输注册命令识别码。
在一实施例中,步骤S102具体可以包括:根据检测到的所述用户的升级触发操作和所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包。例如用户选择好待升级的目标设备,形成需升级列表后,一键触发升级,根据检测到的所述用户的升级触发操作和所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包。
在一实施例中,步骤S103之前,还可以包括:向所述目标设备发送准备 传输命令。所述本地预先保存有所述本地的下游设备的相关升级信息、所述本地的下游设备之间的连接关系。其中,所述准备传输命令的内容包括设备的身份信息、所述设备本身是否升级、所述设备的下游设备是否升级。通过这种方式,一方面能够使设备做好升级准备,另一方面能够使本地的下游设备有针对性、有目的地将所述目标设备对应版本的升级包传输至所述目标设备。
例如:如图3所示,当前与本地连接的下游设备供4个,按照与本地的连接由近及远分别是设备A(与本地直接连接)、设备B(与设备A直接连接)、设备C(与设备A直接连接)以及设备D(与设备B直接连接);准备传输命令的内容是:设备A,设备A升级(即设备A为目标设备),设备A的下游设备升级;设备B,设备B不升级,设备B的下游设备升级;设备C,设备C升级(即设备C为目标设备),设备C的下游设备无;设备D,设备D升级(即设备D为目标设备),设备D的下游设备无。当目标设备对应版本的升级包传输至设备A时,由于设备A升级,设备A获取设备A对应版本的升级包,然后向与设备A直接连接的设备B、C转发目标设备对应版本的升级包;设备B收到后,由于设备B不升级,但设备B的下游设备升级,设备B直接转发与设备B连接的设备D;设备C收到后,由于设备C升级,设备C没有下游设备(即设备C为叶子设备),设备C获取设备C对应版本的升级包,不再转发;设备D收到后,由于设备D升级,设备D没有下游设备,设备D获取设备D对应版本的升级包,不再转发。
在一实施例中,步骤S104中,所述控制所述目标设备根据所述目标设备对应版本的升级包进行升级,还可以包括:向与所述本地直接连接的下游设备发送升级触发命令;通过与所述本地直接连接的下游设备分别触发所述目标设备,使所述目标设备根据所述目标设备对应版本的升级包进行升级。
此时,所述方法还可以包括:接收与所述本地直接连接的下游设备推送的升级进度,直到所述目标设备升级结束。
大多数情况下,所述目标设备的数量为两个以上,下面具体说明步骤S103的细节内容。
步骤S103,所述将所述目标设备对应版本的升级包和所述目标设备的身份信息向本地的下游设备传输,可以包括:子步骤S1031和子步骤S1032。
子步骤S1031:将两个以上的所述目标设备对应版本的升级包和所述目标设备的身份信息并行向与所述本地直接连接的下游设备传输。
子步骤S1032:根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,所述本地的下游设备中每个设备保存有下游设备的身份信息。
当所述目标设备的数量为两个以上,并行向与所述本地直接连接的下游设备传输,能够避免依次传输因升级设备多而过多延长升级时间,能够满足升级新需求“升级设备数量大”。
待升级的目标设备可以分为以下几种情况:第一种目标设备包括目标叶子设备(目标设备接收到对应版本的升级包后,不需要转发),第二种目标设备包括目标中间设备(目标设备接收到对应版本的升级包后,根据其下游设备是否需要升级来确定是否需要转发),第三种目标设备包括目标叶子设备和目标中间设备,可以结合上述第一种和第二种的情况进行实施。
其中,目标设备包括目标叶子设备,可以分为两种情况:第一种目标设备是与所述本地直接连接的下游设备(目标设备直接接收所述本地的对应版本的升级包),第二种目标设备是与所述本地间接连接的下游设备(需要目标设备与本地之间的中间设备中转至目标设备,目标设备才能接收到对应版本的升级包)。
其中,目标设备包括目标中间设备,也可以分为四种情况:第一种是目标设备是与所述本地直接连接的下游设备、目标设备的下游设备不需要升级(目标设备直接接收所述本地的对应版本的升级包,目标设备不需要中转),第二种是目标设备是与所述本地直接连接的下游设备、目标设备的下游设备需要升级(目标设备直接接收所述本地的对应版本的升级包,目标设备需要继续向其下游设备中转),第三种目标设备是与所述本地间接连接的下游设备、目标设备的下游设备不需要升级(需要目标设备与本地之间的中间设备中转至目标设备,目标设备才能接收到对应版本的升级包,目标设备不需要中转),第四种目标设备是与所述本地间接连接的下游设备、目标设备的下游设备需要升级(需要目标设备与本地之间的中间设备中转至目标设备,目标设备才能接收到对应版本的升级包,目标设备需要继续向其下游设备中转)。
具体说明如下:
A、目标设备包括目标叶子设备,目标设备是与所述本地直接连接的下游设备,子步骤S1032可以包括:根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备包括与所述本地直接连接的下游设备,叶子设备向下没有连接的下游设备;控制与所述本地直接连接的下游设备获取对应版本的升级包,并停止转发。
B、目标设备包括目标叶子设备,目标设备是与所述本地间接连接的下游设备,子步骤S1032可以包括:根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备和与所述本地直接连接的下游设备之间包括中间设备,所述中间设备向下连接有下游设备,叶子设备向下没有连接的下游设备;控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标叶子设备;控制所述目标叶子设备获取对应版本的升级包,并停止转发。
C、目标设备包括目标中间设备,目标设备是与所述本地直接连接的下游设备,子步骤S1032可以包括:根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备直接连接,中间设备向下连接有下游设备;控制与所述本地直接连接的下游设备将所述对应版本的升级包转发至所述目标中间设备;控制所述目标中间设备获取对应版本的升级包。
C1、目标设备的下游设备不需要升级,所述控制所述目标中间设备获取对应版本的升级包,还包括:若所述目标设备不包括所述目标中间设备的下游设备,则控制所述目标中间设备获取对应版本的升级包,并停止转发。
C2、目标设备的下游设备需要升级,所述控制所述目标中间设备获取对应版本的升级包,还包括:若所述目标设备还包括所述目标中间设备的目标下游设备,则控制所述目标中间设备获取对应版本的升级包,并向所述目标中间设备的下游设备转发对应版本的升级包,直到转发至所述目标下游设备;控制所述目标下游设备获取对应版本的升级包。
D、目标设备包括目标中间设备,目标设备是与所述本地间接连接的下游设备,子步骤S1032可以包括:根据所述目标设备的身份信息,确定所述目标 设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备之间包括中间设备,中间设备向下连接有下游设备;控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标中间设备;控制所述目标中间设备获取对应版本的升级包。
D1、目标设备的下游设备不需要升级,所述控制所述目标中间设备获取对应版本的升级包,还包括:若所述目标设备不包括所述目标中间设备的下游设备,则控制所述目标中间设备获取对应版本的升级包,并停止转发。
D2、目标设备的下游设备需要升级,所述控制所述目标中间设备获取对应版本的升级包,还包括:若所述目标设备还包括所述目标中间设备的目标下游设备,则控制所述目标中间设备获取对应版本的升级包,并向所述目标中间设备的下游设备转发对应版本的升级包,直到转发至所述目标下游设备;控制所述目标下游设备获取对应版本的升级包。
下面以遥控器和无人机***为例,来详细说明本申请实施例的方法。
参见图4,图4是本申请设备升级的方法在遥控器和无人机***中的应用一流程示意图,包括如下步骤:
1.设备通过注册的方式向本地APP推送心跳包(包括设备的相关升级信息),本地把无人机的各设备组织起来,在本地APP形成一份升级管理列表,升级管理列表的内容可以包括每个设备的是否需要升级(根据设备的当前版本信息与该设备对应的可升级的最新版本来确定)、该设备对应的可升级的最新版本,并且将之通知到用户;
2.本地APP无需关注每个设备的连接状态,只需要根据每个设备的心跳包推送是否存在,来更新升级管理列表;
3.用户可以从中选择自己需要升级的设备形成需升级列表,并且一键触发升级;
4.本地APP收到用户触发升级的操作后,根据用户的需升级列表,下载列表中的目标设备对应版本的升级包;
5.下载完成后,本地APP并行向需升级列表中的目标设备发送准备传输命令、并行向这些目标设备传输升级包,而无需依次传输和升级;
6.所有需升级的目标设备对应版本的升级包传输完成后,本地APP向与 本地直接连接的下游设备(也可以称为直接下游设备)发送升级触发命令,该直接下游设备分别触发需升级列表中的目标设备进行内部升级,本地APP接收该直接下游设备推送过来的升级进度,直到所有目标设备升级结束。
在第1步中,设备通过注册的方式进行心跳包推送的方式,能够把多设备组织起来,为解决设备升级新需求“升级设备数量大、升级方案需要保持扩展性、能够应对设备随时插拔”打下基础。消费级无人机典型的升级场景如图5,行业级无人机典型的升级场景如图2,两者的升级拓扑图均呈现树状结构,本申请实施例统称为设备树。本地APP是设备树的根节点;每一个设备就是一个树节点;向下无下游设备的设备就是一个叶子设备(叶子节点);向下有下游设备的设备就是一个中间设备(中间节点)。对于消费级无人机典型的设备树来说(如图5),遥控器是一个中间设备,飞机是一个叶子设备。对于行业级无人机典型的设备树来说(如图2),遥控器和飞机都是中间设备,外设和挂载是叶子设备。
为把物理上的设备树,转化为逻辑上能够处理的设备树,本申请实施例使用“设备注册”和“传输注册”。设备注册可以是:下游设备向直接连接的上游设备(直接上游设备)注册,让每个设备节点都知道自己的直接连接的下游设备(直接下游设备)的存在;传输注册可以是:设备注册成功后,下游设备向直接连接的上游设备(直接上游设备)和间接连接的上游设备(间接上游设备)进行注册,让每个设备节点都知道自己的所有下游设备的存在。这两者注册,都是下游设备以心跳包的方式,即1Hz的频率向上游设备推送。若第一次收到某个下游设备的用于注册的心跳包,即把该设备加入到本地APP升级管理列表;若某个下游设备的心跳包超时,即超过一定时间内(例如:具体实现时可以为5秒)本地APP一直没有收到该下游设备的用于注册的心跳包,本地APP则认为该设备不在连接状态,本地APP把该设备从升级管理列表中移除。所以,“推送用于注册的心跳包”这种方式,让本地APP无需关心每个设备的连接状态,能够实现升级方案的扩展性、能够应对设备的随时插拔。
另外,本地APP升级管理列表包括的内容可以是:设备类型、设备ID、设备是否需要升级的状态、设备在服务器上的最新版本。其中,是否需要升级的状态,是设备当前版本和服务器上的最新版本比较,若本设备当前版本较小, 则需要升级,否则不需要升级。
在本实施例中,设备注册的具体实现请参见图6:下游设备C连接上游设备B后,C需要发送规定格式的注册数据包,上发到上游设备B;上游设备B收到后,回发同样格式的注册数据包,下发到下游设备C。此过程结束后,视为下游设备C向上游设备B的设备注册成功。其中,注册命令数据格式可以参见表1。
表1注册命令数据格式
数据内容 备注
命令id 设备注册命令id,或传输注册命令id
设备名称 该设备的名字,字符串
设备id 该设备本身的id
设备类型 该设备的类型,枚举值
通信id 此次设备注册中,上游设备id
在本实施例中,传输注册的具体实现请参见图6,下游设备C向上游设备B的设备注册成功后,下游设备C向上游设备B发送规定格式的注册数据包(注册命令id区别与设备注册的注册命令id);上游设备B收到后,给下游设备C仅反馈应答数据包;同时,上游设备B向根节点A,转发下游设备C的注册数据包;根节点A收到后,给设备B仅反馈应答数据包。此过程结束后,视为下游设备C向直接上游设备和间接上游设备的传输注册成功。
在第2步中,根据用来注册而推送的心跳包来更新本地APP的升级管理列表。在第3步中,用户可以从中选择自己需要升级的目标设备形成需升级列表,并且一键触发升级。这里需要注意的是,用户从本地APP的升级管理列表中,选择可升级的目标设备,如果该设备已是最新版本的设备,在界面显示灰色,用户无法选择。形成需升级列表后,用户点击一键升级。在第4步中,下载需升级列表中的目标设备对应版本的升级包。
在第5步中,本地APP并行传输目标设备对应的升级包至需升级列表中的目标设备。现有消费级无人机APP升级方案中,APP是逐个升级设备,依次传输和升级,而本申请实施例的方案,本地APP向需升级列表内的目标设备并行发送准备传输命令,然后传输该目标设备的升级包。如果需升级列表里面包括多个目标设备,上述过程是并行的。在本实施例中,发送准备传输命令的具体实现可以参见图7-图11,对于行业级无人机,常用的升级场景可以包 括:场景一、本地APP单独升级一个设备;场景二、本地APP升级全部设备;场景三、本地APP升级全部设备中的某一个叶子设备;场景四、本地APP升级全部设备中的某一个中间设备;场景五、本地APP升级全部设备中的某一群设备。本地APP作为设备树的根节点,向下发送准备传输命令。本申请实施例中的准备传输命令,不同于消费级无人机APP升级方案的准备传输命令,要多两个标志参数,本实施例中的准备传输命令的命令格式可以参见表2。
表2准备传输命令的命令数据格式
数据内容 备注
命令id 传输准备命令id
设备id  
设备本身是否升级flag1 用于标志是否跳过该设备本身的升级
设备的下游设备是否升级flag2 用于标志是否触发该设备的下游设备的升级
场景一、本地APP单独升级某个设备(如图7,该待升级的目标设备包括B设备,B设备为叶子设备,B设备与本地直接连接),准备传输命令的值可以参见表3。
表3场景一的准备传输命令的值
设备id 设备本身是否升级flag1 设备的下游设备是否升级flag2
B yes --
场景二、本地APP升级全部设备(如图8,待升级的目标设备包括B设备、C设备、D设备、E设备以及F设备;B设备和C设备为中间设备,D设备、E设备以及F设备为叶子设备;B设备与本地直接连接,C设备与B设备直接连接,D设备与B设备直接连接;E设备以及F设备分别与C设备直接连接),准备传输命令的值可以参见表4。
表4场景二的准备传输命令的值
设备id 设备本身是否升级flag1 设备的下游设备是否升级flag2
B yes yes
C yes yes
D yes --
E yes --
F yes --
场景三、本地APP升级全部设备中的某一个叶子设备(如图9,待升级的目标设备包括E设备,E设备为与本地间接连接的叶子设备;E设备与本地之间包括中间设备,分别是B设备和C设备),准备传输命令的值可以参见表5。
表5场景三的准备传输命令的值
设备id 设备本身是否升级flag1 设备的下游设备是否升级flag2
B no yes
C no yes
D no --
E yes --
F no --
场景四、本地APP升级全部设备中的某一个中间设备(如图10,待升级的目标设备包括C设备,C设备为与本地间接连接的中间设备;C设备与本地之间包括中间设备B设备),准备传输命令的值可以参见表6。
表6场景四的准备传输命令的值
设备id 设备本身是否升级flag1 设备的下游设备是否升级flag2
B no yes
C yes no
D no --
E -- --
F -- --
场景五、本地APP升级全部设备中的某一群设备(如图11,待升级的目标设备包括C设备、E设备以及F设备,C设备为与本地间接连接的中间设备,E设备和F设备为与本地间接连接的叶子设备;E设备和F设备为与C设备直接连接的下游设备,C设备与本地之间包括中间设备B设备),准备传输命令的值可以参见表7。
表7场景五的准备传输命令的值
设备id 设备本身是否升级flag1 设备的下游设备是否升级flag2
B no yes
C yes yes
D no --
E yes --
F yes --
准备传输命令发送成功后,本地APP向需要升级的目标设备传输升级包;不需要升级的设备仅仅参与中转升级包的过程。由于本地APP和每一个需要升级的目标设备的实际物理链路不一样,所以传输方式也可不一样,这里不赘述。等所有的升级包传输成功结束后,进行第6步:本地APP向直接下游设备发送升级触发命令,该直接下游设备会分别触发需升级列表中的目标设备进 行内部升级,本地APP接收该直接下游设备推送过来的升级进度,直到升级结束。
本申请实施例通过设备注册与传输注册的方式,让需要升级的目标设备成为设备树的一个节点,而本地APP是该设备树的根节点。每插上一种设备(无论是遥控器上的外设,还是飞机上的挂载),本地APP根据该设备的用于注册的心跳包,把该设备加入到升级管理列表内;若该设备被移除,本地APP根据该设备的用于注册的心跳包超时,把该设备从升级管理列表中删除。只要所有接入本申请实施例设备树的设备,满足注册的实现与数据标准,本地APP就能实现该设备的升级,并能够方便地处理该设备的插拔,同时保持升级方案的扩展性。用户触发升级后,本地APP根据用户选择形成的需升级列表,并行向设备树的这些目标设备发送升级指令、并行向这些目标设备传输升级包,所有需升级的目标设备的升级包传输完成后,本地APP同时触发这些目标设备的内部升级。所以用户只需要选择需要升级的目标设备,就能一键升级,同时并行传输替代现有方案中的依次传输升级,能够较大减少多设备情况下的升级时间。
综上所述,通过本申请实施例的方案,本地APP能够很好地满足升级新要求“升级设备数量大、保持扩展性、能够应对设备随时插拔”,从而达到行业级无人机的升级目标:用户可以在多设备中选择自己需要升级的目标设备,进行一键升级。
参见图12,图12是本申请设备升级的装置一实施例的结构示意图,需要说明的是,本实施例的装置能够执行上述设备升级的方法中的步骤,相关内容的详细说明,请参见上述设备升级的方法的相关内容,在此不再赘叙。
所述装置100包括:存储器1、处理器2以及通信电路3,所述存储器1和所述通信电路3分别与所述处理器2连接。
其中,处理器2可以是微控制单元、中央处理单元或数字信号处理器,等等。
其中,存储器1可以是Flash芯片、只读存储器、磁盘、光盘、U盘或者移动硬盘等等。
其中,通信电路3可以用于该装置与外部通信,也可以用于自身与处理器 2的通信、以及存储器1与处理器2之间的通信。
所述存储器1用于存储计算机程序;所述处理器2用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:
根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;根据所述目标设备的当前版本信息,控制所述通信电路下载所述目标设备对应版本的升级包;控制所述通信电路将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:获取所述本地的下游设备的相关升级信息。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:通过心跳包获取所述本地的下游设备的相关升级信息。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:获取所述本地的下游设备的注册命令,所述注册命令是所述本地的下游设备向与所述本地的下游设备直接连接和/或间接连接的上游设备进行注册而发送的;通过所述本地的下游设备的注册命令获取所述本地的下游设备的相关升级信息。
其中,所述注册命令包括设备注册命令和/或传输注册命令,所述设备注册命令是所述本地的下游设备向与所述本地的下游设备直接连接的上游设备进行设备注册而发送的注册命令,所述传输注册命令所述本地的下游设备向与所述本地的下游设备直接连接和间接连接的上游设备进行传输注册而发送的注册命令。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令,以使与所述本地的下游设备直接连接的上游设备获取所述本地的下游 设备的相关升级信息。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:生成预定格式的注册数据包;控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备发送;控制所述与所述本地的下游设备直接连接的上游设备接收所述注册数据包。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,以使所述本地的下游设备中每个设备获取自己所有下游设备的相关升级信息。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:在所述设备注册成功后,控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:生成预定格式的注册数据包;控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送,直到发送至所述本地;控制所述本地向与所述本地直接连接的下游设备返回应答数据包。
其中,所述注册数据包的数据内容包括命令识别码、设备名称、设备识别码、设备类型以及直接连接的上游设备识别码。
其中,所述命令识别码包括设备注册命令识别码或传输注册命令识别码。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:根据检测到的所述用户的升级触发操作和所述目标设备的当前版本信息,控制所述通信电路下载所述目标设备对应版本的升级包。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:控制所述通 信电路向所述目标设备发送准备传输命令。
其中,所述准备传输命令的内容包括设备的身份信息、所述设备本身是否升级、所述设备的下游设备是否升级。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:通知所述通信电路向与所述本地直接连接的下游设备发送升级触发命令;通过与所述本地直接连接的下游设备分别触发所述目标设备,使所述目标设备根据所述目标设备对应版本的升级包进行升级。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:控制所述通信电路接收与所述本地直接连接的下游设备推送的升级进度,直到所述目标设备升级结束。
其中,所述目标设备的数量为两个以上,所述处理器在执行所述计算机程序时,实现如下步骤:控制所述通信电路将两个以上的所述目标设备对应版本的升级包和所述目标设备的身份信息并行向与所述本地直接连接的下游设备传输;根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,所述本地的下游设备中每个设备保存有下游设备的身份信息。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备包括与所述本地直接连接的下游设备,叶子设备向下没有连接的下游设备;控制与所述本地直接连接的下游设备获取对应版本的升级包,并停止转发。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备和与所述本地直接连接的下游设备之间包括中间设备,所述中间设备向下连接有下游设备,叶子设备向下没有连接的下游设备;控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标叶子设备;控制所述目标叶子设备获取对应版本的升级包,并停止转发。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备直接连接,中间设备向下连接有下游设 备;控制与所述本地直接连接的下游设备将所述对应版本的升级包转发至所述目标中间设备;控制所述目标中间设备获取对应版本的升级包。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备之间包括中间设备,中间设备向下连接有下游设备;控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标中间设备;控制所述目标中间设备获取对应版本的升级包。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:若所述目标设备还包括所述目标中间设备的目标下游设备,则控制所述目标中间设备获取对应版本的升级包,并向所述目标中间设备的下游设备转发对应版本的升级包,直到转发至所述目标下游设备;控制所述目标下游设备获取对应版本的升级包。
其中,所述处理器在执行所述计算机程序时,实现如下步骤:若所述目标设备不包括所述目标中间设备的下游设备,则控制所述目标中间设备获取对应版本的升级包,并停止转发。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上任一项所述的设备升级的方法。相关内容的详细说明请参见上述相关内容部分,在此不再赘叙。
其中,该计算机可读存储介质可以是上述设备升级的装置的内部存储单元,例如硬盘或内存。该计算机可读存储介质也可以是外部存储设备,例如配备的插接式硬盘、智能存储卡、安全数字卡、闪存卡,等等。
应当理解,在本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
以上所述,仅为本申请的具体实施例,但本申请的保护范围并不局限于此, 任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (53)

  1. 一种设备升级的方法,其特征在于,所述方法包括:
    根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;
    根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包;
    将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;
    当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
  2. 根据权利要求1所述的方法,其特征在于,所述根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息之前,还包括:
    获取所述本地的下游设备的相关升级信息。
  3. 根据权利要求2所述的方法,其特征在于,所述获取所述本地的下游设备的相关升级信息,包括:
    通过心跳包获取所述本地的下游设备的相关升级信息。
  4. 根据权利要求2所述的方法,其特征在于,所述获取所述本地的下游设备的相关升级信息,包括:
    获取所述本地的下游设备的注册命令,所述注册命令是所述本地的下游设备向与所述本地的下游设备直接连接和/或间接连接的上游设备进行注册而发送的;
    通过所述本地的下游设备的注册命令获取所述本地的下游设备的相关升级信息。
  5. 根据权利要求4所述的方法,其特征在于,所述注册命令包括设备注册命令和/或传输注册命令,所述设备注册命令是所述本地的下游设备向与所述本地的下游设备直接连接的上游设备进行设备注册而发送的注册命令,所述传输注册命令所述本地的下游设备向与所述本地的下游设备直接连接和间接连接的上游设备进行传输注册而发送的注册命令。
  6. 根据权利要求5所述的方法,其特征在于,所述获取所述本地的下游设备的注册命令之前,包括:
    控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令,以使与所述本地的下游设备直接连接的上游设备获取所述本地的下游设备的相关升级信息。
  7. 根据权利要求6所述的方法,其特征在于,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令,包括:
    生成预定格式的注册数据包;
    控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备发送;
    控制所述与所述本地的下游设备直接连接的上游设备接收所述注册数据包。
  8. 根据权利要求6所述的方法,其特征在于,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送设备注册命令,包括:
    以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令。
  9. 根据权利要求5所述的方法,其特征在于,所述获取所述本地的下游设备的注册命令之前,包括:
    控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,以使所述本地的下游设备中每个设备获取自己所有下游设备的相关升级信息。
  10. 根据权利要求9所述的方法,其特征在于,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发 送传输注册命令,包括:
    在所述设备注册成功后,控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
  11. 根据权利要求9所述的方法,其特征在于,所述控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,包括:
    生成预定格式的注册数据包;
    控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送,直到发送至所述本地;
    控制所述本地向与所述本地直接连接的下游设备返回应答数据包。
  12. 根据权利要求7或11所述的方法,其特征在于,所述注册数据包的数据内容包括命令识别码、设备名称、设备识别码、设备类型以及直接连接的上游设备识别码。
  13. 根据权利要求12所述的方法,其特征在于,所述命令识别码包括设备注册命令识别码或传输注册命令识别码。
  14. 根据权利要求9所述的方法,其特征在于,控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令,包括:
    以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
  15. 根据权利要求1所述的方法,其特征在于,所述根据所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包,包括:
    根据检测到的所述用户的升级触发操作和所述目标设备的当前版本信息,下载所述目标设备对应版本的升级包。
  16. 根据权利要求1所述的方法,其特征在于,所述将所述目标设备对应版本的升级包和所述目标设备的身份信息向本地的下游设备传输之前,包括:
    向所述目标设备发送准备传输命令。
  17. 根据权利要求16所述的方法,其特征在于,所述准备传输命令的内容包括设备的身份信息、所述设备本身是否升级、所述设备的下游设备是否升 级。
  18. 根据权利要求1所述的方法,其特征在于,所述控制所述目标设备根据所述目标设备对应版本的升级包进行升级,包括:
    向与所述本地直接连接的下游设备发送升级触发命令;
    通过与所述本地直接连接的下游设备分别触发所述目标设备,使所述目标设备根据所述目标设备对应版本的升级包进行升级。
  19. 根据权利要求18所述的方法,其特征在于,所述方法还包括:
    接收与所述本地直接连接的下游设备推送的升级进度,直到所述目标设备升级结束。
  20. 根据权利要求1所述的方法,其特征在于,所述目标设备的数量为两个以上,所述将所述目标设备对应版本的升级包和所述目标设备的身份信息向本地的下游设备传输,包括:
    将两个以上的所述目标设备对应版本的升级包和所述目标设备的身份信息并行向与所述本地直接连接的下游设备传输;
    根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,所述本地的下游设备中每个设备保存有下游设备的身份信息。
  21. 根据权利要求20所述的方法,其特征在于,所述根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,包括:
    根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备包括与所述本地直接连接的下游设备,叶子设备向下没有连接的下游设备;
    控制与所述本地直接连接的下游设备获取对应版本的升级包,并停止转发。
  22. 根据权利要求20所述的方法,其特征在于,所述根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,包括:
    根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且 所述目标叶子设备和与所述本地直接连接的下游设备之间包括中间设备,所述中间设备向下连接有下游设备,叶子设备向下没有连接的下游设备;
    控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标叶子设备;
    控制所述目标叶子设备获取对应版本的升级包,并停止转发。
  23. 根据权利要求20所述的方法,其特征在于,所述根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,包括:
    根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备直接连接,中间设备向下连接有下游设备;
    控制与所述本地直接连接的下游设备将所述对应版本的升级包转发至所述目标中间设备;
    控制所述目标中间设备获取对应版本的升级包。
  24. 根据权利要求20所述的方法,其特征在于,所述根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,包括:
    根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备之间包括中间设备,中间设备向下连接有下游设备;
    控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标中间设备;
    控制所述目标中间设备获取对应版本的升级包。
  25. 根据权利要求23或24所述的方法,其特征在于,所述控制所述目标中间设备获取对应版本的升级包,还包括:
    若所述目标设备还包括所述目标中间设备的目标下游设备,则控制所述目标中间设备获取对应版本的升级包,并向所述目标中间设备的下游设备转发对应版本的升级包,直到转发至所述目标下游设备;
    控制所述目标下游设备获取对应版本的升级包。
  26. 根据权利要求23或24所述的方法,其特征在于,所述控制所述目标中间设备获取对应版本的升级包,还包括:
    若所述目标设备不包括所述目标中间设备的下游设备,则控制所述目标中间设备获取对应版本的升级包,并停止转发。
  27. 一种设备升级的装置,其特征在于,所述装置包括:存储器、处理器以及通信电路,所述存储器和所述通信电路分别与所述处理器连接;
    所述存储器用于存储计算机程序;
    所述处理器用于执行所述计算机程序并在执行所述计算机程序时,实现如下步骤:
    根据检测到的用户的目标设备选择操作,从本地的下游设备的相关升级信息中获取待升级的目标设备的相关升级信息,所述相关升级信息包括设备的身份信息和设备的当前版本信息,所述本地的下游设备包括与本地直接连接的设备和/或间接连接的设备;
    根据所述目标设备的当前版本信息,控制所述通信电路下载所述目标设备对应版本的升级包;
    控制所述通信电路将所述目标设备对应版本的升级包和所述目标设备的身份信息向所述本地的下游设备传输,使所述本地的下游设备根据所述目标设备的身份信息将所述目标设备对应版本的升级包传输至所述目标设备,使所述目标设备获取对应版本的升级包;
    当所述目标设备获取到对应版本的升级包后,控制所述目标设备根据所述目标设备对应版本的升级包进行升级。
  28. 根据权利要求27所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    获取所述本地的下游设备的相关升级信息。
  29. 根据权利要求28所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    通过心跳包获取所述本地的下游设备的相关升级信息。
  30. 根据权利要求28所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    获取所述本地的下游设备的注册命令,所述注册命令是所述本地的下游设备向与所述本地的下游设备直接连接和/或间接连接的上游设备进行注册而发送的;
    通过所述本地的下游设备的注册命令获取所述本地的下游设备的相关升级信息。
  31. 根据权利要求30所述的装置,其特征在于,所述注册命令包括设备注册命令和/或传输注册命令,所述设备注册命令是所述本地的下游设备向与所述本地的下游设备直接连接的上游设备进行设备注册而发送的注册命令,所述传输注册命令所述本地的下游设备向与所述本地的下游设备直接连接和间接连接的上游设备进行传输注册而发送的注册命令。
  32. 根据权利要求31所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令,以使与所述本地的下游设备直接连接的上游设备获取所述本地的下游设备的相关升级信息。
  33. 根据权利要求32所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    生成预定格式的注册数据包;
    控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备发送;
    控制所述与所述本地的下游设备直接连接的上游设备接收所述注册数据包。
  34. 根据权利要求32所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备发送所述设备注册命令。
  35. 根据权利要求31所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备 和间接连接的上游设备发送传输注册命令,以使所述本地的下游设备中每个设备获取自己所有下游设备的相关升级信息。
  36. 根据权利要求35所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    在所述设备注册成功后,控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
  37. 根据权利要求35所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    生成预定格式的注册数据包;
    控制所述本地的下游设备将所述注册数据包向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送,直到发送至所述本地;
    控制所述本地向与所述本地直接连接的下游设备返回应答数据包。
  38. 根据权利要求33或37所述的装置,其特征在于,所述注册数据包的数据内容包括命令识别码、设备名称、设备识别码、设备类型以及直接连接的上游设备识别码。
  39. 根据权利要求38所述的装置,其特征在于,所述命令识别码包括设备注册命令识别码或传输注册命令识别码。
  40. 根据权利要求35所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    以预定时间间隔控制所述本地的下游设备向与所述本地的下游设备直接连接的上游设备和间接连接的上游设备发送传输注册命令。
  41. 根据权利要求27所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    根据检测到的所述用户的升级触发操作和所述目标设备的当前版本信息,控制所述通信电路下载所述目标设备对应版本的升级包。
  42. 根据权利要求27所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    控制所述通信电路向所述目标设备发送准备传输命令。
  43. 根据权利要求42所述的装置,其特征在于,所述准备传输命令的内 容包括设备的身份信息、所述设备本身是否升级、所述设备的下游设备是否升级。
  44. 根据权利要求27所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    通知所述通信电路向与所述本地直接连接的下游设备发送升级触发命令;
    通过与所述本地直接连接的下游设备分别触发所述目标设备,使所述目标设备根据所述目标设备对应版本的升级包进行升级。
  45. 根据权利要求44所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    控制所述通信电路接收与所述本地直接连接的下游设备推送的升级进度,直到所述目标设备升级结束。
  46. 根据权利要求27所述的装置,其特征在于,所述目标设备的数量为两个以上,所述处理器在执行所述计算机程序时,实现如下步骤:
    控制所述通信电路将两个以上的所述目标设备对应版本的升级包和所述目标设备的身份信息并行向与所述本地直接连接的下游设备传输;
    根据所述目标设备的身份信息,控制与所述本地直接连接的下游设备执行匹配的操作,以使所述目标设备获取对应版本的升级包,所述本地的下游设备中每个设备保存有下游设备的身份信息。
  47. 根据权利要求46所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备包括与所述本地直接连接的下游设备,叶子设备向下没有连接的下游设备;
    控制与所述本地直接连接的下游设备获取对应版本的升级包,并停止转发。
  48. 根据权利要求46所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    根据所述目标设备的身份信息,确定所述目标设备包括目标叶子设备,且所述目标叶子设备和与所述本地直接连接的下游设备之间包括中间设备,所述 中间设备向下连接有下游设备,叶子设备向下没有连接的下游设备;
    控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标叶子设备;
    控制所述目标叶子设备获取对应版本的升级包,并停止转发。
  49. 根据权利要求46所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备直接连接,中间设备向下连接有下游设备;
    控制与所述本地直接连接的下游设备将所述对应版本的升级包转发至所述目标中间设备;
    控制所述目标中间设备获取对应版本的升级包。
  50. 根据权利要求46所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    根据所述目标设备的身份信息,确定所述目标设备包括目标中间设备,且所述目标中间设备和与所述本地直接连接的下游设备之间包括中间设备,中间设备向下连接有下游设备;
    控制与所述本地直接连接的下游设备和所述中间设备将所述对应版本的升级包转发至所述目标中间设备;
    控制所述目标中间设备获取对应版本的升级包。
  51. 根据权利要求49或50所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    若所述目标设备还包括所述目标中间设备的目标下游设备,则控制所述目标中间设备获取对应版本的升级包,并向所述目标中间设备的下游设备转发对应版本的升级包,直到转发至所述目标下游设备;
    控制所述目标下游设备获取对应版本的升级包。
  52. 根据权利要求49或50所述的装置,其特征在于,所述处理器在执行所述计算机程序时,实现如下步骤:
    若所述目标设备不包括所述目标中间设备的下游设备,则控制所述目标中 间设备获取对应版本的升级包,并停止转发。
  53. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如权利要求1-26任一项所述的设备升级的方法。
PCT/CN2020/084052 2020-04-09 2020-04-09 设备升级的方法、装置及存储介质 WO2021203384A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080005231.5A CN112771497A (zh) 2020-04-09 2020-04-09 设备升级的方法、装置及存储介质
PCT/CN2020/084052 WO2021203384A1 (zh) 2020-04-09 2020-04-09 设备升级的方法、装置及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/084052 WO2021203384A1 (zh) 2020-04-09 2020-04-09 设备升级的方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2021203384A1 true WO2021203384A1 (zh) 2021-10-14

Family

ID=75699516

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084052 WO2021203384A1 (zh) 2020-04-09 2020-04-09 设备升级的方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN112771497A (zh)
WO (1) WO2021203384A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461240B (zh) * 2021-06-30 2023-04-14 荣耀终端有限公司 软件升级方法、软件升级***及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083537A (zh) * 2006-05-31 2007-12-05 华为技术有限公司 一种实现设备管理的方法、装置和***
CN102937904A (zh) * 2012-10-24 2013-02-20 华为技术有限公司 一种多节点固件升级方法和装置
US20130219030A1 (en) * 2012-02-21 2013-08-22 F5 Networks, Inc. In service upgrades for a hypervisor or hardware manager hosting virtual traffic managers
CN106775841A (zh) * 2016-11-29 2017-05-31 广州广电运通金融电子股份有限公司 插件升级的方法、***及装置
CN107465539A (zh) * 2017-07-25 2017-12-12 北京康得新创科技股份有限公司 固件的升级方法、终端及固件的升级***
CN110768817A (zh) * 2018-07-27 2020-02-07 视联动力信息技术股份有限公司 视联网终端的升级方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083537A (zh) * 2006-05-31 2007-12-05 华为技术有限公司 一种实现设备管理的方法、装置和***
US20130219030A1 (en) * 2012-02-21 2013-08-22 F5 Networks, Inc. In service upgrades for a hypervisor or hardware manager hosting virtual traffic managers
CN102937904A (zh) * 2012-10-24 2013-02-20 华为技术有限公司 一种多节点固件升级方法和装置
CN106775841A (zh) * 2016-11-29 2017-05-31 广州广电运通金融电子股份有限公司 插件升级的方法、***及装置
CN107465539A (zh) * 2017-07-25 2017-12-12 北京康得新创科技股份有限公司 固件的升级方法、终端及固件的升级***
CN110768817A (zh) * 2018-07-27 2020-02-07 视联动力信息技术股份有限公司 视联网终端的升级方法和装置

Also Published As

Publication number Publication date
CN112771497A (zh) 2021-05-07

Similar Documents

Publication Publication Date Title
JP6566500B2 (ja) 端末システムをアップグレードする方法、端末、およびシステム
KR101481443B1 (ko) 통신 네트워크의 디바이스 관리 방법 및 시스템
CN111324363A (zh) 设备升级方法及升级终端、设备和存储介质
CN110839235B (zh) 一种终端升级方法、装置、设备及计算机可读介质
CN103580921A (zh) 一种网络设备自动升级的方法及自动升级***
CN111142905B (zh) 一种ota升级方法、ota服务器及ota升级***
US10469620B2 (en) Method for transferring a new software version to at least one electricity meter via a communication network
US11876676B2 (en) Network node firmware update
WO2021203384A1 (zh) 设备升级的方法、装置及存储介质
CN108153561B (zh) 一种dsp与fpga的以太网加载方法及信号处理***
WO2021223247A1 (zh) 一种设备升级方法、智能设备及计算机可读存储介质
CN110362323A (zh) 基于分布式自组网的嵌入式终端设备程序更新方法
WO2023151372A1 (zh) 模块升级方法和***
CN110661850A (zh) 一种边缘计算方法、***、计算机设备和存储介质
JP2002215476A (ja) ネットワークに接続されたホストコンピュータの死活監視方法、死活監視システム、及びプログラム
CN110750327A (zh) 虚拟网络功能的管理方法及***、代理装置、存储介质
CN113950118B (zh) 基于Mesh的软件升级方法
WO2010124567A1 (zh) 大对象传输方法、服务器
CN109688000B (zh) 一种同时接入多个iptv网管服务器平台的方法
CN114978906B (zh) 基于局域网的智能设备固件升级方法及存储介质
KR102054144B1 (ko) IoT 서비스에서 단말을 제어하기 위한 방법 및 장치
WO2014113960A1 (zh) 近场通信射频发现控制方法、装置和终端设备
US11507582B2 (en) Event-driven internet of things (IoT) abstraction using rules
CN110830275A (zh) 一种转发器配置方法、装置、设备及可读存储介质
KR20130049137A (ko) Tr-069 프로토콜을 이용한 사용자 단말 장치 동시 제어 방법, 장치 및 시스템

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: 20930403

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: 20930403

Country of ref document: EP

Kind code of ref document: A1