Service deployment methods, apparatus, equipment and computer-readable storage media

By acquiring incremental change information and compilation change information, the compiled files in the virtual machine memory are updated during the execution of the server program, which solves the problem that service component upgrades require stopping the service in the existing technology and realizes efficient upgrade deployment without restarting the service.

CN115729590BActive Publication Date: 2026-03-13ANHUI IFLYREC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies require stopping the current service process when upgrading and deploying service components, making it impossible to complete the upgrade and deployment without stopping the service.

Method used

By acquiring incremental change information, the compiled files loaded in the virtual machine memory are updated during the execution of the server program using the compiled change information. This includes adding, changing, and deleting compiled files, reducing the amount of data transferred, and enabling upgrade deployment without restarting the service.

Benefits of technology

The upgrade deployment was completed during the server-side program's operation, which reduced the amount of data transmitted, lowered network transmission time and bandwidth costs, improved upgrade efficiency, and reduced the impact on users' service usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115729590B_ABST
    Figure CN115729590B_ABST
Patent Text Reader

Abstract

This application discloses a service deployment method, apparatus, device, and computer-readable storage medium. The method includes: a service node acquiring incremental change information representing the difference between the software package file to be updated and the current software package file of the service node; using the incremental change information to obtain compilation change information; and updating the compilation file loaded in the virtual machine memory based on the compilation change information in the changed file during the execution of the server program. In this way, only incremental change information needs to be transmitted during upgrade deployment, reducing the amount of data transmitted. By using a small amount of changed content, the compilation file loaded in the virtual machine memory is dynamically changed to the new version of the compilation file, thereby enabling the upgrade deployment of the server program without stopping the service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software technology, and in particular to a service deployment method, apparatus, device, and computer-readable storage medium. Background Technology

[0002] With the progress of the times and the development of science, people's demand for and reliance on electronic devices and the internet are increasing day by day, and various internet applications are emerging and changing rapidly. The functional iteration of internet applications is becoming faster and faster, and service components are being deployed and launched more and more frequently, making deployment and update work an important task.

[0003] During the long-term research and development process, the applicant of this application needed to stop the current service process and be unable to provide services to the outside world during the upgrade and deployment of existing service components. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a service deployment method, apparatus, device, and computer-readable storage medium that enables service upgrade deployment without interrupting the service.

[0005] To address the aforementioned technical problems, this application provides a service deployment method, which includes: a service node acquiring incremental change information, whereby the incremental change information represents the difference between the software package file to be updated and the current software package file of the service node; obtaining compilation change information using the incremental change information; and updating the compiled files loaded in the virtual machine memory based on the compilation change information during the execution of the server program, thereby updating the server program.

[0006] The process of updating the compiled files loaded in the virtual machine memory based on compilation change information includes at least one of the following steps: if the compilation change information includes a compiled file to be added, the compiled file to be added is loaded into the virtual machine memory; if the compilation change information includes a modified compiled file, the modified compiled file is loaded into the virtual machine memory and replaces the corresponding current compiled file in the virtual machine memory; if the compilation change information includes identification information of a compiled file to be deleted, the compiled file to be deleted corresponding to the identification information in the virtual machine memory is destroyed.

[0007] Updating the compiled files loaded in the virtual machine memory based on compilation change information includes: obtaining the process identifier corresponding to the server program, and using the process identifier to update the corresponding compiled files in the virtual machine memory.

[0008] The process of obtaining incremental change information includes: receiving incremental change information sent by the terminal-side repository of the target terminal using the service-side repository. The incremental change information is generated by the terminal-side repository based on a comparison between the latest package file to be updated stored in the terminal-side repository and the current package file of the service node. Obtaining compilation change information using the incremental change information includes: updating the latest package file stored in the service-side repository from the current package file to the package file to be updated using the incremental change information, so that the latest package files stored in the service-side repository and the terminal-side repository are consistent. The incremental compilation file is obtained from the latest package file stored in the service-side repository. The incremental compilation file includes the compilation file to be added and / or the modified compilation file.

[0009] The process of obtaining compilation change information using incremental change information also includes: using a file monitoring system to monitor version updates of the latest package files stored in the server-side repository, where the package files stored in the server-side repository follow changes in the package files stored in the terminal-side repository of the target terminal; in response to detecting changes in the latest package files stored in the server-side repository, obtaining a list of changed files and sending it to the deployment module, whereby the list of changed files contains identification information for at least one of the following: files to be added for compilation, modified files, and files to be deleted for compilation; obtaining incremental compilation files from the latest package files stored in the server-side repository includes: using the deployment module to obtain the list of changed files, and obtaining incremental compilation files from the latest package files stored in the server-side repository based on the list of changed files.

[0010] The method further includes updating the current software package resources of the server program based on incremental change information.

[0011] The server-side program is built using the Java programming language, and the virtual machine is used to run Java programs.

[0012] To address the aforementioned technical problems, this application provides a service deployment method, which includes: a target terminal obtaining a software package file to be updated; comparing the current software package file of the service node with the software package file to be updated to obtain incremental change information; and sending the incremental change information to the service node so that the service node can use the incremental change information to obtain compilation change information, and update the compiled files loaded in the virtual machine memory based on the compilation change information during the execution of the server program.

[0013] The process of obtaining the software package file to be updated includes: compiling the service source code using a compilation module to obtain the software package to be updated, and decompressing the software package to obtain the software package file to be updated.

[0014] This process involves comparing the current software package file and the software package file to be updated on the service node to obtain incremental change information. This includes synchronizing the software package file to be updated to the terminal-side repository and using the terminal-side repository to obtain the current software package file and the software package file to be updated on the service node to compare and obtain incremental change information.

[0015] The method further includes: in response to user operation, determining a list of changed files using the terminal-side repository, and sending the list of changed files to the service node.

[0016] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a service deployment apparatus, including an acquisition module, a generation module, and an update module. The acquisition module is used to acquire incremental change information, which represents the difference between the software package file to be updated and the current software package file of the service node. The generation module is used to obtain compilation change information using the incremental change information. The update module is used to update the compiled files loaded in the virtual machine memory based on the compilation change information during the execution of the server program, thereby updating the server program.

[0017] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a service deployment apparatus, including an acquisition module, a comparison module, and a sending module. The acquisition module is used to acquire the software package file to be updated; the comparison module is used to compare the current software package file of the service node with the software package file to be updated to obtain incremental change information; the sending module is used to send the changed file to the service node, so that the service node can obtain the compilation change information using the incremental change information, and update the compiled file loaded in the virtual machine memory based on the compilation change information during the execution of the server program.

[0018] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the method in any of the above claims.

[0019] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the method in any of the above-mentioned items.

[0020] The above scheme involves the service node acquiring incremental change information representing the differences between the package file to be updated and the current package file of the service node. This incremental change information is used to obtain compilation change information. During the execution of the server program, the compilation file loaded in the virtual machine memory is updated based on the compilation change information in the modified file. Therefore, during upgrade deployment, only incremental change information needs to be transmitted, reducing the amount of data transmitted. By using a small amount of changed content to dynamically update the compilation file loaded in the virtual machine memory to the new version, the server program can be upgraded and deployed without stopping service. Attached Figure Description

[0021] Figure 1 This is a flowchart illustrating an embodiment of the service deployment method of this application;

[0022] Figure 2 This is a flowchart illustrating another embodiment of the service deployment method of this application;

[0023] Figure 3 This is a flowchart illustrating another embodiment of the service deployment method of this application;

[0024] Figure 4 This is a flowchart illustrating yet another embodiment of the service deployment method of this application;

[0025] Figure 5 This is a schematic diagram of the framework of an embodiment of the service deployment device of this application;

[0026] Figure 6 This is a schematic diagram of another embodiment of the service deployment device of this application;

[0027] Figure 7 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;

[0028] Figure 8 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and effects of this application clearer and more explicit, the following detailed description is provided with reference to the accompanying drawings and embodiments. In the following description, specific details such as particular system structures, interfaces, and technologies are set forth for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0030] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0031] It should be noted that the service deployment method in this application is used to upgrade and deploy service components of Internet applications. More specifically, it can be used to upgrade and deploy service components using a distributed server-side architecture. For a distributed server-side architecture, deployment is performed separately on each service node to complete the overall service upgrade.

[0032] The service node in this application can run a virtual machine, which can be used to run server programs. The service deployment method in this application can be used to upgrade and deploy server programs in a service node.

[0033] It should be noted that, for a distributed server architecture, different service nodes can be deployed on the same server or on different servers.

[0034] In a specific application scenario, a user uses a target terminal that can communicate with a service node. The user can upgrade and deploy the server program on the service node by operating the target terminal.

[0035] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the service deployment method of this application. In this embodiment, the relevant steps performed by the service node are described as examples. Specifically, the method may include the following steps:

[0036] Step S110: Obtain incremental change information.

[0037] Incremental change information can be used to represent the differences between the software package file to be updated and the current software package file of the service node. Specifically, it can be used to represent the additions, changes, and deletions in the software package file to be updated compared to the current software package file of the service node.

[0038] It should be noted that the current software package resources of the server program running in the virtual machine are consistent with the contents of the current software package stored on the service node. The current software package file can be obtained by decompressing the current software package. The software package file to be updated can be used to upgrade the server program, that is, it can be used to upgrade the current software package resources.

[0039] Both the package file to be updated and the current package file can contain multiple files. Both can also contain several compiled files. The compiled files in the package file to be updated and the compiled files in the current package file may also differ.

[0040] For example, the current software package files of a service node include files A, B, and C, while the software package files to be updated include files B1 and C1. Compared to the current software package files, the software package files to be updated do not contain file A, and file B has been changed to file B1, and file C has been changed to file C1. Incremental change information can be used to represent the differences in the software package files to be updated compared to the current software package files of the service node, based on the deletion of file A, the differences between files B and B1, and the differences between files C and C1.

[0041] Step S120: Obtain compilation change information using incremental change information.

[0042] It should be noted that the current software package resources used by the server program running in the virtual machine are consistent with the contents of the current software package stored on the service node. Incremental change information indicates the differences between the current software package file and the software package file to be updated.

[0043] The upgrade deployment process includes updating the currently loaded compiled files in the virtual machine's memory. The compilation change information can be obtained based on the incremental change information, and the compilation change information can be used to update the currently loaded compiled files in the virtual machine's memory.

[0044] Step S130: Update the compiled files loaded in the virtual machine memory based on the compilation change information.

[0045] It should be noted that step S130 can be executed during the operation of the server program.

[0046] Before executing step S130, the virtual machine memory loads the compiled files from the current software package resources, which are consistent with the compiled files in the current software package file. After updating the compiled files loaded in the virtual machine memory based on the compilation change information, the compiled files loaded in the virtual machine memory are updated to be consistent with the compiled files in the software package file to be updated. This allows the virtual machine to use the compiled files in the software package file to be updated, i.e., the new version of the compiled files, to upgrade and deploy the server program without restarting the service.

[0047] In general, existing technologies will stop the service process of the current service node, directly replace the current package resources with the package to be updated, and then restart the service process, so that the compiled files of the new version in the package to be updated can be loaded into the virtual machine memory for use.

[0048] The above scheme involves the service node acquiring incremental change information representing the differences between the package file to be updated and the current package file of the service node. This incremental change information is used to obtain compilation change information. During the execution of the server program, the compilation file loaded in the virtual machine memory is updated based on the compilation change information in the modified file. Therefore, during upgrade deployment, only incremental change information needs to be transmitted, reducing the amount of data transmitted. By using a small amount of changed content to dynamically update the compilation file loaded in the virtual machine memory to the new version, the server program can be upgraded and deployed without stopping service.

[0049] In some embodiments, the incremental change information may be obtained by the service node from the target terminal used by the user.

[0050] In some embodiments, a deployment module may also run on the service node, used to upgrade and deploy the server program during its execution. The aforementioned update of the compiled files loaded in the virtual machine memory based on compilation change information can be implemented by the service node using the deployment module.

[0051] In some embodiments, the server program is built using the Java programming language, and the virtual machine in the server node is used to run the Java program.

[0052] In a specific application scenario, the package to be updated is a service component package (Java Archive File, or JAR file) generated by compiling the source code of an updated version of the server program. The current package is the service component package stored in the service node that is identical in content to the currently used package resources (i.e., the current server program package) in the virtual machine. The package file to be updated is the file obtained by decompressing the package to be updated; similarly, the current package file is the file obtained by decompressing the current package. The compiled files are files with the .class extension.

[0053] In a specific application scenario, the software package file may also include resource files, such as static files like HTML files, JS files, CSS files, Properties files, and other non-Java compiled bytecode files.

[0054] In some embodiments, the compilation change information is information used by the service node to update the memory loaded in the virtual machine. Specifically, it can be used to update the compiled file in the currently loaded package resource (which is consistent with the compiled file in the current package file) to be consistent with the compiled file in the package file to be updated.

[0055] Compared to the compiled files in the current package file, the compiled files in the package file to be updated may contain some changes, deletions, or new additions. This compilation change information allows the deployment module to update the compiled files loaded in the virtual machine's memory to implement these additions, deletions, and changes. The steps for updating the compiled files loaded in the virtual machine differ depending on the type of change.

[0056] In some embodiments, the package file to be updated contains new compiled files compared to the current package file. In this case, the compilation change information includes the new compiled files, and updating the compiled files loaded in the virtual machine memory based on the compilation change information includes loading the new compiled files into the virtual machine memory.

[0057] In some embodiments, the package file to be updated has changed relative to the current package file regarding the same compiled file, and the compilation change information includes the modified compiled file. Before the update, the current compiled file is loaded in the virtual machine memory. Updating the compiled file loaded in the virtual machine memory based on the compilation change information includes loading the modified compiled file into the virtual machine memory and replacing the corresponding current compiled file in the virtual machine memory.

[0058] In some embodiments, the software package file to be updated contains compiled files that need to be deleted compared to the current software package file. The compilation change information includes the identification information of the compiled files to be deleted. Before the update, the compiled files are loaded in the virtual machine memory. Updating the compiled files loaded in the virtual machine memory based on the compilation change information includes destroying the compiled files to be deleted that are loaded in the virtual machine memory and correspond to the identification information.

[0059] It should be noted that, in order to manage virtual machine memory, process identifiers are needed to manage the memory corresponding to those process identifiers. Furthermore, updating the compiled files loaded in the virtual machine memory based on compilation change information can include: obtaining the process identifier corresponding to the server program, and using that process identifier to update the corresponding compiled files in the virtual machine memory. In addition, updating the corresponding compiled files in the virtual machine memory can be performed using appropriate update steps depending on the type of change.

[0060] In a specific application scenario, the process identifier corresponds one-to-one with the server program and the Java Virtual Machine. The service node can query the service running process number, i.e. the process identifier, based on the service Jar package resource name (i.e., the current package resource name, used to uniquely identify the current package resource) through operating system shell commands.

[0061] In some embodiments, the compilation change information includes incremental compilation files, which include the compilation files to be added and / or the modified compilation files. This allows the deployment module to use the incremental compilation files in the compilation change information to add, modify, and delete compilation files loaded in the virtual machine memory, thereby replacing the compilation files loaded in the virtual machine memory with those consistent with the software files to be updated. Obtaining the compilation change information based on the incremental change information may include steps related to the deployment module obtaining the incremental compilation files. In some embodiments, the compilation change information includes a list of changed files, and obtaining the compilation change information based on the incremental change information may include steps related to obtaining the list of changed files.

[0062] Furthermore, incremental build files can be obtained based on a list of changed files, or they can be obtained through other means.

[0063] Please see Figure 2 , Figure 2This is a flowchart illustrating another embodiment of the service deployment method of this application. In this embodiment, the steps executed by the service node are described as examples. Specifically, a virtual machine runs on the service node, which can be used to run the server-side program. A deployment module also runs on the service node, used to upgrade and deploy the server-side program during its execution. Additionally, a server-side repository and a file monitoring system also run on the service node. The server-side repository stores the current software package file, and the current software package resource content is consistent with that used by the server-side program. The server-side repository can communicate with the terminal-side repository running on the target terminal and can be used to obtain incremental change information.

[0064] Specifically, the method may include the following steps:

[0065] Step S210: Use the file monitoring system to monitor version updates of the latest package files stored in the server-side repository.

[0066] Specifically, the service node utilizes a file monitoring system to monitor whether there are any changes to the latest stored software package files in the service-side repository. This monitoring process can be continuous, lasting from before step S220 is executed until after step S220 is executed.

[0067] By using a file monitoring system to monitor version updates of the latest software package files stored in the server-side repository, it is possible to determine whether an upgrade deployment can proceed based on the version changes of the latest software package files stored in the server-side repository after a user makes changes to the software package files stored in the terminal-side repository of the target terminal.

[0068] In a specific application scenario, the server-side repository can be a remote Git repository. The file monitoring system can determine whether the latest stored package files in the server-side repository have been changed by reading Git log information in real time and checking for new commit logs. When a new commit log appears in the Git log, it can be determined that the latest stored package files in the server-side repository have been changed.

[0069] Step S220: Obtain incremental change information.

[0070] It should be noted that the software package files stored in the server-side repository can change along with the software package files stored in the target terminal's terminal-side repository. Before executing the service deployment method, the software package files stored in the server-side repository and the target terminal's terminal-side repository are identical; both are the current software package files in the service node and are consistent with the current software package resource content of the server program.

[0071] To perform an upgrade deployment, the target terminal can respond to user actions by sending incremental change information to the service node to complete the upgrade deployment. Specifically, this can be achieved by utilizing the terminal-side repository running on the target terminal and the service-side repository running on the service node.

[0072] The incremental change information can be generated by comparing the latest package files to be updated stored in the terminal-side repository with the current packages of the service nodes.

[0073] Step S230: Use incremental change information to update the latest package file stored in the server-side repository from the current package file to the package file to be updated.

[0074] Incremental change information is obtained by comparing the current package file with the package file to be updated. Therefore, after receiving the incremental change information, the server repository can update the package file stored in the server repository with the package file to be updated by using the current package file and the incremental change information.

[0075] In the above method, during the upgrade deployment process, the target terminal only needs to send incremental change information to the service node. Compared with the existing technology that requires sending the entire software package to be updated to the service node, this solution significantly reduces the file size that needs to be transferred during the upgrade deployment process, enabling service launch with minimal transmission content, saving network transmission time, bandwidth costs, and storage space, and improving the efficiency of upgrade deployment.

[0076] In some embodiments, the target terminal can obtain the software package file to be updated from the terminal-side repository. The above-mentioned acquisition steps may include obtaining the software package file to be updated and adding the software package file to be updated to the repository version management, so that the software package file to be updated can be compared with the current software package file currently stored in the terminal-side repository to obtain incremental change information. The incremental change information is then sent to the server-side repository running in the service node. The service node uses the server-side repository to receive the incremental change information sent by the target terminal's terminal-side repository, and uses the incremental change information to update the latest software package file stored in the server-side repository from the current software package file to the software package file to be updated, so that the latest software package files stored in the server-side repository and the terminal-side repository are consistent.

[0077] In a specific application scenario, the terminal-side repository can be a local Git repository, and the server-side repository can be a remote Git repository. The terminal device can obtain the package file to be updated using the local Git repository. In response to the user's git push command or the device automatically compares the package file to be updated with the current package file to obtain incremental change information (i.e., the difference between the package file to be updated and the current package file), and then sends the incremental change information to the remote Git repository running on the server node.

[0078] Furthermore, the update package file can be obtained by decompressing the update package, and the update package can be generated by obtaining the service source code from the source code repository and compiling the service source code. The above steps can be implemented by a build platform. The target terminal or other terminal devices can run the above build platform to generate the update package file based on the service source code. For the target terminal, if the above build platform is run by other terminal devices, the target terminal can obtain the update package file by communicating with the build platform running on other terminal devices through the terminal-side repository; if the target terminal runs the above build platform, then the target terminal obtains the service source code from the source code repository through the build platform, processes it to obtain the update package file, and then obtains the update package file from the build platform through the terminal-side repository.

[0079] In a specific application scenario, the terminal-side repository can be a local Git repository. The target terminal uses a build platform to process the service source code to obtain the package file to be updated. The target terminal can then respond to user actions by executing the `git commit` command, retrieving the package file to be updated obtained from the build platform, and adding it to the local Git repository.

[0080] Step S240: In response to the detection that the latest package files stored in the server-side repository have changed, obtain a list of changed files and send it to the deployment module.

[0081] Specifically, the changed file list includes a list of files that have been modified. More specifically, the changed file list may contain identification information for at least one of the following: files to be added for compilation, modified files, and files to be deleted. The changed file list can be used to identify at least one of these three types of files.

[0082] For a specific example, the current software package files of a service node include compiled file A and compiled file B, while the software package files to be updated include compiled file B1 and compiled file D. The list of changed files could then include the identification information for compiled file A to be deleted, the current compiled file B, the modified compiled file B1, and the newly added compiled file D.

[0083] In some embodiments, the software package file may also include several resource files. When comparing the software package file to be updated with the current software package file, the resource files contained therein may have been changes, additions, or deletions. The list of changed files may also include identification information for at least one of the resource files to be added, the changed resource files, and the resource files to be deleted.

[0084] The list of changed files can be determined by the terminal device using a terminal-side repository, and the service node obtains the list of changed files by communicating with the terminal device. It should be noted that the steps for the terminal device to determine the list of changed files can be performed after the terminal device obtains the software package file to be updated, before the terminal device sends incremental change information to the service node, or after the terminal device sends incremental change information to the service node.

[0085] In a specific application scenario, the terminal-side repository can be a local Git repository, and the server-side repository can be a remote Git repository. The terminal device can respond to the user's `git diff` command by comparing the package file to be updated with the current package file, thereby determining the list of changed files involved in the differences between the two.

[0086] In some embodiments, the service node can use the service-side repository to connect with the terminal-side repository to obtain a list of changed files. Then, when changes occur, the file monitoring system obtains the list of changed files from the terminal-side repository and sends the list of changed files to the deployment module for execution of step S250.

[0087] In some embodiments, the service node can also query the process identifier via operating system shell commands and send the process identifier to the deployment module.

[0088] Step S250: Use the deployment module to obtain a list of changed files, and obtain incremental compilation files from the latest package files stored in the service-side repository based on the list of changed files.

[0089] Specifically, after the deployment module obtains the incremental compilation file, it can use the incremental compilation file to perform corresponding addition and replacement operations on files loaded in the virtual machine's memory, thereby updating the virtual machine's memory. The incremental compilation file includes the file to be added and / or the modified compilation file.

[0090] Furthermore, after obtaining the list of changed files, the deployment module can retrieve the incremental compilation files from the latest package files stored in the service-side repository, i.e., the package files to be updated, based on the list of changed files.

[0091] Step S260: Update the compiled files loaded in the virtual machine memory based on the compilation change information.

[0092] The compilation change information may include a list of changed files and incremental compilation files. By executing the aforementioned steps S240 and S250, the deployment module can obtain the list of changed files and incremental compilation files, which can be used by the deployment module to update the compilation files loaded in the virtual machine memory. The updates include adding, changing, and deleting.

[0093] In some cases, the list of changed files contains identification information for the files to be added to the compilation system and / or the files to be modified. In such cases, the incremental compilation file contains the files to be added to the compilation system and / or the files to be modified. The deployment module can be used to load the files to be added to the virtual machine memory. The deployment module can also be used to destroy the corresponding current compilation file loaded in the virtual machine memory and then load the modified compilation file into the virtual machine memory, so as to replace the corresponding current compilation file with the modified compilation file.

[0094] In some cases, the list of changed files contains identification information for compiled files to be deleted. In such cases, it is not necessary to obtain the incremental compiled files from the package files to be updated. Based on the identification information, the deployment module can destroy the compiled files to be deleted that are loaded in the virtual machine memory.

[0095] Step S270: Update the current software package resources of the server program based on the incremental change information through the deployment module.

[0096] The execution order of steps S260 and S270 can be interchanged, and they can also be executed simultaneously.

[0097] It should be noted that in addition to compiled files, a software package file may also include several resource files. The resource files contained in the package file to be updated may differ from those in the current package file. The list of changed files may also include identification information for the changed resource files.

[0098] Service nodes can also use the deployment module to update the current software package resources of the server program to complete service upgrades. Specifically, this can include updating resource files and compiled files within the current software package resources. Similarly, updating the current software package resources can also include operations such as adding, modifying, and deleting.

[0099] Specifically, the service node can first obtain change information using incremental change information, including compilation change information and resource change information. The change information may include a list of changed files and incremental files. The deployment module then updates the current software package resources based on the change information. The related operation steps are similar to updating the compiled files loaded in the virtual machine memory, and can be referred to the relevant descriptions in the foregoing embodiments.

[0100] In some embodiments, the list of changed files obtained in step S240 includes identification information for at least one of the files to be added, the modified files, and the files to be deleted. In step S250, incremental files (including incremental resource files in addition to incremental compilation files) can also be obtained from the server-side repository based on the identification information, and operations such as adding, modifying, and deleting the current software package resources can be performed, and the updated software package resources can be recompressed.

[0101] In a specific application scenario, the current software package resource of the server program is the service JAR package resource. Based on incremental change information, the change information is first obtained, and then the resource files and bytecode files in it are replaced with the new version to update the service JAR package resource.

[0102] The above scheme involves the service node acquiring incremental change information representing the differences between the package file to be updated and the current package file of the service node. This incremental change information is used to obtain compilation change information. During the execution of the server program, the compilation file loaded in the virtual machine memory is updated based on the compilation change information in the modified file. Therefore, during upgrade deployment, only incremental change information needs to be transmitted, reducing the amount of data transmitted. By using a small amount of changed content to dynamically update the compilation file loaded in the virtual machine memory to the new version, the server program can be upgraded and deployed without stopping service, minimizing the impact on users' service usage.

[0103] In some embodiments, based on Git repository version management, it can provide a visual way to trace the update records of each incremental version and the rollback operation of a specified version. It can restore the package files stored in the repository to the specified version of the package files according to user instructions, and can show the incremental differences between versions to the user, making it easier for the user to manage the package files.

[0104] For a distributed server architecture, the steps in the above embodiments can be the steps executed by a service node. Each service node can act as the execution subject to execute the steps of the aforementioned service deployment method, thereby enabling the overall service upgrade.

[0105] Please see Figure 3 , Figure 3This is a flowchart illustrating another embodiment of the service deployment method of this application.

[0106] This embodiment uses the steps performed by the target terminal as an example for illustration. Specifically, the method may include:

[0107] Step S310: Obtain the software package file to be updated.

[0108] The software package file to be updated can be obtained by compiling and decompressing the service source code.

[0109] Furthermore, the above steps can be performed by the target terminal using a compilation platform to obtain the service source code from the source code repository and compile it, and then decompressing the resulting package to be updated.

[0110] Step S320: Compare the current package file and the package file to be updated on the service node to obtain incremental change information.

[0111] Specifically, this can be achieved by synchronizing the package file to be updated to the terminal-side repository, and then comparing the current package file on the service node with the package file to be updated using the terminal-side repository. The current package file on the service node can be stored in the terminal-side repository.

[0112] Step S330: Send the incremental change information to the service node.

[0113] The target terminal sends incremental change information to the service node, which then uses the incremental change information to obtain the compilation change information. During the execution of the server program, the service node updates the compiled files loaded in the virtual machine memory based on the compilation change information included in the incremental change information, thereby completing the service upgrade deployment.

[0114] In some embodiments, the target terminal may also respond to user operations by using a terminal-side repository to determine a list of changed files. The list of changed files contains identification information for at least one of the files to be added to the compilation list, the modified compilation files, and the compilation files to be deleted, so that the service node can obtain incremental compilation files based on the list of changed files, and update the compilation files loaded in the virtual machine memory using the incremental compilation files and the list of changed files.

[0115] The relevant descriptions of steps S310-S330 can be found in the foregoing embodiments and will not be repeated here.

[0116] Please see Figure 4 , Figure 4 This is a flowchart illustrating yet another embodiment of the service deployment method of this application.

[0117] In this embodiment, the target terminal runs a build platform and a build environment Git repository (terminal-side repository). The target terminal uses the build platform to pull source code from the source code repository, compiles the obtained source code to obtain a Maven build JAR package, and decompresses it to obtain a compilation folder (including the package files to be updated). The compilation folder is synchronized to the version management repository. The build environment Git repository compares the compilation folder with the current package files stored therein and pushes the incremental files (incremental change information) to the production environment Git repository. The service node runs a production environment Git repository, a file monitoring system, a hot deployment module, and Java service components. The service node receives incremental files through the production environment Git repository to update the current package files stored therein to match the compilation folder (package files to be updated). In addition, the production environment Git repository can also receive a list of changed files determined by the build environment Git repository. The file monitoring system monitors version changes of package files in the production environment's Git repository and notifies the hot deployment module of the change information (including a list of changed files). The hot deployment module can then extract the corresponding incremental change files (which may include bytecode files and resource files) from the updated package files in the production environment's Git repository. The compiled files in the incremental change files are used to update the virtual machine memory, and the incremental change files can also be used to update service JAR package resources.

[0118] Please see Figure 5 , Figure 5 This is a schematic diagram of a framework of an embodiment of the service deployment device of this application.

[0119] In this embodiment, the service deployment device 50 includes an acquisition module 51, a generation module 52, and an update module 53. The acquisition module 51 is used to acquire incremental change information, which represents the difference between the software package file to be updated and the current software package file of the service node. The generation module 52 is used to obtain compilation change information using the incremental change information. The update module 53 is used to update the compiled files loaded in the virtual machine memory based on the compilation change information during the execution of the server program, so as to update the server program.

[0120] The update module 53 is used to update the compiled files loaded in the virtual machine memory based on the compilation change information, specifically including at least one of the following steps: if the compilation change information includes a compiled file to be added, load the compiled file to be added into the virtual machine memory; if the compilation change information includes a modified compiled file, load the modified compiled file into the virtual machine memory and replace the corresponding current compiled file in the virtual machine memory; if the compilation change information includes the identification information of a compiled file to be deleted, destroy the compiled file to be deleted in the virtual machine memory corresponding to the identification information.

[0121] The update module 53 is used to update the compiled files loaded in the virtual machine memory based on the compilation change information. Specifically, it includes: obtaining the process identifier corresponding to the server program and using the process identifier to update the corresponding compiled files in the virtual machine memory.

[0122] The acquisition module 51 is used to acquire incremental change information, specifically including: receiving incremental change information sent by the terminal-side repository of the target terminal using the service-side repository. The incremental change information is generated by the terminal-side repository based on the comparison between the latest package file to be updated stored in the terminal-side repository and the current package file of the service node. The generation module 52 is used to obtain compilation change information using the incremental change information, specifically including: updating the latest package file stored in the service-side repository from the current package file to the package file to be updated using the incremental change information, so that the latest package files stored in the service-side repository and the terminal-side repository are consistent; and obtaining the incremental compilation file from the latest package file stored in the service-side repository. The incremental compilation file includes the compilation file to be added and / or the modified compilation file.

[0123] The generation module 52 is used to obtain compilation change information using incremental change information. Specifically, it also includes: using a file monitoring system to monitor version updates of the latest package files stored in the server-side repository, where the package files stored in the server-side repository follow changes in the package files stored in the terminal-side repository of the target terminal; in response to detecting changes in the latest package files stored in the server-side repository, obtaining a list of changed files and sending it to the deployment module, whereby the list of changed files contains identification information for at least one of the files to be added for compilation, the modified compiled files, and the compiled files to be deleted; the generation module 52 is used to obtain incremental compilation files from the latest package files stored in the server-side repository, specifically including: using the deployment module to obtain the list of changed files, and obtaining incremental compilation files from the latest package files stored in the server-side repository based on the list of changed files.

[0124] The update module 53 can also be used to update the current software package resources of the server program based on incremental change information.

[0125] The server-side program is built using the Java programming language, and the virtual machine is used to run Java programs.

[0126] Please see Figure 6 , Figure 6 This is a schematic diagram of another embodiment of the service deployment device of this application.

[0127] In this embodiment, the service deployment device 60 includes an acquisition module 61, a comparison module 62, and a sending module 63. The acquisition module 61 is used to acquire the software package file to be updated; the comparison module 62 is used to compare the current software package file of the service node with the software package file to be updated to obtain incremental change information; the sending module 63 is used to send the changed file to the service node so that the service node can obtain the compilation change information using the incremental change information, and update the compiled file loaded in the virtual machine memory based on the compilation change information during the execution of the server program.

[0128] The acquisition module 61 is used to acquire the software package file to be updated. Specifically, it includes: compiling the service source code using the compilation module to obtain the software package to be updated, and decompressing the software package to obtain the software package file to be updated.

[0129] The comparison module 62 is used to compare the current software package file of the service node with the software package file to be updated to obtain incremental change information. Specifically, it includes: synchronizing the software package file to be updated to the terminal-side repository, and using the terminal-side repository to obtain the current software package file of the service node and the software package file to be updated to compare and obtain incremental change information.

[0130] The service deployment device 60 also includes a generation module, which, in response to user operations, uses the terminal-side repository to determine a list of changed files and sends the list of changed files to the service node.

[0131] Please see Figure 7 , Figure 7 This is a schematic diagram of the framework of an embodiment of the electronic device of this application.

[0132] In this embodiment, the electronic device 70 includes a memory 71 and a processor 72, wherein the memory 71 is coupled to the processor 72. Specifically, the various components of the electronic device 70 can be coupled together via a bus, or the processor 72 of the electronic device 70 can be connected to each other component individually. The electronic device 70 can be any device with processing capabilities, such as a computer, tablet computer, mobile phone, etc.

[0133] The memory 71 is used to store program data executed by the processor 72, as well as data generated by the processor 72 during processing. Examples include incremental change information and the current software package file. The memory 71 includes a non-volatile storage portion for storing the aforementioned program data.

[0134] Processor 72 controls the operation of electronic device 70. Processor 72 can also be referred to as CPU (Central Processing Unit). Processor 72 may be an integrated circuit chip with signal processing capabilities. Processor 72 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor or any conventional processor. In addition, processor 72 can be implemented by multiple integrated circuit chips.

[0135] The processor 72 executes instructions to implement any of the above service deployment methods by calling the program data stored in the memory 71.

[0136] Please see Figure 8 , Figure 8 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application.

[0137] In this embodiment, the computer-readable storage medium 80 stores processor-executable program data 81, which can be executed to implement any of the above-described service deployment methods.

[0138] The computer-readable storage medium 80 can specifically be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or a medium that can store program data. Alternatively, it can be a server that stores the program data, which can send the stored program data to other devices for execution or run the stored program data itself.

[0139] In some embodiments, the computer-readable storage medium 80 may also be such as Figure 7 The memory shown.

[0140] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A service deployment method characterized by, The method comprises: The service node receives the incremental change information sent by the terminal-side warehouse of the target terminal by using the service-side warehouse, and the incremental change information represents the difference between the to-be-updated software package file and the current software package file of the service node; The software package file newly stored in the service-side warehouse is updated from the current software package file to the to-be-updated software package file by using the incremental change information, so that the newly stored software package files of the service-side warehouse and the terminal-side warehouse are consistent; In response to monitoring that the newly stored software package file in the service-side warehouse changes by using a file monitoring system, a changed file list is obtained and sent to a deployment module, and the changed file list contains identification information of at least one of a to-be-added compiled file, a changed compiled file and a to-be-deleted compiled file; An incremental compiled file is obtained from the software package file newly stored in the service-side warehouse by using the deployment module according to the changed file list, and the incremental compiled file includes the to-be-added compiled file and / or the changed compiled file; In the process of running the service-side program, the compiled file loaded in the virtual machine memory is updated based on the compiled change information to update the service-side program, and the compiled change information includes at least one of the incremental compiled file and the changed file list.

2. The method of claim 1, wherein, The updating of the compiled file loaded in the virtual machine memory based on the compiled change information comprises at least one of the following steps: In the case that the compiled change information includes the to-be-added compiled file, the to-be-added compiled file is loaded into the virtual machine memory; In the case that the compiled change information includes the changed compiled file, the changed compiled file is loaded into the virtual machine memory and replaces the corresponding current compiled file in the virtual machine memory; In the case that the compiled change information includes the identification information of the to-be-deleted compiled file, the to-be-deleted compiled file corresponding to the identification information in the virtual machine memory is destroyed.

3. The method according to claim 1 or 2, characterized in that, The updating of the compiled file loaded in the virtual machine memory based on the compiled change information comprises: The process identification corresponding to the service-side program is obtained, and the corresponding compiled file in the virtual machine memory is updated by using the process identification.

4. The method of claim 1, wherein, The incremental change information is generated by the terminal-side warehouse based on the comparison between the to-be-updated software package file newly stored in the terminal-side warehouse and the current software package file of the service node.

5. The method of claim 1, wherein, The method further comprises: The current software package resource of the service-side program is updated based on the incremental change information; and / or The service-side program is constructed by using the Java programming language, and the virtual machine is used to run the Java program.

6. A service deployment method characterized by, The method comprises: A target terminal obtains a to-be-updated software package file; A current software package file of a service node and the to-be-updated software package file are compared to obtain incremental change information; and The incremental change information is generated by the terminal-side warehouse based on the comparison between the to-be-updated software package file newly stored in the terminal-side warehouse and the current software package file of the service node. sending the incremental change information to the service node, so that the service node uses the incremental change information to update the service-side warehouse latest stored software package file from the current software package file to the to-be-updated software package file, so that the service-side warehouse and the terminal-side warehouse latest stored software package files are consistent; in response to a user operation, determining a changed file list using the terminal-side warehouse, and sending the changed file list to the service node; so that the service node uses a file monitoring system to monitor that the service-side warehouse latest stored software package file has changed, obtains a changed file list and sends it to a deployment module, uses the deployment module to obtain an incremental compilation file from the service-side warehouse latest stored software package file according to the changed file list, and updates the compiled file loaded in the virtual machine memory based on the compilation change information during the service program running process, the changed file list contains identification information of at least one of the to-be-added compiled file, the changed compiled file and the to-be-deleted compiled file, the incremental compilation file includes the to-be-added compiled file and / or the changed compiled file, and the compilation change information includes at least one of the incremental compilation file and the changed file list.

7. The method of claim 6, wherein, The to-be-updated software package file is obtained by: compiling the service source code using a compilation module to obtain a to-be-updated software package, and decompressing the to-be-updated software package to obtain the to-be-updated software package file; And / or, the current software package file of the service node and the to-be-updated software package file are compared to obtain incremental change information, including: synchronizing the to-be-updated software package file to the terminal-side warehouse, and using the terminal-side warehouse to obtain the current software package file of the service node and the to-be-updated software package file for comparison to obtain the incremental change information.

8. A service deployment apparatus characterized by comprising: including: an acquisition module configured to receive incremental change information sent by a terminal-side warehouse of a target terminal using a service-side warehouse, the incremental change information indicating differences between a to-be-updated software package file and a current software package file of the service node; a generation module configured to use the incremental change information to update the service-side warehouse latest stored software package file from the current software package file to the to-be-updated software package file, so that the service-side warehouse and the terminal-side warehouse latest stored software package files are consistent; in response to monitoring that the service-side warehouse latest stored software package file has changed using a file monitoring system, obtaining a changed file list and sending it to a deployment module, the changed file list contains identification information of at least one of a to-be-added compiled file, a changed compiled file and a to-be-deleted compiled file; using the deployment module to obtain an incremental compilation file from the service-side warehouse latest stored software package file according to the changed file list, the incremental compilation file includes the to-be-added compiled file and / or the changed compiled file; The updating module is configured to update the compiled file loaded in the virtual machine memory based on the compiling change information during the running of the service-side program, so as to update the service-side program, wherein the compiling change information comprises at least one of the incremental compiled file and the change file list.

9. A service deployment apparatus characterized by comprising: The method comprises the following steps: The obtaining module is configured to obtain a software package file to be updated; The comparing module is configured to compare the current software package file of the service node with the software package file to be updated to obtain incremental change information; The sending module is configured to send the incremental change information to the service node, so that the service node updates the software package file newly stored in the service-side repository from the current software package file to the software package file to be updated by using the incremental change information, so that the software package files newly stored in the service-side repository and the terminal-side repository are consistent; The generating module is configured to determine a change file list by using the terminal-side repository in response to a user operation, and send the change file list to the service node; so that the service node monitors the change of the software package file newly stored in the service-side repository by using a file monitoring system, obtains a change file list and sends it to a deployment module, obtains an incremental compiled file from the software package file newly stored in the service-side repository according to the change file list by using the deployment module, and updates the compiled file loaded in the virtual machine memory based on the compiling change information during the running of the service-side program, wherein the change file list contains identification information of at least one of a compiled file to be added, a changed compiled file and a compiled file to be deleted, the incremental compiled file comprises the compiled file to be added and / or the changed compiled file, and the compiling change information comprises at least one of the incremental compiled file and the change file list.

10. An electronic device, comprising: The program instructions are executed by the processor to implement the service deployment method of any one of claims 1-5 or 6-7.

11. A computer readable storage medium having stored thereon program instructions, wherein, The program instructions are executed by the processor to implement the service deployment method of any one of claims 1-5 or 6-7.

Citation Information

Patent Citations

  • Method for updating application running in container, computing equipment and storage medium

    CN113296814A