Device remote upgrading method, control terminal, device terminal and storage medium
By utilizing cloud platform, server and LoRaWAN gateway, the remote upgrade method of equipment is realized, which solves the problem of short Bluetooth communication distance and realizes remote upgrade of equipment in large-scale breeding scenarios, which is suitable for long-distance equipment upgrade requirements.
Patent Information
- Application Number
- CN202411416879.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-11
AI Technical Summary
The existing Bluetooth communication protocol is limited by the short communication distance, making it difficult to be suitable for remote upgrades of equipment in large-scale breeding scenarios with a slaughter of tens of millions of yuan.
By utilizing cloud platforms, servers and LoRaWAN gateways, remote upgrade methods are implemented, including responding to upgrade operation instructions, transmitting upgrade inquiry requests and upgrade packages, ensuring that the target device can be upgraded at a longer distance.
Overcoming the defect that long-distance WAN devices can only perform short-distance remote upgrades through Bluetooth, remote upgrades of devices are carried out based on the LoRaWAN communication protocol, and the communication distance is longer and more suitable for large-scale breeding scenarios.
Smart Images

Figure CN119421139A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of communication technology. More specifically, the present disclosure relates to a method for remotely upgrading a device, a control terminal, a device terminal, and a storage medium. Background Art
[0002] In large-scale intelligent farming scenarios, many controllers or sensors based on Long Range Wide Area Network (LoRaWAN) communication are usually deployed to monitor the farming environment, farming equipment, and farmed animals in real time. Due to the differences in monitoring needs in different seasons and regions, these LoRaWAN-based devices are often upgraded using remote over the air (OTA) to meet new monitoring needs.
[0003] Currently, the controller upgrade solution has nothing to do with LoRaWAN communication, but is implemented based on OTA of Bluetooth communication protocol. However, this upgrade solution is limited by the short communication distance of Bluetooth, and requires the controller to be within 100 meters of the target end to be executed. This is not applicable to the batch upgrade of equipment in the farming scenario with tens of millions of slaughtered animals.
[0004] In view of this, there is an urgent need to provide a method for remote upgrading of equipment, a control terminal, a device terminal and a storage medium to improve the applicability of OTA in large-scale breeding scenarios. Summary of the invention
[0005] In order to at least solve the technical problems mentioned above, the present disclosure proposes a method for remote upgrading of a device, a control terminal, a device terminal and a storage medium solution.
[0006] In a first aspect, the present disclosure provides a method for remotely upgrading a device, which is applied to a control end, wherein the control end includes a cloud platform, a server, and a LoRaWAN gateway, and the method includes:
[0007] Using the cloud platform, responding to the upgrade operation instruction to send an upgrade query request to the server;
[0008] Utilizing the server and the LoRaWAN gateway to transmit the upgrade inquiry request to the device end;
[0009] The cloud platform, the server and the LoRaWAN gateway are used to respond to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device, wherein the target device belongs to the device end.
[0010] In some embodiments, the using the cloud platform to respond to the upgrade operation instruction to send an upgrade query request to the server includes:
[0011] Using the cloud platform, determining the upgrade type according to the upgrade operation instruction and generating the upgrade inquiry request;
[0012] If it is a unicast upgrade type, sending the upgrade query request to the server once;
[0013] If it is a multicast upgrade type, the upgrade query request is sent to the server based on a preset time interval and a preset number of times.
[0014] In some embodiments, the utilizing the cloud platform, the server, and the LoRaWAN gateway to respond to the upgrade confirmation information returned by the target device to transmit the upgrade package to the target device includes:
[0015] Using the cloud platform, determining the device identification of the target device according to the confirmed upgrade information;
[0016] Using the cloud platform, the split upgrade packages and corresponding JOSN files are sent to the server in sequence;
[0017] Using the server, determining a gateway identifier according to the JOSN file, and sending the upgrade package and the JOSN file to the corresponding LoRaWAN gateway based on the gateway identifier;
[0018] The LoRaWAN gateway is used to determine the device identification according to the JOSN file, and the upgrade package and the JOSN file are sent to the corresponding target device in sequence based on the device identification.
[0019] In some embodiments, after the cloud platform, the server and the LoRaWAN gateway are used to respond to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device, the method further includes:
[0020] Utilizing the cloud platform, receiving and responding to the missing packet retransmission request sent by the target device, so as to execute the step of utilizing the cloud platform, the server and the LoRaWAN gateway to respond to the confirmation information sent back by the target device and transmit the upgrade package to the target device;
[0021] When the heartbeat packet transmitted by the target device is received, the version number is verified using the cloud platform to determine whether the target device is successfully upgraded.
[0022] In some embodiments, the method further comprises:
[0023] The cloud platform is used to create an upgrade record in response to the upgrade operation instruction, and the cloud platform is used to perform an operation of modifying the upgrade record when any of the following trigger conditions is met:
[0024] Receiving the upgrade confirmation information or the packet-missing resend request transmitted by the target device;
[0025] The upgrade package is sent out.
[0026] In a second aspect, the present disclosure provides a method for remotely upgrading a device, which is applied to a device, and includes:
[0027] Receive an upgrade inquiry request sent by the control terminal, and return confirmation upgrade information to the control terminal;
[0028] Receiving the upgrade package sent by the control terminal and verifying whether the upgrade package is missing;
[0029] If the upgrade package is not missing any package, perform a package assembly operation on the upgrade package to obtain a complete upgrade package;
[0030] An upgrade operation is performed based on the complete upgrade package.
[0031] In some embodiments, the method further comprises:
[0032] If the upgrade package is missing, sending a missing package resend request to the control terminal;
[0033] After detecting that the upgrade operation is completed, a heartbeat packet is sent to the control end.
[0034] In a third aspect, the present disclosure provides a control terminal, comprising: a processor;
[0035] The memory stores program instructions for remote upgrading of the device. When the program instructions are executed by the processor, the method described above is implemented.
[0036] In a fourth aspect, the present disclosure provides a device end, including: a processor;
[0037] The memory stores program instructions for remote upgrading of the device. When the program instructions are executed by the processor, the method as described above is implemented.
[0038] In a fifth aspect, the present disclosure provides a computer-readable storage medium storing computer program instructions for remote upgrading of a device. When the computer program instructions are executed by a processor, the method described above can be implemented.
[0039] Through the method, control end, device end and storage medium for remote upgrading of the device provided above, the disclosed embodiment is applied to the control end, and the control end includes a cloud platform, a server and a LoRaWAN gateway. By utilizing the cloud platform of the control end, the upgrade operation instruction is responded to to send an upgrade inquiry request to the server. Subsequently, the server and the LoRaWAN gateway are utilized to transmit the upgrade inquiry request to the device end. Finally, the cloud platform, the server and the LoRaWAN gateway are utilized to respond to the confirmation upgrade information returned by the target device to transmit the upgrade package to the target device, wherein the target device belongs to the device end. In addition, the disclosed embodiment also applies to the device end, and the device end is capable of receiving the upgrade inquiry request sent by the control end and returning the confirmation upgrade information to the control end. When the device end receives the upgrade package sent by the control end, it will check whether the upgrade package is missing. If the upgrade package is not missing, the upgrade package is spliced to obtain a complete upgrade package. Finally, the device end will perform the upgrade operation based on the complete upgrade package. Through the above method, the defect that long-distance wide area network devices can only be upgraded remotely over short distances via Bluetooth is overcome. The remote upgrade of devices based on the LoRaWAN communication protocol has a longer communication distance and is more suitable for large-scale breeding scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] By reading the detailed description below with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present disclosure will become readily understood. In the accompanying drawings, several embodiments of the present disclosure are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0041] Figure 1 An exemplary flow chart of a control end of a method for remotely upgrading a device in an embodiment of the present disclosure is shown;
[0042] Figure 2 An exemplary flow chart of a control end of a method for remotely upgrading a device in another embodiment of the present disclosure is shown;
[0043] Figure 3 An exemplary flow chart of a control end of a method for remotely upgrading a device in another embodiment of the present disclosure is shown;
[0044] Figure 4 An exemplary flow chart of the device side of the method for remotely upgrading a device in an embodiment of the present disclosure is shown;
[0045] Figure 5 An exemplary flow chart of a device-side method for remotely upgrading a device in another embodiment of the present disclosure is shown;
[0046] Figure 6 The flowchart of the interaction between the control end and the device end in the unicast upgrade mode in the embodiment of the present disclosure is shown;
[0047] Figure 7 The following is a flowchart showing the interaction between the multicast upgrade mode control terminal and the device terminal in the embodiment of the present disclosure;
[0048] Figure 8 An exemplary structural block diagram of a control end of a method for remotely upgrading a device according to an embodiment of the present disclosure is shown;
[0049] Fig. 9 An exemplary structural block diagram of the control end of the method for remote device upgrade according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0051] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present disclosure indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0052] It should also be understood that the terms used in this disclosure are only for the purpose of describing specific embodiments and are not intended to limit the disclosure. As used in this disclosure and claims, the singular forms of "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be further understood that the term "and / or" used in this disclosure and claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations.
[0053] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0054] The specific implementation of the present disclosure is described in detail below with reference to the accompanying drawings.
[0055] Reference Figure 1 , Figure 1The flowchart of the method for remote upgrading of the device in the embodiment of the present disclosure is shown, which is applied to the control end. Figure 1 The method 100 for remote upgrading of a device shown in the figure is applied to a control end, and the control end includes a cloud platform, a server and a LoRaWAN gateway, including: at step S101, using the cloud platform, responding to the upgrade operation instruction to send an upgrade query request to the server. In some embodiments, the control end includes a cloud platform and a server, and a LoRaWAN gateway of the transmission layer. In the breeding scenario, the cloud platform can be a breeding cloud platform, which not only supports remote upgrading of the device end in the breeding farm, but also provides functions including data management, monitoring system, intelligent analysis and connection with breeding equipment. The server corresponds to the cloud platform, and the cloud platform can flow various data in the cloud, while the server is used to process various data and requests, and also supports data storage and management. The LoRaWAN gateway is used to connect the LoRa device on the device end with the server. It can not only receive data sent from the LoRa node through wireless transmission and forward it to the server, but also send data and information sent by the server to the device end.
[0056] When the device side needs to be upgraded, the user can trigger the upgrade operation instruction through the small program of the mobile terminal or the short web page of the PC, and the upgrade operation instruction will be published to the cloud platform through Ethernet based on the message queue telemetry transmission protocol (Message QueuingTelemetry Transport, MQTT). The cloud platform responds to the upgrade operation instruction, generates an upgrade query request and sends the upgrade query request to the server through Ethernet and MQTT protocol. The upgrade query request also includes the total number of upgrade packages, which will be transmitted to the device side by the LoRaWAN gateway later to inquire whether the device side starts the device upgrade. In a feasible implementation, the present disclosure divides the remote upgrade of the device into a unicast upgrade type and a multicast upgrade type. Unicast upgrade can be understood as the mode corresponding to the upgrade of a single sub-device. Multicast upgrade can be understood as the mode corresponding to the upgrade of batch sub-devices. When sending an upgrade query request, the upgrade type can be determined according to the upgrade operation instruction previously triggered by the user. If it is a unicast upgrade type, an upgrade query request is sent to the server through the cloud platform. If it is a multicast upgrade type, an upgrade query request is sent to the server based on a preset time interval and a preset number of times through the cloud platform. Optionally, as a feasible implementation, the preset time interval can be set to 3 seconds, and the preset number of times can be set to 3 times. When sending, the cloud platform will send an upgrade inquiry request to the server once every three seconds until it is sent three times in a row.
[0057] It should be noted that when the cloud platform responds to the upgrade operation instruction, it will also create an upgrade record. The upgrade record is used to record the upgrade information related to each link, including the upgrade time, upgrade progress, etc. If the upgrade fails, the record can help to roll back and restore the device to the state before the upgrade. By writing the details of the device upgrade into the upgrade record, it is convenient for subsequent query and management. When any of the following trigger conditions is met, the cloud platform will modify the upgrade record accordingly. The trigger conditions are: the cloud platform receives the confirmation upgrade information transmitted by the target device or the missing package resend request; the cloud platform sends the upgrade package to the server to complete.
[0058] Next, at step S102, the server and the LoRaWAN gateway are used to transmit the upgrade query request to the device end. In some embodiments, when the server obtains the upgrade query request, it will transmit it to the LoRaWAN gateway by wireless transmission. The LoRaWAN gateway will also send the request to the sub-devices (i.e., the device end) managed by itself by wireless transmission. Since the transmission method of the LoRaWAN gateway can reach a transmission distance of several kilometers and cover a wider communication area, it is more suitable for remote upgrades of LoRa devices in large-scale breeding scenarios compared to the Bluetooth upgrade method.
[0059] Further, at step S103, the cloud platform, server and LoRaWAN gateway are used to respond to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device. In some embodiments, after the device side receives the upgrade inquiry request, the device that needs to start the upgrade (hereinafter referred to as the target device) will send a confirmation upgrade message to the control side. The cloud platform of the control side can confirm whether the device side starts the upgrade now through the confirmation upgrade information. After that, for the target device, the cloud platform will transmit the previously split upgrade package and the target device identification and other data to the server together. The server further sends the upgrade package and other data to the specified LoRaWAN gateway according to the connection topic of the remote upgrade. Finally, the LoRaWAN gateway sends the upgrade package and other data to the specific sub-device (ie, the target device) according to the target device identification. The target device verifies the upgrade package after receiving the upgrade package, and performs the upgrade operation based on the upgrade package after the verification is correct. It is understandable that the control end uses the cloud platform, server and LoRaWAN gateway to send upgrade packages and other data to the device end, thus overcoming the defect that long-distance wide area network devices can only be upgraded remotely over short distances via Bluetooth, making it more suitable for large-scale breeding scenarios.
[0060] In addition, it should be noted that the cloud platform will modify the upgrade record accordingly when receiving the upgrade confirmation information sent by the control end and when the upgrade package is sent down, so as to update the upgrade progress, such as upgrading in progress or upgrade completed.
[0061] Reference Figure 2 , Figure 2 A flowchart of a method for remotely upgrading a device to which another embodiment of the present disclosure can be applied is shown. Figure 2 The method 200 for remote device upgrade shown in the figure includes: at step S210, using the cloud platform, responding to the upgrade operation instruction to send an upgrade query request to the server. At step S220, using the server and the LoRaWAN gateway to transmit the upgrade query request to the device end. At step S230, using the cloud platform, the server and the LoRaWAN gateway, responding to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device. In some embodiments, step S230 also includes: at step S231, using the cloud platform, determining the device identification of the target device according to the confirmation upgrade information. In some embodiments, the confirmation upgrade information sent back by the target device contains the identification of the device itself, and the device identification corresponds to the target device one by one, and can uniquely identify the target device, which can be a device ID or a MAC address, etc. Taking the device ID as an example, the cloud platform parses the confirmation upgrade information sent back by the target device to determine the device ID of the target device.
[0062] Then, at step S232, the cloud platform is used to send the split upgrade package and the corresponding JOSN file to the server in order. In some embodiments, the cloud platform will previously split the upgrade package into multiple files, and generate a CRC (cyclic redundancy check) check code for each split file, which is used to subsequently verify the data integrity of the split files. In addition, the cloud platform will also generate a corresponding JSON file to record the name, order, corresponding CRC check code and target device ID of each file. Subsequently, the cloud platform packages the split upgrade package files and the corresponding JSON together, and uses the MQTT transmission protocol to send the packaged files to the server in order. It should be noted that the upgrade package split by the platform is a difference package generated by differential compression based on the pre-update version and the updated version. The difference package only contains the difference data between the versions. When updating, only the changed part needs to be processed, which improves the upgrade efficiency and reduces bandwidth usage.
[0063] In addition, when the device is in networking, working, standby and other states, it will upload gateway configuration data, business data, keep-alive messages and other content to the control end. After receiving this data, the cloud platform will determine the data type and transfer the data to the cloud according to different data types. For example, if it is business data, it will be transferred to the corresponding business system; if it is keep-alive information, the correspondence between the device and the corresponding gateway is determined based on the keep-alive information and saved by the server; if it is gateway configuration data, the corresponding gateway configuration rules are saved through the server; if it is firmware upgrade completion information, the upgrade status of the corresponding device is updated according to the firmware upgrade completion information. Optionally, the cloud platform can choose Alibaba Cloud Platform for deployment.
[0064] Subsequently, at step S233, the server is used to determine the gateway identifier according to the JOSN file, and the upgrade package and the JOSN file are sent to the corresponding LoRaWAN gateway based on the gateway identifier. In some embodiments, the server previously stores the networking correspondence between the sub-device and the LoRaWAN gateway to which it belongs. The server searches for the corresponding relationship stored in itself through the target device id in the JOSN file, thereby finding the gateway identifier of the LoRaWAN gateway to which the target device belongs. The gateway identifier can uniquely identify the gateway, which can be a gateway id or other identifier that can uniquely represent the gateway. Then, the server sends the received upgrade package file and the JOSN file to the corresponding LoRaWAN gateway according to the gateway identifier.
[0065] Finally, at step S234, the LoRaWAN gateway is used to determine the device identification according to the JOSN file, and the upgrade package and the JOSN file are sent to the corresponding target device in sequence based on the device identification. In some embodiments, when the LoRaWAN gateway receives the upgrade package and other content sent by the server, it can parse the JOSN file to determine the device identification (such as the device ID), and then forward the upgrade package and the JOSN file to the target device in sequence according to the device identification.
[0066] It should be noted that in the multicast upgrade mode, in addition to sending the upgrade query request based on the preset time interval and the preset number of times, the cloud platform also needs to perform the splitting and sending of the upgrade package based on the preset time interval and the preset number of times, that is, after each preset time interval, step S231-step S234 is performed once until the preset number of times is reached. Correspondingly, the cloud platform will also modify the upgrade record after each upgrade package is sent.
[0067] It is understandable that step S210 and step S220 can be combined with the above Figure 1 The described steps S101 and S102 are the same or similar and will not be described again here.
[0068] Reference Figure 3 , Figure 3 A flowchart of a method for remotely upgrading a device according to another embodiment of the present disclosure is shown. Figure 3 The method 300 for remote upgrading of the device shown, after step S103, further includes: at step S310, using the cloud platform, receiving and responding to the missing packet retransmission request sent by the target device, so as to execute the step of using the cloud platform, server and LoRaWAN gateway to respond to the confirmation information sent back by the target device and transmit the upgrade package to the target device. In some embodiments, after receiving the upgrade package sent after splitting, the target device will verify it. If it is verified that there is a missing packet, a missing packet retransmission request will be sent to the control end. After receiving the missing packet retransmission request, the cloud platform will retransmit the upgrade package, that is, the steps of using the cloud platform, server and LoRaWAN gateway to respond to the confirmation information sent back by the target device and transmit the upgrade package to the target device are executed again. By retransmitting the upgrade package when the target device fails to receive the upgrade package, it can be ensured that the target device finally obtains a complete and correct upgrade package, so that the target device completes the firmware update, and the flexibility of remote upgrading of the device end is improved.
[0069] Then, at step S320, when the heartbeat packet transmitted by the target device is received, the cloud platform is used to verify the version number to determine whether the target device has been successfully upgraded. In some embodiments, after the target device is upgraded based on the upgrade package, it uploads a heartbeat packet to the control end, and the heartbeat contains the device id and the current version number. The cloud platform receives the heartbeat packet sent back by the target device and parses the content. Next, the cloud platform compares the received version number with the version number of the preset target version. If they match, the platform records that the upgrade is successful, and also updates the device status in the upgrade record; if they do not match, the corresponding retry or fault handling procedure may be started. In this embodiment, by verifying the version number of the heartbeat packet, the device status can be monitored in real time, and devices that have not been successfully upgraded can be discovered in time, reducing the troubleshooting time and improving the efficiency of fault handling.
[0070] Reference Figure 4 , Figure 4 The method flow of remote device upgrade of the device end using the embodiment of the present disclosure is shown. Figure 4The method 400 for remote upgrading of the device shown includes: at step S410, receiving the upgrade query request sent by the control end, and transmitting confirmation upgrade information back to the control end. In some embodiments, the device end is a single node device under the LoRaWAN gateway. These node devices will upload gateway configuration data, service data, and keep-alive messages to the control end in networking, working, standby and other states. In addition, these node devices can also monitor the communication channel based on the LoRaWAN protocol and receive upgrade query requests from the LoRaWAN gateway. When the upgrade query request is received, the validity and format of the request will be parsed and verified to confirm the content of the request. Afterwards, the target device on the device end will generate confirmation upgrade information, which includes the current firmware version, upgradeable version and other content. Subsequently, the device end will transmit the confirmation upgrade information back to the control end, first back to the LoRaWAN gateway, and then transmitted to the server and cloud platform by the LoRaWAN gateway, so that the cloud platform will eventually perform the subsequent operation of issuing the upgrade package based on the confirmation upgrade information.
[0071] Then, at step S420, the upgrade package sent by the control end is received and it is verified whether the upgrade package is missing. In some embodiments, the control end will start to send the upgrade package after receiving the confirmation upgrade information from the device end. After the device end receives the upgrade package sent by the control end, it will verify whether the received upgrade package is missing. Optionally, in a feasible implementation, the device end can use a CRC verification method. That is, by calculating the CRC verification value of the upgrade package, the calculated CRC value is compared with the CRC value sent by the control end. If they are the same, it is confirmed that the upgrade package is complete. If they are different, it is confirmed that there is a missing package. In this embodiment, the reliability of the upgrade process of the device end can be improved by verifying the upgrade package.
[0072] Further, at step S430, if the upgrade package is not missing, the upgrade package is spliced to obtain a complete upgrade package. In some embodiments, when the device side verifies that there is no missing package in the upgrade package, the upgrade packages are spliced in sequence according to the package order to obtain a complete upgrade package. Optionally, the device side can also perform an integrity check on the complete upgrade package after splicing to ensure that there are no errors in the splicing process. Finally, at step S440, based on the complete upgrade package, an upgrade operation is performed. In some embodiments, after the device side confirms that there is no missing package in the upgrade package and the splicing is completed, the device side can perform an upgrade operation based on the complete upgrade package through its own firmware upgrade process and execute an upgrade command. It can be understood that the device side performs remote upgrades of the device based on the LoRaWAN communication protocol, which overcomes the defect that long-distance wide area network devices can only perform short-range remote upgrades through Bluetooth, and is more suitable for large-scale breeding scenarios.
[0073] Reference Figure 5 , Figure 5Another embodiment of the present disclosure is shown, which is applied to a method flow of remote device upgrade on a device side. Figure 5 The method 500 for remotely upgrading a device shown includes: at step S510, if there is a missing packet in the upgrade package, a missing packet resend request is sent to the control end. In some embodiments, when the control end sends the upgrade package to the device end, it may be affected by network fluctuations, etc., resulting in a missing packet in the upgrade package received by the device end. The device end can detect whether there is a missing packet in the received upgrade package by checking the upgrade package. If there is a missing packet, the device end will send a missing packet resend request to the control end, so that the control end resends the upgrade package so that the device end performs the upgrade operation again when it receives a complete upgrade package.
[0074] And, at step S520, after detecting that the upgrade operation is completed, a heartbeat packet is sent to the control end. In some embodiments, the device end creates a heartbeat packet after the upgrade is completed, which contains information such as device id, version number, current status, timestamp, etc. Subsequently, the device end sends the heartbeat packet to the LoRaWAN gateway of the control end based on the LoRaWAN communication protocol. The control end can not only update the connection status between the device and the control end according to the received heartbeat packet, but also verify whether the upgrade of the device end is successful according to the version number, thereby improving the reliability of the remote upgrade of the device end based on the LoRaWAN communication protocol.
[0075] In order to facilitate the understanding of the technical solution disclosed in this disclosure, the following are respectively combined Figure 6 and Figure 7 To explain the interaction process between the control end and the device end. Figure 6 , Figure 6This is the interaction process between the control end and the device end in unicast upgrade mode. The control end includes the cloud platform, server and LoRaWAN gateway. When the upgrade operation instruction is triggered, the cloud platform of the control end responds, creates an upgrade record and records the start of the upgrade. At the same time, the cloud platform sends an upgrade query request to the server, which is sent to the LoRaWAN gateway, and the LoRaWAN gateway sends it to the device end. After receiving the upgrade query request, the target device confirms the upgrade and then sends the upgrade confirmation information to the control end. Then, the cloud platform of the control end receives the upgrade confirmation information, modifies the upgrade record accordingly, and then starts to send the previously split upgrade package and the corresponding JOSN file to the server in sequence, which includes the CRC check code, package sequence and target device id. After the sending is completed, the cloud platform modifies the upgrade record. Then, after receiving it, the server determines the corresponding LoRaWAN gateway and sends it to the gateway. After receiving the upgrade package and JOSN file, the LoRaWAN gateway sends it to the corresponding target device again according to the device id in it. After receiving the upgrade package, the target device checks whether there is a missing package. If there is no missing package, it will perform a package upgrade; if there is a missing package, it will send a missing package resend request to the control end. When the cloud platform receives the missing package resend request, it will resend the upgrade package and modify the upgrade record accordingly. After the target device is upgraded, it will upload a heartbeat package to the control end. The cloud platform on the control end verifies the version number of the heartbeat package to determine whether the unicast upgrade is successful and modify the upgrade record accordingly.
[0076] Next, refer to Figure 7 , Figure 7This is the interactive process between the control end and the device end in the multicast upgrade mode. When the upgrade operation instruction is triggered, the cloud platform of the control end responds, creates an upgrade record and records the start of the upgrade. At the same time, the cloud platform continuously sends multiple upgrade query requests to the server based on the preset time interval and preset number of times, and the request is sent to the device end via the server and the LoRaWAN gateway. After receiving the upgrade query request, the target device confirms the upgrade and sends the upgrade confirmation information to the control end. The cloud platform receives the upgrade confirmation information, modifies the upgrade record, and starts to send the previously split upgrade package and the corresponding JOSN file to the server in sequence based on the preset time interval and preset number of times, which includes CRC check code, package sequence and target device id. After each upgrade package is sent, the cloud platform modifies the upgrade record once. Subsequently, the upgrade package is also sent to the target device via the server and the LoRaWAN gateway. After receiving the upgrade package, the target device verifies whether there is a missing package. If there is no missing package, it will perform a package upgrade; if there is a missing package, it will send a missing package resend request to the control end. When the cloud platform receives the missing package resend request, it will resend the upgrade package and modify the upgrade record accordingly. After the target device is upgraded, it will upload a heartbeat packet to the control end. The cloud platform of the control end verifies the version number of the heartbeat packet to determine whether the upgrade is successful and modify the upgrade record accordingly.
[0077] Figure 8 800 is a schematic diagram of a system for remote upgrading of a device according to an embodiment of the present application. The system 800 may include a control terminal 801 for remote upgrading of a device according to an embodiment of the present application, as well as its peripheral devices and an external network, to realize the aforementioned combination Figure 1 - Figure 3 The method for remotely upgrading a device according to an embodiment of the present application is described.
[0078] like Figure 8 As shown in , the control terminal 801 may also include a CPU 811, which may be a general-purpose CPU, a special-purpose CPU, or other information processing and program execution units. Further, the control terminal 801 for remote device upgrade may also include a large-capacity memory 812 and a read-only memory ROM 813, wherein the large-capacity memory 812 may be configured to store various types of data. In the embodiment of the present application, it may include an upgrade package, an upgrade query request, an upgrade record, etc. In addition, the ROM 813 may be configured to store the initialization of each functional module of the control terminal 801 for remote device upgrade, the basic input / output driver of the system, and the data required for booting the operating system.
[0079] Furthermore, the system 800 may also include other hardware platforms or components, such as the tensor processing unit (TPU) 814, the image processing unit (GPU) 815, the field programmable gate array (FPGA) 816, and the machine learning unit (MLU) 817. It is understood that although a variety of hardware platforms or components are shown in the system 800, they are merely exemplary and not restrictive, and those skilled in the art may add or remove corresponding hardware according to actual needs.
[0080] The control terminal 800 for remote device upgrade also includes a communication interface 818, so that it can be connected to a local area network / wireless local area network (LAN / WLAN) 805 through the communication interface 818, and then connected to a local server 806 or to the Internet ("Internet") 805 through the LAN / WLAN. Alternatively or additionally, the control terminal 801 for remote device upgrade of the embodiment of the present application can also be directly connected to the Internet or cellular network based on wireless communication technology through the communication interface 818, such as wireless communication technology based on the third generation ("3G"), the fourth generation ("4G") or the fifth generation ("5G") . In some application scenarios, the control terminal 801 for remote device upgrade can also access the server 808 of the external network and the possible database 809 as needed, so as to obtain various known interactive information, and can store upgrade records, heartbeat packets, gateway configuration data, business data and other data.
[0081] The peripheral devices of the control terminal 801 for remote upgrading of the device may include a display device 802, an input device 803 and a data transmission interface 804. In one embodiment, the display device 802 may, for example, include one or more speakers and / or one or more visual displays, which are configured to perform voice prompts and / or image video display on the computing process or final result of the test device of the present application. The input device 803 may include, for example, a keyboard, a capture camera, or other input buttons or controls, which are configured to receive input or user instructions for detecting the call status. The data transmission interface 804 may include, for example, a serial interface, a parallel interface or a universal serial bus interface ("USB"), a small computer system interface ("SCSI"), a serial ATA, a FireWire ("FireWire"), a PCI Express and a high-definition multimedia interface ("HDMI"), etc., which are configured to transmit and interact with data of other devices or systems. According to the scheme of the present application, the data transmission interface 804 can transmit interactive information, control signals, images to be detected and detection results. The CPU 811, the mass storage 812, the read-only memory ROM 813, the TPU 814, the GPU 815, the FPGA 816, the MLU 817 and the communication interface 818 of the control terminal 801 for remote device upgrade of the present application can be connected to each other through a bus 819, and data interaction with peripheral devices can be achieved through the bus. In one embodiment, through the bus 819, the CPU 811 can control other hardware components and peripheral devices in the control terminal 801 for remote device upgrade.
[0082] Fig. 9 1 is a schematic diagram of a computing device 900 for performing remote device upgrade according to an embodiment of the present application. The computing device 900 may include a processor 910 and a processor 920 for performing remote device upgrade according to an embodiment of the present application to implement the aforementioned combination Figure 4 - Figure 5 The method for remotely upgrading a device according to an embodiment of the present application is described.
[0083] The present application also discloses a computer-readable storage medium, in which program instructions are stored, and the program instructions are suitable for being loaded and executed by a processor: using a cloud platform, responding to an upgrade operation instruction to send an upgrade query request to a server; using a server and a LoRaWAN gateway to transmit the upgrade query request to a device end; using a cloud platform, a server and a LoRaWAN gateway, responding to the confirmation upgrade information returned by the target device to transmit the upgrade package to the target device, wherein the target device belongs to the device end. Based on this, when the scheme of the present application is embodied in the form of a software product (computer-readable storage medium), the software product can be stored in a memory, which can include several instructions to enable a computer device (such as a personal computer, a server or a network device, etc.) to perform some or all of the steps of the method described in the embodiment of the present application. The aforementioned memory may include, but is not limited to, various media that can store program codes, such as a U disk, a flash drive, a read-only memory ROM, a random access memory ("Random Access Memory", abbreviated as RAM), a mobile hard disk, a disk or an optical disk.
[0084] Although multiple embodiments of the present disclosure have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art may think of many changes, modifications, and alternatives without departing from the thought and spirit of the present disclosure. It should be understood that in the process of practicing the present disclosure, various alternatives to the embodiments of the present disclosure described herein may be adopted. The attached claims are intended to define the scope of protection of the present disclosure, and therefore cover equivalents or alternatives within the scope of these claims.
Claims
1. A method for remotely upgrading a device, characterized in that: Applied to a control end, the control end includes a cloud platform, a server and a LoRaWAN gateway, and the method includes: Using the cloud platform, responding to the upgrade operation instruction to send an upgrade query request to the server; Utilizing the server and the LoRaWAN gateway to transmit the upgrade inquiry request to the device end; The cloud platform, the server and the LoRaWAN gateway are used to respond to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device, wherein the target device belongs to the device end.
2. The method according to claim 1, characterized in that The utilizing the cloud platform and responding to the upgrade operation instruction to send an upgrade inquiry request to the server includes: Using the cloud platform, determining the upgrade type according to the upgrade operation instruction and generating the upgrade inquiry request; If it is a unicast upgrade type, sending the upgrade query request to the server once; If it is a multicast upgrade type, the upgrade query request is sent to the server based on a preset time interval and a preset number of times.
3. The method according to claim 1, characterized in that The utilizing of the cloud platform, the server and the LoRaWAN gateway to respond to the confirmation upgrade information returned by the target device to transmit the upgrade package to the target device comprises: Using the cloud platform, determining the device identification of the target device according to the confirmed upgrade information; Using the cloud platform, the split upgrade packages and corresponding JOSN files are sent to the server in sequence; Using the server, determining a gateway identifier according to the JOSN file, and sending the upgrade package and the JOSN file to the corresponding LoRaWAN gateway based on the gateway identifier; The LoRaWAN gateway is used to determine the device identification according to the JOSN file, and the upgrade package and the JOSN file are sent to the corresponding target device in sequence based on the device identification.
4. The method according to claim 1, characterized in that: After the cloud platform, the server and the LoRaWAN gateway are used to respond to the confirmation upgrade information sent back by the target device to transmit the upgrade package to the target device, the method further includes: Utilizing the cloud platform, receiving and responding to the missing packet retransmission request sent by the target device, so as to execute the step of utilizing the cloud platform, the server and the LoRaWAN gateway to respond to the confirmation information sent back by the target device and transmit the upgrade package to the target device; When the heartbeat packet transmitted by the target device is received, the version number is verified using the cloud platform to determine whether the target device is successfully upgraded.
5. The method according to claim 1, characterized in that The method further comprises: The cloud platform is used to create an upgrade record in response to the upgrade operation instruction, and the cloud platform is used to perform an operation of modifying the upgrade record when any of the following trigger conditions is met: Receiving the upgrade confirmation information or the packet-missing resend request transmitted by the target device; The upgrade package is sent out.
6. A method for remotely upgrading a device, characterized in that: Applied to the device side, including: Receive an upgrade inquiry request sent by the control terminal, and return confirmation upgrade information to the control terminal; Receiving the upgrade package sent by the control terminal and verifying whether the upgrade package is missing; If the upgrade package is not missing any package, perform a package assembly operation on the upgrade package to obtain a complete upgrade package; An upgrade operation is performed based on the complete upgrade package.
7. The method according to claim 6, characterized in that The method further comprises: If the upgrade package is missing, sending a missing package resend request to the control terminal; After detecting that the upgrade operation is completed, a heartbeat packet is sent to the control end.
8. A control terminal, characterized in that: include: processor; A memory storing program instructions for remote upgrading of a device, wherein when the program instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.
9. A device end, characterized in that: include: processor; A memory storing program instructions for remote upgrading of a device, wherein when the program instructions are executed by the processor, the method according to any one of claims 6-7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions for remote upgrading of a device. When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 5 or claims 6 to 7 can be implemented.