Hot deployment method, remote server and hot deployment system of remote server
By installing an IDE architecture and extending the hot deployment plugin on a remote server, combined with Git and HotswapAgent, the problem of automated hot deployment of services on remote pre-release servers was solved, enabling rapid code updates and verification, and improving development efficiency.
Patent Information
- Application Number
- CN202311865966.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Existing technologies lack automated hot deployment solutions for services on remote pre-release servers, resulting in lengthy compilation and deployment operations during the development process.
Install an IDE architecture on a remote server, extend the hot deployment plugin on the IDE architecture, implement hot deployment functionality using HotswapAgent, combine it with Git for code management and monitoring, and use scheduled tasks to detect code changes and automatically perform hot deployment.
It greatly improves the speed of development interaction, reduces service restart time, realizes automated hot deployment and rapid verification of code, and improves development efficiency.
Smart Images

Figure CN117850818B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a hot deployment method of remote server, a remote server, a computer readable storage medium and a hot deployment system. BACKGROUND
[0002] In the process of daily project development, code self-test and joint debugging need to be continuously carried out, and the staff needs to deploy the service to the remote pre-distribution group, first complete the compilation and packaging, and then carry out service deployment. It takes about 10-15 minutes from compilation to service start-stop each time, and during the entire project online period, the staff needs to repeatedly carry out the above-mentioned compilation, packaging and deployment operations.
[0003] That is, the existing scheme lacks a scheme for realizing automatic hot deployment of services on a remote pre-release server. SUMMARY
[0004] The main purpose of the present application is to provide a hot deployment method of remote server, a remote server, a computer readable storage medium and a hot deployment system, so as to at least solve the problem that the existing scheme lacks a scheme for realizing automatic hot deployment of services on a remote pre-release server.
[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a hot deployment method of remote server is provided, which is applied to a remote server in a hot deployment system, the hot deployment system further comprising a client, the client and the remote server being in communication, the method comprising: receiving and responding to IDE installation information sent by the client to install an IDE architecture, wherein the IDE installation information is information for installing an IDE framework, or information including an IDE installation package, and the IDE architecture is an architecture of an integrated development environment; receiving and responding to hot deployment plug-in installation information sent by the client to install a hot deployment plug-in on the IDE architecture to realize the service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0006] Optionally, receiving and responding to the IDE installation information sent by the client to install the IDE architecture comprises: in the case that the IDE installation information includes the IDE installation package, downloading the IDE architecture by using the IDE installation package, or compiling the IDE source code in the IDE installation information to install the IDE architecture.
[0007] Optionally, receiving and responding to the hot deployment plug-in installation information sent by the client to install the hot deployment plug-in on the IDE architecture comprises:
[0008] installing the hot deployment code package in the plugin installation information into the Docker image inside the IDE architecture to install the hot deployment plugin on the IDE architecture, the hot deployment code package including code for implementing a hot deployment function.
[0009] Optionally, the hot deployment system further comprises a GIT, the GIT being configured to store code, after installing the hot deployment plugin on the IDE architecture, the method further comprises: determining whether the code in the code directory is identical to the code in the GIT; in a case where the code in the code directory is not identical to the code in the GIT, replacing all the code in the code directory with all the code in the GIT; in a case where the code in the code directory is identical to the code in the GIT, determining that the code in the code directory does not need to be replaced.
[0010] Optionally,
[0011] The determining whether the code in the code directory is identical to the code in the GIT comprises: executing a git fetch command to determine whether the code in the code directory is identical to the code in the GIT.
[0012] The replacing all the code in the code directory with all the code in the GIT comprises:
[0013] The replacing all the code in the code directory with all the code in the GIT comprises: executing a git pull command to replace all the code in the code directory with all the code in the GIT.
[0014] Optionally, after replacing all the code in the code directory with all the code in the GIT, the method further comprises: compiling all the code in the code directory to obtain compiled code; in a case where the type of the code in the code directory is Java, reloading the compiled code of a class class in all the compiled code; in a case where the application framework of the code in the code directory is Spring, regenerating a Bean object using the compiled code.
[0015] Optionally, the hot deployment system further comprises a GIT, the GIT being configured to store code, after installing the hot deployment plugin on the IDE architecture, the method further comprises: monitoring services running in the IDE framework using a monitoring script; in a case where the code in the code directory is not identical to the code in the GIT, pulling all the code in the GIT from the GIT using the monitoring script, and replacing all the code in the code directory with all the code in the GIT.
[0016] According to another aspect of the present application, a remote server is provided, the remote server comprising:
[0017] The first receiving unit is configured to receive and install IDE architecture in response to IDE installation information sent by the client, wherein the IDE installation information is information for installing the IDE framework, or information including an IDE installation package, and the IDE architecture is an architecture of an integrated development environment (IDE).
[0018] The second receiving unit is configured to receive and install a hot deployment plug-in on the IDE architecture in response to hot deployment plug-in installation information sent by the client, to implement a service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0019] According to another aspect of the present application, a computer readable storage medium is provided, which comprises a stored program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute any of the hot deployment methods of the remote server when the program is run.
[0020] According to another aspect of the present application, a hot deployment system is provided, which comprises a remote server, a client and a GIT, the client communicates with the remote server, and the GIT is configured to store code, and the remote server is configured to execute any of the hot deployment methods of the remote server.
[0021] The technical solution of the present application is used to install the IDE architecture on the remote server first, and then extend the hot deployment plug-in on the IDE architecture, to implement the service function of hot deployment, thereby solving the problem that the prior art lacks a solution for automatically deploying services on a remote pre-release server. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and are used to interpret the present application together with its description. In the drawings:
[0023] Figure 1 FIG. 1 shows a flowchart of a hot deployment method of a remote server according to an embodiment of the present application;
[0024] Figure 2 FIG. 2 shows a principle diagram of a hot deployment method of a remote server according to an embodiment of the present application;
[0025] Figure 3 FIG. 3 shows a flowchart of another hot deployment method of a remote server according to an embodiment of the present application;
[0026] Figure 4A structural block diagram of a remote service end provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0028] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.
[0029] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] For the convenience of description, the following describes some nouns or terms related to the embodiments of the present application:
[0031] GitHub is a code hosting platform based on GIT version control system. It provides an integrated development tool that allows teams to collaborate, code review, issue tracking and release. GitHub is also a social platform where developers can share their code, participate in open source projects and exchange discussions. GitHub is widely used for hosting and collaborative development of open source projects, and in the present application, GitHub is only used to download HotswapAgent.
[0032] IDE architecture refers to the architectural design of an Integrated Development Environment (IDE). It encompasses the relationships between various components and modules of the IDE, as well as the overall design philosophy and principles. IDE architecture design needs to consider the needs and habits of developers, the software development workflow, and factors such as system performance, scalability, and flexibility. Common IDE architectures include client-server architecture, plug-in architecture, and layered architecture. Different IDE architectures have different characteristics and applicable scenarios; developers can choose the appropriate IDE architecture based on their needs.
[0033] Git is an open-source distributed version control system used to track file changes and facilitate collaborative development. It records file modification history, branches, and merged code, and assists multiple developers in collaborating on the same project. Git helps development teams better manage code, improve efficiency, and ensure code quality. In this application, Git is used to store application services.
[0034] A Bean is a crucial concept in the Spring framework, referring to an object or component managed by the Spring container. In Spring, a Bean can be any Java object, including POJOs (Plain Old Java Objects), services, data access objects, configuration files, etc. The Spring container is responsible for instantiating, configuring, and managing these Beans, as well as injecting them into other Beans when needed. By using Beans, the Spring framework enables loosely coupled, modular, and reusable component-based development.
[0035] The `git pull` command is used to pull the latest updates from a remote repository to the local repository. It's essentially a combination of `git fetch` and `git merge`, meaning it first fetches the updates from the remote repository and then merges them into the current branch. This keeps the local and remote repositories synchronized.
[0036] `git fetch` is a command used to fetch the latest version from a remote repository. It downloads the latest changes from the remote repository to the local repository, but does not automatically merge these changes into the current working branch. In contrast, the `git pull` command automatically merges the changes from the remote repository into the current working branch.
[0037] DCEVM (Dynamic Code Evolution VM) is an enhanced version of the OpenJDK-based Java Virtual Machine that provides the ability to modify Java class files at runtime, allowing developers to debug and fix code without restarting the application. DCEVM also supports additional features such as loading bytecode files directly into the JVM, live editing and debugging, and more. It aims to improve developer productivity and reduce the time spent on code modifications and debugging.
[0038] Compilation: Compilation is the process of converting program code written in high-level languages such as C++ or Java into binary code that can be understood by a computer. Computers only recognize 1s and 0s, so compilation programs convert familiar high-level programming languages into machine language that computers can understand.
[0039] Hot deployment: Hot deployment refers to the process of upgrading software while the application is running without the need to restart the application. For Java applications, hot deployment means updating Java class files at runtime.
[0040] git push is a GIT command used to push code from a local code repository to a remote code repository. By using the git push command, you can submit code from a local branch to a remote branch, keeping the code in the remote repository synchronized with the code in the local repository. This command is commonly used in team development to share code with other members or upload code to a remote repository.
[0041] scan.sh is a shell script file used to perform system or file scanning operations. It may contain commands and logic to scan files or directories in the system for specific content or issues and generate corresponding reports or logs. This script may be used for security scanning, virus scanning, vulnerability scanning, and other system scanning tasks.
[0042] HotswapAgent is an open-source Java application hot deployment tool that allows updating Java class files without restarting the application. It can be used with JVM to monitor changes in class files and reload these classes at runtime, enabling hot deployment. HotswapAgent can help developers speed up the development and debugging process, saving time on restarting the application.
[0043] IDEA is an abbreviation for IntelliJ IDEA, which is an integrated development environment (IDE). It is mainly used for Java development, but also supports other programming languages such as Kotlin, Groovy, Scala, etc. IDEA provides rich features, including code editing, debugging, auto-completion, version control, etc., making it easier for developers to perform software development work.
[0044] An HTTP request is a process of exchanging information from a client to a server, which contains the information and instructions needed to initiate the request.
[0045] As introduced in the background, in the daily project development process, code self-test and joint debugging are needed, and the staff needs to deploy the service to the remote pre-distribution group, first complete the compilation and packaging, and then perform service deployment. It takes about 10-15 minutes from compilation to service start-stop each time. During the entire project requirement online period, the staff needs to repeatedly perform the above-mentioned compilation, packaging, and deployment operations. In order to solve the problem that the existing scheme lacks an automatic hot deployment scheme for services on a remote pre-release server, the embodiments of the present application provide a hot deployment method for a remote server, a remote server, a computer readable storage medium, and a hot deployment system.
[0046] The technical solutions in the embodiments of the present application will be described clearly and completely below in combination with the drawings in the embodiments of the present application.
[0047] In the present embodiment, a hot deployment method for a remote server is provided, which is applied to a remote server in a hot deployment system. The hot deployment system further includes a client, and the client communicates with the remote server. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0048] Figure 1 is a flowchart of a hot deployment method for a remote server according to an embodiment of the present application. As shown in Figure 1 the method includes the following steps:
[0049] Step S101, receiving and responding to the IDE installation information sent by the client, installing the IDE architecture, wherein the IDE installation information is information for installing the IDE framework, or information including the IDE installation package, and the IDE architecture is the architecture of the integrated development environment;
[0050] The step S101, that is, the hot deployment system further comprises a GIT, the GIT is used to store code, receive and respond to the IDE installation information sent by the client, and install the IDE architecture, including: in the case that the IDE installation information comprises the IDE installation package, downloading the IDE architecture by using the IDE installation package, or compiling the IDE source code in the IDE installation information to install the IDE architecture.
[0051] Specifically, the IDE architecture is installed by using the installation package if the installation package exists, otherwise, the IDE source code is pulled from the GIT according to the IDE installation information, and the IDE source code is compiled to install the IDE architecture, so that the process of installing the IDE architecture has multiple choices.
[0052] The step S102 receives and responds to the hot deployment plug-in installation information sent by the client, installs the hot deployment plug-in on the IDE architecture, and implements the service function of the hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0053] In the above steps, the IDE architecture is first installed on the remote server, and then the hot deployment plug-in is extended on the IDE architecture to implement the service function of the hot deployment, thereby solving the problem that the existing scheme lacks an automatic hot deployment scheme for realizing the service of the remote pre-release server.
[0054] On the remote server, the github (a hosting platform for open source and private software projects) hot update agent open source project is developed and improved, an interface for receiving a hot deployment request is added on the basis of the original hot deployment function, and the 55455 port is occupied, finally, the project is packaged into a hot update jar package through an IDE project management tool software (Maven) plug-in, a-javaagent parameter (in the actual use process, javaagent is a parameter of the java command, when the application program is started through the java command, the specified method in the specified jar package can be executed by specifying a jar package through the parameter-javaagent) is added on the application service start parameter, and the absolute file address of the hot deployment jar package is specified. After the service is started, the hot deployment agent service starts a server thread in the premain function (pre-initialization function) and waits for a hot deployment request.
[0055] The present application greatly improves the interaction speed of the developer, and can effectively improve the fault tolerance of the service, find problems at any time, develop and modify at any time, and verify online at any time, whether it is self-test or debugging with the front end and other backend services in the entire demand development process cycle.
[0056] As shown in Figure 2 , the hot deployment script first implements the installation of DCEVM, i.e., the jvm hot update patch. After installation, class changes can be replaced, including method function addition, attribute field addition, etc. The second step needs to listen to GIT changes of the service project running on the cloud IDE. The second step mainly executes the git fetch command every 10s in the code directory on the remote server to determine whether the project has changed. If there is a change, the git pull command is executed, and the changed file list is filtered out. The third step interacts with the hot deployment interface service (hot deploy) through the changed file list and file content. After the hot deployment service receives the changed file, the related file is recompiled to generate a class file or a bean object to replace the existing class file or bean object in jvm. Then, the hot deployment service returns the result. If the result is successful or failed, the hot deployment related information is sent back to the client through the HTTP request. The project related developers can know the hot update result on the client. Figure 2
[0057] The above hot deployment system also includes GIT, which is used to store code. Step S102, i.e., receiving and responding to the hot deployment plug-in installation information sent by the client, installs the hot deployment plug-in on the IDE architecture, including:
[0058] Install the hot deployment code package in the above plug-in installation information into the Docker image inside the IDE architecture to install the above hot deployment plug-in on the IDE architecture. The hot deployment code package includes code for implementing hot deployment functions.
[0059] Specifically, the Docker image is built and the code pulled from GIT is placed in the generated Docker container to load, so that the above hot deployment plug-in can be installed on the IDE architecture.
[0060] The open source HotswapAgent is used to modify the IDE hot deployment plug-in. The plug-in development framework of the IDE is used, and the corresponding code is written to implement the function of HotswapAgent. Then, the plug-in is packaged into a zip file and installed offline into the docker image of the cloud IDE.
[0061] After step S102, i.e., after installing the hot deployment plug-in on the IDE architecture, the method further includes:
[0062] determining whether the code in the code directory is identical to the code in the GIT; in the case that the code in the code directory is not identical to the code in the GIT, replacing all the code in the code directory with all the code in the GIT; in the case that the code in the code directory is identical to the code in the GIT, determining that the code in the code directory does not need to be replaced.
[0063] Specifically, by determining whether the code in the code directory is identical to the code in the GIT, the hot deployment update work is automatically performed, in the case that the code in the code directory is not identical to the code in the GIT, it is indicated that all the code in the code directory of the remote server needs to be modified, and the update is performed in the manner of full replacement, so that the code in the code directory can be quickly updated.
[0064] In an embodiment of the present application,
[0065] The determining whether the code in the code directory is identical to the code in the GIT comprises: executing a git fetch command to determine whether the code in the code directory is identical to the code in the GIT.
[0066] The replacing all the code in the code directory with all the code in the GIT comprises:
[0067] The replacing all the code in the code directory with all the code in the GIT comprises:
[0068] Specifically, by combining git fetch and git pull, the purpose of detecting first and then replacing can be achieved.
[0069] In an embodiment of the present application, after replacing all the code in the code directory with all the code in the GIT, the method further comprises: compiling all the code in the code directory to obtain compiled code; in the case that the type of the code in the code directory is Java, reloading the compiled code of the class in all the compiled code; in the case that the application framework of the code in the code directory is Spring, regenerating a Bean object by using the compiled code.
[0070] Specifically, the hot deployment server service interface receives a hot deployment request, parses the hot deployment, has multiple java file changes, and performs a compilation operation on the java file content in a loop. If the compilation is successful, the reloading and replacement of the java class are triggered, and then the existing Spring container object of the class is replaced.
[0071] Recompile the changed java file, after the compilation is completed, the class loader is reloaded, if the class is the spring framework bean, the life cycle of the bean is refreshed, the bean object is regenerated, so the code hot deployment hot update is completed; The overall time consumption is about 30s, which greatly reduces the service restart time.
[0072] In an embodiment of the present application, the above hot deployment system further comprises a GIT, the GIT is used for storing code, after installing the hot deployment plug-in on the IDE architecture, the method further comprises: using a monitoring script to monitor the service running in the IDE framework; in the case that the code in the code directory is not the same as the code in the GIT, using the monitoring script to pull all the code in the GIT from the GIT, and replacing all the code in the code directory with all the code in the GIT.
[0073] Specifically, the user (i.e. the client) locally changes the code by git push. The service started on the cloud IDE needs to start another automation script on the remote service to realize automation, and the functions are connected in series. The automatic hot deployment script includes the following functions: timed file scanning, finding file changes, automatically merging code, analyzing code change list, calling hot deployment interface, and pushing hot deployment related information. In this way, the user locally pushes the code, the cloud automatically pulls the code, automatically merges, and automatically performs hot deployment, realizing the automatic hot deployment of the code based on the cloud Ide.
[0074] The monitoring script scan.sh runs in the docker container and cyclically and timely monitors the service running in the IDE, so as to realize the automatic hot deployment of the remote service after the local code is submitted, greatly saving the time of packaging, compiling and restarting publishing.
[0075] In order to enable those skilled in the art to more clearly understand the technical solutions of the present application, the implementation process of the hot deployment method of the remote server of the present application will be described in detail below in combination with specific embodiments.
[0076] The present embodiment relates to a specific hot deployment method of a remote server, which is applied to a remote server in a hot deployment system, the hot deployment system further comprises a client, the client and the remote server communicate with each other, the hot deployment system further comprises a GIT, the GIT is used for storing code, as shown in Figure 3 The method comprises the following steps:
[0077] Step S1: receiving IDE installation information sent by the client, in the case that the IDE installation information includes an IDE installation package, downloading an IDE framework by using the IDE installation package, or compiling IDE source code in the IDE installation information to install the IDE framework;
[0078] Step S2: receiving and responding to hot deployment plug-in installation information sent by the client, installing a hot deployment code package in the plug-in installation information into a Docker image inside the IDE framework to install a hot deployment plug-in on the IDE framework, the hot deployment code package including code for implementing a hot deployment function;
[0079] Step S3: monitoring services running in the IDE framework by using a monitoring script;
[0080] Step S4: in the case that code in a code directory is not the same as code in GIT, pulling all the code in the GIT by using the monitoring script and replacing all the code in the code directory with all the code in the GIT.
[0081] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.
[0082] The embodiment of the present application also provides a remote server, and it should be noted that the remote server of the embodiment of the present application can be used to execute the hot deployment method for the remote server provided by the embodiment of the present application. The remote server is used to implement the above-mentioned embodiments and preferred embodiments, and details are not described herein. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the remote server described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0083] The remote server provided by the embodiment of the present application is described below.
[0084] Figure 4 is a structural block diagram of a remote server provided according to the embodiment of the present application. As shown in Figure 4 , the remote server includes:
[0085] The first receiving unit 41 is configured to receive and respond to IDE installation information sent by the client to install an IDE framework, wherein the IDE installation information is information for installing an IDE framework, or information including an IDE installation package, and the IDE framework is a framework of an integrated development environment;
[0086] The second receiving unit 42 is configured to receive and respond to the hot deployment plug-in installation information sent by the client, install the hot deployment plug-in on the IDE architecture, and implement the service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0087] In the remote server, the IDE architecture is installed first, and then the hot deployment plug-in is extended on the IDE architecture to implement the service function of hot deployment, thereby solving the problem that the existing scheme lacks a scheme for automatically deploying services on a remote pre-release server.
[0088] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is configured to store codes, the first receiving unit comprises a first processing module, and the first processing module is configured to, in a case where the IDE installation information comprises the IDE installation package, download the IDE architecture by using the IDE installation package, or compile the IDE source code in the IDE installation information to install the IDE architecture.
[0089] In an embodiment of the present application, the second receiving unit comprises a second processing module, the second processing module is configured to install the hot deployment code package in the plug-in installation information into the Docker image of the IDE architecture to install the hot deployment plug-in on the IDE architecture, and the hot deployment code package comprises codes for implementing the hot deployment function.
[0090] In an embodiment of the present application, the hot deployment system further comprises a GIT, and the remote server further comprises a determining unit, a first processing unit and a second processing unit, the GIT is configured to store codes, and after the hot deployment plug-in is installed on the IDE architecture, the determining unit is configured to determine whether the codes in the code directory are the same as the codes in the GIT; the first processing unit is configured to, in a case where the codes in the code directory are not the same as the codes in the GIT, replace all the codes in the code directory with all the codes in the GIT; and the second processing unit is configured to, in a case where the codes in the code directory are the same as the codes in the GIT, determine that the codes in the code directory do not need to be replaced.
[0091] In an embodiment of the present application,
[0092] The determining unit comprises a third processing module, and the third processing module is configured to execute a git fetch command to determine whether the codes in the code directory are the same as the codes in the GIT.
[0093] The first processing unit comprises a fourth processing module, which is configured to execute a git pull command to replace all the codes in the code directory with all the codes in the GIT.
[0094] In an embodiment of the present application, the remote server further comprises a third processing unit, a fourth processing unit and a fifth processing unit. After all the codes in the code directory are replaced with all the codes in the GIT, the third processing unit is configured to compile all the codes in the code directory to obtain compiled codes; the fourth processing unit is configured to reload the compiled codes of the class in all the compiled codes in the case that the application framework of the codes in the code directory is Spring; and the fifth processing unit is configured to regenerate a Bean object by using the compiled codes in the case that the application framework of the codes in the code directory is Spring.
[0095] In an embodiment of the present application, the remote server further comprises a sixth processing unit and a seventh processing unit. The hot deployment system further comprises a GIT, which is configured to store codes. After a hot deployment plug-in is installed on an IDE architecture, the sixth processing unit is configured to monitor services running in the IDE framework by using a monitoring script; and the seventh processing unit is configured to pull all the codes in the GIT by using the monitoring script in the case that the codes in the code directory are different from the codes in the GIT, and replace all the codes in the code directory with all the codes in the GIT.
[0096] The remote server comprises a processor and a memory. The first receiving unit, the second receiving unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions. The modules are located in the same processor; or the modules are located in different processors in any combination.
[0097] The processor comprises a core, and the core calls corresponding program units from the memory. The core can be one or more, and the core parameters are adjusted to solve the problem that the existing scheme lacks a scheme for realizing automatic hot deployment of services on a remote pre-release server.
[0098] The memory can comprise a non-permanent memory in a computer readable medium, a random access memory (RAM) and / or a non-volatile memory such as a read-only memory (ROM) or a flash memory (flash RAM), and the memory comprises at least one memory chip.
[0099] The embodiment of the present application provides a computer readable storage medium, which comprises a stored program, wherein the program controls a device where the computer readable storage medium is located to execute the hot deployment method of the remote server when the program is running.
[0100] Specifically, the hot deployment method of the remote server comprises the following steps.
[0101] In step S101, IDE architecture is installed in response to IDE installation information sent by the client, wherein the IDE installation information is information for installing the IDE framework or information comprising an IDE installation package, and the IDE architecture is architecture of an integrated development environment.
[0102] In step S102, a hot deployment plug-in is installed on the IDE architecture in response to hot deployment plug-in installation information sent by the client, so as to realize the service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0103] In an embodiment of the present application, the hot deployment system further comprises a GIT, and the GIT is used for storing codes, receiving and responding to the IDE installation information sent by the client to install the IDE architecture, comprising: in the case that the IDE installation information comprises the IDE installation package, downloading the IDE architecture by using the IDE installation package, or pulling IDE source code from the GIT according to the IDE installation information and compiling the IDE source code to install the IDE architecture.
[0104] In an embodiment of the present application, the hot deployment system further comprises a GIT, and the GIT is used for storing codes, receiving and responding to the hot deployment plug-in installation information sent by the client to install the hot deployment plug-in on the IDE architecture, comprising:
[0105] According to the plug-in installation information, a hot deployment code package is pulled from the GIT and installed into a Docker image of the IDE architecture, so as to install the hot deployment plug-in on the IDE architecture, and the hot deployment code package comprises codes for realizing the hot deployment function.
[0106] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is used to store the code, after the hot deployment plug-in is installed on the IDE architecture, the method further comprises: determining whether the code in the code directory is same as the code in the GIT; in the case that the code in the code directory is not same as the code in the GIT, replacing all the code in the code directory with all the code in the GIT; in the case that the code in the code directory is same as the code in the GIT, determining that the code in the code directory does not need to be replaced.
[0107] In an embodiment of the present application,
[0108] The determining whether the code in the code directory is same as the code in the GIT comprises: executing a git fetch command to determine whether the code in the code directory is same as the code in the GIT.
[0109] The replacing all the code in the code directory with all the code in the GIT comprises:
[0110] The replacing all the code in the code directory with all the code in the GIT comprises: executing a git pull command to replace all the code in the code directory with all the code in the GIT.
[0111] In an embodiment of the present application, after replacing all the code in the code directory with all the code in the GIT, the method further comprises: compiling all the code in the code directory to obtain compiled code; in the case that the type of the code in the code directory is Java, reloading the compiled code of the class in all the compiled code; in the case that the application framework of the code in the code directory is Spring, regenerating a Bean object by using the compiled code.
[0112] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is used to store the code, after the hot deployment plug-in is installed on the IDE architecture, the method further comprises: monitoring the service running in the IDE framework by using a monitoring script; in the case that the code in the code directory is not same as the code in the GIT, pulling all the code in the GIT from the GIT by using the monitoring script, and replacing all the code in the code directory with all the code in the GIT.
[0113] An embodiment of the present application provides a processor, the processor is used to run a program, wherein the program runs to execute the hot deployment method of the remote server.
[0114] Specifically, the hot deployment method of the remote server comprises:
[0115] Step S101, receiving and responding to the IDE installation information sent by the client, installing the IDE framework, wherein the IDE installation information is information for installing the IDE framework, or information including the IDE installation package, and the IDE framework is the framework of the integrated development environment;
[0116] Step S102, receiving and responding to the hot deployment plug-in installation information sent by the client, installing the hot deployment plug-in on the IDE framework to realize the service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0117] In an embodiment of the present application, the hot deployment system further includes a GIT, which is used to store code, and the method of receiving and responding to the IDE installation information sent by the client to install the IDE framework includes: in the case that the IDE installation information includes the IDE installation package, downloading the IDE framework by using the IDE installation package, or pulling the IDE source code from the GIT according to the IDE installation information and compiling the IDE source code to install the IDE framework.
[0118] In an embodiment of the present application, the hot deployment system further includes a GIT, which is used to store code, and the method of receiving and responding to the hot deployment plug-in installation information sent by the client to install the hot deployment plug-in on the IDE framework includes:
[0119] According to the plug-in installation information, the hot deployment code package is pulled from the GIT and installed into the Docker image of the IDE framework, so as to install the hot deployment plug-in on the IDE framework, and the hot deployment code package includes code for realizing the hot deployment function.
[0120] In an embodiment of the present application, the hot deployment system further includes a GIT, which is used to store code, and after installing the hot deployment plug-in on the IDE framework, the method further includes: determining whether the code in the code directory is the same as the code in the GIT; in the case that the code in the code directory is not the same as the code in the GIT, replacing all the code in the code directory with all the code in the GIT; and in the case that the code in the code directory is the same as the code in the GIT, determining that the code in the code directory does not need to be replaced.
[0121] In an embodiment of the present application,
[0122] The determination of whether the code in the code directory is the same as the code in the GIT includes: executing a git fetch command to determine whether the code in the code directory is the same as the code in the GIT.
[0123] replacing all the codes in the code directory with all the codes in the GIT, including:
[0124] executing a git pull command to replace all the codes in the code directory with all the codes in the GIT.
[0125] In an embodiment of the present application, after replacing all the codes in the code directory with all the codes in the GIT, the method further comprises: compiling all the codes in the code directory to obtain compiled codes; in the case that the type of the codes in the code directory is Java, reloading the compiled codes of the class in all the compiled codes; in the case that the application framework of the codes in the code directory is Spring, regenerating a Bean object using the compiled codes.
[0126] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT being used to store codes, after installing the hot deployment plug-in on the IDE framework, the method further comprises: monitoring the services running in the IDE framework using a monitoring script; in the case that the codes in the code directory are not the same as the codes in the GIT, pulling all the codes in the GIT using the monitoring script, and replacing all the codes in the code directory with all the codes in the GIT.
[0127] An embodiment of the present application provides a device, the device comprising a processor, a memory, and a program stored on the memory and executable on the processor, and the processor implements at least the following steps when executing the program: receiving and responding to IDE installation information sent by a client to install an IDE framework, wherein the IDE installation information is information for installing the IDE framework, or information comprising an IDE installation package, and the IDE framework is a framework of an integrated development environment; receiving and responding to hot deployment plug-in installation information sent by the client to install a hot deployment plug-in on the IDE framework to implement a service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in. The device herein can be a server, a PC, a PAD, a mobile phone, etc.
[0128] In an embodiment of the present application, receiving and responding to IDE installation information sent by the client to install the IDE framework comprises: in the case that the IDE installation information comprises the IDE installation package, downloading the IDE framework using the IDE installation package, or compiling IDE source code in the IDE installation information to install the IDE framework.
[0129] In an embodiment of the present application, the hot deployment plug-in installation information sent by the client is received and responded to, and the hot deployment plug-in is installed on the IDE architecture, including:
[0130] The hot deployment code package in the plug-in installation information is installed into the Docker image of the IDE architecture to install the hot deployment plug-in on the IDE architecture, and the hot deployment code package includes code for implementing the hot deployment function.
[0131] In an embodiment of the present application, the hot deployment system further includes a GIT, and the GIT is used to store code. After the hot deployment plug-in is installed on the IDE architecture, the method further includes: determining whether the code in the code directory is the same as the code in the GIT; in the case where the code in the code directory is not the same as the code in the GIT, replacing all the code in the code directory with all the code in the GIT; and in the case where the code in the code directory is the same as the code in the GIT, determining that the code in the code directory does not need to be replaced.
[0132] In an embodiment of the present application,
[0133] The determination of whether the code in the code directory is the same as the code in the GIT includes: executing a git fetch command to determine whether the code in the code directory is the same as the code in the GIT.
[0134] The replacement of all the code in the code directory with all the code in the GIT includes:
[0135] A git pull command is executed to replace all the code in the code directory with all the code in the GIT.
[0136] In an embodiment of the present application, after all the code in the code directory is replaced with all the code in the GIT, the method further includes: compiling all the code in the code directory to obtain compiled code; in the case where the type of the code in the code directory is Java, reloading the compiled code of the class in all the compiled code; and in the case where the application framework of the code in the code directory is Spring, regenerating a Bean object using the compiled code.
[0137] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is used for storing codes, after the hot deployment plug-in is installed on the IDE architecture, the method further comprises: monitoring the service running in the IDE framework by using a monitoring script; in a case that the codes in the code directory are not the same as the codes in the GIT, pulling all the codes in the GIT by using the monitoring script, and replacing all the codes in the code directory with all the codes in the GIT.
[0138] The present application further provides a computer program product, when executed on a data processing device, is adapted to execute a program initialized with at least the following method steps: receiving and responding to IDE installation information sent by the client to install an IDE architecture, wherein the IDE installation information is information for installing an IDE framework, or information comprising an IDE installation package, and the IDE architecture is an architecture of an integrated development environment; receiving and responding to hot deployment plug-in installation information sent by the client to install a hot deployment plug-in on the IDE architecture to realize a service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in.
[0139] In an embodiment of the present application, receiving and responding to the IDE installation information sent by the client to install the IDE architecture comprises: in a case that the IDE installation information comprises the IDE installation package, downloading the IDE architecture by using the IDE installation package, or compiling the IDE source code in the IDE installation information to install the IDE architecture.
[0140] In an embodiment of the present application, receiving and responding to the hot deployment plug-in installation information sent by the client to install the hot deployment plug-in on the IDE architecture comprises:
[0141] installing the hot deployment code package in the plug-in installation information into the Docker image of the IDE architecture to install the hot deployment plug-in on the IDE architecture, the hot deployment code package comprising codes for realizing the function of hot deployment.
[0142] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is used for storing codes, after the hot deployment plug-in is installed on the IDE architecture, the method further comprises: determining whether the codes in the code directory are the same as the codes in the GIT; in a case that the codes in the code directory are not the same as the codes in the GIT, replacing all the codes in the code directory with all the codes in the GIT; in a case that the codes in the code directory are the same as the codes in the GIT, determining that the codes in the code directory do not need to be replaced.
[0143] In an embodiment of the present application,
[0144] The determining whether the code in the code directory is the same as the code in the GIT comprises: executing a git fetch command to determine whether the code in the code directory is the same as the code in the GIT.
[0145] The replacing all the code in the code directory with all the code in the GIT comprises:
[0146] The replacing all the code in the code directory with all the code in the GIT comprises:
[0147] In an embodiment of the present application, after replacing all the code in the code directory with all the code in the GIT, the method further comprises: compiling all the code in the code directory to obtain compiled code; in the case that the type of the code in the code directory is Java, reloading the compiled code of the class in all the compiled code; in the case that the application framework of the code in the code directory is Spring, regenerating a Bean object using the compiled code.
[0148] In an embodiment of the present application, the hot deployment system further comprises a GIT, the GIT is used to store code, after installing the hot deployment plug-in on the IDE architecture, the method further comprises: monitoring services running in the IDE framework using a monitoring script; in the case that the code in the code directory is not the same as the code in the GIT, pulling all the code in the GIT from the GIT using the monitoring script, and replacing all the code in the code directory with all the code in the GIT.
[0149] The present application also provides a hot deployment system, the hot deployment system comprises: a remote server, a client and a GIT, the client communicates with the remote server, the GIT is used to store code, and the remote server is used to execute any of the hot deployment methods of the remote server. By first installing an IDE architecture on the remote server, and then expanding a hot deployment plug-in on the IDE architecture, the service function of the hot deployment is realized, thereby solving the problem that the prior art lacks a scheme of realizing the automatic hot deployment of services on a remote pre-release server.
[0150] It should be apparent to those skilled in the art that the modules or steps of the application described above can be implemented with a general purpose computer, and can be centralized in a single computer or distributed among a network of computers, and can be implemented with program code executable by a computer, and thus can be stored in a storage device and executed by a computer, and in some cases, the steps shown or described can be executed in a different order than shown or described, or can be implemented as separate integrated circuit modules or as a single integrated circuit module, and thus the application is not limited to any particular combination of hardware and software.
[0151] Those skilled in the art will appreciate that embodiments of the application can be devised for a method, a system, or a computer program product. Accordingly, the application can be embodied in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can be in the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage media, etc.) embodying computer readable program code.
[0152] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0153] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.
[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams.Figure 1 one or more processes and / or blocks Figure 1 the function(s) specified in the flow block or blocks.
[0155] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0156] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. The memory is an example of computer readable media.
[0157] Computer readable media includes permanent and non-permanent, 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. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0158] It should also be noted that the terms "comprising", "containing", or any other variant thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0159] From the above description, it can be seen that the above-mentioned embodiments of the present application achieve the following technical effects:
[0160] 1) The hot deployment method of the remote server in this application first installs an IDE architecture on the remote server, and then extends the hot deployment plugin on the IDE architecture to realize the hot deployment service function, thereby solving the problem that the existing solutions lack an automated hot deployment solution for services on a remote pre-release server.
[0161] 2) The remote server in this application first installs an IDE architecture on the remote server, and then extends the hot deployment plugin on the IDE architecture to realize the hot deployment service function, thereby solving the problem that existing solutions lack an automated hot deployment solution for services on a remote pre-release server.
[0162] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for hot deployment of a remote server, applied to a remote server in a hot deployment system, wherein the hot deployment system further includes a client, and the client communicates with the remote server, characterized in that, The method comprises the following steps: receiving and responding to IDE installation information sent by the client to install an IDE framework, wherein the IDE installation information is information for installing the IDE framework, or information including an IDE installation package, and the IDE framework is a framework of an integrated development environment (IDE) ; receiving and responding to hot deployment plug-in installation information sent by the client to install a hot deployment plug-in on the IDE framework to realize a service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in; The hot deployment system further comprises a GIT, which is used to store code, and after the hot deployment plug-in is installed on the IDE framework, the method further comprises the following steps: monitoring services running in the IDE framework by using a monitoring script; when the code in the code directory is different from the code in the GIT, pulling all the code in the GIT by using the monitoring script, and replacing all the code in the code directory with all the code in the GIT; and after all the code in the code directory is replaced with all the code in the GIT, the method further comprises the following steps: compiling all the code in the code directory to obtain compiled code; when the type of the code in the code directory is Java, reloading the compiled code of all class files in all the compiled code; when the application framework of the code in the code directory is Spring, regenerating a Bean object by using the compiled code.
2. The method of claim 1, wherein, The method of receiving and responding to IDE installation information sent by the client to install an IDE framework comprises the following steps: when the IDE installation information includes the IDE installation package, downloading the IDE framework by using the IDE installation package, or compiling IDE source code in the IDE installation information to install the IDE framework.
3. The method of claim 1, wherein, The method of receiving and responding to hot deployment plug-in installation information sent by the client to install a hot deployment plug-in on the IDE framework comprises the following steps: installing a hot deployment code package in the plug-in installation information into a Docker image of the IDE framework to install the hot deployment plug-in on the IDE framework, wherein the hot deployment code package includes code for realizing a hot deployment function.
4. The method of claim 1, wherein, The hot deployment system further comprises a GIT, which is used to store code, and after the hot deployment plug-in is installed on the IDE framework, the method further comprises the following steps: determining whether the code in the code directory is the same as the code in the GIT; when the code in the code directory is different from the code in the GIT, replacing all the code in the code directory with all the code in the GIT; when the code in the code directory is the same as the code in the GIT, determining that the code in the code directory does not need to be replaced.
5. The method of claim 4, wherein The determining whether the code in the code directory is same as the code in the GIT comprises: executing a git fetch command to determine whether the code in the code directory is same as the code in the GIT; The replacing all the code in the code directory with all the code in the GIT comprises: The replacing all the code in the code directory with all the code in the GIT comprises: executing a git pull command to replace all the code in the code directory with all the code in the GIT.
6. A remote server, characterized in that The method comprises: The first receiving unit is configured to receive and install IDE architecture in response to IDE installation information sent by the client, wherein the IDE installation information is information for installing the IDE framework, or information including an IDE installation package, and the IDE architecture is architecture of an integrated development environment (IDE). The second receiving unit is configured to receive and install a hot deployment plug-in on the IDE architecture in response to hot deployment plug-in installation information sent by the client, so as to implement a service function of hot deployment, wherein the hot deployment plug-in installation information is information for installing the hot deployment plug-in. The hot deployment system further comprises a GIT configured to store code, wherein after the hot deployment plug-in is installed on the IDE architecture, a monitoring script is used to monitor services running in the IDE framework; in a case where the code in the code directory is not same as the code in the GIT, the monitoring script is used to pull all the code in the GIT from the GIT, and all the code in the code directory is replaced with all the code in the GIT; and the IDE hot deployment plug-in is reformed by using an open-source HotswapAgent. The remote server is further configured to perform the following steps: After all the code in the code directory is replaced with all the code in the GIT, all the code in the code directory is compiled to obtain compiled code; in a case where the type of the code in the code directory is Java, the compiled code of a class in all the compiled code is reloaded; and in a case where an application framework of the code in the code directory is Spring, a Bean object is regenerated by using the compiled code.
7. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein when the program is executed, the computer readable storage medium controls a device where the computer readable storage medium is located to perform the hot deployment method of the remote server in any one of claims 1 to 5.
8. A hot deployment system, characterized by The method comprises: The remote server, the client and the GIT, the client and the remote server are in communication, the GIT is configured to store code, and the remote server is configured to perform the hot deployment method of the remote server in any one of claims 1 to 5.