CN117667147A - Application upgrading method and device, electronic equipment and storage medium - Google Patents

Application upgrading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117667147A
CN117667147A CN202311677448.2A CN202311677448A CN117667147A CN 117667147 A CN117667147 A CN 117667147A CN 202311677448 A CN202311677448 A CN 202311677448A CN 117667147 A CN117667147 A CN 117667147A
Authority
CN
China
Prior art keywords
instruction
application
downloading
upgrading
task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311677448.2A
Other languages
Chinese (zh)
Inventor
邓博文
杨略
宋银科
陈林
俞杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu New Hope Finance Information Co Ltd
Original Assignee
Chengdu New Hope Finance Information Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengdu New Hope Finance Information Co Ltd filed Critical Chengdu New Hope Finance Information Co Ltd
Priority to CN202311677448.2A priority Critical patent/CN117667147A/en
Publication of CN117667147A publication Critical patent/CN117667147A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides an application upgrading method, an application upgrading device, electronic equipment and a storage medium, which are applied to a front-end processor, wherein the front-end processor is deployed at a client, and the method comprises the following steps: acquiring a downloading task, wherein the downloading task comprises a downloading instruction set; the downloading task is generated according to a pre-configured downloading instruction template after the client receives an upgrading prompt sent by the server and confirms downloading; executing a downloading instruction set to finish a downloading task; acquiring an upgrade task, wherein the upgrade task comprises an upgrade instruction set; the upgrading task is generated according to a pre-configured upgrading instruction template after the client confirms upgrading after the downloading task is completed; and executing the upgrade instruction set to finish the upgrade task. The front-end processor is used for finishing the upgrading and updating of the client software, manual deployment is not needed, and the upgrading efficiency is improved. And the client is upgraded through the front-end processor, so that the possibility of data leakage is reduced, and the safety of the data is further improved.

Description

Application upgrading method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an application upgrading method, an application upgrading device, an electronic device, and a storage medium.
Background
In recent years, software-as-a-Service (SaaS) products provided by networks are popularized with extremely rapid acceleration, and for information security, many enterprises store application data in their own local servers or internal networks to realize localized deployment. At present, when upgrading and maintaining the application aiming at localized deployment, operation and maintenance personnel are required to manually deploy and update at the places of enterprises, and more time and manpower resources are required to be spent.
Disclosure of Invention
The embodiment of the application aims at providing an application upgrading method, an application upgrading device, an electronic device and a storage medium, wherein a front-end processor is deployed at a client, and the client is pre-configured with a downloading instruction template and an upgrading instruction template, so that the downloading instruction and the upgrading instruction can be automatically generated when the client needs to be upgraded. If the client needs to be upgraded, the front-end processor acquires the downloading instruction generated by the client, then executes the downloading instruction, and after the client generates the upgrading instruction, executes the upgrading instruction. The front-end processor is used for finishing the upgrading and updating of the client software, manual deployment is not needed, and the upgrading efficiency is improved.
In a first aspect, an embodiment of the present application provides an application upgrade method, applied to a front-end processor, where the front-end processor is deployed at a client, including: acquiring a downloading task, wherein the downloading task comprises a downloading instruction set; the downloading task is generated according to a pre-configured downloading instruction template after the client receives an upgrading prompt sent by the server and confirms downloading; executing a downloading instruction set to finish a downloading task; acquiring an upgrade task, wherein the upgrade task comprises an upgrade instruction set; the upgrading task is generated according to a pre-configured upgrading instruction template after the client confirms upgrading after the downloading task is completed; and executing the upgrade instruction set to finish the upgrade task.
In the implementation process, the front-end processor is deployed at the client, and the client is pre-configured with the downloading instruction template and the upgrading instruction template, so that the downloading instruction and the upgrading instruction can be automatically generated when the upgrading is required. If the client needs to be upgraded, the front-end processor acquires the downloading instruction generated by the client, then executes the downloading instruction, and after the client generates the upgrading instruction, executes the upgrading instruction. The front-end processor is used for finishing the upgrading and updating of the client software, manual deployment is not needed, and the upgrading efficiency is improved. And the front-end processor upgrades the client application, thereby reducing manual operation, reducing the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrade, and further improving the security of the data.
Optionally, in an embodiment of the present application, acquiring the download task includes: sending a heartbeat request to a client; the heartbeat request is used for inquiring whether the client generates a downloading task or not; if the downloading task generated by the client is inquired, confirming whether the downloading task is executed or not according to the identification of the downloading task; in the case where the download task is not executed, the download task is acquired.
In the implementation process, the front-end processor acquires the state of the client by sending a heartbeat request to the client, inquires whether the client generates a downloading task, timely confirms whether the client has downloading upgrading requirements, does not need to be checked manually, and improves upgrading convenience and efficiency.
Optionally, in an embodiment of the present application, the downloading instruction set includes a file downloading instruction, a file checking instruction, and a file transmitting instruction; executing the downloading instruction set to complete the downloading task, including: executing a file downloading instruction, and downloading an application upgrading packet corresponding to the application to be upgraded from a server; executing a file verification instruction, performing abstract calculation on the application upgrading packet to obtain an abstract result, and verifying the application upgrading packet according to the abstract result to obtain a verification result; and under the condition that the verification result passes, executing a file transmission instruction, and transmitting the application upgrading packet to the client corresponding to the application to be upgraded.
In the implementation process, the front-end processor executes the downloading instruction to finish the downloading of the application upgrading package, and the front-end processor upgrades the client application, so that the manual operation is reduced, the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrading is reduced, and the data security is further improved.
Optionally, in an embodiment of the present application, the application upgrade package includes an application unpacking package; executing a file downloading instruction, and downloading an application upgrading packet corresponding to an application to be upgraded from a server, wherein the method comprises the following steps: executing a file downloading instruction, and downloading an application unpacking packet corresponding to the application to be upgraded from a server; the application splitting package is obtained after the server splits the application upgrading package according to a preset splitting threshold; and merging the application splitting packages according to the number sequence of the application splitting packages to obtain the application upgrading package.
In the implementation process, the server splits the application upgrade package according to the application upgrade package, so that the problem that more resources are occupied and consumed in the downloading and transmitting processes possibly due to larger memory occupied by the application upgrade package is solved, and the efficiency of downloading the application upgrade package is improved while resources are saved.
Optionally, in the embodiment of the present application, the upgrade instruction set includes a file backup instruction, a traffic removal instruction, an application stop instruction, an application start instruction, and a traffic restoration instruction; executing an upgrade instruction set, comprising: executing a file backup instruction, and replacing a current version application package in a starting folder corresponding to an application to be upgraded by using the application upgrading package; executing a flow removal instruction to stop receiving a request by a request port of an application to be upgraded; executing an application stopping instruction to stop running the application to be upgraded; calling an application starting instruction, and restarting the updated software corresponding to the application upgrading packet according to the application upgrading packet in the starting folder; and executing the flow recovery instruction to enable the request port to continuously receive the request.
In the implementation process, the front-end processor executes the upgrade instruction to finish the upgrade of the application upgrade package, and the front-end processor upgrades the client application, so that the manual operation is reduced, the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrade is reduced, and the safety of the data is further improved.
Optionally, in an embodiment of the present application, the upgrade instruction set further includes a mirror load instruction; after executing the traffic removal instruction to stop receiving requests at the request port of the application to be upgraded, the method further comprises: and confirming whether the application to be upgraded is deployed in the container, if so, detecting whether the image of the upgrading application packet is loaded in the container, and if not, executing an image loading instruction and loading the image of the upgrading application packet.
In the implementation process, when the flow removal instruction is executed, whether the deployment mode of the application to be upgraded is container deployment or not can be judged, whether the mirror image of the upgrading application package is loaded in the container or not is detected, so that the mirror image of the upgrading application package is loaded in the container, the upgrading of the application in the container deployment mode is completed, and the usability of the application upgrading is improved.
Optionally, in an embodiment of the present application, the method further includes: if the execution of the download instruction in the download instruction set fails, acquiring a download rollback instruction in the download task, and executing the download rollback instruction so as to restore the download task to the step before the download failure; the download rollback instruction is used for canceling the corresponding download instruction; if the upgrade instruction in the upgrade instruction set fails to be executed, an upgrade rollback instruction in the upgrade task is obtained, and the upgrade rollback instruction is executed, so that the upgrade task is restored to the step before the upgrade failure; the upgrade rollback instruction is used for canceling the corresponding upgrade instruction.
In the implementation process, if the execution of the download instruction in the download instruction set fails, executing the download rollback instruction to restore the download task to the step before the download failure; if the upgrade instruction in the upgrade instruction set fails to be executed, executing an upgrade rollback instruction so as to restore the upgrade task to the step before the upgrade fails; and processing the application program errors in time, ensuring the integrity of data and enhancing the stability and maintainability of the system.
In a second aspect, an embodiment of the present application further provides an application upgrading device, including: the downloading task module is used for acquiring a downloading task, and the downloading task comprises a downloading instruction set; the downloading task is generated after the client receives the upgrade prompt sent by the server and confirms the downloading; the execution downloading module is used for executing a downloading instruction set to finish a downloading task; the upgrade task module is used for acquiring an upgrade task, and the upgrade task comprises an upgrade instruction set; the upgrading task is generated after the client confirms upgrading after the downloading task is completed; and the execution upgrading module is used for executing the upgrading instruction set and completing the upgrading task.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor and a memory storing machine-readable instructions executable by the processor to perform the method as described above when executed by the processor.
In a fourth aspect, embodiments of the present application also provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method described above.
By adopting the application upgrading method, the device, the electronic equipment and the storage medium, the front-end processor is deployed at the client, and the downloading instruction template and the upgrading instruction template are preconfigured at the client, so that the downloading instruction and the upgrading instruction can be automatically generated when the upgrading is needed. If the client needs to be upgraded, the front-end processor acquires the downloading instruction generated by the client, then executes the downloading instruction, and after the client generates the upgrading instruction, executes the upgrading instruction. The front-end processor is used for finishing the upgrading and updating of the client software, manual deployment is not needed, and the upgrading efficiency is improved. And the front-end processor upgrades the client application, thereby reducing manual operation, reducing the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrade, and further improving the security of the data.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of an application upgrading method according to an embodiment of the present application;
FIG. 2 is a timing chart of an application upgrade process according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an application upgrading device according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Embodiments of the technical solutions of the present application will be described in detail below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical solutions of the present application, and thus are only examples, and are not intended to limit the scope of protection of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
In the description of the embodiments of the present application, the technical terms "first," "second," etc. are used merely to distinguish between different objects and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated, a particular order or a primary or secondary relationship. In the description of the embodiments of the present application, the meaning of "plurality" is two or more unless explicitly defined otherwise.
In the age when the security of information is critical, more and more enterprises put extremely high demands on the protection of sensitive application data. To meet these requirements, enterprises tend to keep application data in their own local servers or in-house networks, i.e., localized deployments, to ensure security and privacy of the data. Where localized deployment refers to the deployment of applications or software on a local device or server, rather than using cloud services or other external infrastructure. That is, localized deployments install applications and related resources directly onto a local device or server, which is typically owned and maintained by an enterprise or individual.
For localized deployment, application upgrades to clients typically require the application provider to go to the client site for maintenance and upgrades of manually deployed devices, which takes significant time and human resources.
For non-localized deployed software, such as mobile phone terminal software, when the software is upgraded, a software developer ensures that the user's data can be smoothly migrated to the new version of software, so as to ensure that the user uses the upgraded application seamlessly. Typically by way of automatic data migration or import of existing data so that the user can continue to access the relevant data before the upgrade. This data migration process is allowed or authorized by the user, but for enterprises with higher data security, this approach may have the potential for data leakage.
Therefore, the application upgrading method, the device, the electronic equipment and the storage medium provided by the embodiment of the application deploy the software or the model at the client side, and deploy the front-end processor, and pre-configure the downloading instruction template and the upgrading instruction template at the client side. When the client needs to update and maintain the software or the model, a downloading instruction can be generated according to the downloading instruction template, and the downloading instruction is executed by the front-end processor; and generating an upgrade instruction according to the upgrade instruction template, and executing the upgrade instruction by the front-end processor to finish the upgrade of the application. Therefore, an application developer or a provider only needs to conduct one-time deployment, subsequent upgrading does not need manual deployment, labor cost is saved, and upgrading efficiency is saved.
Furthermore, the client application is upgraded through the front-end processor, so that manual operation is reduced, the possibility of data leakage caused by the acquisition of the client operation permission by the manual upgrade is reduced, and the data security is further improved.
Please refer to fig. 1, which illustrates a flowchart of an application upgrading method provided in an embodiment of the present application. The application upgrading method provided by the embodiment of the application upgrading method can be applied to the front-end processor, the front-end processor can serve as a front-end service deployed on the local side of the client, and the front-end processor can be used for processing and forwarding network communication requests. The front-end processor can be used as an interactive interface between the terminal equipment and the back-end server. The system has the functions of load balancing, safety protection, buffering, data conversion and the like, so that the performance, safety and reliability of the system are improved. The terminal device may be a smart phone, a tablet computer, a personal digital assistant (Personal Digital Assitant, PDA), etc. The application upgrading method can comprise the following steps:
Step S110: acquiring a downloading task, wherein the downloading task comprises a downloading instruction set; the downloading task is generated according to a pre-configured downloading instruction template after the client receives the upgrading prompt sent by the server and confirms the downloading.
Step S120: and executing the downloading instruction set to finish the downloading task.
Step S130: acquiring an upgrade task, wherein the upgrade task comprises an upgrade instruction set; the upgrade task is generated according to a pre-configured upgrade instruction template after the download task is completed and the client confirms the upgrade.
Step S140: and executing the upgrade instruction set to finish the upgrade task.
In step S110, the application developer or the provider issues the upgrade version of the software to be upgraded to the server, and after receiving the upgrade version, the server sends an upgrade prompt to the client, where the upgrade prompt is used to prompt the client that the software to be upgraded has an upgradeable version. Wherein the client may be software or a device used as a user interface.
After the client receives the upgrade prompt, the upgrade operation or the neglect operation can be performed, the upgrade operation is to confirm downloading of the upgrade version, and the neglect operation is to not perform the upgrade operation at this time. If the client confirms the downloading upgrading version, generating a downloading task in the database according to a pre-configured downloading instruction template, wherein the downloading task comprises a plurality of downloading instruction sets. The front-end processor acquires a downloading task and a downloading instruction set in the downloading task through a database of the client.
The generation of download tasks in the database according to the pre-configured download instruction templates will be described in detail below by way of example. The download instruction templates associated with the download tasks are configured in advance in the database, for example, table 1"tb_task", table 2 "tb_task" and table 3 "tb_task_task" can be configured in the database; where tb_task represents a task that has been generated; tb_instruct represents the template instruction table, and tb_task_instruct represents the actual operation instruction under the task.
After the client confirms the downloading, a downloading task is generated in the tb_task of the database, then a downloading instruction corresponding to the downloading task is screened in a tb_instruct template instruction table, parameters in the downloading instruction are configured, such as a downloading address and the like, and the parameters such as the downloading address and the like can be obtained through an upgrading prompt sent by the server. The configured download instruction set is inserted into the tb_task_instruct and associated with the download task generated in the tb_task.
The front-end processor queries that the client generates a downloading task, acquires the downloading task from a tb_task table of the database, and acquires a downloading instruction set from the tb_task_instruct table through the downloading task.
In step S120, the download instruction set includes at least one download instruction, where a download instruction may be understood as a step in the process of executing a download task, one step may correspond to one or more instructions, and one task may be a set of multiple instructions. In particular, for example, the download instructions may be a network transport protocol for downloading files or other data over a network. The download instructions specify how to request and receive data and how to transmit data over the network.
After the front-end processor acquires the downloading instruction set, the front-end processor executes the instructions in the downloading instruction set according to the serial number sequence of the instructions to complete the downloading task. The instructions in the download instruction set are, for example, download instructions, transfer instructions, etc.
In step S130, after the front end processor completes the downloading task, the front end processor reminds the client of completing the downloading, and the client can select whether to upgrade or not, if the upgrade is confirmed, the upgrade time can also be selected, and the upgrade time comprises immediate upgrade or preset time. The download task completion time is during the day, and in order to avoid the influence of the daily upgrade on the service, the client may set up to upgrade at a specified time.
After the client confirms the upgrade, generating an upgrade task in a database according to a pre-configured upgrade instruction template, and the front-end processor can sense that the client confirms the upgrade and acquire the upgrade task by sending heartbeat data and the like to the client.
In step S140, after the front end processor acquires the upgrade instruction set, the front end processor executes the instructions in the upgrade instruction set according to the serial number sequence of the instructions, thereby completing the upgrade task. The instructions in the upgrade instruction set may include file backup instructions, traffic removal instructions, application start instructions, and the like.
In the implementation process, the front-end processor is deployed at the client, and the client is pre-configured with the downloading instruction template and the upgrading instruction template, so that the downloading instruction and the upgrading instruction can be automatically generated when the upgrading is required. If the client needs to be upgraded, the front-end processor acquires the downloading instruction generated by the client, then executes the downloading instruction, and after the client generates the upgrading instruction, executes the upgrading instruction. The front-end processor is used for finishing the upgrading and updating of the client software, manual deployment is not needed, and the upgrading efficiency is improved. And the front-end processor upgrades the client application, thereby reducing manual operation, reducing the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrade, and further improving the security of the data.
Optionally, in an embodiment of the present application, acquiring the download task includes: sending a heartbeat request to a client; the heartbeat request is used for inquiring whether the client generates a downloading task or not; if the downloading task generated by the client is inquired, confirming whether the downloading task is executed or not according to the identification of the downloading task; in the case where the download task is not executed, the download task is acquired.
In the specific implementation process: the front end processor sends a heartbeat request to the client, the heartbeat request being used to query the client as to whether to generate a download task, e.g., to determine a network protocol used between the front end processor and the client, such as TCP/IP or UDP. The front end processor establishes connection with the client, determines the format and the content of the heartbeat request message, and sends the heartbeat request to the client in a preset time interval.
The front-end processor acquires the state of the client by sending a heartbeat request to the client, inquires whether the client generates a downloading task, if so, confirms whether the downloading task is executed according to the identification of the downloading task, and if so, does not need to repeatedly execute the downloading task. In the case where the download task is not executed, the download task is acquired.
In the implementation process, the front-end processor acquires the state of the client by sending a heartbeat request to the client, inquires whether the client generates a downloading task, timely confirms whether the client has downloading upgrading requirements, does not need to be checked manually, and improves upgrading convenience and efficiency.
Optionally, in an embodiment of the present application, the downloading instruction set includes a file downloading instruction, a file checking instruction, and a file transmitting instruction; executing the downloading instruction set to complete the downloading task, including: executing a file downloading instruction, and downloading an application upgrading packet corresponding to the application to be upgraded from a server; executing a file verification instruction, performing abstract calculation on the application upgrading packet to obtain an abstract result, and verifying the application upgrading packet according to the abstract result to obtain a verification result; and under the condition that the verification result passes, executing a file transmission instruction, and transmitting the application upgrading packet to the client corresponding to the application to be upgraded.
In the specific implementation process: after the front-end processor acquires the downloading task, the front-end processor executes the instruction in the downloading instruction set. For example, executing a file downloading instruction, downloading an application upgrading packet corresponding to the application to be upgraded from a server, defining an sftp server port number in the file downloading instruction, and downloading the application upgrading packet corresponding to the application to be upgraded according to the sftp server port number by the front-end processor.
Executing a file checking instruction: and carrying out abstract calculation on the downloaded application upgrade package to obtain an abstract result, and checking the application upgrade package according to the abstract result to obtain a checking result. For example, comparing the abstract result with the abstract result of the source file corresponding to the application upgrading package in the server; if the verification results are consistent, the verification results are considered to be passed, and if the verification results are inconsistent, the verification results are considered to be not passed.
Executing a file transmission instruction under the condition that the verification result passes: the application upgrading package is transmitted to a client corresponding to the application to be upgraded, for example, the front end processor address is 127.0.0.1, the application deployment address is 127.0.0.2, and the application upgrading package is transmitted to a directory to be upgraded of the client by executing a file transmission instruction sshpass-p "password" scp-l 100M-rp test.jar "user" @ 127.0.0.2:uploading/test.jar.
In the implementation process, the front-end processor executes the downloading instruction to finish the downloading of the application upgrading package, and the front-end processor upgrades the client application, so that the manual operation is reduced, the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrading is reduced, and the data security is further improved.
Optionally, in an embodiment of the present application, the application upgrade package includes an application unpacking package; executing a file downloading instruction, and downloading an application upgrading packet corresponding to an application to be upgraded from a server, wherein the method comprises the following steps: executing a file downloading instruction, and downloading an application unpacking packet corresponding to the application to be upgraded from a server; the application splitting package is obtained after the server splits the application upgrading package according to a preset splitting threshold; and merging the application splitting packages according to the number sequence of the application splitting packages to obtain the application upgrading package.
In the specific implementation process: considering that if the memory occupied by the application upgrade package is large, more resources may be occupied and consumed during the downloading and transmission process,
therefore, in order to improve transmission efficiency, the application upgrade package may be split by the server according to the application upgrade package. For example, the application upgrade package is 100M, the size of the application upgrade package test.jar package is 90M, and the application upgrade package is not required to be split, and the application upgrade package is test.jar.1 (90M); if the application upgrade package test.jar package size is 110M, the application split after splitting is classified into test.jar.1 (100M) and test.jar.2 (10M). And uploading the split to the appointed path of the SFTP server.
Executing a file downloading instruction, and downloading an application unpacking packet corresponding to the application to be upgraded from a designated path in the server; and merging the application splitting packages according to the number sequence of the application splitting packages to obtain the application upgrading package. In the above embodiment, two split files are packaged test.jar.1 and test.jar.2, and finally combined into test-1.1.Jar.
In an alternative embodiment, MD5 verification may be performed on the synthesized application upgrade package to verify whether the synthesized application upgrade package is consistent with the source file on the SFTP server.
In the implementation process, the server splits the application upgrade package according to the application upgrade package, so that the problem that more resources are occupied and consumed in the downloading and transmitting processes possibly due to larger memory occupied by the application upgrade package is solved, and the efficiency of downloading the application upgrade package is improved while resources are saved.
Optionally, in the embodiment of the present application, the upgrade instruction set includes a file backup instruction, a traffic removal instruction, an application stop instruction, an application start instruction, and a traffic restoration instruction; executing an upgrade instruction set, comprising: executing a file backup instruction, and replacing a current version application package in a starting folder corresponding to an application to be upgraded by using the application upgrading package; executing a flow removal instruction to stop receiving a request by a request port of an application to be upgraded; executing an application stopping instruction to stop running the application to be upgraded; calling an application starting instruction, and restarting the updated software corresponding to the application upgrading packet according to the application upgrading packet in the starting folder; and executing the flow recovery instruction to enable the request port to continuously receive the request.
In the specific implementation process: the front-end processor executes a file backup instruction, a flow removal instruction, an application stop instruction, an application start instruction and a flow recovery instruction in an upgrading instruction set to realize the upgrading of the application to be upgraded.
The following describes the steps of executing each instruction in detail, executing the file backup instruction: the APPlication upgrade package is used to replace the current version APPlication package in the start folder corresponding to the APPlication to be upgraded, for example, the APPlication upgrade package in the upgrade folder can be moved to the APP start folder, and the current version APPlication in the APP (APPlication) start folder can be moved to the backup folder.
Executing a flow extraction instruction: so that the request port of the application to be upgraded stops receiving requests. Traffic removal (Traffic offloading) refers to the process of transferring network traffic from one network interface or network path to another. The execution of the traffic removal instruction refers to transferring the network traffic in the application to be upgraded to the application without upgrading. The traffic extraction process can be implemented by upstream configuration in nginnx and script annotation. In nginix (reverse proxy server), upstream is a configuration block that defines a backend server cluster. The method is used for managing and load balancing the traffic of the client requests, and distributing the requests to the back-end server for processing.
Specifically, for example, two examples are deployed, example 1 is an application to be upgraded, and example 2 is an application that does not need to be upgraded. In nginix, the up stream configures two request agents of the instance, and the request agents are annotated before the instance 1 through the linux script, so that the request port corresponding to the instance 1 stops receiving the request, the network traffic of the instance 1 is transferred to the instance 2 without upgrading, and the instance 2 processes the request.
And executing an application stopping instruction to stop running the application to be upgraded. For example, judging whether an application to be upgraded is running, and for an application deployed by a container, calling a dock stop instruction to stop the specified mirror image running; for the application deployed by the jar package, stopping the application by using a kill-15 instruction graceful shutdown mode.
And calling an application starting instruction, and restarting the updated software corresponding to the application upgrading package according to the application upgrading package in the starting folder. For example, for an application to be upgraded deployed by a container, the dock run instruction boot image may be recalled, so that the upgraded software corresponding to the application upgrade package is restarted; and re-invoking a java-jar instruction to start the jar package for the application to be upgraded deployed by the jar package, so that the upgraded software corresponding to the application upgrading package is restarted.
In an alternative embodiment, after restarting the updated software corresponding to the application upgrade package, a start check may be performed, for example, performing continuous start detection for a preset number of times at preset time intervals, and stopping the detection flow if the application start is detected; and if the application starting is not detected after the execution of the preset times is completed, judging that the application starting fails.
And executing the flow recovery instruction to enable the request port to continuously receive the request. Following the above embodiment, the annotation added before instance 1 can be canceled by the linux script and a nginx-s reload command is executed to restart the niginx.
In the implementation process, the front-end processor executes the upgrade instruction to finish the upgrade of the application upgrade package, and the front-end processor upgrades the client application, so that the manual operation is reduced, the possibility of data leakage caused by the acquisition of the client operation authority by the manual upgrade is reduced, and the safety of the data is further improved.
Optionally, in an embodiment of the present application, the upgrade instruction set further includes a mirror load instruction; after executing the traffic removal instruction to stop receiving requests at the request port of the application to be upgraded, the method further comprises: and confirming whether the application to be upgraded is deployed in the container, if so, detecting whether the image of the upgrading application packet is loaded in the container, and if not, executing an image loading instruction and loading the image of the upgrading application packet.
In the specific implementation process: when the flow removal instruction is executed, whether the deployment mode of the application to be upgraded is container deployment or not can be judged, if yes, whether the mirror image of the upgrading application packet is loaded in the container is detected; if the image of the upgrade application package is not loaded, the image loading instruction is executed, for example, the image loading instruction can be specifically executed by calling a dock load to load the image of the upgrade application package in the container. If the image of the upgrade application package is judged to be loaded, the image loading instruction does not need to be repeatedly executed.
In the implementation process, when the flow removal instruction is executed, whether the deployment mode of the application to be upgraded is container deployment or not can be judged, whether the mirror image of the upgrading application package is loaded in the container or not is detected, so that the mirror image of the upgrading application package is loaded in the container, the upgrading of the application in the container deployment mode is completed, and the usability of the application upgrading is improved.
Optionally, in an embodiment of the present application, the method further includes: if the execution of the download instruction in the download instruction set fails, acquiring a download rollback instruction in the download task, and executing the download rollback instruction so as to restore the download task to the step before the download failure; the download rollback instruction is used for canceling the corresponding download instruction; if the upgrade instruction in the upgrade instruction set fails to be executed, an upgrade rollback instruction in the upgrade task is obtained, and the upgrade rollback instruction is executed, so that the upgrade task is restored to the step before the upgrade failure; the upgrade rollback instruction is used for canceling the corresponding upgrade instruction.
In the specific implementation process: each download instruction in the download instruction set has a corresponding download rollback instruction. The download rollback instruction is used to restore the download task to a step prior to the download failed instruction.
Specifically, for example, the download rollback instruction corresponding to the file download instruction is: deleting the downloaded application upgrade package; the download rollback instruction corresponding to the file verification instruction is: returning the operation result of the previous instruction, and not executing the operation; the download rollback instruction corresponding to the file transfer instruction is: and deleting the application upgrade package transmitted to the client.
And each upgrade instruction in the upgrade instruction set has a corresponding upgrade rollback instruction. The upgrade rollback instruction is used to restore the upgrade task to a step prior to the upgrade failed instruction.
Specifically, for example, the upgrade rollback instruction corresponding to the file backup instruction is: and returning the operation result of the last instruction, and not executing the operation. The upgrade rollback instruction corresponding to the flow extraction instruction is as follows: and canceling the server forwarding configuration annotation by using the linux script, and executing the nginx-sreload command to restart the nginx. The upgrade rollback instruction corresponding to the application stop instruction is: and re-calling the dock run instruction to start the mirror image for the application deployed by the container, and re-calling the java-jar instruction to start the jar packet for the application deployed by the jar packet.
The upgrade rollback instruction corresponding to the application starting instruction is: and detecting whether the application package with the appointed version runs normally, if so, calling a dock stop instruction to stop appointed mirror running for the application deployed by the container, and stopping the application by using a kill-15 instruction to stop the application in an elegant mode. The upgrade rollback instruction corresponding to the flow recovery instruction is: and re-annotating the server forwarding configuration through the linux script, and then executing the nginx-sreload command to restart the nginx.
In the implementation process, if the execution of the download instruction in the download instruction set fails, executing the download rollback instruction to restore the download task to the step before the download failure; if the upgrade instruction in the upgrade instruction set fails to be executed, executing an upgrade rollback instruction so as to restore the upgrade task to the step before the upgrade fails; and processing the application program errors in time, ensuring the integrity of data and enhancing the stability and maintainability of the system.
In an alternative embodiment, the instructions are divided into single node execution and cluster execution, as there may be multiple instance deployment scenarios at deployment time. Multiple instance deployment refers to the deployment of multiple instances of an application onto different servers or computing resources, each instance running independently and together providing services. The single node execution is completed by one instance deployment machine for all instructions, and the cluster execution is completed by a plurality of instance deployment machines for the instructions.
Such as file download instructions that only need to be downloaded at the client's local head-end. Because there are multiple instance deployers, file transfer instructions will execute on multiple instances.
Thus, an upgrade task instruction set is in single node deployment execution order:
file downloading, file synthesis, front MD5 verification, file transmission and rear file verification.
If multi-node deployment is applied, the execution sequence is split into:
file download, file synthesis, pre-MD 5 verification, file transfer (a instance), a post-instance file verification, file transfer (B instance), and B instance post-file verification.
Please refer to the application upgrade flowchart provided in the embodiment of fig. 2.
The B end is a service provider, the C end is a client, the front end processor is deployed at the client, and the executor is an execution machine corresponding to the front end processor. The service provider issues an application, i.e. an upgrade application package of the software to be upgraded, which may include a version number and specific materials. After receiving the upgrade prompt sent by the server, the client confirms the upgrade and generates an upgrade task. The front-end processor acquires the downloading task generated by the client by sending the heartbeat data to the client, executes the task and downloads the application upgrading packet in the server. And merging and checking the files, and transmitting the files after the files pass the checking. And sequentially executing the file backup instruction, the flow removal instruction, the application stop instruction, the application start instruction and the flow recovery instruction, and returning an execution result to the client after the execution is completed.
Please refer to fig. 3, which illustrates a schematic structural diagram of an application upgrading device provided in an embodiment of the present application; the embodiment of the application provides an application upgrading device 200, which is applied to a front-end processor, wherein the front-end processor is deployed at a client, and comprises:
a download task module 210, configured to obtain a download task, where the download task includes a download instruction set; the downloading task is generated after the client receives the upgrade prompt sent by the server and confirms the downloading;
an execution download module 220, configured to execute a download instruction set to complete a download task;
the upgrade task module 230 is configured to obtain an upgrade task, where the upgrade task includes an upgrade instruction set; the upgrading task is generated after the client confirms upgrading after the downloading task is completed;
and the execution upgrade module 240 is configured to execute an upgrade instruction set to complete an upgrade task.
Optionally, in the embodiment of the present application, the application upgrading device executes the downloading module 220, and is specifically configured to send a heartbeat request to the client; the heartbeat request is used for inquiring whether the client generates a downloading task or not; if the downloading task generated by the client is inquired, confirming whether the downloading task is executed or not according to the identification of the downloading task; in the case where the download task is not executed, the download task is acquired.
Optionally, in an embodiment of the present application, the application upgrading device, the downloading instruction set includes a file downloading instruction, a file checking instruction and a file transmitting instruction; the execution download module 220 is specifically configured to execute a file download instruction, and download an application upgrade package corresponding to an application to be upgraded from a server; executing a file verification instruction, performing abstract calculation on the application upgrading packet to obtain an abstract result, and verifying the application upgrading packet according to the abstract result to obtain a verification result; and under the condition that the verification result passes, executing a file transmission instruction, and transmitting the application upgrading packet to the client corresponding to the application to be upgraded.
Optionally, in an embodiment of the present application, the application upgrading device, the application upgrading package includes an application unpacking package; the execution download module 220 is further configured to execute a file download instruction, and download an application split packet corresponding to the application to be upgraded from the server; the application splitting package is obtained after the server splits the application upgrading package according to a preset splitting threshold; and merging the application splitting packages according to the number sequence of the application splitting packages to obtain the application upgrading package.
Optionally, in an embodiment of the present application, the application upgrading device includes an upgrade instruction set including a file backup instruction, a flow removal instruction, an application stop instruction, an application start instruction, and a flow restoration instruction; the execution upgrade module 240 is specifically configured to execute a file backup instruction, and replace a current version application package in a start folder corresponding to an application to be upgraded with an application upgrade package; executing a flow removal instruction to stop receiving a request by a request port of an application to be upgraded; executing an application stopping instruction to stop running the application to be upgraded; calling an application starting instruction, and restarting the updated software corresponding to the application upgrading packet according to the application upgrading packet in the starting folder; and executing the flow recovery instruction to enable the request port to continuously receive the request.
Optionally, in an embodiment of the present application, the upgrade apparatus, the upgrade instruction set further includes an image load instruction; the upgrade execution module 240 is further configured to determine whether an application to be upgraded is deployed in the container, if so, detect whether an image of the upgrade application package is loaded in the container, and if not, execute an image loading instruction, and load an image of the upgrade application package.
Optionally, in the embodiment of the present application, the application upgrading device further includes a rollback module, configured to obtain a download rollback instruction in the download task if the execution of the download instruction in the download instruction set fails, and execute the download rollback instruction, so that the download task is restored to the step before the download failure; the download rollback instruction is used for canceling the corresponding download instruction; if the upgrade instruction in the upgrade instruction set fails to be executed, an upgrade rollback instruction in the upgrade task is obtained, and the upgrade rollback instruction is executed, so that the upgrade task is restored to the step before the upgrade failure; the upgrade rollback instruction is used for canceling the corresponding upgrade instruction.
It should be understood that, corresponding to the above application upgrading method embodiment, the apparatus can perform the steps related to the above method embodiment, and specific functions of the apparatus may be referred to the above description, and detailed descriptions are omitted herein as appropriate to avoid repetition. The device includes at least one software functional module that can be stored in memory in the form of software or firmware (firmware) or cured in an Operating System (OS) of the device.
Please refer to fig. 4, which illustrates a schematic structural diagram of an electronic device provided in an embodiment of the present application. An electronic device 300 provided in an embodiment of the present application includes: a processor 310 and a memory 320, the memory 320 storing machine-readable instructions executable by the processor 310, which when executed by the processor 310 perform the method as described above.
The present application also provides a storage medium having stored thereon a computer program which, when executed by a processor, performs a method as above.
The storage medium may be implemented by any type of volatile or nonvolatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
The foregoing description is merely an optional implementation of the embodiments of the present application, but the scope of the embodiments of the present application is not limited thereto, and any person skilled in the art may easily think about changes or substitutions within the technical scope of the embodiments of the present application, and the changes or substitutions should be covered in the scope of the embodiments of the present application.

Claims (10)

1. The application upgrading method is characterized by being applied to a front-end processor, wherein the front-end processor is deployed at a client and comprises the following steps:
acquiring a downloading task, wherein the downloading task comprises a downloading instruction set; the downloading task is generated according to a pre-configured downloading instruction template after the client receives an upgrading prompt sent by a server and confirms downloading;
executing the downloading instruction set to finish the downloading task;
acquiring an upgrade task, wherein the upgrade task comprises an upgrade instruction set; the upgrading task is generated according to a pre-configured upgrading instruction template after the client confirms upgrading after the downloading task is completed;
And executing the upgrading instruction set to finish the upgrading task.
2. The method of claim 1, wherein the acquiring the download task comprises:
sending a heartbeat request to the client; the heartbeat request is used for inquiring whether the client generates the downloading task or not;
if the downloading task generated by the client is queried, confirming whether the downloading task is executed or not according to the identification of the downloading task;
and acquiring the downloading task under the condition that the downloading task is not executed.
3. The method of claim 1, wherein the download instruction set comprises a file download instruction, a file check instruction, and a file transfer instruction; the executing the downloading instruction set to complete the downloading task comprises the following steps:
executing the file downloading instruction, and downloading an application upgrading packet corresponding to the application to be upgraded from the server;
executing the file verification instruction, performing abstract calculation on the application upgrading packet to obtain an abstract result, and verifying the application upgrading packet according to the abstract result to obtain a verification result;
and under the condition that the verification result passes, executing the file transmission instruction, and transmitting the application upgrading packet to the client corresponding to the application to be upgraded.
4. The method of claim 3, wherein the application upgrade package comprises an application tear down package; the executing the file downloading instruction, downloading an application upgrading packet corresponding to the application to be upgraded from the server, includes:
executing the file downloading instruction, and downloading the application split package corresponding to the application to be upgraded from the server; the application splitting package is obtained after the server splits the application upgrading package according to a preset splitting threshold;
and merging the application splitting packages according to the number sequence of the application splitting packages to obtain the application upgrading package.
5. The method of claim 1, wherein the upgrade instruction set includes a file backup instruction, a traffic removal instruction, an application stop instruction, an application start instruction, and a traffic restoration instruction; the executing the upgrade instruction set includes:
executing the file backup instruction, and replacing a current version application package in a starting folder corresponding to the application to be upgraded with the application upgrading package;
executing the flow extraction instruction to stop receiving the request by the request port of the application to be upgraded;
Executing the application stopping instruction to stop running the application to be upgraded;
invoking the application starting instruction, and restarting the updated software corresponding to the application upgrading package according to the application upgrading package in the starting folder;
and executing the flow recovery instruction so that the request port continues to receive requests.
6. The method of claim 5, wherein the upgrade instruction set further comprises a mirrored load instruction; after the executing the traffic removal instruction to stop the request port of the application to be upgraded from receiving the request, the method further includes:
and confirming whether the application to be upgraded is deployed in a container, if so, detecting whether the image of the upgrading application packet is loaded in the container, and if not, executing the image loading instruction and loading the image of the upgrading application packet.
7. The method according to any one of claims 1-6, further comprising:
if the execution of the downloading instruction in the downloading instruction set fails, acquiring a downloading rollback instruction in the downloading task, and executing the downloading rollback instruction so as to restore the downloading task to the step before the downloading failure; the download rollback instruction is used for canceling the corresponding download instruction;
If the upgrade instruction in the upgrade instruction set fails to be executed, an upgrade rollback instruction in the upgrade task is obtained, and the upgrade rollback instruction is executed, so that the upgrade task is restored to the step before the upgrade failure; the upgrade rollback instruction is used for canceling the corresponding upgrade instruction.
8. The application upgrading device is characterized by being applied to a front-end processor, wherein the front-end processor is deployed at a client and comprises:
the downloading task module is used for acquiring a downloading task, and the downloading task comprises a downloading instruction set; the downloading task is generated after the client receives an upgrade prompt sent by a server and confirms downloading;
the execution downloading module is used for executing the downloading instruction set and completing the downloading task;
the upgrading task module is used for acquiring an upgrading task, and the upgrading task comprises an upgrading instruction set; the upgrading task is generated after the client confirms upgrading after the downloading task is completed;
and the execution upgrading module is used for executing the upgrading instruction set and completing the upgrading task.
9. An electronic device, comprising: a processor and a memory storing machine-readable instructions executable by the processor to perform the method of any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, characterized in that it has stored thereon a computer program which, when executed by a processor, performs the method according to any of claims 1 to 7.
CN202311677448.2A 2023-12-07 2023-12-07 Application upgrading method and device, electronic equipment and storage medium Pending CN117667147A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311677448.2A CN117667147A (en) 2023-12-07 2023-12-07 Application upgrading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311677448.2A CN117667147A (en) 2023-12-07 2023-12-07 Application upgrading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117667147A true CN117667147A (en) 2024-03-08

Family

ID=90080418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311677448.2A Pending CN117667147A (en) 2023-12-07 2023-12-07 Application upgrading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117667147A (en)

Similar Documents

Publication Publication Date Title
CN108551487B (en) Application deployment method, device, server and storage medium of PaaS platform
CN108595221B (en) Plug-in loading method, device, server and storage medium of PaaS platform
US11106453B2 (en) Method and system for a client to server deployment via an online distribution platform
CN109491698B (en) System updating method and device based on hot patch
CN111324412A (en) Service deployment method, device and storage medium
WO2017198156A1 (en) Service deployment method, apparatus and system
CN113760311A (en) Micro-service deployment method, device and medium
US9208320B2 (en) Software distribution system and software distribution method
US20170052779A1 (en) Method and Device for Running Version File
CN110908681A (en) Method and device for upgrading software
CN112596771A (en) Method and system for uninterrupted service upgrade
CN112732285B (en) Upgrading method and device suitable for cloud computing linux operating system and electronic equipment
CN115202680A (en) System and method for automatically upgrading local client on line in remote manner
US20190012161A1 (en) Distributed and self-deleting apparatus for fast software deployment and upgrade in a network
CN117667147A (en) Application upgrading method and device, electronic equipment and storage medium
CN115145596A (en) OTA (over the air) upgrading method and device for robot upgrading package
CN105765908B (en) A kind of multi-site automatic update method, client and system
CN109428936B (en) APP upgrading method, device, system, electronic equipment and storage medium
CN112558990A (en) Maintenance and upgrading method and system for vehicle-mounted safety computer
CN113157307A (en) Software version upgrading method and device
CN110673869B (en) Library file loading method, device and system
CN114003260A (en) Application hot update method and device
CN113791810B (en) ZYNQ platform-based remote upgrading method, device and system
CN115454580B (en) Node host resource management method and device and computing equipment
CN114153554A (en) Data consistency service deployment method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination