A remote upgrade method and terminal device, and computer-readable storage medium
By using multicast technology in Zigbee single node to send remote upgrade data packets to terminal devices in the device sequence group, the problem of time and instability of large-scale terminal equipment firmware upgrades in the existing technology is solved, and a fast and stable remote upgrade of large-scale terminal equipment is achieved.
Patent Information
- Application Number
- CN202210095855.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2042-01-26
AI Technical Summary
The large-scale firmware upgrade of existing Zigbee single nodes still uses single point OTA technology, resulting in high repetition of operations, high time-consuming and long-term unstable operation, which cannot meet the needs of rapid synchronous and rapid firmware upgrades of large-scale terminal equipment.
Multicast technology is used to send remote upgrade data packets to several terminal devices in the device sequence group, and through communication between the gateway and the router, the data packets are forwarded to the terminal device to realize the synchronous upgrade of large-scale terminal devices.
It greatly shortens the total time for remote upgrades of large-scale terminal devices, improves the stability of remote upgrades and the reliability of data reporting.
Smart Images

Figure CN114489730B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a remote upgrade method and a terminal device and a computer-readable storage medium. Background Art
[0002] In recent years, wireless communication technology has played an increasingly important role in the development of the Internet of Things. Under the epidemic situation, wireless communication technology has been widely used in many Internet of Things fields such as smart home, smart city, smart agriculture, and smart transportation due to its advantages such as contactless, high reliability, and single-point multi-control. Among them, Zigbee wireless communication technology has played an increasingly important role in the transmission layer and perception layer of the Internet of Things due to its unique low power consumption, low complexity, and the ability to build a huge wireless Internet of Things network.
[0003] The principle of OTA (Over the air) technology is to remotely manage the firmware upgrade of terminal devices based on wireless communication. With more and more Zigbee single nodes being put into use, large-scale Zigbee single-node firmware upgrades still use single-point OTA technology, which is highly repeatable, time-consuming, and long-term unstable, and cannot meet the needs of large-scale terminal device firmware synchronization and rapid upgrades. Summary of the invention
[0004] In view of this, the purpose of this application is to provide a remote upgrade method that can upgrade a class of equipment in a targeted manner, greatly shorten the total time for remote upgrades of all devices in the case of large-scale terminal devices, and improve the stability of remote upgrades of large-scale terminal devices and the reliability of data reporting.
[0005] In order to solve the above technical problems, the first technical solution provided by the present application is: to provide a remote upgrade method, the remote upgrade method comprising:
[0006] In response to the remote upgrade instruction, obtaining a remote upgrade data packet;
[0007] Acquire a device sequence group, wherein the device sequence group includes a plurality of terminal devices;
[0008] The multicast technology is used to send remote upgrade data packets to a number of terminal devices in the device sequence group, so that the terminal devices use the remote upgrade data packets for upgrading.
[0009] Wherein, the remote upgrade method further includes:
[0010] Sending a remote upgrade notification to a number of terminal devices in the device sequence group so that the number of terminal devices enter a remote upgrade state;
[0011] The remote upgrade notification includes at least one of the following information: upgrade mode information, multicast protocol version, remote upgrade firmware key information, and multiple enable bits.
[0012] The device sequence group further includes a plurality of routers, each of which is in communication connection with at least one terminal device.
[0013] The method of sending a remote upgrade data packet to a plurality of terminal devices in the device sequence group using a multicast technology includes:
[0014] Using the multicast technology to send the remote upgrade data packet to the routers in the device sequence group;
[0015] The remote upgrade data packet is forwarded to a plurality of terminal devices through the router.
[0016] The method of sending a remote upgrade data packet to a number of terminal devices in the device sequence group using multicast technology includes:
[0017] Acquire communication information of several terminal devices in the device sequence group;
[0018] Using multicast technology to allocate packet sending time for the plurality of terminal devices according to the communication information of the plurality of terminal devices;
[0019] The remote upgrade data packet is sent according to the packet sending time of the plurality of terminal devices.
[0020] After the multicast technology is used to send a remote upgrade data packet to a number of terminal devices in the device sequence group, the remote upgrade method includes:
[0021] Sending missing query instructions to the plurality of terminal devices;
[0022] Obtaining the missing sub-data packet sequence numbers uploaded by the plurality of terminal devices based on the missing query instruction;
[0023] The sub-data packet corresponding to the sub-data packet sequence number is sent to the plurality of terminal devices using multicast technology.
[0024] Wherein, the obtaining device sequence group includes:
[0025] Get the device management queue;
[0026] Traversing the terminal devices in the device management queue in a semaphore blocking waiting manner, and adding the terminal devices to the device sequence group;
[0027] Re-traverse the terminal devices that failed to join the device sequence group until the number of traversals reaches a preset number of times.
[0028] Wherein, the remote upgrade method further includes:
[0029] In response to a group setting instruction from the cloud, creating the device sequence group based on the group device instruction;
[0030] The grouping progress of creating the device sequence group is obtained, and the grouping progress is sent to a mobile client so that the mobile client can visualize the grouping progress.
[0031] In order to solve the above technical problems, the second technical solution provided by the present application is: to provide a remote upgrade method, the remote upgrade method is applied to a remote upgrade system, and the remote upgrade system includes a gateway end and a device end.
[0032] The gateway receives a remote upgrade data packet in response to a remote upgrade instruction from the cloud.
[0033] The gateway end obtains a device sequence group, wherein the device sequence group includes a plurality of device ends;
[0034] The gateway uses multicast technology to send remote upgrade data packets to several device terminals in the device sequence group;
[0035] The device end is upgraded using the remote upgrade data packet.
[0036] After the gateway sends a remote upgrade data packet to several devices in the device sequence group using multicast technology, the remote upgrade method further includes:
[0037] The gateway sends a missing query instruction to the device;
[0038] The device uploads the missing sub-data packet sequence number based on the missing query instruction;
[0039] The gateway uses multicast technology to send the sub-data packet corresponding to the sub-data packet sequence number to the device end;
[0040] The device determines whether it is missing the sub-data packet, discards the non-missing sub-data packet, and writes the missing sub-data packet.
[0041] In order to solve the above technical problems, the third technical solution provided in the present application is: to provide a terminal device, the terminal device includes a processor, and the processor is used to implement the above-mentioned remote upgrade method when executing a computer program stored in a memory.
[0042] In order to solve the above technical problems, the third technical solution provided by the present application is: providing a computer-readable storage medium, and when the program is executed by a processor, the remote upgrade method as described above is implemented.
[0043] The beneficial effect of the present application is that the remote upgrade method of the present application can respond to remote instructions to obtain upgrade data packets, and then obtain a device sequence group containing several terminal devices, and use multicast technology to send remote upgrade data packets to several devices in the device sequence group to achieve the upgrade of several terminal devices. The method can upgrade a class of devices in a targeted manner, greatly shorten the total time for remote upgrade of all devices in the case of large-scale terminal devices, and improve the stability of remote upgrade of large-scale terminal devices and the reliability of data reporting. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0045] Figure 1 It is a flowchart of the first embodiment of the remote upgrade method provided by the present application;
[0046] Figure 2 It is a flowchart of the second embodiment of the remote upgrade method provided by the present application;
[0047] Figure 3 It is a schematic diagram of the workflow of the remote upgrade system provided by this application;
[0048] Figure 4 It is an interactive schematic diagram of an embodiment of a remote upgrade system provided by the present application;
[0049] Figure 5 It is a structural diagram of an embodiment of a terminal device provided by the present application;
[0050] Figure 6 It is a schematic diagram of the structure of the computer-readable storage medium provided in this application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] The core of this application is to provide a remote upgrade method to solve the problem that single-point OTA technology cannot meet the needs of large-scale terminal device firmware synchronous and rapid upgrade due to its high operation repeatability, high time consumption and long-term instability.
[0053] The present application is described in detail below with reference to the accompanying drawings and embodiments.
[0054] The terminal device of the present application may be a server, or a system composed of a server and a local terminal. Accordingly, the various parts of the terminal device of the present application, such as various units, subunits, modules, and submodules, may all be arranged in the server, or may be arranged in the server and the local terminal respectively.
[0055] Furthermore, the above-mentioned server can be hardware or software. When the server is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules, such as software or software modules used to provide distributed servers, or it can be implemented as a single software or software module, which is not specifically limited here. In some possible implementations, the remote upgrade method of the embodiment of the present application can be implemented by a processor calling computer-readable instructions stored in a memory. Specifically, the terminal device of the embodiment of the present application can be specifically a gateway end, and the following description is made with the gateway end as the protection subject of the remote upgrade method.
[0056] like Figure 1 As shown, Figure 1 : is a flowchart of the first embodiment of the remote upgrade method provided by the present application. The specific steps of the remote upgrade method of the embodiment of the present application are as follows:
[0057] Step S11: Responding to the remote upgrade instruction, obtaining a remote upgrade data packet.
[0058] In the embodiment of the present application, the user can initiate an upgrade request to the cloud through the mobile client, and after receiving the upgrade request instruction, the cloud sends a remote upgrade instruction to the gateway. The gateway can respond to the remote upgrade instruction from the cloud to obtain the remote upgrade data packet required by the device.
[0059] Step S12: Acquire a device sequence group, wherein the device sequence group includes a number of terminal devices.
[0060] In the embodiment of the present application, in order for the gateway to use multicast technology to send a remote upgrade data packet to the device, so that the device can upgrade using the remote upgrade data packet, the gateway can obtain a device sequence group, wherein the device sequence group includes several terminal devices.
[0061] It should be noted that multicast technology refers to a type of network communication in which a single sender corresponds to multiple receivers. In multicast technology, by transmitting a single information stream to multiple receivers, the network communication traffic in the case where multiple receivers listen to or view the same resource at the same time can be reduced. In the embodiment of the present application, the gateway end can use multicast technology to send a remote upgrade data packet to the device end.
[0062] Specifically, the gateway can establish a memory management linked list for the above device sequence to manage the devices in groups. It should be noted that the embodiment of the present application does not limit the number of groups, for example, it can be one group, or two groups or more than two groups. The embodiment of the present application is described by dividing the devices into one group.
[0063] In other embodiments, the above-mentioned device sequence group may also include several routers, each of which is connected to at least one terminal device. It is understandable that for a device end that is closer to the gateway end, the gateway end can directly communicate with the device end; however, for a device end that is farther away from the gateway end, generally, the device end needs to establish a communication connection with the router first, and then communicate with the gateway end through the router. Therefore, the gateway end obtains a device sequence including several routers to achieve communication with the device end that is farther away, and then achieves grouping.
[0064] Preferably, in order to successfully add the terminal device to be upgraded, in other embodiments, the above-mentioned gateway end can also obtain a device management queue, wherein the device management queue includes a number of terminal devices to be added to the group. Further, the gateway end uses a semaphore blocking waiting method to traverse the terminal devices in the device management queue to add the terminal device to the device sequence group. For the terminal device that failed to join the group, the gateway end re-traverses the terminal device that failed to join the device sequence group until the number of traversals reaches a preset number.
[0065] It should be noted that semaphore blocking waiting is a state in which a program waits for a message. During the entire waiting process, the waiter cannot do anything else except waiting for the message. This mechanism is a semaphore blocking waiting mechanism. If it is manifested in the program, it means that the program is always blocked at the function call and cannot continue to execute. In the embodiment of the present application, several device ends can only wait for the gateway end to traverse in turn to join the group. If the device end fails to join the group, the gateway end traverses it again to make it join the group.
[0066] Furthermore, the present application does not impose any restrictions on the setting of the preset number of traversals, for example, it can be three times. In an embodiment of the present application, for a device end that has traversed three times by the gateway end but failed to join the group three times, the gateway end will no longer traverse it and considers that the device end has failed to join the group.
[0067] Preferably, in other embodiments, the gateway can create the above-mentioned device sequence group based on the group device instruction after responding to the group setting instruction of the cloud.
[0068] Specifically, the gateway can actively report the remote upgrade attributes of the gateway and the device to the cloud each time it is powered on again, and the attribute indicates whether the gateway and the device have the remote upgrade capability. After receiving the remote upgrade attributes of the gateway and the device sent by the gateway, the cloud sends a group setting instruction to the gateway for the gateway and the device that meet the remote upgrade capability, wherein the group includes several device ends that meet the remote upgrade capability.
[0069] Preferably, in order to enable the user to view the grouping progress of the device end through the mobile client, the gateway end can also obtain the grouping progress of creating the device sequence group, and send the grouping progress to the mobile client so that the mobile client can visualize the grouping progress.
[0070] Specifically, the gateway can start the grouping progress reporting timer to display the grouping progress proportionally on the mobile client to enrich the human-computer interaction. After the grouping action on the device starts, the gateway's grouping progress reporting timer starts immediately and periodically reports the results of grouping success or failure to the cloud to relieve the pressure of frequent data transmission and reception on the cloud.
[0071] Step S13: using multicast technology to send remote upgrade data packets to several terminal devices in the device sequence group, so that the several terminal devices use the remote upgrade data packets for upgrading.
[0072] In an embodiment of the present application, after obtaining a device sequence group including several terminal devices, the gateway uses multicast technology to send a remote upgrade data packet to several terminal devices in the device sequence group, so that several terminal devices can be upgraded using the remote upgrade data packet.
[0073] Based on the above embodiment, the gateway can also use multicast technology to send remote upgrade data packets to routers in the device sequence group, so that the remote upgrade data packets are forwarded to several terminal devices through the routers, thereby enabling several terminal devices to upgrade using the remote upgrade data packets.
[0074] Specifically, the gateway can first obtain the communication information of several terminal devices in the device sequence group, then use multicast technology to allocate the packet sending time of the terminal device according to the communication information of the above device end, and finally send the remote upgrade data packet to the terminal device according to the packet sending time of the terminal device.
[0075] It is understandable that when the gateway and the device are communicating, the heartbeats between them are frequently interacting. At the same time, because the gateway continuously multicasts the remote upgrade data packets to the device, the signal energy output of a large number of gateway data sources and the high-frequency forwarding of multicast data between routers are very likely to encounter the CCA (Clear Channel Assessment) threshold problem of the collision avoidance mechanism, causing the remote upgrade data packet to fail to be sent and be lost by the IEEE 802.15.4 physical layer. Therefore, in order to maximize the use of the occupied channel bandwidth, a large number of firmware upgrade experimental spectrum and device-side successful packet reception rate are analyzed. The gateway can obtain the optimal packet sending time of the terminal device based on the communication information of the device and send the packet to it.
[0076] It should be noted that the above-mentioned CCA (Clear Channel Assessment) is a channel assessment. In a wireless communication system, before a device needs to send data on a certain channel, it first receives on this channel. If after a given period of time, no other device is found to be sending data on this channel, it starts sending; if other devices are found to be sending data, it randomly avoids for a period of time and then retries the process. This method can effectively avoid conflicts on wireless channels, and is also called carrier frequency sensing multiple access with conflict avoidance. In an embodiment of the present application, if the transmission frequency from the gateway end to the device end exceeds the CCA threshold, a wireless channel conflict is likely to occur, which in turn causes the failure and loss of the remote upgrade data packet.
[0077] Therefore, in order to prevent the failure of data packet transmission due to the CCA threshold problem, the gateway can obtain the optimal packet transmission time of the terminal device according to the communication information of the device and transmit the packet to it.
[0078] Preferably, the gateway end can use a dynamic interval time allocation method to circumvent this problem. The dynamic interval time allocation method refers to adjusting the communication time in a certain system line when working online, that is, communicating, to avoid conflicts in the upstream and downstream traffic demands between multiple lines. In an embodiment of the present application, the gateway end can use a dynamic interval time allocation method to adjust the packet sending time according to the communication information of the device end, so as to achieve the optimal packet sending time to the device end, thereby avoiding the failure of data packet sending due to the CCA threshold problem.
[0079] It should be noted that the above remote upgrade data packet is sent from the cloud to the gateway, and the gateway locally saves the remote upgrade data packet and then sends it to the device.
[0080] Preferably, the gateway can parse the remote upgrade data packet sent from the cloud to obtain a URL (Uniform Resource Locator) link for storage. Furthermore, the gateway can also perform a local verification operation on the saved remote upgrade data packet.
[0081] Preferably, after completing the local verification operation of the remote upgrade data packet, the gateway may further send a remote upgrade notification to several terminal devices in the device sequence group, so that the several terminal devices enter the remote upgrade state.
[0082] It should be noted that the present application does not limit the information contained in the remote upgrade notification, for example, it may be upgrade mode information, multicast protocol version, remote upgrade firmware key information, multiple enable bits, etc.
[0083] Based on the above embodiment, after the gateway sends a remote upgrade notification to the device end in the device sequence group so that several terminal devices enter the remote upgrade state, it can further send remote upgrade data packets to them. Since it is impossible to ensure that all terminal devices can receive complete remote upgrade data packets, the remote upgrade data packets can be marked to facilitate the terminal devices to find their own missing data packets.
[0084] Preferably, the gateway can read the remote upgrade data packet stored locally to form the load content, and then send the remote upgrade data packet to the device. Since the maximum tolerance of a single remote upgrade data packet is 128B, the APS frame header data length is removed, and the effective load in each load content is 60B, and the control instruction type, sub-data packet device sequence number and data check bit are added, so as to use multicast technology to send the remote upgrade data packet to the terminal devices in the device sequence group.
[0085] Further, such as Figure 2 As shown, Figure 2 After the gateway uses multicast technology to send remote upgrade data packets to several terminal devices in the device sequence group, it can further send missing query instructions to several terminal devices to query whether the device end has failed to upgrade.
[0086] Step S21: Send missing query instructions to several terminal devices.
[0087] In an embodiment of the present application, the gateway sends missing query instructions to several terminal devices to query whether the device fails to upgrade.
[0088] Step S22: Obtain the missing sub-data packet sequence numbers uploaded by several terminal devices based on the missing query instruction.
[0089] In an embodiment of the present application, for a device that fails to upgrade, it can upload the sequence number of its missing sub-data packet to the gateway based on the missing query instruction.
[0090] Step S23: using multicast technology to send the sub-data packet corresponding to the sub-data packet sequence number to a number of terminal devices.
[0091] In an embodiment of the present application, the gateway obtains the missing sub-packet sequence numbers uploaded by the terminal devices that failed to upgrade, and uses multicast technology to send the sub-packets corresponding to the missing sub-packet sequence numbers to the device ends in the device sequence group.
[0092] Preferably, all device ends in the group will receive the sub-data packets sent by the gateway end and determine whether they are missing. For device ends that are missing sub-data packets, the missing data packets will be written into the cache; for device ends that are not missing sub-data packets, that is, the upgraded devices are successful, the data packets received thereafter will be discarded.
[0093] It is understandable that the gateway uses multicast packet replenishment to perform supplementary reporting operations on the device side. The number of device replenishment packets traversed by the gateway shows an exponentially decreasing trend. At the same time, the speed of traversal query response packet replenishment by the gateway is getting faster and faster, which greatly improves the execution speed of group upgrade data packets.
[0094] Preferably, when the gateway obtains the missing sub-packet sequence numbers uploaded by the terminal devices that failed to upgrade, it can communicate with the device end using the differential cyclic response mode of the MF flag due to its single maximum data transmission limit of 128B.
[0095] The MF flag is the lowest bit in the flag field in data transmission. By setting the MF flag to replace the entire flag field, the data receiver can know the entire flag field where the flag is located, that is, the arrival time of the data packet, only through the MF flag.
[0096] Preferably, in order to reduce the task overhead of dynamic memory allocation during the entire transmission process, the gateway end can use static memory allocation to record the sub-packet sequence missing from the device end, and can use the global offset as a packet replacement identifier.
[0097] It should be noted that static memory allocation means that the system automatically allocates the required memory space for the gateway, and when the data packet is used up within the scope, the system will automatically release the occupied memory space for the gateway; the global offset is a means of parsing manual encryption. By setting the static memory allocation method and the global offset method, the task overhead of dynamic memory allocation in the entire transmission process can be effectively reduced.
[0098] See also Figure 3 , Figure 3This is a schematic diagram of the workflow of the remote upgrade system provided by this application. Figure 3 As shown, the user initiates an upgrade request to the cloud through the mobile client. The cloud receives the upgrade request instruction and sends a notification to the gateway to establish a group. The gateway receives the group establishment instruction from the cloud and sends it to the device to establish the device group, and displays the result to the user through the mobile client visualization.
[0099] Furthermore, the gateway receives the remote upgrade data packet sent from the cloud, parses the remote upgrade data packet, and performs local caching and verification operations on the remote upgrade data packet through the parsed URL link.
[0100] Furthermore, the gateway multicasts the remote upgrade data packet to the device to realize the remote upgrade of the device. Among them, the gateway can start the group upgrade progress reporting timer, and display the group upgrade progress of the device and the remaining time required in a proportional manner through the mobile client. After the group upgrade of the device is completed, the gateway can further send a missing query instruction to the terminal device to query whether the device upgrade has failed. All device ends in the group will receive the sub-data packet sent by the gateway and determine whether they are missing. For the device end that lacks a sub-data packet, its missing data packet will be written into the cache; for the device end that does not lack a sub-data packet, that is, the device end that has been successfully upgraded, the data packet received thereafter will be discarded. Furthermore, the gateway traverses and reports the current firmware versions of all devices so that the cloud background can determine the upgrade structure of the device end after verification, and the result can be displayed on the mobile client for user viewing.
[0101] Furthermore, after the group upgrade process is completed, the gateway can report an end mark to the cloud. After receiving the end mark instruction, the cloud disbands the group and releases resources, and notifies the mobile client so that the user can perform other operations.
[0102] The remote upgrade method proposed in this application can remotely upgrade large-scale terminal devices in a centralized manner, reducing the threshold for manual operation of product firmware iterations using large-scale Zigbee nodes. At the same time, it adopts the expected query response group packet replenishment method to 100% avoid the CCA threshold collision problem caused by the packet sending process of the gateway end and the upgrade failure caused by the interference of the network environment on the device end. The gateway uses multicast technology to communicate with the device end, and can perform data management on a targeted basis for several devices that need to be upgraded in groups. The implementation of the above-mentioned multiple optimization methods greatly shortens the total time for successful remote upgrades of all devices under large-scale terminal devices, improves the stability of remote upgrades of large-scale devices, and greatly improves the performance of large-scale equipment control, data reporting reliability, and other aspects.
[0103] Please continue reading Figure 4 , Figure 43 is an interactive diagram of an embodiment of a remote upgrade system provided by the present application. The remote upgrade method described in the embodiment of the present application is applied to a remote upgrade system 300, and the remote upgrade system 300 includes a gateway end 33 and a device end 34. Further, the remote upgrade system may also include a mobile client 31 and a cloud 32.
[0104] In the embodiment of the present application, the user initiates an upgrade request to the cloud 32 through the mobile client 31, and the cloud 32 receives the instruction of the upgrade request and sends a remote upgrade instruction to the gateway 33. The gateway 33 responds to the remote upgrade instruction of the cloud 32 and obtains a remote upgrade data packet for upgrading the device 34. In addition, the gateway 33 obtains the device sequence group through the device 34 and labels it, wherein the device sequence group includes a plurality of device ends 34. Further, the gateway 33 uses multicast technology to send a remote upgrade data packet to a plurality of device ends 34 in the device sequence group, so that the device end 34 can be upgraded using the remote upgrade data packet.
[0105] Furthermore, the gateway 33 can also send a missing query instruction to the device 34 to query whether the upgrade of the device 34 has failed. All the devices 34 in the group will receive the sub-data packets sent by the gateway 33 and determine whether they are missing. For the device 34 that is missing a sub-data packet, the missing data packet will be written into the cache; for the device 34 that is not missing a sub-data packet, that is, the upgraded device 34, the data packet received later will be discarded.
[0106] Please continue to see Figure 5 , Figure 5 4 is a schematic diagram of a terminal device according to an embodiment of the present application. The terminal device includes a memory 41 and a processor 42 connected to each other.
[0107] The memory 41 is used to store and implement the above-mentioned remote upgrade method.
[0108] The processor 42 is used to execute program instructions stored in the memory 41 .
[0109] The processor 42 may also be referred to as a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip having the ability to process signals. The processor 42 may also be a general-purpose processor, a digital signaling processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0110] The memory 41 can be a memory stick, a TF card, etc., which can store all the information in the terminal device, including the input raw data, computer programs, intermediate operation results and final operation results are all stored in the memory. It stores and retrieves information according to the location specified by the controller. With the memory, the system has a memory function to ensure normal operation. The system's memory can be divided into main memory (internal memory) and auxiliary memory (external memory) according to its purpose. There is also a classification method of dividing it into external memory and internal memory. External memory is usually a magnetic medium or an optical disk, etc., which can store information for a long time. Memory refers to the storage component on the motherboard, which is used to store the data and programs currently being executed, but is only used to temporarily store programs and data. If the power is turned off or the power is cut off, the data will be lost.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0112] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0113] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0114] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a system server, or a network device, etc.) or a processor to execute all or part of the steps of the various implementation methods of the present application.
[0115] See also Figure 6 , Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided for the present application. The storage medium of the present application stores a program file 51 that can implement all the above-mentioned remote upgrade methods, wherein the program file 51 can be stored in the above-mentioned storage medium in the form of a software product, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage device includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, etc., which can store program codes, or a computer, server, mobile phone, tablet and other devices.
[0116] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A remote upgrade method, characterized in that: The remote upgrade method comprises: In response to a remote upgrade instruction, a remote upgrade data packet is obtained, wherein the remote upgrade instruction is an upgrade request initiated by a user to a cloud through a mobile client, so that the cloud generates a remote upgrade data packet based on the upgrade request; Get the device management queue; Initially traversing the terminal devices in the device management queue in a semaphore blocking waiting manner to obtain some terminal devices that have successfully entered the device sequence group; Re-traversing the terminal devices in the device management queue that have not been successfully added to the device sequence group until the number of traversals reaches a preset number, so as to add the terminal devices to obtain a device sequence group that includes at least some of the terminal devices; Multicast technology and dynamic interval time allocation method are used to send remote upgrade data packets to several terminal devices in the device sequence group, so that the several terminal devices use the remote upgrade data packets for upgrading, wherein the terminal devices are zigbee devices.
2. The remote upgrade method according to claim 1, characterized in that: The remote upgrade method further includes: Sending a remote upgrade notification to a number of terminal devices in the device sequence group so that the number of terminal devices enter a remote upgrade state; The remote upgrade notification includes at least one of the following information: upgrade mode information, multicast protocol version, remote upgrade firmware key information, and multiple enable bits.
3. The remote upgrade method according to claim 1 or 2, characterized in that: The device sequence group also includes a plurality of routers, each of which is communicatively connected to at least one terminal device; The method of sending a remote upgrade data packet to a plurality of terminal devices in the device sequence group using a multicast technology includes: Using the multicast technology to send the remote upgrade data packet to the routers in the device sequence group; The remote upgrade data packet is forwarded to a plurality of terminal devices through the router.
4. The remote upgrade method according to claim 1, characterized in that: The method of sending a remote upgrade data packet to a plurality of terminal devices in the device sequence group using a multicast technology includes: Acquire communication information of several terminal devices in the device sequence group; Using multicast technology to allocate packet sending time for the plurality of terminal devices according to the communication information of the plurality of terminal devices; The remote upgrade data packet is sent according to the packet sending time of the plurality of terminal devices.
5. The remote upgrade method according to claim 1, characterized in that: After the multicast technology is used to send the remote upgrade data packet to the plurality of terminal devices in the device sequence group, the remote upgrade method includes: Sending missing query instructions to the plurality of terminal devices; Obtaining the missing sub-data packet sequence numbers uploaded by the plurality of terminal devices based on the missing query instruction; The sub-data packet corresponding to the sub-data packet sequence number is sent to the plurality of terminal devices using multicast technology.
6. The remote upgrade method according to claim 1, characterized in that: The remote upgrade method further includes: In response to a group setting instruction from the cloud, creating the device sequence group based on the group setting instruction; The grouping progress of creating the device sequence group is obtained, and the grouping progress is sent to a mobile client so that the mobile client can visualize the grouping progress.
7. A remote upgrade method, characterized in that: The remote upgrade method is applied to a remote upgrade system, which includes a gateway end and a device end; wherein, The gateway end obtains a remote upgrade data packet in response to a remote upgrade instruction from the cloud, wherein the remote upgrade instruction is an upgrade request initiated by a user to the cloud through a mobile client, so that the cloud generates a remote upgrade data packet based on the upgrade request; The gateway end obtains a device management queue, and initially traverses the device ends in the device management queue in a semaphore blocking waiting manner to obtain some device ends that have successfully joined the device sequence group, and then re-traverses the device ends in the device management queue that have not successfully joined the device sequence group until the number of traversals reaches a preset number, so as to add the device ends to obtain a device sequence group that at least includes the some device ends; The gateway uses multicast technology and dynamic interval time allocation method to send remote upgrade data packets to several device terminals in the device sequence group; The device end is upgraded using the remote upgrade data packet, wherein the device end is a zigbee device end.
8. The remote upgrade method according to claim 7, characterized in that: After the gateway uses multicast technology to send remote upgrade data packets to several device ends in the device sequence group, the remote upgrade method further includes: The gateway sends a missing query instruction to the device; The device uploads the missing sub-data packet sequence number based on the missing query instruction; The gateway uses multicast technology to send the sub-data packet corresponding to the sub-data packet sequence number to the device end; The device determines whether it is missing the sub-data packet, discards the non-missing sub-data packet, and writes the missing sub-data packet.
9. A terminal device, characterized in that: The terminal device includes a processor and a memory connected to the processor, wherein the memory stores program instructions; the processor is used to execute the program instructions stored in the memory to implement the remote upgrade method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed, the remote upgrade method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Software updating method and system of network equipment
CN101286867A
Firmware upgrade method and device of Zigbee equipment
CN107104836A
Method for improving success rate of remote upgrading of large-scale NB-IoT terminal
CN111818554A