Device upgrade method, device, computer readable medium and device
By periodically sending version information and receiving upgrade firmware information packets through the gateway device, parsing and prioritizing upgrades, the problem of low upgrade efficiency of the gateway device and its sub-devices is solved, and an efficient upgrade process is achieved.
Patent Information
- Application Number
- CN201910763428.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-19
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2039-08-19
AI Technical Summary
In existing technologies, upgrading gateway devices and their sub-devices is inefficient due to the large number of sub-devices or network issues, and requires repeated downloading of upgrade firmware, which wastes time.
The gateway device periodically sends the current version information to the server, receives and stores the upgrade firmware information packet, parses and executes the upgrade operation to avoid duplicate downloads and prioritizes upgrades.
It improves the upgrade efficiency of gateway devices and their sub-devices, reduces repeated downloads of upgrade firmware, and saves bandwidth consumption.
Smart Images

Figure CN112394966B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and more specifically, to a device upgrading method, apparatus, computer-readable medium and device. Background Art
[0002] With the development of network technology, the IoT gateway is a bridge connecting the wide area network and the local area network. At the same time, the gateway also manages sub-devices, and each sub-device forms its own local area network. Due to the differences in functions and responsibilities of each sub-device, the firmware versions of the sub-devices are different.
[0003] Currently, when a gateway device and its sub-devices need to be upgraded, the upgrade firmware is downloaded one by one by the gateway device for upgrade. If the number of sub-devices is large or the upgrade of a sub-device fails due to network reasons, the gateway device will re-download the upgrade firmware during the next upgrade, which takes too much time to download the upgrade firmware, resulting in low upgrade efficiency of the gateway and its sub-devices. Summary of the invention
[0004] In view of this, the present application provides a device upgrade method, apparatus, computer-readable medium and device. When a gateway device and its sub-devices meet the upgrade conditions, the gateway device and its sub-devices are upgraded to avoid repeated downloading of upgrade firmware, thereby achieving the purpose of improving the upgrade efficiency of the gateway device and its sub-devices.
[0005] In order to achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, the present application discloses a device upgrade method, which is applied to a gateway device. The method comprises:
[0007] Periodically send the current version information of the gateway device and its sub-devices to the server;
[0008] In response to receiving prompt information returned by the server for prompting downloading of an upgrade firmware information package, based on the prompt information, downloading and storing the upgrade firmware information package, the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information;
[0009] Parse the upgrade firmware information package to obtain the upgrade firmware, and perform corresponding upgrade operations based on the upgrade firmware.
[0010] In some embodiments, after parsing the upgrade firmware information package to obtain the upgrade firmware and performing corresponding upgrade operations based on the upgrade firmware, the method further includes:
[0011] If the upgrade operation related to the firmware upgrade fails, the number of upgrade failures related to the firmware upgrade is recorded;
[0012] If the number of upgrade failures reaches the preset number, the upgrade firmware will be deleted.
[0013] In some embodiments, parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware include:
[0014] Parse the upgrade firmware information package to obtain the gateway upgrade firmware;
[0015] Based on the gateway upgrade firmware, updating the current firmware version of the gateway device to the first target firmware version;
[0016] Delete the gateway upgrade firmware.
[0017] In some embodiments, parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware include:
[0018] Parse the upgrade firmware information package to obtain the upgrade firmware of the sub-device;
[0019] Based on the sub-device firmware upgrade, updating the current firmware version of the sub-device to a second target firmware version;
[0020] Delete the sub-device to upgrade the firmware.
[0021] In some embodiments, the gateway device includes a coordinator, and while periodically sending the current version information of the gateway device and its sub-devices to the server, the current version information of the coordinator is also sent; and
[0022] If the firmware upgrade information package also includes the coordinator firmware upgrade, after deleting the gateway firmware upgrade, the method further includes:
[0023] Sending the coordinator upgrade firmware to the coordinator, so that the coordinator updates the current firmware version of the coordinator to the third target firmware version based on the coordinator upgrade firmware;
[0024] Delete the coordinator to upgrade the firmware.
[0025] In some embodiments, the gateway device includes a coordinator; and
[0026] Based on the sub-device firmware upgrade, the current firmware version of the sub-device is updated to the second target firmware version, including:
[0027] The sub-device upgrade firmware is sent to the coordinator, so that the coordinator sends the sub-device upgrade firmware to the sub-device, so that the sub-device updates the current firmware version to the second target firmware version based on the sub-device upgrade firmware.
[0028] The second aspect of the present application discloses a device upgrade apparatus, which is applied to a gateway device, and the device includes:
[0029] A sending unit, used to periodically send the current version information of the gateway device and its sub-devices to the server;
[0030] a storage unit, configured to, in response to receiving a prompt message returned by the server for prompting download of an upgrade firmware information package, download and store the upgrade firmware information package based on the prompt message, wherein the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information;
[0031] The upgrade unit is used to parse the upgrade firmware information package, obtain the upgrade firmware, and perform corresponding upgrade operations based on the upgrade firmware.
[0032] In some embodiments, the above apparatus further comprises:
[0033] A recording unit, for recording the number of upgrade failures related to the firmware upgrade if the upgrade operation related to the firmware upgrade fails to be performed;
[0034] The deletion unit is used to delete the upgrade firmware if the number of upgrade failures reaches a preset number.
[0035] A third aspect of the present application discloses a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner in the first aspect is implemented.
[0036] A fourth aspect of the present application discloses a processor, which is used to run a program, wherein the program, when running, executes the method described in any implementation manner in the first aspect.
[0037] The fifth aspect of the present application discloses a device, which includes: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation method in the first aspect.
[0038] Through the above technical solution, it can be known that the present application discloses a device upgrade method, apparatus, computer-readable medium and device that can periodically send the current version information of the gateway device and its sub-devices to the server, and in response to receiving the prompt information returned by the server for prompting the download of the upgrade firmware information package, based on the prompt information, download and store the upgrade firmware information package, the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information, parse the upgrade firmware information package, obtain the upgrade firmware, and perform the corresponding upgrade operation based on the upgrade firmware. Through the above technical solution, after downloading the upgrade firmware information package, the upgrade firmware is parsed to obtain the upgrade firmware. When the gateway device and its sub-devices meet the upgrade conditions, the gateway device and its sub-devices are upgraded to avoid repeated downloading of the upgrade firmware, thereby improving the upgrade efficiency of the gateway device and its sub-devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the present application can also be applied to other similar scenarios based on the provided drawings. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0040] Figure 1 A schematic diagram of a process flow of a device upgrade method disclosed in an embodiment of the present application;
[0041] Figure 2 A flowchart of parsing an upgrade firmware information package disclosed in an embodiment of the present application, obtaining a gateway upgrade firmware, and performing corresponding upgrade operations based on the gateway upgrade firmware;
[0042] Figure 3 A flowchart of another method disclosed in an embodiment of the present application for parsing an upgrade firmware information package, obtaining a sub-device upgrade firmware, and performing a corresponding upgrade operation based on the sub-device upgrade firmware;
[0043] Figure 4 A schematic diagram of the structure of a device upgrading apparatus disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The present application will be further described in detail below in conjunction with the accompanying drawings and examples. It will be understood that the specific embodiments described herein are only used to explain the relevant inventions, rather than to limit the invention. The described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0045] It should be noted that, for the convenience of description, only the parts related to the relevant invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.
[0046] It should be understood that the "system", "device", "unit" and / or "module" used in this application is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.
[0047] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The elements defined by the sentence "includes a..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
[0048] Flowcharts are used in this application to illustrate the operations performed by the apparatus according to the embodiments of the application. It should be understood that the preceding or following operations are not necessarily performed precisely in order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0049] From the background technology, it can be seen that in the prior art, when a gateway device and its sub-devices need to be upgraded, the upgrade firmware is downloaded one by one by the gateway device for upgrade. If the number of sub-devices is large or the upgrade of a sub-device fails due to network reasons, the gateway device will re-download the upgrade firmware during the next upgrade, which takes too much time in the process of downloading the upgrade firmware, resulting in low upgrade efficiency of the gateway and its sub-devices.
[0050] Therefore, the present application discloses a device upgrade method, apparatus, computer-readable medium and device, which upgrade a gateway device and its sub-devices simultaneously when they meet the upgrade conditions, thereby achieving the purpose of improving the upgrade efficiency of the gateway device and its sub-devices.
[0051] like Figure 1 FIG. 1 is a flow chart of a device upgrade method disclosed in an embodiment of the present application, which specifically includes the following steps:
[0052] Step S101: regularly sending the current version information of the gateway device and its sub-devices to the server.
[0053] In the specific implementation of step S101 , the gateway device checks the version information based on a preset time, and sends the current version information of the gateway device and its sub-devices to the server.
[0054] It should be noted that the current version information of the gateway device and its sub-devices may be sent to the server at regular intervals of 6 minutes, 10 minutes, or one day, etc. The time for sending the current version information of the gateway device and its sub-devices to the server is set by the technical staff according to the actual situation.
[0055] A coordinator is set in the gateway device. The coordinator selects a channel and a personal area network address (PAN ID) to establish and start the entire network.
[0056] Step S102: In response to receiving the prompt information returned by the server for prompting to download the upgrade firmware information package, based on the prompt information, download and store the upgrade firmware information package, which is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information.
[0057] In the specific implementation of step S102, the server performs version matching after receiving the version request information sent by the gateway device. The server sends a prompt message to the gateway device to download the upgrade firmware information package according to the upgrade strategy, and the gateway device downloads the upgrade firmware information package based on the prompt message.
[0058] It should be noted that after the gateway device downloads the upgrade firmware information package, it stores the upgrade firmware information package in the solid-state memory flash of the gateway device.
[0059] Step S103: parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware.
[0060] In the specific implementation of step S103, the upgrade firmware information package is parsed to obtain the upgrade firmware, and the upgrade firmware information package includes verification information, each upgrade firmware package type, upgrade firmware package version number, upgrade firmware package length, upgrade priority and other information.
[0061] It should be noted that the upgrade priorities of the corresponding gateway devices, sub-devices and coordinators are determined based on the upgrade priority, and the gateway devices, sub-devices and coordinators are upgraded in descending order according to their upgrade priorities.
[0062] Upgrading firmware may include at least one of the following: upgrading firmware of a gateway, upgrading firmware of a sub-device, and upgrading firmware of a coordinator.
[0063] The gateway device performs an upgrade operation based on the gateway upgrade firmware. When the gateway device is successfully upgraded, the gateway device restarts.
[0064] Gateway device upgrades can be divided into app upgrades and Linux kernel upgrades. If the gateway device is under the Linux operating system, the gateway device upgrade will involve Linux kernel upgrades and app upgrades. If the gateway device is under a real-time operating system RTOS or a single-chip microcomputer without an operating system, only the app will be upgraded.
[0065] The sub-device performs an upgrade operation based on the sub-device upgrade firmware.
[0066] The number of sub-devices can be one or more.
[0067] When the upgrade priorities of the gateway device, sub-device and coordinator are the same, they are not limited to the order. When there are corresponding upgrade firmwares, the gateway device, the sub-device or the coordinator can be upgraded.
[0068] The coordinator receives the coordinator upgrade firmware based on the universal asynchronous receive / transmit transmission (UART) serial port, and the coordinator performs the upgrade operation.
[0069] The embodiment of the present application discloses a device upgrade method. The method is applied to a gateway device, and a specific implementation of the method includes: regularly sending the current version information of the gateway device and its sub-devices to the server, responding to the prompt information returned by the server for prompting the download of the upgrade firmware information package, downloading and storing the upgrade firmware information package based on the prompt information, the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information, parsing the upgrade firmware information package to obtain the upgrade firmware, and performing the corresponding upgrade operation based on the upgrade firmware. Through the above technical solution, the upgrade firmware information package is downloaded and parsed to obtain the upgrade firmware. When the gateway device and its sub-devices meet the upgrade conditions, the gateway device and its sub-devices are upgraded to avoid repeated downloading of the upgrade firmware, thereby improving the upgrade efficiency of the gateway device and its sub-devices.
[0070] The above step S103 involves parsing the upgrade firmware information package, obtaining the gateway upgrade firmware, and performing corresponding upgrade operations based on the gateway upgrade firmware, such as Figure 2 As shown, the specific steps include:
[0071] Step S201: Parse the upgrade firmware information package to obtain the gateway upgrade firmware.
[0072] Step S202: Based on the gateway upgrade firmware, the current firmware version of the gateway device is updated to the first target firmware version.
[0073] In the specific implementation of step S202 , the gateway device installs the installation package of the gateway upgrade firmware based on the gateway upgrade firmware obtained by parsing the upgrade firmware information package, so that the current firmware version of the gateway device is updated to the first target firmware version.
[0074] It should be noted that the first target firmware version is the latest upgraded firmware version of the current gateway device.
[0075] If the gateway device upgrade fails, the gateway upgrade firmware is saved in the flash of the gateway device, and the server periodically sends the gateway upgrade firmware to the gateway device for upgrading.
[0076] The server regularly sends the gateway upgrade firmware to the gateway device for upgrading at an interval of 7 minutes, 9 minutes, or one day. The server regularly sends the gateway upgrade firmware to the gateway device for upgrading at an interval of 7 minutes, 9 minutes, or one day. The technical staff can set the time according to the actual situation.
[0077] Based on the process of upgrading the current firmware version of the gateway device to the first target firmware version in the above step S202, an example is given here to illustrate:
[0078] The first target firmware version of the gateway upgrade firmware is 2.0, and the current firmware version of the gateway device is 1.0. If the current firmware version of the gateway device is inconsistent with the first target firmware version, the current firmware version 1.0 of the gateway device is updated to the first target firmware version 2.0, wherein the first target firmware version 2.0 is the latest firmware version of the gateway device.
[0079] Step S203: Delete the gateway upgrade firmware.
[0080] By executing the above steps S201 to S203 to parse the upgrade firmware information package, the gateway upgrade firmware is obtained, and based on the gateway upgrade firmware, the current firmware version of the gateway device is updated to the first target firmware version, and the gateway upgrade firmware is deleted.
[0081] In the embodiment of the present application, the gateway upgrade firmware is obtained by parsing the upgrade firmware information package, thereby achieving the purpose of updating the current firmware version of the gateway device to the first target firmware version based on the gateway upgrade firmware.
[0082] Optionally, the gateway device includes a coordinator, and the gateway device sends the current version information of the coordinator to the server while periodically sending the current version information of the gateway device and its sub-devices to the server. If the upgrade firmware information package also includes the coordinator upgrade firmware, after deleting the gateway upgrade firmware, the gateway device can also send the coordinator upgrade firmware to the coordinator, so that the coordinator, based on the coordinator upgrade firmware, sets the current firmware version of the coordinator to the third target firmware version, and deletes the coordinator upgrade firmware.
[0083] It should be noted that the third target firmware version is the latest upgraded firmware version of the current coordinator.
[0084] If the coordinator upgrade fails, the coordinator upgrade firmware is saved in the flash of the gateway device, and the coordinator upgrade firmware is sent to the coordinator regularly for upgrading.
[0085] The gateway device periodically sends the coordinator upgrade firmware to the coordinator for upgrade, which can be sent at intervals of 5 minutes, 12 minutes, or one day, etc. The gateway device periodically sends the coordinator upgrade firmware to the coordinator for upgrade. The time setting is set by the technical staff according to the actual situation.
[0086] In an embodiment of the present application, the gateway device sends the coordinator upgrade firmware to the coordinator, thereby achieving the purpose of updating the current firmware version of the coordinator to the third target firmware version based on the coordinator upgrade firmware.
[0087] The above step S103 involves parsing the upgrade firmware information package, obtaining the sub-device upgrade firmware, and performing corresponding upgrade operations based on the sub-device upgrade firmware, such as Figure 3 As shown, the specific steps include:
[0088] Step S301: Parse the upgrade firmware information package to obtain the upgrade firmware of the sub-device.
[0089] Step S302: based on the firmware upgrade of the sub-device, the current firmware version of the sub-device is updated to a second target firmware version.
[0090] During the execution of step S302, the sub-device installs the installation package of the sub-device upgrade firmware based on the sub-device upgrade firmware obtained by parsing the upgrade firmware information package, so that the current firmware version of the sub-device is updated to the second target firmware version.
[0091] It should be noted that the second target firmware version is the latest upgraded firmware version of the current sub-device.
[0092] If the sub-device upgrade fails, the sub-device upgrade firmware is saved in the flash of the gateway device, and the gateway device periodically sends the sub-device upgrade firmware to the sub-device for upgrading.
[0093] The gateway device periodically sends sub-device upgrade firmware to the sub-device for upgrading, which can be sent at intervals of 10 minutes, 15 minutes, or one day. The gateway device periodically sends sub-device upgrade firmware to the sub-device for upgrading at a time set by the technical staff according to the actual situation.
[0094] Based on the process of upgrading the firmware of the sub-device in step S302, the current firmware version of the sub-device is updated to the second target firmware version, which is described by way of example:
[0095] The second target firmware version of the sub-device firmware upgrade is 3.1, and the current firmware version of the sub-device is 3.0. If the current firmware version of the sub-device is inconsistent with the second target firmware version, the current firmware version 3.0 of the sub-device is updated to the second target firmware version 3.1, wherein the second target firmware version 3.1 is the latest firmware version of the sub-device.
[0096] Optionally, the gateway device includes a coordinator. The gateway device may send the sub-device upgrade firmware to the coordinator, so that the coordinator sends the sub-device upgrade firmware to the sub-device, so that the sub-device updates the current firmware version to the second target firmware version based on the sub-device upgrade firmware.
[0097] Step S303: Delete the sub-device upgrade firmware.
[0098] By executing steps S301 to S303 to parse the upgrade firmware information package, the upgrade firmware of the sub-device is obtained, and based on the upgrade firmware of the sub-device, the current firmware version of the sub-device is updated to the second target firmware version, and the upgrade firmware of the sub-device is deleted.
[0099] In the embodiment of the present application, the upgrade firmware of the sub-device is obtained by parsing the upgrade firmware information package, so as to achieve the purpose of updating the current firmware version of the sub-device to the second target firmware version based on the sub-device upgrade firmware.
[0100] Optionally, after parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware, if the upgrade operation related to the upgrade firmware fails, the gateway device can record the number of upgrade failures related to the upgrade firmware. If the number of upgrade failures reaches a preset number, the upgrade firmware will be deleted.
[0101] It should be noted that if the number of upgrade failures related to the upgrade firmware does not reach the preset number, the gateway device can continue to perform the corresponding upgrade operation based on the upgrade firmware. Specifically, if the number of upgrade failures related to the upgrade firmware does not reach the preset number, the gateway device can continue to perform the corresponding upgrade operation based on the upgrade firmware after a preset time interval.
[0102] The preset number of times can be 3 times a day, 5 times a day, or other times. The specific preset number of times is determined by the technical staff according to the data situation.
[0103] In an embodiment of the present application, after parsing the upgrade firmware information package to obtain the upgrade firmware, and performing the corresponding upgrade operation based on the upgrade firmware, if the upgrade operation related to the upgrade firmware fails, the number of upgrade failures related to the upgrade firmware is recorded. When the number of upgrade failures reaches a preset number, the upgrade firmware is deleted. When the number of upgrade failures does not reach the preset number, the corresponding upgrade operation continues to be performed based on the upgrade firmware, thereby avoiding repeated downloading of the upgrade firmware information package. For gateway devices with limited traffic, the purpose of saving traffic consumption caused by the upgrade of gateway devices and sub-devices is achieved.
[0104] The following is an example of the generation process of the upgrade firmware information package:
[0105] The server may store the latest firmware version information corresponding to the gateway device and the sub-device of the gateway device, respectively. After receiving the current version information of the gateway device and the sub-device, the server may determine whether there is a device to be upgraded in the gateway device and the sub-device by verifying whether the current version information of the gateway device and the sub-device is lower than the latest firmware version information corresponding to the gateway device and the sub-device, respectively. Among them, the device to be upgraded is a device whose current version information is lower than the corresponding latest firmware version information. After determining that there is a device to be upgraded in the gateway device and the sub-device, the server may use the latest firmware version indicated by the latest firmware version information corresponding to the device to be upgraded as the upgrade firmware. Afterwards, the server may obtain the determined upgrade firmware from the local or connected device, and based on the configuration information related to the firmware upgrade, package the determined upgrade firmware to generate an upgrade firmware information package.
[0106] In the embodiment of the present application, the server verifies whether the current version information of the gateway device and / or the current version information of its sub-device is lower than the corresponding latest firmware version information, and determines whether the gateway device needs to download the upgrade firmware information package, thereby avoiding repeated downloading of the upgrade firmware information package. For gateway devices with limited traffic, the traffic consumption caused by the upgrade of the gateway device and sub-devices is saved.
[0107] Optionally, after receiving the current version information sent by the gateway device (e.g., the current version information of the gateway device, the sub-device of the gateway device, and / or the coordinator), if the server determines that there is no device to be upgraded among the devices corresponding to the received current version information, it sends a prompt message to the gateway device to indicate that there is no firmware update. In response to receiving the prompt message, the gateway device may not download the upgrade firmware information package, thereby avoiding downloading useless upgrade firmware information packages to save traffic consumption.
[0108] Based on the specific implementation process of the above device upgrade method, here is an example to illustrate:
[0109] The gateway device sends the current version information of the gateway device and the current version information of the sub-device to the server. The server matches the firmware versions based on the current version information of the gateway device and the current version information of the sub-device. The server matches the upgrade firmware information package. The server sends a prompt message to the gateway device to download the upgrade firmware. The gateway device downloads the upgrade firmware information package and stores it in the flash of the gateway device. The gateway device parses the upgrade firmware information package to obtain the gateway target firmware version 2.1 and the sub-device target firmware version 3.2. The gateway device is upgraded based on the gateway target firmware version 2.1. The current firmware version of the gateway device is upgraded from 2.0 to 2.1. The gateway device is upgraded successfully. The gateway upgrade firmware in the flash of the gateway device is deleted. The sub-device is upgraded based on the sub-device target firmware version 3.2. The current firmware version of the sub-device is upgraded from 3.1 to 3.2. The sub-device is upgraded successfully. The sub-device upgrade firmware in the flash of the gateway device is deleted.
[0110] Based on the device upgrade method disclosed in the above embodiment of the present application, the embodiment of the present application correspondingly discloses a device upgrade apparatus 400, which can be applied to a gateway device. Figure 4 As shown, the device upgrading apparatus 400 specifically includes:
[0111] The sending unit 401 is used to periodically send the current version information of the gateway device and its sub-devices to the server.
[0112] The storage unit 402 is used to respond to the prompt information returned by the server for prompting the download of the upgrade firmware information package, and download and store the upgrade firmware information package based on the prompt information. The upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the above current version information.
[0113] The upgrading unit 403 is used to parse the upgrading firmware information package, obtain the upgrading firmware, and perform corresponding upgrading operations based on the upgrading firmware.
[0114] Furthermore, the upgrading unit 403 includes:
[0115] The parsing module is used to parse the upgrade firmware information package to obtain the gateway upgrade firmware.
[0116] The first upgrade module is used to upgrade the firmware of the gateway device to update the current firmware version of the gateway device to a first target firmware version based on the gateway upgrade firmware.
[0117] The first deletion module is used to delete the gateway upgrade firmware. Optionally, the parsing module is also used to parse the upgrade firmware information package to obtain the sub-device upgrade firmware; and the upgrade unit 403 includes: a second upgrade module, used to update the current firmware version of the sub-device to the second target firmware version based on the sub-device upgrade firmware; and a second deletion module, used to delete the sub-device upgrade firmware.
[0118] Optionally, the device upgrading apparatus 400 further includes:
[0119] The recording unit is used to record the number of upgrade failures related to the firmware upgrade if the upgrade operation related to the firmware upgrade fails.
[0120] The deletion unit is used to delete the upgrade firmware if the number of upgrade failures reaches a preset number.
[0121] Furthermore, the gateway device may include a coordinator. The second upgrade module includes:
[0122] The update submodule is used to send the sub-device upgrade firmware to the coordinator, so that the coordinator sends the sub-device upgrade firmware to the sub-device, so that the sub-device updates the current firmware version to the second target firmware version based on the sub-device upgrade firmware.
[0123] Optionally, the parsing module is further used to parse the upgrade firmware information package to obtain the coordinator upgrade firmware; and the upgrade unit 403 includes:
[0124] The third upgrading module is used to send the coordinator upgrading firmware to the coordinator, so that the coordinator updates the current firmware version of the coordinator to a third target firmware version based on the coordinator upgrading firmware.
[0125] The third deletion module is used to delete the coordinator upgrade firmware.
[0126] It should be noted that the device upgrade apparatus 400 may include a processor and a memory, and the sending unit 401, the storage unit 402 and the upgrade unit 403 are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.
[0127] The processor may include a kernel, which retrieves the corresponding program unit from the memory. One or more kernels may be set, and the upgrade efficiency of the gateway device and its sub-devices may be improved by adjusting kernel parameters.
[0128] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0129] The embodiment of the present application discloses a device upgrade apparatus. The device is applied to a gateway device, and a specific implementation of the device includes: regularly sending the current version information of the gateway device and its sub-devices to the server, responding to the prompt information returned by the server for prompting the download of the upgrade firmware information package, downloading and storing the upgrade firmware information package based on the prompt information, the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information, parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware. Through the above technical solution, the upgrade firmware information package is downloaded and parsed to obtain the upgrade firmware. When the gateway device and its sub-devices meet the upgrade conditions, the gateway device and its sub-devices are upgraded to avoid repeated downloading of the upgrade firmware, thereby improving the upgrade efficiency of the gateway device and its sub-devices.
[0130] The specific principles and execution processes of each unit and module in the device upgrade device disclosed in the above embodiment of the present application are the same as those of the device upgrade method disclosed in the above embodiment of the present application. Please refer to the corresponding parts of the device upgrade method disclosed in the above embodiment of the present application, and no further details will be given here.
[0131] An embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the device upgrade method provided by the above method embodiments.
[0132] An embodiment of the present application provides a processor, which is used to run a program, wherein the device upgrade method provided by the above method embodiments is implemented when the program is run.
[0133] An embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the device upgrade method provided by the above method embodiments is implemented.
[0134] The embodiment of the present application also provides a computer program product, which, when executed on a data processing device, enables the data processing device to implement the device upgrade method provided by the above method embodiments.
[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0140] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0142] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used, and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. The scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, a technical solution formed by replacing the above-mentioned features with the technical features with similar functions disclosed in this application (but not limited to).
Claims
1. A device upgrading method, characterized in that: Applied to a gateway device, the gateway device includes a coordinator, and the method includes: Periodically sending the current version information of the gateway device and its sub-devices, and the current version information of the coordinator to the server; wherein the number of the sub-devices is multiple; In response to receiving the prompt information returned by the server for prompting to download the upgrade firmware information package, based on the prompt information, downloading and storing the upgrade firmware information package, the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information; the upgrade firmware information package at least includes verification information, each upgrade firmware package type, upgrade firmware package version number, upgrade firmware package length, and upgrade priority; Parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware, including: parsing the upgrade firmware information package to obtain the sub-device upgrade firmware; sending the sub-device upgrade firmware to the coordinator, so that the coordinator sends the sub-device upgrade firmware to the sub-device, so that the sub-device updates the current firmware version to the second target firmware version based on the sub-device upgrade firmware; deleting the sub-device upgrade firmware; If the gateway device upgrade fails, save the gateway upgrade firmware to the flash of the gateway device for upgrading; If the coordinator upgrade fails, the coordinator upgrade firmware is saved in the flash of the gateway device, and the coordinator upgrade firmware is sent to the coordinator regularly for upgrading; If the sub-device upgrade fails, the sub-device upgrade firmware is saved in the flash of the gateway device, and the gateway device periodically sends the sub-device upgrade firmware to the sub-device for upgrading.
2. The method according to claim 1, characterized in that After parsing the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware, the method further includes: If the upgrade operation related to the upgrade firmware fails, record the number of upgrade failures related to the upgrade firmware; If the number of upgrade failures reaches a preset number, the upgrade firmware is deleted.
3. The method according to claim 1, characterized in that The parsing of the upgrade firmware information package to obtain the upgrade firmware, and performing corresponding upgrade operations based on the upgrade firmware, includes: Parsing the upgrade firmware information package to obtain gateway upgrade firmware; Based on the gateway upgrade firmware, updating the current firmware version of the gateway device to a first target firmware version; Delete the gateway upgrade firmware.
4. The method according to claim 3, characterized in that If the upgrade firmware information package also includes the coordinator upgrade firmware, after deleting the gateway upgrade firmware, the method further includes: Sending the coordinator upgrade firmware to the coordinator, so that the coordinator updates the current firmware version of the coordinator to a third target firmware version based on the coordinator upgrade firmware; Delete the coordinator to upgrade the firmware.
5. A device upgrading apparatus, characterized in that: Applied to a gateway device, the gateway device includes a coordinator, and the apparatus includes: A sending unit, used to periodically send the current version information of the gateway device and its sub-devices, and send the current version information of the coordinator to the server; wherein the number of the sub-devices is multiple; a storage unit, configured to, in response to receiving a prompt message returned by the server for prompting to download an upgrade firmware information package, download and store the upgrade firmware information package based on the prompt message, wherein the upgrade firmware information package is generated by the server after determining that there is a device to be upgraded in the device corresponding to the current version information; the upgrade firmware information package at least includes verification information, each upgrade firmware package type, upgrade firmware package version number, upgrade firmware package length, and upgrade priority; An upgrade unit is used to parse the upgrade firmware information package, obtain the upgrade firmware, and perform corresponding upgrade operations based on the upgrade firmware, including: parsing the upgrade firmware information package to obtain the sub-device upgrade firmware; sending the sub-device upgrade firmware to the coordinator, so that the coordinator sends the sub-device upgrade firmware to the sub-device, so that the sub-device updates the current firmware version to the second target firmware version based on the sub-device upgrade firmware; deleting the sub-device upgrade firmware; if the gateway device upgrade fails, saving the gateway upgrade firmware to the flash of the gateway device for upgrading; if the coordinator upgrade fails, saving the coordinator upgrade firmware to the flash of the gateway device, and regularly sending the coordinator upgrade firmware to the coordinator for upgrading; if the sub-device upgrade fails, saving the sub-device upgrade firmware to the flash of the gateway device, and the gateway device regularly sends the sub-device upgrade firmware to the sub-device for upgrading.
6. The device according to claim 5, characterized in that Also includes: a recording unit, configured to record the number of upgrade failures associated with the upgrade firmware if the upgrade operation associated with the upgrade firmware fails to execute; The deleting unit is used to delete the upgrade firmware if the number of upgrade failures reaches a preset number.
7. A computer-readable medium, characterized in that A computer program is stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
8. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 4 when running.
9. A device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for upgrading built-in WiFi firmware of set top box, and set top box
CN106131682A
Multi-firmware upgrading method and system, and readable storage medium
CN107291497A
Cooperative upgrading method of gateway and coordinator of the gateway, apparatus and storage medium
CN108306768A