Terminal upgrade method, device and storage medium
Through the shadow theme mechanism and incremental upgrade package, the pressure on servers of large-scale upgrades of terminal equipment is solved, and the equipment is upgraded independently, timely and efficiently.
Patent Information
- Application Number
- CN202111550883.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-17
AI Technical Summary
In the prior art, a large number of upgrades to terminal devices lead to problems such as increasing server response time, high bandwidth pressure, and untimely upgrades.
Through the shadow theme mechanism, the server generates an upgrade message and sends it to the device to be upgraded. The device obtains upgrade task information through the shadow theme and performs version upgrades when it is online, supporting incremental upgrade packages to reduce network overhead.
It reduces the processing pressure and bandwidth pressure of the server, improves the terminal upgrade efficiency, and realizes independent and timely upgrades of equipment.
Smart Images

Figure CN114489711B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a terminal upgrading method, a terminal upgrading device and a machine-readable storage medium. Background Art
[0002] With the development of computer technology, the shipment volume of terminal devices is also increasing. This includes retail devices in the new retail sector, such as coffee machines. As the number of devices increases and they are distributed across various locations, when bugs or function upgrades occur in the device's built-in software system, manually updating the system or fixing the bugs on each device requires a significant investment of time and money.
[0003] To address this issue, the prior art provides a technical solution for upgrading devices based on HTTP request methods. When the terminal is turned on, the terminal can send a request to the server to determine whether there is an available upgrade package on the server. If so, the full upgrade package is downloaded and installed to upgrade the version. However, in this way, the terminal is upgraded based on a fixed startup judgment. When the number of terminals is large, since the terminals access the server at the same time, a large number of terminals will access the server in a short period of time, resulting in an increase in the server's response time and a slowdown in the server's processing efficiency. At the same time, the bandwidth pressure on the server is also very high, and the server's handling of bugs is not timely enough. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide a terminal upgrade method, device, storage medium and processor. In order to achieve the above purpose, the first aspect of the present application provides a terminal upgrade method, which is applied to a server. The terminal upgrade method includes:
[0005] Get upgrade task information, including upgrade packages;
[0006] Determine the device to be upgraded in the terminal according to the upgrade task information, and generate an upgrade message corresponding to the device to be upgraded;
[0007] Send an upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded can obtain the upgrade task information through the shadow topic when it is online and perform the version upgrade.
[0008] In one embodiment of the present application, upgrade feedback information reported by the device to be upgraded is received; and when it is determined according to the upgrade feedback information that the upgrade of the device to be upgraded is successful, the version number of the device to be upgraded is updated.
[0009] In one embodiment of the present application, when it is determined that the upgrade of the device to be upgraded has failed based on the upgrade feedback information, an upgrade message is sent again to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic and performs a version upgrade until the upgrade of the device to be upgraded is successful.
[0010] In one embodiment of the present application, when it is determined based on the upgrade feedback information that the upgrade of the device to be upgraded has failed, a reminder message of the upgrade failure is sent to the device to be upgraded; and an upgrade log of the device to be upgraded is obtained to determine the cause of the upgrade failure.
[0011] In one embodiment of the present application, sending the upgrade message to the shadow topic subscribed by the device to be upgraded includes: sending the upgrade message to the shadow topic subscribed by the device to be upgraded through a message queue telemetry transmission protocol.
[0012] In one embodiment of the present application, the terminal includes multiple devices, and the upgrade task information also includes additional information. The device to be upgraded in the terminal is determined according to the upgrade task information, and an upgrade message corresponding to the device to be upgraded is generated, including: obtaining the current version number of each device; determining the device to be upgraded among the multiple devices according to the current version number and the version number information in the upgrade task information; generating an upgrade message corresponding to each device to be upgraded according to the additional information and the upgrade package, wherein the upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package.
[0013] In one embodiment of the present application, the upgrade package is an incremental upgrade package.
[0014] A second aspect of the present application provides a terminal upgrade method, which is applied to a terminal. The terminal upgrade method includes:
[0015] Get upgrade messages by subscribing to shadow topics;
[0016] When going online, the upgrade message is received according to the shadow topic to obtain the upgrade task information, which includes the upgrade package;
[0017] Upgrade the version according to the upgrade task information.
[0018] In one embodiment of the present application, when the upgrade is successful, an upgrade feedback message indicating the success of the upgrade is sent to the server so that the version number is updated through the server.
[0019] In one embodiment of the present application, in the event of an upgrade failure, an upgrade feedback message of the upgrade failure is sent to the server; the upgrade message issued by the server based on the upgrade feedback information of the upgrade failure is obtained again through the shadow theme, and the upgrade task information corresponding to the upgrade message is obtained from the server, and the version is upgraded according to the upgrade task information until the upgrade is successful.
[0020] In one embodiment of the present application, in the event of an upgrade failure, upgrade feedback information of the upgrade failure is sent to the server; reminder information sent by the server based on the upgrade feedback information of the upgrade failure is obtained; and the upgrade log is uploaded to the server to determine the cause of the upgrade failure.
[0021] In one embodiment of the present application, an upgrade message sent by the server through a message queue telemetry transmission protocol is obtained through a shadow topic.
[0022] In one embodiment of the present application, the upgrade task information includes additional information, the terminal includes multiple devices, and obtaining the upgrade message through the subscribed shadow topic also includes: for each device, uploading the device identification and the current version number of the device to the server; after the server determines the device to be upgraded based on the current version number and the version number in the upgrade task information, obtaining the upgrade message generated by the server based on the additional information and the upgrade package through the shadow topic; wherein, the upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package.
[0023] In one embodiment of the present application, the upgrade package is an incremental upgrade package.
[0024] A third aspect of the present application provides a terminal upgrade device, which is applied to a server. The terminal upgrade device includes:
[0025] A data acquisition module is used to obtain upgrade task information, including upgrade packages;
[0026] An upgrade device determination module is used to determine the device to be upgraded in the terminal according to the upgrade task information and generate an upgrade message corresponding to the device to be upgraded;
[0027] The first upgrade module is used to send an upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic when it is online and performs version upgrade.
[0028] A fourth aspect of the present application provides a terminal upgrade device, which is applied to a terminal. The terminal upgrade device includes:
[0029] Message monitoring module, used to obtain upgrade messages through subscribed shadow topics;
[0030] The data acquisition module is used to obtain upgrade task information based on the upgrade message received from the shadow topic when going online. The upgrade task information includes the upgrade package;
[0031] The second upgrade module is used to upgrade the version according to the upgrade task information.
[0032] A fifth aspect of the present application provides a machine-readable storage medium having instructions stored thereon. When the instructions are executed by a processor, the processor is configured to execute any one of the terminal upgrade methods described above.
[0033] In the above technical solution, the server can determine the device to be upgraded in the terminal based on the acquired upgrade task information, and generate an upgrade message corresponding to the device to be upgraded. After the server sends the upgrade message to the shadow theme subscribed by the device to be upgraded, the device to be upgraded can obtain the upgrade task information through the shadow theme and perform a version upgrade. When the server receives the upgrade feedback information reported by the device to be upgraded and determines that the upgrade of the device to be upgraded is successful based on the upgrade feedback information, it can update the version number of the device to be upgraded, thus completing the upgrade of the terminal version. In this method, the terminal can use the shadow theme to ensure that it will not miss the upgrade message sent by the server even when it is offline. When the terminal is online, it can obtain the upgrade task information corresponding to the upgrade message sent by the server through the shadow theme to achieve the upgrade of the version. Using this method to achieve the terminal upgrade will not cause a large number of terminals to access the server at the same time, resulting in an increase in the processing pressure of the server. At the same time, the terminal also has the autonomy to upgrade and can choose the time to upgrade the version according to its own situation, effectively reducing the bandwidth pressure of the server and improving the upgrade efficiency of the terminal.
[0034] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following detailed description, they are used to explain the embodiments of the present application but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:
[0036] Figure 1 The following schematically shows a flow chart of a terminal upgrade method according to an embodiment of the present invention;
[0037] Figure 2 A schematic flowchart of a terminal upgrading method according to another embodiment of the present invention is schematically shown;
[0038] Figure 3 The following schematically shows a structural block diagram of a terminal upgrading device according to an embodiment of the present invention;
[0039] Figure 4 A schematic block diagram of a terminal upgrading device according to another embodiment of the present invention is shown;
[0040] Figure 5 The figure schematically shows the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The following describes the specific embodiments of the present application in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only used to illustrate and explain the present application and are not intended to limit the present application.
[0042] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0043] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the fact that they can be implemented by ordinary technicians in this field. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0044] like Figure 1 As shown, it schematically shows a flow chart of the terminal upgrade method according to an embodiment of the present application. Figure 1 As shown, in one embodiment of the present application, a terminal upgrade method is provided, which is applied to a server and includes the following steps:
[0045] Step 101: Obtain upgrade task information, which includes an upgrade package.
[0046] Step 102: Determine the device to be upgraded in the terminal according to the upgrade task information, and generate an upgrade message corresponding to the device to be upgraded;
[0047] Step 103: Send an upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded can obtain the upgrade task information through the shadow topic when it is online and perform version upgrade.
[0048] In one embodiment, the upgrade message includes at least one of an identifier of the upgrade package, a version number of the upgrade package, an address of the upgrade package, an update level of the upgrade package, and a release time of the upgrade package.
[0049] The upgrade message generated by the server corresponding to the device to be upgraded in the terminal may include at least one of: an identifier of the upgrade package, a version number of the upgrade package, an address of the upgrade package, an update level of the upgrade package, and a release time of the upgrade package. The update level of the upgrade package includes at least one of: direct update, idle update, restart update, and forced update.
[0050] In one embodiment, the upgrade package is an incremental upgrade package.
[0051] The server can obtain upgrade task information for the terminal device to be upgraded. This upgrade task information may include an upgrade package. This upgrade package is an incremental upgrade package, not a full upgrade package. This means that the upgrade package uses an incremental upgrade approach, replacing only modified files to reduce network overhead between the terminal and the server. After receiving the upgrade task information, the server can identify the device to be upgraded in the terminal based on the received upgrade task information and designate it as the device to be upgraded. After identifying the device to be upgraded, the server can generate an upgrade message corresponding to the device to be upgraded.
[0052] In one embodiment, the terminal includes multiple devices, and the upgrade task information also includes additional information. The device to be upgraded in the terminal is determined according to the upgrade task information, and an upgrade message corresponding to the device to be upgraded is generated, including: obtaining the current version number of each device; determining the device to be upgraded among the multiple devices according to the current version number and the version number information in the upgrade task information; generating an upgrade message corresponding to each device to be upgraded according to the additional information and the upgrade package, wherein the upgrade task information includes the upgrade package and additional information, the upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package.
[0053] In one embodiment, the additional information includes at least one of a version number of the upgrade package, an update level of the upgrade package, and an update log.
[0054] In one embodiment, the update level includes at least one of direct update, idle update, restart update and forced update. After obtaining the upgrade task information of the upgrade package, the device to be upgraded performs the version upgrade according to the selected update level.
[0055] The server can obtain upgrade task information, wherein the upgrade task information may include an upgrade package, and the upgrade package is an incremental upgrade package, not a full upgrade package. The upgrade task information may also include additional information. The additional information may include at least one of the version number of the upgrade package, the update level of the upgrade package, and the update log. The additional information in the upgrade task information may be used to describe the properties of the upgrade package, the update level, and the metadata information of this upgrade update, wherein the metadata information of this upgrade update may include time, publisher information, etc. The update level of the upgrade package may include at least one of direct update, idle update, restart update, and forced update.
[0056] The terminal may include multiple devices. The server may obtain the current version number of each device and, based on the received upgrade task information, compare the obtained current version number of each device in the terminal with the version number information in the upgrade task information. The server may then determine the device to be upgraded in the terminal based on the received upgrade task information and determine it as the device to be upgraded. The server may generate an upgrade message corresponding to each device to be upgraded based on the additional information in the upgrade task information and the upgrade package. The upgrade package is used to complete the upgrade task for the device to be upgraded, and the additional information is used to describe the relevant information of the upgrade package. For example, the additional information may be used to describe the attributes of the upgrade package, the update level, and metadata information for this upgrade update. The metadata information for this upgrade update may include time, publisher information, and the like.
[0057] In one embodiment, after generating an upgrade message corresponding to each device to be upgraded based on the additional information and the upgrade package, the upgrade package is saved; user information for entering the additional information is obtained; and a corresponding upgrade record is created based on the user information, the upgrade message, and the generation time of the upgrade message.
[0058] After generating an upgrade message corresponding to each device to be upgraded in the terminal based on the additional information in the upgrade task information and the upgrade package, the server can save the upgrade package. It also obtains the user information that entered the additional information and creates a corresponding upgrade record based on the user information, the upgrade message, and the time the upgrade message was generated. The upgrade record can include data such as the upgrade information, user information (i.e., the creator), and the time the upgrade information was generated.
[0059] The server can send the upgrade message corresponding to the device to be upgraded to a shadow topic subscribed to by the device to be upgraded. When the device to be upgraded is online, the server can retrieve the upgrade message sent by the server through the shadow topic, thereby obtaining upgrade task information. The device can then perform a version upgrade based on the obtained task information. When performing a version upgrade based on the obtained task information, the device can upgrade based on the upgrade package's update level, which can be at least one of direct update, idle update, reboot update, and forced update.
[0060] In one embodiment, sending the upgrade message to the shadow topic subscribed by the device to be upgraded includes: sending the upgrade message to the shadow topic subscribed by the device to be upgraded through a message queue telemetry transmission protocol.
[0061] The server can send the upgrade message to the shadow topic subscribed by the device to be upgraded through the message queue telemetry transmission protocol, so that the device to be upgraded in the terminal can obtain the upgrade task information through the shadow topic, thereby upgrading the version.
[0062] In one embodiment, upgrade feedback information reported by the device to be upgraded is received; and when it is determined according to the upgrade feedback information that the upgrade of the device to be upgraded is successful, the version number of the device to be upgraded is updated.
[0063] After the device to be upgraded in the terminal receives the upgrade task information through the shadow theme and performs the version upgrade, it can send the upgrade feedback information to the server. After receiving the upgrade feedback information reported by the device to be upgraded, the server can determine whether the upgrade of the device to be upgraded is successful based on the upgrade feedback information. If the server determines that the upgrade of the device to be upgraded is successful based on the received upgrade feedback information, it can update the version number of the upgraded device.
[0064] In one embodiment, upgrade feedback information reported by the device to be upgraded through the upgrade topic is received, and the upgrade feedback information carries the device identifier of the device to be upgraded and the upgrade task identifier corresponding to the upgrade message.
[0065] The server can receive upgrade feedback information from the device to be upgraded via a shadow topic to which the device is subscribed. The upgrade feedback information reported by the device to be upgraded can include the device identifier and the upgrade task identifier corresponding to the upgrade message. In other words, the device to be upgraded in the terminal can report the upgrade progress and results to the server via the upgrade feedback information.
[0066] In one embodiment, when it is determined based on the upgrade feedback information that the upgrade of the device to be upgraded has failed, an upgrade message is sent again to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic and performs a version upgrade until the upgrade of the device to be upgraded is successful.
[0067] After the device to be upgraded in the terminal obtains the upgrade task information through the shadow theme and performs the version upgrade, the specific upgrade status can be reported to the server through the upgrade feedback information. The server determines that the device to be upgraded is in the state of device upgrade failure through the received upgrade feedback information. The server can send an upgrade message to the shadow theme subscribed by the holy grail to be upgraded again, so that the device to be upgraded can obtain the upgrade task information sent by the server through the shadow theme again and perform the version upgrade according to the obtained upgrade task information. Until the upgrade of the device to be upgraded is successful, the device to be upgraded can report the upgrade success information to the server through the upgrade feedback information. The server determines that the upgrade of the device to be upgraded is successful through the upgrade feedback information, and can no longer send upgrade messages to the shadow theme subscribed by the device to be upgraded.
[0068] In one embodiment, when it is determined according to the upgrade feedback information that the upgrade of the device to be upgraded has failed, a reminder message of upgrade failure is sent to the device to be upgraded; and an upgrade log of the device to be upgraded is obtained to determine the cause of the upgrade failure.
[0069] When the server determines that the upgrade of the device to be upgraded has failed based on the upgrade feedback information uploaded by the device to be upgraded, the server can send an upgrade failure reminder message to the device to be upgraded, thereby obtaining the upgrade log of the device to be upgraded, and determine the reason for the upgrade failure of the device to be upgraded based on the obtained upgrade log.
[0070] In the above technical solution, the server can determine the device to be upgraded in the terminal based on the acquired upgrade task information, and generate an upgrade message corresponding to the device to be upgraded. After the server sends the upgrade message to the shadow theme subscribed by the device to be upgraded, the device to be upgraded can obtain the upgrade task information through the shadow theme and perform a version upgrade. When the server receives the upgrade feedback information reported by the device to be upgraded and determines that the upgrade of the device to be upgraded is successful based on the upgrade feedback information, it can update the version number of the device to be upgraded, thus completing the upgrade of the terminal version. In this method, the terminal can use the shadow theme to ensure that it will not miss the upgrade message sent by the server even when it is offline. When the terminal is online, it can obtain the upgrade task information corresponding to the upgrade message sent by the server through the shadow theme to achieve the upgrade of the version. Using this method to achieve the terminal upgrade will not cause a large number of terminals to access the server at the same time, resulting in an increase in the processing pressure of the server. At the same time, the terminal also has the autonomy to upgrade and can choose the time to upgrade the version according to its own situation, effectively reducing the bandwidth pressure of the server and improving the upgrade efficiency of the terminal.
[0071] like Figure 2 As shown, it schematically shows a flow chart of the terminal upgrade method according to an embodiment of the present application. Figure 2 As shown, in one embodiment of the present application, a terminal upgrade method is provided, which is applied to a terminal and includes the following steps:
[0072] Step 201: Obtain upgrade information through the subscribed shadow topic;
[0073] Step 202: When going online, an upgrade message is received according to the shadow theme to obtain upgrade task information, where the upgrade task information includes an upgrade package.
[0074] In one embodiment, the upgrade message sent by the server through the message queue telemetry transmission protocol is obtained through the shadow topic.
[0075] Step 203: perform version upgrade according to the upgrade task information.
[0076] Because the terminal subscribes to a shadow topic, it can receive messages from the shadow topic in real time. After the shadow topic receives an upgrade message from the server, the terminal can access the upgrade message through the subscribed shadow topic. When the terminal goes online, the device to be upgraded in the terminal can use the shadow topic to obtain the upgrade message sent by the server via the message queue telemetry transmission protocol. After the device to be upgraded in the terminal receives the upgrade message through the shadow topic, it can retrieve the upgrade task information corresponding to the upgrade message from the server based on the upgrade message received in the shadow topic. The upgrade task information includes the upgrade package. The device to be upgraded in the terminal can then be upgraded based on the upgrade task information.
[0077] In one embodiment, the upgrade task information includes additional information, the terminal includes multiple devices, and obtaining the upgrade message through the subscribed shadow topic also includes: for each device, uploading the device identification and the current version number of the device to the server; after the server determines the device to be upgraded based on the current version number and the version number in the upgrade task information, obtaining the upgrade message generated by the server based on the additional information and the upgrade package through the shadow topic; wherein, the upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package.
[0078] The terminal includes multiple devices. For each device in the terminal, the device identifier and the current version number of the device are uploaded to the server. After receiving the identifier and current version number of each device uploaded by the terminal, the server can determine the device to be upgraded in the terminal based on the current version number and the version number in the upgrade task information. The upgrade task information can include an upgrade package. After the server determines the device to be upgraded, it can generate an upgrade message based on the upgrade package and additional information in the upgrade task information. The device to be upgraded in the terminal can obtain the upgrade message through the shadow topic. The upgrade package is used to complete the upgrade task, and the additional information is used to describe the relevant information of the upgrade package, such as the attributes of the upgrade package, the update level, and the metadata information of this upgrade update. The metadata information of this upgrade update includes information such as the time and publisher.
[0079] In one embodiment, the upgrade message carries at least one of an identifier of the upgrade package, a version number of the upgrade package, an address of the upgrade package, an update level of the upgrade package, and a release time of the upgrade package.
[0080] The upgrade message received by the device to be upgraded may carry at least one of the upgrade package identifier, the upgrade package version number, the upgrade package address, the upgrade package update level, and the release time of the upgrade package. The update level of the upgrade package may include at least one of direct update, idle update, restart update, and forced update.
[0081] In one embodiment, the upgrade package is an incremental upgrade package.
[0082] The upgrade package in the upgrade task information is an incremental upgrade package, not a full upgrade package. Incremental upgrade packages use an incremental upgrade method and only replace modified files, thereby reducing network overhead between the terminal and the server.
[0083] In one embodiment, when the upgrade is successful, an upgrade feedback message indicating the upgrade is successful is sent to the server so that the version number is updated through the server.
[0084] The terminal can upgrade the device to be upgraded according to the upgrade task information. If the upgrade of the device to be upgraded is successful, the device to be upgraded in the terminal can send upgrade feedback information of successful upgrade to the server, so that the version number is updated by the server and the version number is updated to the version number after the upgrade is successful.
[0085] In one embodiment, in the event of an upgrade failure, an upgrade feedback message of the upgrade failure is sent to the server; the upgrade message issued by the server based on the upgrade feedback information of the upgrade failure is obtained again through the shadow theme, and the upgrade task information corresponding to the upgrade message is obtained from the server, and the version is upgraded according to the upgrade task information until the upgrade is successful.
[0086] If the upgrade fails for the device in the terminal, the terminal can send an upgrade feedback message to the server. After receiving the upgrade feedback message, the server can send an upgrade message to the shadow topic again. Therefore, the device in the terminal can receive the upgrade message from the server again through the shadow topic after the upgrade fails. It then obtains the upgrade task information corresponding to the upgrade message from the server and then performs the version upgrade based on the obtained upgrade task information. This continues until the device is successfully upgraded.
[0087] In one embodiment, in the event of an upgrade failure, upgrade feedback information of the upgrade failure is sent to the server; reminder information sent by the server based on the upgrade feedback information of the upgrade failure is obtained; and an upgrade log is uploaded to the server to determine the cause of the upgrade failure.
[0088] If an upgrade fails, the device in the terminal can send an upgrade failure feedback message to the server. Upon receiving the upgrade failure feedback message, the server can send an upgrade failure reminder message to the terminal. Upon receiving the reminder message from the server, the device in the terminal can upload an upgrade log to the server, allowing the server to determine the cause of the upgrade failure from the upgrade log.
[0089] like Figure 3 As shown, a block diagram of the terminal upgrade device according to an embodiment of the present application is schematically shown. Figure 3 As shown, in one embodiment of the present application, a terminal upgrade device 300 is provided, which is applied to a server and includes:
[0090] The data acquisition module 301 is used to acquire upgrade task information, including upgrade packages;
[0091] An upgrade device determination module 302 is configured to determine a device to be upgraded in the terminal according to the upgrade task information and generate an upgrade message corresponding to the device to be upgraded;
[0092] The first upgrade module 303 is configured to send an upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains upgrade task information through the shadow topic when it is online and performs version upgrade.
[0093] The terminal upgrade apparatus 300 includes a data acquisition module 301, which can acquire upgrade task information, including an upgrade package. The upgrade package can be an incremental upgrade package, meaning that the upgrade package uses an incremental upgrade method to replace only modified files, reducing network overhead between the terminal and the server. The upgrade task information also includes additional information, including at least one of the upgrade package version number, the upgrade package update level, and an update log.
[0094] The upgrade device determination module 302 can determine the devices to be upgraded in the terminal based on the upgrade task information. The upgrade device determination module 302 can obtain the current version number of each device in the terminal and compare the current version number with the version number in the upgrade task information obtained by the data acquisition module 301, thereby determining the devices to be upgraded among the multiple devices in the terminal. After determining the devices to be upgraded in the terminal, the upgrade device determination module 302 can generate an upgrade message corresponding to each device to be upgraded based on the additional information in the upgrade task information and the upgrade package. The upgrade message includes at least one of the upgrade package identifier, the upgrade package version number, the upgrade package address, the upgrade package update level, and the release time of the upgrade package. The upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package, such as the upgrade package attributes, update level, and metadata information of the upgrade update. The metadata information of the upgrade update includes information such as the time and publisher.
[0095] After generating an upgrade message corresponding to each device to be upgraded based on the additional information and the upgrade package, the upgrade device determination module 302 saves the upgrade package and obtains the user information of the additional information. A corresponding upgrade record can be created based on the obtained user information, the upgrade message, and the generation time of the upgrade message.
[0096] After the upgrade device determination module 302 generates the corresponding upgrade message, the first upgrade module 303 can send the upgrade message to the shadow topic subscribed by the device to be upgraded through the message queue telemetry transmission protocol, so that the device to be upgraded can obtain the upgrade task information through the shadow topic when it is online, and upgrade the version according to the obtained upgrade task information.
[0097] Specifically, for example, the first upgrade module 303 in the server sends an upgrade message to the terminal. The device to be upgraded in the terminal can determine how to handle this update based on the version number and update level contained in the upgrade message. Assuming the update level is direct update, this means that this update does not require a restart and will not affect the normal operation of the terminal device. The terminal can determine the version number of the device to be upgraded. If it is a new version, the terminal can download the upgrade package and start the upgrade task. If it is a smaller version or the same version number, the terminal sends the upgrade result and refuses the upgrade. Assuming the update level is idle update, the terminal will wait until the production task stops and begin to determine the version number of the device to be upgraded. If it is a new version, the terminal device will download the upgrade package and start the upgrade task. If it is a smaller version or the same version number, the terminal sends the upgrade result and refuses the upgrade. Assuming the update level is restart update, the terminal will set a restart task. When the terminal device is shut down, it will begin to determine the version number. If it is a new version, the terminal device will download the upgrade package and start the upgrade task. After the upgrade is complete, it will shut down. The upgrade will be completed the next time it is turned on. If it is a smaller version or the same version number, the terminal sends the upgrade result, refuses the upgrade, and then shuts down. Assuming that the update level is forced update, the terminal can ignore the version number verification, ignore whether the terminal device is working, directly pause the current task, and start the forced upgrade.
[0098] The first upgrade module 303 can receive upgrade feedback information reported by the device to be upgraded. The upgrade feedback information carries the device identifier of the device to be upgraded and the upgrade task identifier corresponding to the upgrade message. When it is determined based on the upgrade feedback information that the upgrade of the device to be upgraded is successful, the version number of the device to be upgraded can be updated based on the upgrade feedback information. If it is determined based on the upgrade feedback information of the device to be upgraded that the upgrade of the device to be upgraded has failed, the first upgrade module 303 can again send the upgrade message to the shadow topic subscribed by the device to be upgraded through the message queue telemetry transmission protocol, so that the device to be upgraded obtains the upgrade task information through the shadow topic and performs a version upgrade until the upgrade of the device to be upgraded is successful. When the first upgrade module 303 determines based on the upgrade feedback information that the upgrade of the device to be upgraded has failed, it sends an upgrade failure reminder message to the device to be upgraded; and obtains the upgrade log of the device to be upgraded to determine the cause of the upgrade failure.
[0099] like Figure 4 As shown, a block diagram of the terminal upgrade device according to an embodiment of the present application is schematically shown. Figure 4 As shown, in one embodiment of the present application, a terminal upgrading device 400 is provided, which is applied to a terminal and includes:
[0100] Message monitoring module 401, used to obtain upgrade messages through subscribed shadow topics;
[0101] The data acquisition module 402 is used to obtain upgrade task information according to the upgrade message received from the shadow theme when going online. The upgrade task information includes the upgrade package;
[0102] The second upgrade module 403 is used to upgrade the version according to the upgrade task information.
[0103] The terminal can subscribe to the message of the shadow topic through the message monitoring module 401. By subscribing to the message of the shadow topic, it is determined whether the server has sent an upgrade message to the shadow topic.
[0104] After the terminal determines, through message monitoring module 401, that the shadow theme has received an upgrade message from the server, data acquisition module 402 can retrieve the upgrade message from the shadow theme and, based on the received upgrade message, obtain upgrade task information, including the upgrade package. The terminal includes multiple devices. For each device in the terminal, data acquisition module 402 can upload the device identifier and current version number of the device to the server. After the server determines the device to be upgraded based on the current device version number and the device version number in the upgrade task information, the server generates an upgrade message based on the upgrade package and additional information in the upgrade task information. Data acquisition module 402 can retrieve the upgrade message generated by the server based on the additional information and the upgrade package through the shadow theme. The upgrade message carries at least one of the upgrade package identifier, version number, address, update level, and release date. The upgrade package is an incremental upgrade package used to complete the upgrade task. The incremental upgrade package uses an incremental upgrade method, replacing only modified files to reduce network overhead between the terminal and the server. The additional information describes the upgrade package.
[0105] After the terminal obtains the upgrade message through the data acquisition module 402, the upgrade task information corresponding to the upgrade message can be obtained from the server through the second upgrade module 403, thereby performing a version upgrade on the device to be upgraded. When the upgrade of the device to be upgraded is successful, the upgrade feedback information of the successful upgrade is sent to the server, thereby updating the version number through the server. If the upgrade of the device to be upgraded in the terminal fails, the second upgrade module 403 can send the upgrade feedback information of the failed upgrade to the server. Since the server can send the upgrade message to the shadow theme again after receiving the upgrade feedback information of the failed upgrade. Therefore, the message monitoring module 401 can monitor the upgrade message received by the shadow theme. When the shadow theme receives the upgrade message sent by the server through the data acquisition module 402, the terminal obtains the upgrade message through the shadow theme again. The second upgrade module 403 upgrades the version according to the upgrade message obtained again by the data acquisition module 402, and knows that the upgrade of the device to be upgraded is successful.
[0106] In the event of an upgrade failure, the second upgrade module may further send an upgrade feedback message indicating the upgrade failure to the server. Upon receiving the upgrade feedback message indicating the upgrade failure, the server may send an upgrade failure reminder message to the terminal. Upon receiving the reminder message sent by the server, the second upgrade module 403 may upload an upgrade log to the server, so that the server can determine the cause of the upgrade failure from the upgrade log.
[0107] An embodiment of the present application provides a storage medium on which a program is stored. When the program is executed by a processor, the terminal upgrade method described above is implemented.
[0108] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown in the figure) and a database (not shown in the figure) connected via a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02 and a database (not shown in the figure). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A04. The database of the computer device is used to store data related to upgrade information. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program B02 is executed by the processor A01, a terminal upgrade method is implemented.
[0109] Those skilled in the art will understand that the structure shown in Figure Y is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0110] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0112] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0114] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0115] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0116] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0117] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0118] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A terminal upgrade method, characterized in that: Applied to the server, the terminal upgrade method includes: Acquire upgrade task information, wherein the upgrade task information includes an upgrade package; Determine the device to be upgraded in the terminal according to the upgrade task information, and generate an upgrade message corresponding to the device to be upgraded; Send the upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic when it is online and performs version upgrade; Receiving upgrade feedback information reported by the device to be upgraded; When it is determined that the upgrade of the device to be upgraded has failed based on the upgrade feedback information, the upgrade message is sent again to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic and performs version upgrade until the upgrade of the device to be upgraded is successful.
2. The terminal upgrade method according to claim 1, characterized in that: The terminal upgrade method further includes: Receiving upgrade feedback information reported by the device to be upgraded; If it is determined according to the upgrade feedback information that the device to be upgraded is successfully upgraded, the version number of the device to be upgraded is updated.
3. The terminal upgrade method according to claim 1, characterized in that: The terminal upgrade method further includes: When it is determined according to the upgrade feedback information that the upgrade of the device to be upgraded has failed, sending an upgrade failure reminder message to the device to be upgraded; Obtain the upgrade log of the device to be upgraded to determine the cause of the upgrade failure.
4. The terminal upgrade method according to claim 1, characterized in that: The sending of the upgrade message to the shadow topic subscribed by the device to be upgraded includes: Send an upgrade message to the shadow topic subscribed by the device to be upgraded via the message queue telemetry transmission protocol.
5. The terminal upgrade method according to claim 1, characterized in that: The terminal includes multiple devices, the upgrade task information further includes additional information, and determining the device to be upgraded in the terminal according to the upgrade task information and generating an upgrade message corresponding to the device to be upgraded includes: Get the current version number of each device; Determining a device to be upgraded among the multiple devices according to the current version number and the version number information in the upgrade task information; An upgrade message corresponding to each device to be upgraded is generated according to the additional information and the upgrade package, wherein the upgrade package is used to complete the upgrade task and the additional information is used to describe the upgrade package.
6. The terminal upgrade method according to any one of claims 1 to 5, characterized in that: The upgrade package is an incremental upgrade package.
7. A terminal upgrade method, characterized in that: Applied to a terminal, the terminal upgrade method includes: Get upgrade messages through subscribed shadow topics; When going online, receiving an upgrade message according to the shadow theme to obtain upgrade task information, the upgrade task information including the upgrade package; Upgrading the version according to the upgrade task information; In case of upgrade failure, an upgrade feedback message of the upgrade failure is sent to the server; The upgrade message sent by the server according to the upgrade feedback information of the failed upgrade is obtained again through the shadow theme, the upgrade task information corresponding to the upgrade message is obtained from the server, and the version is upgraded according to the upgrade task information until the upgrade is successful.
8. The terminal upgrade method according to claim 7, characterized in that: The terminal upgrade method further includes: In the case of a successful upgrade, an upgrade feedback message indicating a successful upgrade is sent to the server so that the version number is updated through the server.
9. The terminal upgrade method according to claim 7, characterized in that: The terminal upgrade method further includes: In the event of an upgrade failure, sending upgrade feedback information indicating the upgrade failure to the server; Obtaining reminder information sent by the server according to the upgrade feedback information of the failed upgrade; Upload the upgrade log to the server to determine the cause of the upgrade failure.
10. The terminal upgrade method according to claim 7, characterized in that: The obtaining of the upgrade message by subscribing to the shadow topic includes: Obtain upgrade messages sent by the server through the message queue telemetry transport protocol through the shadow topic.
11. The terminal upgrade method according to claim 7, characterized in that: The upgrade task information includes additional information, the terminal includes multiple devices, and obtaining the upgrade message through the subscribed shadow topic further includes: For each device, upload the device identification and the current version number of the device to the server; After the server determines the device to be upgraded according to the current version number and the version number in the upgrade task information, obtaining, through a shadow topic, an upgrade message generated by the server according to the additional information and the upgrade package; The upgrade package is used to complete the upgrade task, and the additional information is used to describe the upgrade package.
12. The terminal upgrade method according to any one of claims 7 to 11, characterized in that: The upgrade package is an incremental upgrade package.
13. A terminal upgrade device, characterized in that: Applied to a server, the terminal upgrade device includes: A data acquisition module, configured to acquire upgrade task information, wherein the upgrade task information includes an upgrade package; An upgrade device determination module is used to determine a device to be upgraded in the terminal according to the upgrade task information, and generate an upgrade message corresponding to the device to be upgraded; The first upgrade module is used to send the upgrade message to the shadow topic subscribed by the device to be upgraded, so that the device to be upgraded obtains the upgrade task information through the shadow topic when it is online and performs a version upgrade; receive upgrade feedback information reported by the device to be upgraded, and if it is determined that the upgrade of the device to be upgraded fails according to the upgrade feedback information, send the upgrade message to the shadow topic subscribed by the device to be upgraded again, so that the device to be upgraded obtains the upgrade task information through the shadow topic and performs a version upgrade, until the upgrade of the device to be upgraded is successful.
14. A terminal upgrade device, characterized in that: Applied to a terminal, the terminal upgrading device comprises: Message monitoring module, used to obtain upgrade messages through subscribed shadow topics; A data acquisition module, configured to acquire upgrade task information according to an upgrade message received from the shadow theme when going online, wherein the upgrade task information includes an upgrade package; The second upgrade module is used to upgrade the version according to the upgrade task information; in the event of upgrade failure, send upgrade feedback information of the upgrade failure to the server; again obtain the upgrade message sent by the server according to the upgrade feedback information of the upgrade failure through the shadow theme, obtain the upgrade task information corresponding to the upgrade message from the server, and upgrade the version according to the upgrade task information until the upgrade is successful.
15. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the terminal upgrade method according to any one of claims 1 to 6.
16. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the terminal upgrade method according to any one of claims 7 to 12.
Citation Information
Patent Citations
Version upgrading method and device, electronic equipment and storage medium
CN112835616A