Program upgrade method and device, storage medium and electronic device
By downloading the installation package from the cloud server for software upgrade, the problem of insufficient hardware dependence and robustness is solved, a flexible and convenient upgrade process is achieved, and automatic sensing and fault recovery capabilities are enhanced.
Patent Information
- Application Number
- CN201910749050.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-14
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2039-08-14
AI Technical Summary
Existing software upgrade technology relies on specific hardware and is difficult to use on other devices. The upgrade is robust and complete, and lacks automatic sensing and failure handling mechanisms.
Get upgrade requests from the cloud server through the upgrade program, download and use the installation package to upgrade the main program to a new version, and use the checkpoint mechanism to ensure upgrade progress logging and failure recovery, achieving fully automatic awareness and robust upgrades.
It has been freed from the shackles of hardware, improves the flexibility and convenience of software upgrades, enhances the robustness and integrity of upgrades, and supports automatic sensing and failure handling.
Smart Images

Figure CN110442367B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a program upgrading method and device, a storage medium and an electronic device. Background Art
[0002] Cloud server (Elastic Compute Service, ECS) is a simple, efficient, secure, reliable, and elastically scalable computing service. Cloud server is an important component of cloud computing servers. It is a server platform that provides comprehensive business capabilities for various Internet users. The platform integrates the three core elements of traditional Internet applications: computing, storage, and network, and provides public Internet infrastructure services to users. In other words, compared with traditional physical servers, users can quickly create or release any number of cloud servers to enable users to access various applications online without purchasing hardware in advance, and interact with information and data. For example, when the terminal needs to upgrade the local software, the installation package can be downloaded from the cloud server through the network for upgrade services.
[0003] Among them, the existing software upgrade technologies include the following: 1) Focus on remote fully automatic upgrade capabilities, such as using a no-response mechanism to allow the client to self-manage, batch remote management under a C / S architecture, and even designing specific hardware components to improve upgrade automation on embedded devices. 2) Focus on upgrade integrity, such as using historical breakpoint continuation technology to ensure that the installation package is fully downloaded with upgrade rollback. However, the above software upgrade methods have the following disadvantages: 1) Device limitations. The upgrade technology of some embedded devices depends on their specific hardware components, which makes it difficult to apply this technology to other devices. 2) Lack of upgrade robustness. At present, most upgrade technologies focus on remote, fully automatic, and integrity, but the ability to deal with unexpected failures such as power outages and network disconnections is insufficient. 3) Insufficient integrity of the upgrade framework. Most upgrade technologies lack automatic sensing upgrades, or lack failed upgrade processing, or lack upgrade completion alarm mechanisms.
[0004] Currently, no effective solution has been proposed for the existing software upgrade problem. Summary of the invention
[0005] The embodiments of the present invention provide a program upgrade method and device, a storage medium and an electronic device, so as to at least solve the technical problem in the related art that software upgrades need to rely on specific hardware and are difficult to use on other devices.
[0006] According to one aspect of an embodiment of the present invention, there is provided a program upgrade method, comprising: in case that a first main program obtains an upgrade instruction from a cloud server, obtaining, through an upgrade program, an upgrade request sent by the first main program, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server; downloading, through the upgrade program, the installation package for upgrading the first main program from the cloud server according to the download link; and upgrading the first main program to a second main program using the installation package through the upgrade program.
[0007] According to another aspect of an embodiment of the present invention, a program upgrading device is also provided, including: an acquisition module, used to obtain an upgrade request sent by the first main program through an upgrade program when the first main program obtains an upgrade instruction from a cloud server, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server; a download module, used to download the installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program; and an upgrade module, used to use the installation package to upgrade the first main program to a second main program through the upgrade program.
[0008] According to another aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above method when running.
[0009] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method through the computer program.
[0010] In an embodiment of the present invention, an upgrade request sent by the first main program is obtained through an upgrade program, and then an installation package for upgrading the first main program is downloaded from the cloud server according to a download link through the upgrade program to upgrade the first main program to a second main program. It can be seen that in this embodiment, an installation package can be obtained from the cloud server to upgrade the first main program through an upgrade program separate from the first main program to be upgraded, which gets rid of the constraint of the prior art that program upgrades need to be executed in specific hardware, solves the technical problem in the related art that software upgrades need to rely on specific hardware and are difficult to use on other devices, making program upgrades more flexible and convenient. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0012] Figure 1 is a schematic diagram of an application scenario of a program upgrade method according to an embodiment of the present invention;
[0013] Figure 2 is a flow chart of a program upgrade method according to an embodiment of the present invention;
[0014] Figure 3 is a timing diagram of program upgrade according to an embodiment of the present invention;
[0015] Figure 4 is a flow chart of fully automatic program upgrade according to an embodiment of the present invention;
[0016] Figure 5 is a flowchart of program rollback according to an embodiment of the present invention;
[0017] Figure 6 is a schematic diagram of the structure of a program upgrading device according to an embodiment of the present invention;
[0018] Figure 7 is an optional structural diagram of a program upgrade device according to an embodiment of the present invention. Figure 1 ;
[0019] Figure 8 is an optional structural diagram of a program upgrade device according to an embodiment of the present invention. Figure 2 ;
[0020] Fig. 9 is an optional structural diagram of a program upgrade device according to an embodiment of the present invention. Figure 3 ;
[0021] Fig.10 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] First, the terms in this application are explained accordingly:
[0024] Checkpoint is a concept in the database field. It refers to a mechanism that forces important logs to be saved to disk when operating a database. This mechanism is mainly used when rolling back and restoring a database.
[0025] C / S architecture: Client / Server architecture, that is, client / server architecture. By reasonably allocating tasks to the client and server, the communication overhead of the system is reduced. The client needs to be installed before management operations can be performed.
[0026] Linux: is a free and open source UNIX-like operating system.
[0027] mv: One of the commands of the Linux operating system, used to rename files or directories, or move files from one directory to another.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] According to one aspect of an embodiment of the present invention, a program upgrade method is provided. Optionally, the program upgrade method can be applied to, but is not limited to, Figure 1 In the application scenario shown in Figure 1 As shown, the main program, upgrade program and cloud server / cloud backend are independent of each other, but they can interact with each other. When the main program obtains the upgrade instruction from the cloud server, the upgrade program obtains the upgrade request sent by the main program, and the upgrade program downloads the installation package for upgrading the main program from the cloud server according to the download link, thereby upgrading the main program. It should be noted that the upgrade program and the main program can be located in the same device or in different devices, and the interaction is realized through the corresponding interface.
[0030] Optionally, in this embodiment, the above-mentioned device may include but is not limited to at least one of the following: a mobile phone, a tablet computer, etc. The above-mentioned network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The above is only an example, and this embodiment does not make any limitation to this.
[0031] Optionally, in this embodiment, as an optional implementation, as Figure 2 As shown, the above program upgrade method may include:
[0032] S202, when the first main program obtains the upgrade instruction from the cloud server, obtaining, through the upgrade program, an upgrade request sent by the first main program, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server;
[0033] S204, downloading an installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program;
[0034] S206, upgrading the first main program to the second main program using the installation package through the upgrade program.
[0035] It should be noted that the first main program and the second main program involved in this embodiment can be application programs, system programs or other programs. As long as the programs can be upgraded, they are within the protection scope of this application; among them, application programs include: office programs (such as office software, PS software, programming software, etc.), game programs (single-level game programs, online game programs, etc.), shopping programs (online shopping programs) and other programs that users often use in daily life and work; and system programs include: language processing programs, data management programs, auxiliary programs and other programs required by the operating system.
[0036] In addition, the cloud server / cloud backend can also be called a cloud computing server or cloud host, where the cloud server uses cloud computing technology and integrates the three core elements of the data center: computing, network and storage. The cloud server is based on cluster server technology and virtualizes multiple parts similar to independent servers, so that the cloud server has high security and stability. In addition, the upgrade program in this embodiment is a program independent of the first main program, and the upgrade program is not limited to a specific hardware, and can be flexibly set in different devices.
[0037] Through the above steps S202 to S206, the upgrade request sent by the first main program is obtained through the upgrade program, and then the installation package for upgrading the first main program is downloaded from the cloud server according to the download link through the upgrade program to upgrade the first main program to the second main program; it can be seen that in this embodiment, the installation package can be obtained from the cloud server to upgrade the first main program through an upgrade program separate from the first main program to be upgraded, which gets rid of the constraint of the prior art that program upgrades need to be executed in specific hardware, solves the technical problem in the related art that software upgrades need to rely on specific hardware and are difficult to use on other devices, making program upgrades more flexible and convenient.
[0038] Optionally, in an optional implementation of the present embodiment, after upgrading the first main program to the second main program using the installation package through the upgrade program involved in step S206 in the embodiment, the method of the present embodiment may further include: when the first main program is successfully upgraded to the second main program, starting the second main program through the upgrade program.
[0039] It can be seen that after the first main program is upgraded to the second main program, the upgrade program can trigger the start of the second main program; that is, in addition to being able to upgrade the first main program alone, the upgrade program can also start the upgraded second main program to determine whether the upgraded second main program can be started normally, and also to determine that the upgrade has been successful.
[0040] Optionally, in an optional implementation manner of this embodiment, the method of obtaining the upgrade request sent by the first main program through the upgrade program involved in step S102 may further include:
[0041] Method (1) is to obtain the upgrade request sent by the first main program through the local port of the upgrade program; wherein the local port is a port for local interaction between the upgrade program and the first main program located in the same device.
[0042] Through the above method (1), it can be known that the upgrade program and the first main program in this embodiment can be located in the same device or in different devices; for example, when the first main program is a game program in a handheld terminal, after a remote cloud server sends an upgrade instruction to the game program at a certain point in time, the game program will send an upgrade request to the upgrade program located in the same handheld terminal as the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. Since the upgrade program and the game program are located in the same device, the two interact with each other through the local port.
[0043] Optionally, the upgrade program in this embodiment can be linked to one or more first main programs through a local port; still taking the above-mentioned game program that needs to be upgraded as an example, in the handheld terminal, the upgrade program can also exchange data with other programs, such as shopping programs, social programs, media programs, etc. through a local port. Therefore, the upgrade program can upgrade multiple programs at the same time. For example, after the remote cloud server sends an upgrade instruction to the game program at a certain time point, the game program will send an upgrade request to the upgrade program located in the same handheld terminal as the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. During the process of upgrading the game program by the upgrade program, the shopping program also receives the upgrade instruction sent by the cloud server. Then, while upgrading the game program, the upgrade program can also download the installation package for upgrading the shopping program from the cloud server. However, the local port between the shopping program and the upgrade program is preferably not equivalent to the local port between the game program and the upgrade program, so as to ensure the smooth execution of the upgrade operation. Of course, in some special scenarios, multiple programs to be upgraded share a local port with the upgrade program. That is to say, the local port can be shared or used individually, or it can be shared by several programs while other programs and upgrade programs are separate.
[0044] Mode (2) is to obtain the upgrade request sent by the first main program from the remote port through the upgrade program, wherein the remote port is a port for remote interaction between the upgrade program and the first main program located in different devices.
[0045] It can be seen from the above method (2) that in this embodiment, in addition to the situation where the upgrade program and the program to be upgraded are in the same device and perform data exchange through the local port, the upgrade program and the program to be upgraded can also be located in different devices. For example, the program to be upgraded is a game program located in the first handheld terminal. After the remote cloud server sends an upgrade instruction to the game program at a certain point in time, the game program will send the upgrade request to the upgrade program located in a different handheld terminal from the game program, that is, located in the second handheld terminal. After that, the upgrade program will obtain the installation package for upgrading the game program from the cloud server. Since the upgrade program and the game program are located in different devices, the two interact with each other through the remote port.
[0046] Optionally, the upgrade program in this embodiment can be linked to one or more first main programs through a remote port; still taking the above-mentioned game program that needs to be upgraded as an example, in the handheld terminal, the upgrade program can also exchange data with other programs, such as shopping programs, social programs, media programs, etc. through a remote port. Therefore, the upgrade program can upgrade multiple programs at the same time. For example, after the remote cloud server sends an upgrade instruction to the game program at a certain time point, the game program will send an upgrade request to the upgrade program located in a different handheld terminal from the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. During the process of upgrading the game program by the upgrade program, the shopping program also receives the upgrade instruction sent by the cloud server. Then, while upgrading the game program, the upgrade program can also download the installation package for upgrading the shopping program from the cloud server. However, the remote port between the shopping program and the upgrade program is not equivalent to the remote port between the game program and the upgrade program, which ensures the smooth execution of the upgrade operation.
[0047] Optionally, in an optional implementation manner of this embodiment, the program upgrade method may further include:
[0048] Step S208, setting checkpoints for recording the current upgrade progress at a plurality of preset time points; wherein the currently saved checkpoint has overwritten the previously saved checkpoint;
[0049] Step S210, reporting an alarm message to the cloud server in case of a failure during the program upgrade process; and / or, after the first main program is upgraded to the second main program using the installation package through the upgrade program, reporting a message of successful upgrade to the cloud server;
[0050] Optionally, the multiple time points involved in the above step S208 may be time points after the multiple execution steps are completed. Figure 3 As can be seen from the timing diagram, the multiple time points can be: the upgrade program receives the upgrade request sent by the main program (old), and the upgrade program sends a download request to the server; the upgrade program decompresses the installation package and upgrades the main program (old); the upgrade program starts the upgraded main program (new) after one or more steps are executed. The settings of the multiple time points can be set accordingly according to the actual situation. For example, only the upgrade program receives the upgrade request sent by the main program (old), the upgrade program sends a download request to the server; the upgrade program decompresses the installation package, and the upgrade of the main program (old) is completed. The time point is set to checkpoint; of course, in this embodiment, it is preferred to set corresponding checkpoints for each step in the entire upgrade process.
[0051] In this embodiment, checkpoints for recording the current upgrade progress can be set at multiple time points during the upgrade process. Through the checkpoints, after an upgrade failure occurs, the upgrade can be continued based on the breakpoints in the checkpoints. That is, when an upgrade failure occurs, there is no need to start the upgrade from scratch, and the breakpoint upgrade can be performed based on the checkpoints saved before the failure occurs, thereby improving the upgrade efficiency.
[0052] It can be seen from the above step S210 that in the event of a failure during the program upgrade, an alarm message is reported to the cloud server; and / or after the first main program is upgraded to the second main program using the installation package through the upgrade program, a message of successful upgrade is reported to the cloud server. Through the alarm message and the message of successful upgrade, the server can obtain the upgrade status in time.
[0053] It should be noted that the number of times the upgrade program obtains the upgrade request sent by the first main program within the preset time period is prohibited from exceeding the preset threshold. Through this mechanism, malicious upgrade behavior can be prevented within the preset time period.
[0054] Based on the above steps S202 to S210, Figure 3 is a timing diagram of an upgrade procedure according to an embodiment of the present invention, based on Figure 3 In this embodiment, the process of upgrading the main program includes:
[0055] Step S302, the upgrade program receives an upgrade request sent by the main program (old);
[0056] Step S304, the upgrade program sends a download request to the server to download the installation package from the server;
[0057] Step S306, the upgrade program decompresses the installation package and upgrades the main program (old) to the main program (new); if the upgrade is successful, step S308 is executed; if the upgrade fails, step S310 is executed;
[0058] Step S308, the upgrade program starts the upgraded main program (new);
[0059] Step S310, the upgrade program executes the rollback program;
[0060] Step S312, the upgrade program sends a message to the cloud server; wherein the message includes: a message of successful upgrade and a message of failed upgrade.
[0061] It can be seen that the upgrade program in this embodiment is a local independent service module, which senses the upgrade demand through requests sent by other programs, and then automatically completes a series of steps such as downloading the program installation package, decompressing, upgrading and installing, and starting the new program. If the upgrade fails, the upgrade program will roll back in time and restore the previously normal program version. In addition, a checkpoint mechanism is set in this application. By saving and recording the key steps of the upgrade, when retrying the upgrade, it can directly continue to run from the last checkpoint, which greatly improves the efficiency of the upgrade retry.
[0062] That is to say, the program upgrade method in this embodiment can be deployed on any client machine that can access network resources, including servers, personal computers and even mobile devices. Through this embodiment, the program can fully automatically sense the upgrade demand and perform the upgrade robustly.
[0063] The following is a detailed introduction to the role of checkpoints in conjunction with the upgrade process. Figure 4 The following is a flow chart showing the specific details of the upgrade process, which includes:
[0064] Step S402, the upgrade program receives a request;
[0065] Step S404, the upgrade program downloads the installation package from the cloud server;
[0066] Step S406, the upgrade program decompresses the installation package;
[0067] Step S408, the upgrade program backs up the current running directory;
[0068] Step S410, upgrading the program and installing it;
[0069] Step S412: the upgrade program starts the upgraded new program.
[0070] It should be noted that the upgrade program will save the current progress, i.e., checkpoint, at each key step from the time the upgrade request is received to the final success or failure of the upgrade. In this embodiment, after the execution of steps S402 to S412, the corresponding checkpoint will be set; in addition, the checkpoint mechanism will only save a current state, i.e., the previous checkpoint will be refreshed after each key step is successfully executed. When the upgrade is retried, the upgrade program first checks the checkpoint and directly jumps to the checkpoint step for execution. If the upgrade program fails after the last upgrade process runs to the "unzip the installation package" step, when it is upgraded again, the upgrade program can directly start the upgrade process from the "backup current running directory" step, eliminating the "download the installation package" and "unzip the installation package" steps. Through this checkpoint mechanism, the entire upgrade can be made more robust and efficient in the case of power outages, network disconnections, and other unexpected situations that often occur in unmanned environments.
[0071] Optionally, in this embodiment, a rollback mechanism is also involved when the upgrade program fails to perform a fully automatic upgrade, so that the program will not be unusable due to an erroneous upgrade package, hardware failure, etc. Figure 5 The rollback process is shown, which includes:
[0072] Step S502, in case of upgrade failure, start the rollback mechanism;
[0073] Step S504, switch the working directory back to the backup;
[0074] Step S506, start the old program.
[0075] It can be seen that the rollback process mainly executes two steps: switching the working directory back to the backup directory and starting the executable program in the working directory. In order to prevent the program from having a second accident, in particular, in the key step of "switching the working directory back to the backup", extremely lightweight atomic operations are used, such as cutting soft links and Linux mv operations. The checkpoint mechanism is also set in the rollback process, that is, during the rollback process, if the rollback fails, you can also roll back to the breakpoint without returning to the initial state for rollback. In other words, the checkpoint mechanism set in the entire rollback process is to ensure that even if there are unexpected situations such as power outages and network disconnections, the upgrade program can be successfully rolled back. For example, if the last run reached the "switching the working directory back to the backup" step, the upgrade program will directly start from the "starting the old program" step to start the program normally after the rollback.
[0076] In this embodiment, a program upgrade device is also provided. Figure 6As shown, the program upgrade device includes: an acquisition module 602, which is used to acquire an upgrade request sent by the first main program through the upgrade program when the first main program acquires an upgrade instruction from the cloud server, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server; a download module 604, which is coupled to the acquisition module 602 and is used to download the installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program; and an upgrade module 606, which is coupled to the download module 604 and is used to upgrade the first main program to a second main program using the installation package through the upgrade program.
[0077] It should be noted that the first main program and the second main program involved in this embodiment can be application programs, system programs or other programs. As long as the programs can be upgraded, they are within the protection scope of this application; among them, application programs include: office programs, game programs, shopping programs and other programs that users often use in daily life and work; and system programs include: language processing programs, data management programs, auxiliary programs and other programs required by the operating system.
[0078] In addition, the cloud server / cloud backend can also be called a cloud computing server or cloud host, where the cloud server uses cloud computing technology and integrates the three core elements of the data center: computing, network and storage. The cloud server is based on cluster server technology and virtualizes multiple parts similar to independent servers, so that the cloud server has high security and stability. In addition, the upgrade program in this embodiment is a program independent of the first main program, and the upgrade program is not limited to a specific hardware, and can be flexibly set in different devices.
[0079] Based on the above Figure 6 In the program upgrade device, the acquisition module 602 acquires the upgrade request sent by the first main program through the upgrade program, and then the download module 604 downloads the installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program, and the upgrade module 606 upgrades the first main program to the second main program; it can be seen that in this embodiment, the installation package can be obtained from the cloud server through an upgrade program separate from the first main program to be upgraded to upgrade the first main program, which gets rid of the constraint of the prior art that the program upgrade needs to be executed in specific hardware, solves the technical problem in the related art that the software upgrade needs to rely on specific hardware and is difficult to use on other devices, making the program upgrade more flexible and convenient.
[0080] Optionally, the acquisition module 602 in this embodiment may include: a first acquisition unit, used to acquire the upgrade request sent by the first main program through the local port of the upgrade program; wherein the local port is a port where the upgrade program and the first main program are located in the same device for local interaction; wherein the upgrade program is linked to one or more first main programs through the local port; a second acquisition unit, used to acquire the upgrade request sent by the first main program from the remote port through the upgrade program, wherein the remote port is a port where the upgrade program and the first main program are located in different devices for remote interaction.
[0081] Based on the first acquisition unit, the upgrade program and the first main program in this embodiment can be located in the same device or in different devices; for example, when the first main program is a game program in a handheld terminal, after a remote cloud server sends an upgrade instruction to the game program at a certain point in time, the game program will send an upgrade request to the upgrade program located in the same handheld terminal as the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. Since the upgrade program and the game program are located in the same device, the two interact with data through the local port.
[0082] Optionally, the upgrade program in this embodiment can be linked to one or more first main programs through a local port; still taking the above-mentioned game program needing to be upgraded as an example, in the handheld terminal, the upgrade program can also exchange data with other programs, such as shopping programs, social programs, media programs, etc., through a local port. Therefore, the upgrade program can upgrade multiple programs at the same time. For example, after the remote cloud server sends an upgrade instruction to the game program at a certain time point, the game program will send an upgrade request to the upgrade program located in the same handheld terminal as the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. During the process of upgrading the game program by the upgrade program, the shopping program also receives the upgrade instruction sent by the cloud server. Then, while upgrading the game program, the upgrade program can also download the installation package for upgrading the shopping program from the cloud server. However, the local port between the shopping program and the upgrade program is preferably not equivalent to the local port between the game program and the upgrade program, so as to ensure the smooth execution of the upgrade operation. Of course, in some special scenarios, multiple programs to be upgraded and the upgrade program share a local port. That is to say, the local port can be shared or used individually, or it can be shared by several programs while other programs and upgrade programs are separate.
[0083] Based on the second acquisition unit, in this embodiment, in addition to the situation where the upgrade program and the program to be upgraded exchange data through the local port in the same device, the upgrade program and the program to be upgraded may also be located in different devices. For example, the program to be upgraded is a game program located in the first handheld terminal. After the remote cloud server sends an upgrade instruction to the game program at a certain point in time, the game program will send the upgrade request to the upgrade program located in a different handheld terminal from the game program, that is, the second handheld terminal. After that, the upgrade program will obtain the installation package for upgrading the game program from the cloud server. Since the upgrade program and the game program are located in different devices, the two exchange data through the remote port.
[0084] Optionally, the upgrade program in this embodiment can be linked to one or more first main programs through a remote port; still taking the above-mentioned game program that needs to be upgraded as an example, in the handheld terminal, the upgrade program can also exchange data with other programs, such as shopping programs, social programs, media programs, etc. through a remote port. Therefore, the upgrade program can upgrade multiple programs at the same time. For example, after the remote cloud server sends an upgrade instruction to the game program at a certain time point, the game program will send an upgrade request to the upgrade program located in a different handheld terminal from the game program, and then the upgrade program will obtain the installation package for upgrading the game program from the cloud server. During the process of upgrading the game program by the upgrade program, the shopping program also receives the upgrade instruction sent by the cloud server. Then, while upgrading the game program, the upgrade program can also download the installation package for upgrading the shopping program from the cloud server. However, the remote port between the shopping program and the upgrade program is not equivalent to the remote port between the game program and the upgrade program, which ensures the smooth execution of the upgrade operation.
[0085] Alternatively, if Figure 7 As shown, the upgrade program device may further include: a startup module 702 for, after the first main program is upgraded to the second main program using the installation package through the upgrade program, starting the second main program through the upgrade program if the first main program is successfully upgraded to the second main program.
[0086] It can be seen that after the first main program is upgraded to the second main program, the upgrade program can trigger the start of the second main program; that is, in addition to being able to upgrade the first main program alone, the upgrade program can also start the upgraded second main program to determine whether the upgraded second main program can be started normally, and also to determine that the upgrade has been successful.
[0087] Alternatively, if Figure 8As shown, the program upgrade device in this embodiment may further include: a setting module 802, which is used to set checkpoints for recording the current upgrade progress at multiple preset time points; wherein the currently saved checkpoint has overwritten the previously saved checkpoint.
[0088] The multiple time points involved above can be time points after multiple execution steps are completed, combined with the following Figure 3 As can be seen from the timing diagram, the multiple time points can be: the upgrade program receives the upgrade request sent by the main program (old), and the upgrade program sends a download request to the server; the upgrade program decompresses the installation package and upgrades the main program (old); the upgrade program starts the upgraded main program (new) after one or more steps are executed. The settings of the multiple time points can be set accordingly according to the actual situation. For example, only the upgrade program receives the upgrade request sent by the main program (old), the upgrade program sends a download request to the server; the upgrade program decompresses the installation package, and the upgrade of the main program (old) is completed. The time point is set to checkpoint; of course, in this embodiment, it is preferred to set corresponding checkpoints for each step in the entire upgrade process.
[0089] It can be seen that in this embodiment, checkpoints for recording the current upgrade progress can be set at multiple time points in the upgrade process. Through the checkpoints, after an upgrade failure occurs, the upgrade can be continued based on the breakpoints based on the checkpoints. That is, when an upgrade failure occurs, there is no need to start the upgrade from scratch. The breakpoint upgrade can be performed based on the checkpoints saved before the failure occurs, thereby improving the upgrade efficiency.
[0090] Alternatively, if Fig. 9 As shown, the program upgrade device in this embodiment may also include: a reporting module 902, which is used to report an alarm message to the cloud server in case a failure occurs during the program upgrade process; and / or, after the first main program is upgraded to the second main program using the installation package through the upgrade program, a successful upgrade message is reported to the cloud server.
[0091] It can be seen that in the event of a failure during the program upgrade, an alarm message is reported to the cloud server; and / or after the first main program is upgraded to the second main program using the installation package through the upgrade program, a message of successful upgrade is reported to the cloud server. Through the alarm message and the message of successful upgrade, the server can obtain the upgrade status in time.
[0092] It should be noted that the number of times the upgrade request sent by the first main program is obtained by the upgrade program within a preset time period is prohibited from exceeding a preset threshold.
[0093] According to another aspect of the embodiments of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0094] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0095] S1, when the first main program obtains an upgrade instruction from the cloud server, obtaining an upgrade request sent by the first main program through the upgrade program, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server;
[0096] S2, downloading an installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program;
[0097] S3, upgrading the first main program to the second main program using the installation package through the upgrade program.
[0098] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0099] S1, when the first main program is successfully upgraded to the second main program, the second main program is started through the upgrade program.
[0100] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0101] S1, obtaining an upgrade request sent by the first main program through the local port of the upgrade program; wherein the local port is a port for local interaction between the upgrade program and the first main program located in the same device.
[0102] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0103] S1, obtaining an upgrade request sent by a first main program from a remote port through an upgrade program, wherein the remote port is a port for remote interaction between the upgrade program and the first main program located in different devices.
[0104] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0105] S1, setting checkpoints for recording the current upgrade progress at multiple preset time points; wherein the currently saved checkpoint has overwritten the previously saved checkpoint;
[0106] S2, in case of failure during program upgrade, reporting an alarm message to the cloud server; and / or, after upgrading the first main program to the second main program using the installation package through the upgrade program, reporting a successful upgrade message to the cloud server.
[0107] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0108] According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the above program upgrade, such as Fig.10 As shown, the electronic device includes: a processor 1002, a memory 1004, a display 1006, a user interface 1008, a transmission device 1010, etc. The memory stores a computer program, and the processor is configured to execute the steps in any of the above method embodiments through the computer program.
[0109] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0110] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0111] S1, when the first main program obtains an upgrade instruction from the cloud server, obtaining an upgrade request sent by the first main program through the upgrade program, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server;
[0112] S2, downloading an installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program;
[0113] S3, upgrading the first main program to the second main program using the installation package through the upgrade program.
[0114] Alternatively, a person skilled in the art may understand that: Fig.10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Fig.10The structure of the electronic device is not limited. Fig.10 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.10 Different configurations are shown.
[0115] Among them, the memory 1004 can be used to store software programs and modules, such as program instructions / modules corresponding to the program upgrade method and device in the embodiment of the present invention, and the processor 1002 executes various functional applications and data processing by running the software programs and modules stored in the memory 1004. The memory 1004 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1004 may further include a memory remotely arranged relative to the processor 1002, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0116] The transmission device 1010 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 1010 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 1010 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0117] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0118] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0119] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0120] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A program upgrade method, It is characterized in that include: When the first main program receives the upgrade instruction sent by the cloud server, obtaining the upgrade request sent by the first main program through the upgrade program, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server; Downloading the installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program; Using the installation package through the upgrade program to upgrade the first main program to a second main program; Wherein, the method also includes: setting checkpoints for recording the current upgrade progress at multiple preset time points; wherein, the currently saved checkpoint has overwritten the previously saved checkpoint, and the multiple preset time points at least include: the time point when the upgrade request sent by the first main program is obtained through the upgrade program, the time point when the installation package of the first main program is downloaded through the upgrade program, the time point when the upgrade program decompresses the installation package, the time point when the upgrade program uses the installation package to upgrade the first main program to the second main program, and the time point when the upgrade program starts the second main program.
2. The method according to claim 1, It is characterized in that The obtaining, through the upgrade program, the upgrade request sent by the first main program, comprises: The upgrade request sent by the first main program is obtained through the local port of the upgrade program; wherein the local port is a port for local interaction between the upgrade program and the first main program located in the same device.
3. The method according to claim 2, It is characterized in that The upgrade program is linked to one or more first main programs through the local port.
4. The method according to claim 1, It is characterized in that The obtaining, through the upgrade program, the upgrade request sent by the first main program, comprises: The upgrade program obtains the upgrade request sent by the first main program from a remote port, wherein the remote port is a port for remote interaction between the upgrade program and the first main program located in different devices.
5. The method according to claim 1, It is characterized in that After the first main program is upgraded to the second main program by using the installation package through the upgrade program, the method further includes: When the first main program is successfully upgraded to the second main program, the second main program is started through the upgraded program.
6. The method according to claim 1, It is characterized in that Also includes: In case of a failure during the program upgrade process, reporting an alarm message to the cloud server; And / or, after the first main program is upgraded to the second main program using the installation package through the upgrade program, a message of successful upgrade is reported to the cloud server.
7. The method according to any one of claims 1 to 6, It is characterized in that The number of times that the upgrade request sent by the first main program is obtained by the upgrade program within a preset time period shall not exceed a preset threshold.
8. A program upgrade device, It is characterized in that include: an acquisition module, configured to acquire, through the upgrade program, an upgrade request sent by the first main program when the first main program receives an upgrade instruction sent by the cloud server, wherein the upgrade request carries a download link, and the download link is used to indicate downloading an installation package for upgrading the first main program from the cloud server; A download module, used to download the installation package for upgrading the first main program from the cloud server according to the download link through the upgrade program; An upgrade module, used to upgrade the first main program to a second main program using the installation package through the upgrade program; The device is also used to: set checkpoints for recording the current upgrade progress at multiple preset time points; wherein the currently saved checkpoint has overwritten the previously saved checkpoint, and the multiple preset time points at least include: the time point when the upgrade program obtains the upgrade request sent by the first main program, the time point when the upgrade program downloads the installation package of the first main program, the time point when the upgrade program decompresses the installation package, the time point when the upgrade program uses the installation package to upgrade the first main program to the second main program, and the time point when the upgrade program starts the second main program.
9. The device according to claim 8, It is characterized in that The device also includes: A startup module is used to start the second main program through the upgrade program after the first main program is upgraded to the second main program using the installation package through the upgrade program, if the first main program is successfully upgraded to the second main program.
10. The device according to claim 8, It is characterized in that The acquisition module comprises: The first acquisition unit is used to acquire the upgrade request sent by the first main program through the local port of the upgrade program; wherein the local port is a port for local interaction between the upgrade program and the first main program located in the same device.
11. The device according to claim 10, It is characterized in that The upgrade program is linked to one or more first main programs through the local port.
12. The device according to claim 8, It is characterized in that The acquisition module comprises: The second acquisition unit is used to acquire the upgrade request sent by the first main program from a remote port through the upgrade program, wherein the remote port is a port for remote interaction between the upgrade program and the first main program located in different devices.
13. A storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
14. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Self-upgrade method for equipment in remote online monitoring system
CN102314369A
Multi-thread software dynamic upgrading method based on asynchronous check points
CN104111848A
Main program upgrading method and device for supporting upgrading of main program
CN104572222A
Program upgrading processing method, device and equipment
CN110007935A
Orchestration of software applications upgrade using checkpoints
US20160070558A1
