CN118733074A - Application upgrading method, device, server and storage medium - Google Patents
Application upgrading method, device, server and storage medium Download PDFInfo
- Publication number
- CN118733074A CN118733074A CN202310363478.XA CN202310363478A CN118733074A CN 118733074 A CN118733074 A CN 118733074A CN 202310363478 A CN202310363478 A CN 202310363478A CN 118733074 A CN118733074 A CN 118733074A
- Authority
- CN
- China
- Prior art keywords
- data packet
- upgrade
- upgrading
- application
- data
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 238000012986 modification Methods 0.000 abstract description 14
- 230000004048 modification Effects 0.000 abstract description 14
- 230000008569 process Effects 0.000 abstract description 14
- 238000012545 processing Methods 0.000 abstract description 9
- 238000010586 diagram Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000012360 testing method Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002085 persistent effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The application discloses an application upgrading method, an application upgrading device, a server and a storage medium, and belongs to the technical field of data processing. Applied to a server, the method comprises the following steps: acquiring a basic data packet and an upgrade data packet of a target application, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet which needs to be upgraded by the target application; determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet; and when the target operation parameters indicate to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet. According to the method and the device, the target operation parameters are determined by acquiring the basic data packet added by the server for each upgrade packet, and when the target operation parameters indicate to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet, and the process does not need to write a modification command manually, so that the data of the target application is automatically upgraded, and the efficiency of the data upgrading of the target application in the server is improved.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an application upgrading method, an application upgrading device, a server, and a storage medium.
Background
With the development of science and technology, various terminal devices are in daily life of people, and people can use the terminal devices to run installed application programs for entertainment, work and the like.
The various application programs correspond to servers, and the servers interact with the terminal equipment to realize functions provided by the application programs. When the application program needs to be updated, the application code of the application program in the server is updated first, and then the terminal equipment downloads the updated application code. For example, when a developer needs to upgrade and update an application program in a server, a development device of the application program encodes and writes modification commands, and the modification commands can specify update data packages written by the developer so that the server updates the application program based on the modification commands.
In the above scheme, since the modification command needs to be written for each update, a lot of time is required in the process, and when the update data packet is more, the written modification command is longer, and is not easy to load successfully, so that the problem of low efficiency of application upgrading in the server is caused.
Disclosure of Invention
In order to solve the problems in the prior art and improve the efficiency of application upgrading in a server, the embodiment of the application provides an application upgrading method, an application upgrading device, a server and a storage medium. The technical scheme is as follows:
in one aspect, the present application provides an application upgrade method, applied to a server, the method comprising:
Acquiring a basic data packet and an upgrade data packet of a target application, wherein the basic data packet is added by the server for each upgrade data packet of the target application, and the upgrade data packet is a code packet which needs to be upgraded by the target application;
Determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet;
And when the target operation parameter indicates to execute the upgrading data packet, carrying out data upgrading on the target application according to the upgrading data packet.
In one aspect, the present application provides an application upgrading apparatus, applied to a server, the apparatus comprising:
The first acquisition module is used for acquiring data upgrading information of the target application, wherein the data upgrading information comprises a basic data packet and an upgrading data packet;
The first determining module is used for determining target operation parameters according to the basic data packet, wherein the target operation parameters are used for indicating whether to execute the upgrading data packet or not;
And the first upgrading module is used for upgrading the data of the target application according to the upgrading data packet when the target operation parameter indicates to execute the upgrading data packet.
In another aspect, the present application provides a server comprising a processor and a memory having stored therein at least one instruction, at least one program, code set, or instruction set, loaded and executed by the processor to implement the application upgrade method according to one aspect.
In another aspect, the present application provides a computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement an application upgrade method as described in one aspect.
In another aspect, embodiments of the present application provide a computer program product which, when run on a computer, causes the computer to perform an application upgrade method as described in one of the above aspects.
In another aspect, an embodiment of the present application provides an application publishing platform, where the application publishing platform is configured to publish a computer program product, and when the computer program product runs on a computer, cause the computer to execute the application upgrading method according to the above aspect.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
Acquiring a basic data packet and an upgrade data packet of a target application, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet which needs to be upgraded by the target application; determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet; and when the target operation parameters indicate to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet. According to the method and the device, the target operation parameters are determined by acquiring the basic data packet added by the server for each upgrade packet, and when the target operation parameters indicate to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet, and the process does not need to write a modification command manually, so that the data of the target application is automatically upgraded, and the efficiency of the data upgrading of the target application in the server is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic architecture diagram of an application scenario for publishing an application provided by an exemplary embodiment of the application;
FIG. 2 is a method flow diagram of an application upgrade method provided by an exemplary embodiment of the present application;
FIG. 3 is a method flow diagram of an application upgrade method provided by an exemplary embodiment of the present application;
Fig. 4 is a schematic structural diagram of a server according to an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a runtime container executing basic packets and individual upgrade packets in sequence, according to an exemplary embodiment of the present application;
FIG. 6 is a block diagram of an application upgrade apparatus provided in an exemplary embodiment of the present application;
fig. 7 is a schematic structural diagram of a server according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of apparatus and methods consistent with aspects of the application as detailed in the accompanying claims.
The scheme provided by the application can be used in a real scene of upgrading and deploying application codes of application programs by using a server in daily life, and in order to facilitate understanding, the following description is firstly provided for simply introducing some nouns related to the embodiment of the application and scene architecture of the application scene.
Kubernetes (K8 s): is a Google open-source container cluster management system for managing containerized applications on multiple hosts in a cloud platform.
Javaagent: java programs may be modified or monitored by a jar package specified by a command line provided by Java Virtual Machine (Java virtual machine, JVM).
Mutating Admission Webhook: is a callback mechanism provided by K8s, and when the matched resource changes, the configured server is called to modify the resource definition.
And (3) continuous deployment: is a higher degree of automation in the server, and is automatically built/deployed whenever significant changes are made to the code.
Along with development of scientific technology, terminal equipment is more and more popular in intelligence, various terminal equipment is provided with application programs, and in practical application, the application programs often need to be updated. For example, when a developer needs to update a function in an application after the development of the application is completed, it is often necessary to rewrite an update content portion of the application, and update application codes in a formal environment by a server to complete data change.
Referring to fig. 1, an architecture diagram of an application scenario for publishing an application program according to an exemplary embodiment of the present application is shown, where, as shown in fig. 1, the application scenario may include: a computer device 110 and a server 120.
The computer device 110 may be a terminal device in which a program code application is installed, and a developer may write application code of an application program through the computer device. For example, the terminal device may be a mobile phone, a tablet computer, a notebook computer, a desktop computer, or the like, which has an application code editable function.
Server 120 may be at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for applications supporting a virtual environment. Optionally, the server 120 includes a plurality of databases, and the server 120 may provide a test environment or a formal environment, that is, what is commonly referred to as a test service or a formal service, to a developer or a user.
Optionally, a communication connection is established between the computer device 110 and the server 120, through which data is transmitted. Wherein the communication connection may be referred to as a communication network or network connection, the communication connection using standard communication techniques and/or protocols. The network is typically the Internet, but may be any network including, but not limited to, a local area network (Local Area Network, LAN), metropolitan area network (Metropolitan Area Network, MAN), wide area network (Wide Area Network, WAN), mobile, wired or wireless network, private network, or any combination of virtual private networks. In some embodiments, data exchanged over the network is represented using techniques and/or formats including HyperText Mark-up Language (HTML), extensible markup Language (Extensible Markup Language, XML), and the like. All or some of the links may also be encrypted using conventional encryption techniques such as secure sockets layer (Secure Socket Layer, SSL), transport layer security (Transport Layer Security, TLS), virtual private network (Virtual Private Network, VPN), internet protocol security (Internet Protocol Security, IPsec), etc. In other embodiments, custom and/or dedicated data communication techniques may also be used in place of or in addition to the data communication techniques described above.
After the application program is edited by the developer through the computer equipment, the developer releases the application program into the server, and the server tests the application code of the application program and releases the flow, so that a user can download the application program from the server through other terminal equipment and operate the application program.
When the application program needs to be updated, a developer edits the updated data content through the computer equipment to generate a Java agent. Jar package, the Java agent. Jar package is uploaded to a server, and the server downloads the Java agent. Jar package according to a specified path when updating. The developer can rewrite the modification command through the computer equipment, the fixed parameter is used for designating the Java agent. Jar package in the command line, and the server upgrades and updates the application code of the application program according to the modification command.
Taking the Java language as an example, javaagent jar packages are specified in the Java command line using-javaagent and jvm parameters are added using-D, such as Java-javaagent:/path/agent. Jar-DAGENTARGS 1=xxx1-DAGENTARGS 1=xxx2-jar app. Jar, or automatically loaded by jvm using java_tol_options environment variables, such as export java_tol_options= -javaagent:/path/agent. Jar-DAGENTARGS 1=xxx1-DAGENTARGS 1 =xxx2, etc.
In the existing data change, since the modification command needs to be written every time of updating, a great amount of time is required in the process, and when more data packets are updated, the written modification command is longer, and is not easy to load successfully, so that the problem of low efficiency of application upgrading in a server is caused.
In order to solve the problems in the related art and improve the efficiency of upgrading the application in the server, the application provides an application upgrading method, which can actively add basic data packets to each upgrading data packet of the target application, determine whether to actively upgrade the data of the target application based on the basic data packets, and reduce the steps of manually writing commands.
Referring to fig. 2, a flowchart of a method for upgrading an application according to an exemplary embodiment of the present application is shown, where the method for upgrading an application may be applied to the server in the scenario architecture of fig. 1. As shown in fig. 2, the application upgrade method may include the steps of:
Step 201, obtaining a basic data packet and an upgrade data packet of a target application, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet of the target application which needs to be upgraded.
The server may store application codes of the target application in advance, and each upgrade data packet may be a code packet written by a developer and needing to be upgraded. For example, taking java application code as an example, the upgrade package written by the developer may be javaagent jar packages. Alternatively, the basic data packet may be a data packet corresponding to the target application, which is set in advance in the server by the developer.
Step 202, determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet.
Alternatively, the server may run the base packet and determine whether to execute the upgrade packet by enabling the base packet. For example, the target operating parameter is a true parameter or a false parameter; the true parameter indicates that the upgrade data packet is executed, the false parameter indicates that the upgrade data packet is not executed, when the basic data packet is started, the written target operation parameter is the true parameter, step 203 is executed, otherwise, the upgrade data packets are not required to be started to upgrade the target application.
And 203, when the target operation parameter indicates to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet.
For example, when the target operation parameter written after the basic data packet is started is a true parameter, the server performs data upgrading on the target application according to the upgrading data packet. And starting each upgrade data packet, and running the application program of the target application to upgrade the data.
In summary, a basic data packet and an upgrade data packet of the target application are obtained, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet of the target application to be upgraded; determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet; and when the target operation parameters indicate to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet. According to the method and the device, the target operation parameters are determined by acquiring the basic data packet added by the server for each upgrade packet, and when the target operation parameters indicate to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet, and the process does not need to write a modification command manually, so that the data of the target application is automatically upgraded, and the efficiency of the data upgrading of the target application in the server is improved.
In one possible implementation manner, before the server executes the data upgrading command, configuration information is added to a container for executing the data upgrading command by intercepting the data upgrading command, the server executes the data upgrading command according to the configuration information in the process of executing the data upgrading command, the situation that the running parameters are too long and cannot be loaded successfully in the process of calling the environment variables is avoided, and the efficiency of data upgrading of the target application in the server is improved.
Referring to fig. 3, a flowchart of a method for upgrading an application according to an exemplary embodiment of the present application is shown, where the method for upgrading an application may be applied to the server in the scenario architecture of fig. 1. As shown in fig. 3, the application upgrade method may include the steps of:
step 301, receiving upgrade version information selected for a target application.
Optionally, in the present application, the server may be provided with a user selection platform, and the user selects the upgrade version information corresponding to the target application and sends the upgrade version information to the server, so that the server receives the upgrade version information. For example, the server includes an upgrade version management system, and the upgrade version management system can provide a selection platform for a developer, and the developer selects a target application to be upgraded and upgrade version information corresponding to the target application from the upgrade version management system through the selection platform. Optionally, an administrator of the upgrade version management system may write a java agent/jar package to be added, configure relevant javaagent parameters for the java agent/jar package, upload the parameters to the upgrade version management system, and enable a developer to autonomously select javaagent information of a version corresponding to the target application.
Taking java codes as an example, a javaagent management system is maintained in the server, and a developer selects a target application to be upgraded and javaagent version information corresponding to the target application through the javaagent management system.
Step 302, a data upgrade command is established according to the upgrade version information.
Optionally, the server performs continuous deployment according to the selected upgrade version information, and establishes a data upgrade command. For example, the server also includes a continuous deployment system, the continuous deployment system can provide an interface for releasing the application for the developer, and after the user selects to release a certain application, the continuous deployment system can query the upgrade version information of the application. For example, the continuous deployment system may have a communication connection with an upgraded version management system from which the continuous deployment system queries for upgraded version information selected by a developer.
Optionally, after the server obtains the upgrade version information, a data upgrade command may be established according to the upgrade version information. For example, taking the obtained updated version information as javaagent version information as an example, the server starts to deploy the target application through the continuous deployment system, creates a Pod container, places a javaagent-enabled label on the Pod, and places an Annotation (animation) on the Pod, where the Annotation contains javaagent version information. Optionally, the server further comprises a K8s cluster, and the Pod is started to be applied to the K8s cluster through the continuous deployment system. Optionally, the server may set up a data upgrade command according to the upgrade version information, and apply the information required by the Pod to the K8s cluster, and then perform data upgrade on the target application in the K8s cluster, for example, a K8s application program interface (Application Program Interface, API) service in the K8s cluster may receive the Pod created in the process of deploying the application in the system continuously, set up a data upgrade command, and perform application upgrade deployment.
Referring to fig. 4, a schematic structural diagram of a server according to an exemplary embodiment of the present application is shown in fig. 4, where a K8s cluster 401 is included, a continuous deployment system 402, a java agent management system 403, a storage system 404, and a K8s API service unit 401a is further included in the K8s cluster 401. The administrator uploads javaagent jar the package to javaagent management system 403, adding parameters. javaagent the management system 403 uploads javaagent jar packets to the storage system, which stores the download address and parameters of javaagent jar packets to form a javaagent version. javaagent the management system 403 may also receive the javaagent version selected by the user for the target application and issue the target application to the persistent deployment system 402, and the persistent deployment system 403 may deploy the target application and issue a command to upgrade the deployment to the K8s cluster 401.
Step 303, intercepting the data upgrade command before executing the data upgrade command.
Step 304, add configuration information to the container executing the data upgrade command.
Optionally, in the present application, before the data upgrade command is executed by the server, the data upgrade command needs to be intercepted, and configuration information is added to the container for executing the data upgrade command, so that the container for executing the data upgrade command in the server executes the data upgrade command according to the configuration information.
Optionally, taking the example that the server further includes a K8s cluster, the application may add a network hook configuration (Mutating Webhook Configuration) unit and a Webhook server unit for deploying variation in the K8s cluster, and after the information required by the Pod is applied to the K8s cluster, the pre-deployed Mutating Webhook Configuration unit may call Webhook the server unit, intercept updating of the Pod, and add configuration information to a container for executing a data upgrade command.
In one possible implementation, a container in a server that executes a data upgrade command includes: a loading container and a running container; the configuration information includes: information loading environment variables, running environment variables and information adding environment variables; the information loading environment variables are used for loading the container to download each upgrade data packet; the running environment variable is used for placing variable characters when the variable length of the information adding environment variable exceeds a preset length; the information addition environment variable is used to add each upgrade data packet.
Optionally, a loading Container (Init Container) and a running Container (Biz Container) are included in the K8s cluster in the server. Wherein, the loading Container (Init Container) is that a standard Javaagent injected Init Container is added to the spec of Pod after the pre-deployed Mutating Webhook Configuration unit intercepts the update of Pod. The configuration information includes: the configuration of the loading Container (Init Container) and the running Container (Biz Container) containing Pod is as follows: mounting an empty Dir for Init containers and Biz Container (to support shared directories); adding an information loading environment variable for the Init Container, so that the Init Container can download a java agent packet corresponding to the target application; adding a runtime environment variable (JAVA_AGENT_PARAM) for Biz Container so that AGENT parameters can be written into the runtime environment variable; an information append environment variable (JAVA_TOOL_OPTIONS) is added for Biz Container so that an append value javaagent:/path/xxxx.jar (allowing a plurality of) is added after the JAVA_TOOL_OPTIONS of Biz Container, thereby appending a Java agent.jar packet corresponding to the target application after the JAVA_TOOL_OPTIONS environment variable.
For example, the K8s cluster 401 in fig. 4 further includes a variant web hook configuration unit 401b, a webhook server unit 401c, a loading container 401d, and a running container 401e. The administrator deploys the mutated network hook configuration unit 401b and Webhook server unit 401c in the K8s cluster 401 in advance, and the network hook configuration unit 401b calls Webhook server unit, intercepts the update of Pod, and adds configuration information to the container executing the data upgrade command.
Optionally, after the configuration information is configured, the Webhook server unit returns the changed Pod to the K8s API service, and the K8s API service continues to perform upgrade deployment.
Step 305, obtaining the upgrade data packet of the target application corresponding to the upgrade version information according to the upgrade version information.
Optionally, when the server performs upgrade deployment on the target application, an upgrade data packet of the target application corresponding to the upgrade version information is obtained according to the obtained upgrade version information.
In one possible implementation manner, when the upgrade deployment is performed on the target application in the server, the upgrade deployment is initiated to the loading Container (Init Container) based on the K8s API service in the K8s cluster, and the server uses the upgrade version information as an information loading environment variable of the loading Container (Init Container) to obtain an upgrade data packet of the target application corresponding to the upgrade version information.
For example, the server downloads the upgrade data packet of the target application corresponding to the upgrade version information by using the upgrade version information as an information loading environment variable of the loading Container (Init Container) in the K8s cluster. For example, after an administrator of the upgrade version management system writes a java agent packet (i.e., each upgrade data packet) to be added, configures relevant javaagent parameters for the java agent packet, and uploads the java agent packet to the upgrade version management system, the upgrade version management system may further upload the java agent packet to the storage system for storage, and store the download address of the java agent packet and the configured javaagent parameters in the storage system to form a javaagent version. In this step, a loading Container (Init Container) loads an environment variable according to the added information, and downloads a java agent packet corresponding to the target application from the storage system.
Step 306, add the base packet before upgrading the packet.
Optionally, the base packet is added in advance of the upgrade packet. For example, the server may write the java agent packet (i.e. each upgrade data packet) to be added by the administrator of the upgrade version management system, configure the relevant javaagent parameters for the java agent packet, upload the parameters to the upgrade version management system, and then automatically add a base data packet (base agent packet) before the upgrade data packet by the upgrade version management system and store the base data packet in the storage system, and download the base data packet in the process of downloading each java agent packet from the storage system in step 305.
Alternatively, the base packet may be configured by Webhook server units in the K8s cluster. For example, after the pre-deployed Mutating Webhook Configuration unit and Webhook server intercept the update of Pod, the configuration information further includes a piece of content: and adding a base data packet (base agent. Jar packet) before each original enabled upgrading data packet.
Step 307, determining a target operation parameter according to the basic data packet, where the target operation parameter is used to indicate whether to execute the upgrade data packet.
After each upgrade data packet (java packet) is downloaded from the storage system in step 305, when the operation container (Biz Container) is started, the basic data packet (base agent. Jar packet) added before each upgrade data packet is operated in the process of upgrading and deploying in the server.
Optionally, the server determines the target operation parameter according to the basic data packet, which may be as follows: judging whether the currently executed data upgrading command belongs to a command for executing a program or not according to the basic data packet; when the currently executed data upgrading command belongs to a command for executing a program, determining that the target operation parameter is an operation parameter for indicating to execute an upgrading data packet; when the currently executed data upgrade command does not belong to a command to execute a program, it is determined that the target operation parameter is an operation parameter indicating that the upgrade data package is not executed. That is, the server starts to determine whether the current upgrade command belongs to a command of executing the program by running the logic of the basic data packet, if so, writes the running parameters of the upgrade data packet, and if not, writes the running parameters of the non-upgrade data packet.
In the above example, the target operation parameter is represented by a java agent, enabled, when the currently executed data upgrade command belongs to a command for executing a program, the java agent, enabled=true, and when the currently executed data upgrade command does not belong to a command for executing a program, the java agent, enabled=false.
In step 308, when the target operation parameter indicates to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet.
Optionally, when the currently executed data upgrade command belongs to a command of executing the program, the target operation parameter indicates to execute the upgrade data packet, and the server sequentially executes each upgrade data packet, thereby implementing data upgrade for the target application. Alternatively, the server may perform data upgrade on the target application as follows: and the server sequentially reads the target operation parameters through the upgrade data packet, executes the operation logic of the upgrade data packet and performs data upgrade on the target application.
Referring to fig. 5, a schematic diagram of a running container according to an exemplary embodiment of the present application sequentially executing a basic data packet and each upgrade data packet is shown. As shown in fig. 5, the basic data packet 501, the upgrade data packet one 502, the upgrade data packet two 503, and the target application 504 are included. And the operation container reads the basic data packet, writes the target operation parameter java agent, enabled=true/false, and sequentially reads the target operation parameter by subsequently operating each upgrade data packet.
Optionally, in the process of executing the basic data packet, when the variable length of the information additional environment variable exceeds the preset length, splitting the information additional environment variable according to the basic data packet, and adding the information additional environment variable into the operation environment variable; and sequentially reading the running environment variables, and acquiring upgrading parameters for upgrading the data of the target application so that the running container runs according to the upgrading parameters.
In a JAVA runtime environment, for example, the length limit of the environment variable java_tol_options is typically 1024 characters, and after the runtime container uses more jvm parameters, the length of the environment variable java_tol_options exceeds the limit, cannot be loaded successfully, in this scheme, after the running environment variable java_agent_part is read through the base packet, the information adding environment variable is split, so the jvm parameter is split into java_agent_part, and jvm is read and written by BaseAgent.
For example, java_tol_options= "JAVA AGENT. Jar-Durl =xxx-Dport =xxx …", and java_agent_param= "-Durl =xxx-Dport =xxx …" after using the base packet, thereby achieving the splitting effect.
In summary, a basic data packet and an upgrade data packet of the target application are obtained, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet of the target application to be upgraded; determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet; and when the target operation parameters indicate to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet. According to the method and the device, the target operation parameters are determined by acquiring the basic data packet added by the server for each upgrade packet, and when the target operation parameters indicate to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet, and the process does not need to write a modification command manually, so that the data of the target application is automatically upgraded, and the efficiency of the data upgrading of the target application in the server is improved.
The following are examples of the apparatus of the present application that may be used to perform the method embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the embodiments of the method of the present application.
Referring to fig. 6, a block diagram of an application upgrading apparatus according to an exemplary embodiment of the present application is shown. The application upgrade apparatus 600 may be used with the servers in the scenario architecture of fig. 1 described above. To perform all or part of the steps performed by the server in the method provided by the embodiment shown in fig. 2, 3. The application upgrade apparatus 600 includes:
A first obtaining module 601, configured to obtain data upgrade information of a target application, where the data upgrade information includes a basic data packet and an upgrade data packet;
A first determining module 602, configured to determine a target operation parameter according to the base packet, where the target operation parameter is used to indicate whether to execute the upgrade packet;
And the first upgrade module 603 is configured to perform data upgrade on the target application according to the upgrade data packet when the target operation parameter indicates to execute the upgrade data packet.
In summary, a basic data packet and an upgrade data packet of the target application are obtained, wherein the basic data packet is added by a server for each upgrade data packet of the target application, and the upgrade data packet is a code packet of the target application to be upgraded; determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet; and when the target operation parameters indicate to execute the upgrade data packet, carrying out data upgrade on the target application according to the upgrade data packet. According to the method and the device, the target operation parameters are determined by acquiring the basic data packet added by the server for each upgrade packet, and when the target operation parameters indicate to execute the upgrade data packet, the data of the target application is upgraded according to the upgrade data packet, and the process does not need to write a modification command manually, so that the data of the target application is automatically upgraded, and the efficiency of the data upgrading of the target application in the server is improved.
Optionally, the first determining module 602 includes: a first judgment unit, a first determination unit and a second determination unit;
The first judging unit is used for judging whether the currently executed data upgrading command belongs to a command for executing a program according to the basic data packet;
the first determining unit is configured to determine that the target operation parameter is an operation parameter indicating to execute the upgrade data packet when the currently executed data upgrade command belongs to a command of an execution program;
the second determining unit is configured to determine that the target operation parameter is an operation parameter indicating that the upgrade data packet is not executed when the currently executed data upgrade command does not belong to a command of executing a program.
Optionally, the first obtaining module 601 includes: a first receiving unit, a first acquiring unit and a first adding unit;
the first receiving unit is used for receiving upgrade version information selected for the target application;
the first obtaining unit is used for obtaining an upgrade data packet of the target application corresponding to the upgrade version information according to the upgrade version information;
the first adding unit is configured to add the basic data packet before the upgrade data packet.
Optionally, the apparatus further includes:
The first establishing module is used for establishing a data upgrading command according to the upgrading version information after receiving the upgrading version information selected for the target application;
The first interception module is used for intercepting the data upgrading command before executing the data upgrading command;
and the first adding module is used for adding configuration information to the container for executing the data upgrading command, so that the container for executing the data upgrading command in the server executes the data upgrading command according to the configuration information.
Optionally, the container for executing the data upgrade command includes: a loading container and a running container; the configuration information includes: information loading environment variables, running environment variables and information adding environment variables;
The information loading environment variable is used for the loading container to download each upgrading data packet; the operation environment variable is used for placing variable characters when the variable length of the information addition environment variable exceeds a preset length; and the information adding environment variable is used for adding each upgrading data packet.
Optionally, the first upgrade module 603 is further configured to sequentially read the target operation parameters through the upgrade data packet, execute the operation logic of the upgrade data packet, and perform data upgrade on the target application.
Optionally, the apparatus further includes:
the second adding module is used for splitting the information adding environment variable according to the basic data packet and adding the information adding environment variable into the running environment variable when the variable length of the information adding environment variable exceeds a preset length;
And the second acquisition module is used for sequentially reading the running environment variables and acquiring the upgrading parameters for carrying out data upgrading on the target application so that the running container runs according to the upgrading parameters.
Referring to fig. 7, a schematic structural diagram of a server according to an exemplary embodiment of the present application is shown. The server 700 includes a Central Processing Unit (CPU) 701, a system memory 704 including a Random Access Memory (RAM) 702 and a Read Only Memory (ROM) 703, and a system bus 705 connecting the system memory 704 and the central processing unit 701. The server 700 also includes a basic input/output system (I/O system) 706, for aiding in the transfer of information between the various devices within the computer, and a mass storage device 707 for storing an operating system 717, application programs 714, and other program modules 715.
The basic input/output system 706 includes a display 708 for displaying information and an input device 709, such as a mouse, keyboard, or the like, for a user to input information. Wherein the display 708 and the input device 709 are coupled to the central processing unit 701 through an input output controller 710 coupled to a system bus 705. The basic input/output system 706 may also include an input/output controller 710 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input output controller 710 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 707 is connected to the central processing unit 701 through a mass storage controller (not shown) connected to the system bus 705. The mass storage device 707 and its associated computer readable media provide non-volatile storage for the server 700. That is, the mass storage device 707 may include a computer readable medium (not shown) such as a hard disk or CD-ROM drive.
The computer readable medium may include computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes RAM, ROM, EPROM, EEPROM, flash memory, or other solid state memory technology, CD-ROM, DVD, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage medium is not limited to the one described above. The system memory 704 and mass storage device 707 described above may be collectively referred to as memory.
The server 700 may be connected to the internet or other network device through a network interface unit 711 connected to the system bus 705.
The memory also includes one or more programs stored in the memory, and the central processor 701 implements all or part of the steps by executing the one or more programs.
It is to be appreciated that in embodiments of the application, the processor may be a central processing unit (Central Processing Unit, CPU), which may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Embodiments of the present application also provide a computer readable medium storing at least one instruction that is loaded and executed by the processor to implement all or part of the steps performed by the server in the application upgrade method described in the above embodiments.
Embodiments of the present application also provide a computer program product storing at least one instruction that is loaded and executed by the processor to implement all or part of the steps of the application upgrade method described in the above embodiments, performed by a server.
It should be noted that: the apparatus provided in the above embodiment only illustrates the division of the above functional modules when executing the control of the server, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the present application is not intended to limit the application, but rather, the application is to be construed as limited to the appended claims.
Claims (10)
1. An application upgrade method, applied to a server, the method comprising:
Acquiring a basic data packet and an upgrade data packet of a target application, wherein the basic data packet is added by the server for each upgrade data packet of the target application, and the upgrade data packet is a code packet which needs to be upgraded by the target application;
Determining a target operation parameter according to the basic data packet, wherein the target operation parameter is used for indicating whether to execute the upgrade data packet;
And when the target operation parameter indicates to execute the upgrading data packet, carrying out data upgrading on the target application according to the upgrading data packet.
2. The method of claim 1, wherein determining the target operating parameter from the base packet comprises:
judging whether the currently executed data upgrading command belongs to a command for executing a program or not according to the basic data packet;
When the currently executed data upgrading command belongs to a command for executing a program, determining that the target operation parameter is an operation parameter for indicating to execute the upgrading data packet;
and when the currently executed data upgrading command does not belong to a command for executing a program, determining that the target operation parameter is an operation parameter for indicating that the upgrading data packet is not executed.
3. The method according to claim 1, wherein the obtaining the base packet and the upgrade packet of the target application includes:
receiving upgrade version information selected for the target application;
acquiring an upgrade data packet of the target application corresponding to the upgrade version information according to the upgrade version information;
And adding the basic data packet before the upgrading data packet.
4. The method of claim 3, wherein after said receiving upgrade version information selected for said target application, said method further comprises:
Establishing a data upgrading command according to the upgrading version information;
Intercepting the data upgrading command before executing the data upgrading command;
And adding configuration information to a container for executing the data upgrading command, so that the container for executing the data upgrading command in the server executes the data upgrading command according to the configuration information.
5. The method of claim 4, wherein executing the container of data upgrade commands comprises: a loading container and a running container; the configuration information includes: information loading environment variables, running environment variables and information adding environment variables;
The information loading environment variable is used for the loading container to download each upgrading data packet; the operation environment variable is used for placing variable characters when the variable length of the information addition environment variable exceeds a preset length; and the information adding environment variable is used for adding each upgrading data packet.
6. The method of claim 5, wherein the data upgrading the target application according to the upgrade data packet comprises:
And sequentially reading the target operation parameters through the upgrading data packet, executing the operation logic of the upgrading data packet, and carrying out data upgrading on the target application.
7. The method of claim 5, wherein the method further comprises:
When the variable length of the information additional environment variable exceeds a preset length, splitting the information additional environment variable according to the basic data packet, and adding the information additional environment variable into the running environment variable;
and sequentially reading the running environment variables, and acquiring upgrading parameters for upgrading the data of the target application, so that the running container runs according to the upgrading parameters.
8. An application upgrade apparatus for use with a server, the apparatus comprising:
The first acquisition module is used for acquiring data upgrading information of the target application, wherein the data upgrading information comprises a basic data packet and an upgrading data packet;
The first determining module is used for determining target operation parameters according to the basic data packet, wherein the target operation parameters are used for indicating whether to execute the upgrading data packet or not;
And the first upgrading module is used for upgrading the data of the target application according to the upgrading data packet when the target operation parameter indicates to execute the upgrading data packet.
9. A server comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the application upgrade method of any one of claims 1-7.
10. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or instruction set being loaded and executed by a processor to implement the application upgrade method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310363478.XA CN118733074A (en) | 2023-03-31 | 2023-03-31 | Application upgrading method, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310363478.XA CN118733074A (en) | 2023-03-31 | 2023-03-31 | Application upgrading method, device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118733074A true CN118733074A (en) | 2024-10-01 |
Family
ID=92857030
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310363478.XA Pending CN118733074A (en) | 2023-03-31 | 2023-03-31 | Application upgrading method, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118733074A (en) |
-
2023
- 2023-03-31 CN CN202310363478.XA patent/CN118733074A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107766126B (en) | Container mirror image construction method, system and device and storage medium | |
US11340893B2 (en) | Mobile application update preserving changes to the application made by a client | |
US8799889B2 (en) | Application downloading | |
CN110096424B (en) | Test processing method and device, electronic equipment and storage medium | |
CN112416353A (en) | Channel package packaging method and device and computer equipment | |
CN107239309B (en) | Patch generation method and device, updating method, electronic device and storage medium | |
US9141363B2 (en) | Application construction for execution on diverse computing infrastructures | |
CN111651219A (en) | Method and equipment for managing multi-module project configuration file | |
CN117112122A (en) | Cluster deployment method and device | |
CN116860266A (en) | Application containerized deployment method and device, electronic equipment and storage medium | |
US9886272B1 (en) | Transformation of a web application into a hybrid mobile application | |
CN112395096B (en) | Remote function call processing method and device, electronic equipment and storage medium | |
CN112235132A (en) | Method, device, medium and server for dynamically configuring service | |
US10073689B2 (en) | Managing application lifecycles within a federation of distributed software applications | |
CN114546588A (en) | Task deployment method and device, storage medium and electronic device | |
US8615751B2 (en) | Seeding product information | |
CN108595169B (en) | Visual programming method, cloud server and storage medium | |
CN118733074A (en) | Application upgrading method, device, server and storage medium | |
CN113805858B (en) | Method and device for continuously deploying software developed by scripting language | |
CN115454575A (en) | Method, device, equipment and storage medium for conversion and automatic loading of jar package | |
Srivastava et al. | An open-source SWUpdate and Hawkbit framework for OTA Updates of RISC-V based resource constrained devices | |
CN115016862A (en) | Kubernetes cluster-based software starting method, device, server and storage medium | |
CN110806876B (en) | Lightweight Linux system customization method based on slit, device computer equipment and storage medium | |
CN114860202A (en) | Project operation method, device, server and storage medium | |
CN110321335B (en) | Modeling data downloading method and device, electronic equipment and computer 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 |