A Jar package component hot deployment method and system

By sending the three elements of the Jar package or the Jar URL address on the user terminal, the private server warehouse address is obtained and the hot deployment of the Jar package components is completed. This solves the problem of the traditional method of requiring a restart of the server for Jar packages in the production environment, and achieves restart-free deployment. Reduces costs and increases system flexibility and reliability.

CN112486509BActive Publication Date: 2024-09-10BEIKE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011183260.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-29
Publication Date
2024-09-10
Estimated Expiration
2040-10-29

AI Technical Summary

Technical Problem

The traditional hot deployment method of Jar packages requires restarting the server in the production environment, resulting in high costs for docking and joint debugging, and the coupling of Jar files and programs makes it difficult to achieve deployment without restarting.

Method used

Send the three elements of the Jar package or the Jar URL address through the user terminal to obtain the storage address in the private server warehouse, realize the download and hot deployment of the Jar package components, and adopt the permission control and release lock mechanism to ensure security and resource saving, and after the server restarts Dynamically initialize the last successfully deployed Jar package component.

Benefits of technology

It realizes Jar package deployment without restarting the server, reduces the communication cost with business parties, improves the flexibility and reliability of the system, and simplifies the deployment process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112486509B
    Figure CN112486509B
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and system for hot deployment of Jar package components, the method comprising: a user terminal sends a publishing request including three elements of a Jar package component to be deployed and information of a server cluster for executing deployment or a Jar url address and information of a server cluster for executing deployment to a publishing request receiving server, and then forwards it to a server cluster for executing deployment, each server of the server cluster for executing deployment obtains the storage address of the Jar package component in a private server warehouse according to the three elements of the Jar package and the address of a private server warehouse, downloads the Jar package component according to the storage address and completes the hot deployment operation, or downloads the Jar package component according to the Jar url address and completes the hot deployment operation. The method and system for hot deployment of Jar package components provided by the embodiment of the present invention realizes the implementation of a formal environment for Jar package deployment online without restarting the server mode, and reduces the communication, docking, joint debugging and other costs between docking business parties.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a Jar package component hot deployment method and system. Background Art

[0002] Jar is a software package file format. Jar files are usually used to aggregate a large number of Java class files, related metadata and resource (text, pictures, etc.) files into one file in order to develop Java platform application software or libraries. Maven is a program compilation and construction tool, which can be understood as an auxiliary environment tool in the R&D process in the IT field. Private service warehouse is a warehouse service set up in the local area network. It is generally a public warehouse built within the company, mainly storing resource files such as Jar packages. The three elements of Jar package: groupId (the unique identifier of the organization or group that created the project, which can be understood as the unique identifier of the project), artifactId (unique base name of the primary artifact being generated by this project, which can be understood as the unique identifier of the file under the project), version (which can be understood as the file version number), as an industry standard, can uniquely identify the directory location of a Jar file in the private service warehouse and uniquely identify a Jar coordinate information.

[0003] Hot deployment is to upgrade the software while the application is running, without restarting the application. The traditional hot deployment method tends to deploy a single file in the test environment. This method is used by programmers to load system internal resources during the development and testing process when developing and debugging program files. When the file changes during the development process, it is automatically loaded, and the tomcat container (a web application server) can be used to debug the program without starting it. This method cannot be used in the production environment (online environment, that is, the officially used function). In the production environment, if a file is modified during the development process, the tomcat container needs to be restarted to make the newly modified function take effect.

[0004] If a traditional application depends on a Jar file, the three elements of the Jar file are configured inside the project. The server online environment needs to install the Maven environment (used to download the dependent Jar files from the private server warehouse), and download the Jar package resources through the dependent file (pom). When the deployment operation is required, the dependent Jar files and project files are downloaded from the private server warehouse using the Maven environment and stored together, and then deployed together to the server. Since the Jar file and the program are deployed together in the production environment, the Jar file and the program file are coupled together. Therefore, each change to the Jar file requires restarting the server to go online. For the traditional method, from a technical analysis, the Jar package that the R&D project in the industry depends on needs to be explicitly introduced in the project, and each change to the Jar package requires redeployment and online. In this process, it is inevitable that the service will be restarted to achieve the effect of system online. From a business analysis, the introduction of personalized Jar package components with frequent changes in third-party requirements will generate immeasurable costs in terms of system communication, docking, and joint debugging, and will also lead to frequent restarts of services to achieve the demand online. Summary of the invention

[0005] In order to solve the problems in the prior art, an embodiment of the present invention provides a Jar package component hot deployment method and system.

[0006] In a first aspect, an embodiment of the present invention provides a method for hot deployment of a Jar package component, the method comprising: a user terminal sends a publishing request to any server in a server cluster, the server receiving the publishing request is a publishing request receiving server, the publishing request includes three Jar package elements of the Jar package component to be deployed and information of a server cluster for executing deployment, or the publishing request includes a Jar url address of the Jar package component to be deployed and information of a server cluster for executing deployment, the Jar url address is a storage address of the Jar package component in a private server warehouse, the server cluster for executing deployment is a subset of the server cluster, and the server cluster for executing deployment includes at least one server on which the Jar package component is to be deployed; the publishing request receiving server sends the publishing request to the server cluster for executing deployment, each server of the server cluster for executing deployment obtains the storage address of the Jar package component in the private server warehouse according to the three Jar package elements and the private server warehouse address, downloads the Jar package component according to the storage address and completes the hot deployment operation, or each server of the server cluster for executing deployment downloads the Jar package component according to the Jar url address and completes the hot deployment operation.

[0007] Furthermore, obtaining the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address specifically includes: obtaining a private server warehouse directory address according to the three elements of the Jar package and the private server warehouse address, requesting the private server warehouse directory address to obtain a corresponding Html tag, and parsing the Html tag to obtain the storage address of the Jar package component in the private server warehouse.

[0008] Furthermore, the publishing request also includes a user terminal identification. Before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method also includes: the publishing request receiving server sends the user terminal identification to the authority control center for the authority control center to verify the publishing authority of the user terminal corresponding to the user terminal identification; after the authority control center verifies the publishing authority of the user terminal corresponding to the user terminal identification, the publishing request receiving server receives the authority confirmation information sent by the authority control center.

[0009] Furthermore, after the publishing request receiving server receives the permission confirmation information sent by the permission control center and before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method also includes: the publishing request receiving server obtains a publishing lock, thereby obtaining the permission to send the publishing request to the execution deployment server cluster in parallel; and, after each server in the execution deployment server cluster completes the hot deployment operation, releasing the publishing lock.

[0010] Furthermore, after downloading the Jar package component according to the storage address and completing the hot deployment operation or after downloading the Jar package component according to the Jar url address and completing the hot deployment operation, the method further includes: each server in the deployment execution server cluster stores the operation record in data.

[0011] Furthermore, the method further includes: the user terminal sends a hot deployment operation result query request to any server in the deployment execution server cluster, and after receiving the hot deployment operation result query request, the any server sends a hot deployment status result to the user terminal.

[0012] Furthermore, the method further comprises: after any server in the server cluster is restarted, dynamically initializing the Jar package component that was successfully deployed last time.

[0013] Furthermore, each server in the server cluster is encapsulated with a Jar package loading and deployment tool class, which provides functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports deployment of different Jar package resources for multiple services.

[0014] In a second aspect, an embodiment of the present invention provides a Jar package component hot deployment system, the system includes a user terminal, a server cluster and a private service warehouse, wherein: the user terminal is used to send a publishing request to any server in the server cluster, the server receiving the publishing request is a publishing request receiving server, the publishing request includes the Jar package three elements of the Jar package component to be deployed and the information of the execution deployment server cluster, or, the publishing request includes the Jar url address of the Jar package component to be deployed and the information of the execution deployment server cluster, the Jar url address is the storage address of the Jar package component in the private service warehouse, the execution deployment server cluster is a subset of the server cluster, and the execution deployment server cluster includes at least one server on which the Jar package component is to be deployed; the publishing request receiving server is used to send the publishing request to the execution deployment server cluster; each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private service warehouse according to the Jar package three elements and the private service warehouse address, download the Jar package component according to the storage address and complete the hot deployment operation, or, each server of the execution deployment server cluster is used to download the Jar package component according to the Jar package three elements and the private service warehouse address and complete the hot deployment operation. url address to download the Jar package component and complete the hot deployment operation.

[0015] Furthermore, when each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, it is specifically used to: obtain the private server warehouse directory address according to the three elements of the Jar package and the private server warehouse address, request the private server warehouse directory address to obtain the corresponding Html tag, and parse the Html tag to obtain the storage address of the Jar package component in the private server warehouse.

[0016] Furthermore, the publishing request also includes a user terminal identification. Before the publishing request receiving server is used to send the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: send the user terminal identification to the authority control center so that the authority control center can verify the publishing authority of the user terminal corresponding to the user terminal identification; after the authority control center has successfully verified the publishing authority of the user terminal corresponding to the user terminal identification, receive the authority confirmation information sent by the authority control center.

[0017] Furthermore, after the publishing request receiving server is used to receive the permission confirmation information sent by the permission control center and before sending the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: obtain a publishing lock, thereby obtaining the permission to send the publishing request to the execution deployment server cluster in parallel; and release the publishing lock after each server in the execution deployment server cluster completes the hot deployment operation.

[0018] Furthermore, after each server of the deployment execution server cluster is used to download the Jar package component according to the storage address and complete the hot deployment operation or after each server of the deployment execution server cluster is used to download the Jar package component according to the Jar url address and complete the hot deployment operation, each server of the deployment execution server cluster is also used to store the operation record data.

[0019] Furthermore, the user terminal is further used to: send a hot deployment operation result query request to any server in the deployment execution server cluster, and receive a hot deployment status result sent by any server after receiving the hot deployment operation result query request.

[0020] Furthermore, any one of the servers in the server cluster is further used to: dynamically initialize the Jar package component that was successfully deployed last time after restarting.

[0021] Furthermore, each server in the server cluster is encapsulated with a Jar package loading and deployment tool class, which provides functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports deployment of different Jar package resources for multiple services.

[0022] The Jar package component hot deployment method and system provided by the embodiment of the present invention includes the Jar package three elements or the Jar url address in the publishing request sent by the user terminal, obtains the storage address of the Jar package component in the private server warehouse according to the Jar package three elements and the private server warehouse address, and then downloads the Jar package component and completes the hot deployment operation, or downloads the Jar package component according to the Jar url address and completes the hot deployment operation, thereby realizing the deployment of the Jar package to the formal environment without restarting the server, and reducing the communication, docking, and joint debugging costs between the docking business parties. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 This is a flow chart of a Jar package component hot deployment method provided by an embodiment of the present invention;

[0025] Figure 2 It is a schematic diagram of the process of a Jar package component hot deployment method provided by an embodiment of the present invention;

[0026] Figure 3 This is an example diagram of Html tag content in a text tool in a Jar package component hot deployment method provided by an embodiment of the present invention;

[0027] Figure 4 This is an example diagram of Html tag content in a browser in a Jar package component hot deployment method provided by an embodiment of the present invention;

[0028] Figure 5 This is a schematic diagram of hot deployment interaction of Jar package components provided by an embodiment of the present invention;

[0029] Figure 6 It is a structural diagram of a Jar package component hot deployment system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] Figure 1 FIG. 1 is a flow chart of a Jar package component hot deployment method provided by an embodiment of the present invention. Figure 1 As shown, the method includes:

[0032] Step 101: The user terminal sends a publishing request to any server in the server cluster. The server that receives the publishing request is the publishing request receiving server. The publishing request includes the three elements of the Jar package of the Jar package component to be deployed and the information of the server cluster for executing the deployment. Alternatively, the publishing request includes the Jar url address of the Jar package component to be deployed and the information of the server cluster for executing the deployment. The Jar url address is the storage address of the Jar package component in the private server warehouse. The server cluster for executing the deployment is a subset of the server cluster, and the server cluster for executing the deployment includes at least one server on which the Jar package component is to be deployed.

[0033] The user terminal is the terminal where the user sends the release request of the Jar package component, and can provide a user operation function interface for the user to operate conveniently. The server cluster is a cluster composed of multiple servers. The user terminal can arbitrarily select one or more servers in the server cluster to perform hot deployment of the Jar package component. When hot deployment of the Jar package component is required, the user terminal sends a release request to any server in the server cluster. This server can be the server where the Jar package component is to be deployed, or it can be a server that is not a server where the Jar package component is to be deployed. For the sake of distinction, the server that receives the release request sent by the user terminal is called the release request receiving server.

[0034] The publishing request sent by the user terminal may include the three elements of the Jar package of the Jar package component to be deployed and the information of the execution deployment server cluster. Among them, the three elements of the Jar package include groupId (which can be understood as the unique identifier of the project), artifactId (which can be understood as the unique identifier of the file under the project), and version (which can be understood as the file version number). As an industry standard, it can uniquely identify the directory location of a Jar file in the private service warehouse and uniquely identify a Jar coordinate information. The publishing request may also include the Jar url address of the Jar package component to be deployed and the information of the execution deployment server cluster. The Jar url address is the storage address of the Jar package component in the private service warehouse. The Jar url address of the Jar package component can be directly stored in the user terminal, and the Jar url address of the Jar package component can be manually obtained in the private service warehouse and stored in the user terminal. The execution deployment server cluster is a subset of the server cluster, and the execution deployment server cluster includes at least one server on which the Jar package component is to be deployed. That is, the user terminal can select the server to be deployed with the Jar package component in the server cluster to form an execution deployment server cluster, thereby realizing selective grayscale hot deployment for online servers. The execution deployment server cluster may include the publishing request receiving server itself.

[0035] Step 102: the publishing request receiving server sends the publishing request to the execution deployment server cluster, and each server of the execution deployment server cluster obtains the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, downloads the Jar package component according to the storage address and completes the hot deployment operation, or, each server of the execution deployment server cluster downloads the Jar package component according to the Jar url address and completes the hot deployment operation.

[0036] The publishing request receiving server sends the publishing request to the execution deployment server cluster. Since the three elements of the Jar package can uniquely identify the directory location of a Jar file in the private service warehouse and uniquely identify a Jar coordinate information, the storage address of the Jar package component in the private service warehouse can be obtained according to the three elements of the Jar package and the private service warehouse address. Each server of the execution deployment server cluster can download the Jar package component according to the storage address of the Jar package component in the private service warehouse and complete the hot deployment operation. Each server of the execution deployment server cluster can also download the Jar package component according to the Jar url address and complete the hot deployment operation.

[0037] In the embodiment of the present invention, the three elements of the Jar package are not stored together with the project program files. By matching the private server warehouse address with the three elements of groupId, artifactId, and version, org.jsoup can be used to parse the Jar resource address, and hot deployment can be achieved without restarting the server. The advantage of this method is that it is simple and convenient, and does not require dependence on additional environments or Maven configurations.

[0038] The embodiment of the present invention includes the three elements of the Jar package or the Jar url address in the publishing request sent by the user terminal, obtains the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, and then downloads the Jar package component and completes the hot deployment operation, or downloads the Jar package component according to the Jar url address and completes the hot deployment operation, thereby realizing the deployment of the Jar package to the formal environment without restarting the server, thereby reducing the communication, docking, and joint debugging costs between the docking business parties.

[0039] Further, based on the above embodiment, obtaining the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address specifically includes: obtaining the private server warehouse directory address according to the three elements of the Jar package and the private server warehouse address, requesting the private server warehouse directory address to obtain the corresponding Html tag, and parsing the Html tag to obtain the storage address of the Jar package component in the private server warehouse.

[0040] Each server in the server cluster that executes the deployment obtains the private server warehouse directory address based on the three elements of the Jar package and the private server warehouse address. The private server warehouse directory address is expressed as: [private server warehouse address + " / " + groupId + " / " + artifactId + " / " + version"]. Request this address, obtain the html tag content, parse out the specific address of the jar package in the private server warehouse (jar url), and then download the jar package file to complete the hot deployment operation.

[0041] On the basis of the above embodiments, the embodiments of the present invention obtain the private server warehouse directory address by splicing the three elements of the Jar package and the private server warehouse address, request the private server warehouse directory address to obtain the corresponding Html tag, parse the Html tag to obtain the storage address of the Jar package component in the private server warehouse, and realize the rapid acquisition of the storage address of the Jar package component in the private server warehouse.

[0042] Further, based on the above embodiment, the publishing request also includes a user terminal identification. Before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method also includes: the publishing request receiving server sends the user terminal identification to the authority control center for the authority control center to verify the publishing authority of the user terminal corresponding to the user terminal identification; after the authority control center verifies the publishing authority of the user terminal corresponding to the user terminal identification, the publishing request receiving server receives the authority confirmation information sent by the authority control center.

[0043] The publishing request also includes a user terminal identifier. After receiving the publishing request, the publishing request receiving server first sends the user terminal identifier to the authority control center so that the authority control center can verify the publishing authority of the user terminal corresponding to the user terminal identifier. If the authority control center verifies the publishing authority of the user terminal corresponding to the user terminal identifier, the authority confirmation information is returned to the publishing request receiving server. If the verification fails, the authority control center sends an indication message of refusing publishing to the publishing request receiving server.

[0044] After receiving the permission confirmation information sent by the permission control center, the publishing request receiving server further executes the operation of sending the publishing request to the execution deployment server cluster; if the user terminal does not have the publishing permission, the operation is terminated.

[0045] On the basis of the above-mentioned embodiment, the embodiment of the present invention improves the system security by sending the publishing request to the execution deployment server cluster after verifying the publishing authority of the user terminal.

[0046] Further, based on the above embodiment, after the publishing request receiving server receives the permission confirmation information sent by the permission control center, before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method also includes: the publishing request receiving server obtains a publishing lock, thereby obtaining the permission to send the publishing request to the execution deployment server cluster in parallel; and, after each server in the execution deployment server cluster completes the hot deployment operation, releasing the publishing lock.

[0047] After receiving the permission confirmation information sent by the permission control center, the publishing request receiving server obtains the publishing lock, thereby obtaining the permission to send the publishing request to the execution deployment server cluster in parallel, and then sends the publishing request to the execution deployment server cluster. After each server in the execution deployment server cluster completes the hot deployment operation, the publishing lock is released.

[0048] The embodiment of the present invention acquires a publishing lock before sending a publishing request to a deployment execution server cluster, and releases the publishing lock after each server in the deployment execution server cluster completes a hot deployment operation, thereby saving system resources.

[0049] Further, based on the above embodiment, after downloading the Jar package component according to the storage address and completing the hot deployment operation or after downloading the Jar package component according to the Jar url address and completing the hot deployment operation, the method also includes: each server in the deployment execution server cluster stores the operation records as data.

[0050] After downloading the Jar package component according to the storage address and completing the hot deployment operation or after downloading the Jar package component according to the Jar url address and completing the hot deployment operation, each server in the deployment server cluster stores the operation record in data. The operation record includes information such as the associated release record id, the current execution ip, the resource address, the file content, the deployment result (success or failure), the prompt information, the execution type, and the execution time.

[0051] On the basis of the above-mentioned embodiments, the embodiments of the present invention store the operation records for data after downloading the Jar package components and completing the hot deployment operation, which is beneficial to query and manage the deployment status of the Jar package components.

[0052] Further, based on the above embodiment, the method also includes: the user terminal sends a hot deployment operation result query request to any server in the deployment execution server cluster, and after receiving the hot deployment operation result query request, the any server sends a hot deployment status result to the user terminal.

[0053] A function interface can be set on the user terminal to realize the one-click hot deployment of Jar package function, as well as the hot deployment detailed operation record viewing service in the cluster environment, which can view the result status of each step of the hot deployment process. The user terminal sends a hot deployment operation result query request to any server in the execution deployment server cluster. After receiving the hot deployment operation result query request, the any server sends the hot deployment status result to the user terminal, such as sending the deployment success or deployment failure information to the user terminal.

[0054] On the basis of the above embodiments, the embodiment of the present invention sends a hot deployment operation result query request to any server in the deployment server cluster through a user terminal to query the hot deployment status result, thereby realizing effective management of the hot deployment status.

[0055] Further, based on the above embodiment, the method further includes: after any server in the server cluster is restarted, dynamically initializing the Jar package component that was successfully deployed last time.

[0056] The developed functional program files are all loaded into the jvm memory (a piece of memory space allocated by the operating system). After the server is restarted, the last hot-loaded Jar program file no longer exists. In order to ensure that the original hot-deployed Jar component function can still be used normally, it is necessary to reinitialize the last successfully deployed Jar component. Therefore, after the server is restarted, the last successfully deployed Jar package component is dynamically initialized.

[0057] for example:

[0058] 2020.04.21 10:11:20 Server A application -------- Release Jar hot deployment ------------> xxx-Demo-V1.Jar

[0059] 2020.04.21 18:31:29 Server A application -------- Release Jar hot deployment ------------> xxx-Demo-V2.Jar

[0060] 2020.05.11 09:21:05 Server A application -------- Release Jar hot deployment ------------> xxx-Demo-V3.Jar

[0061] Server A releases three versions of Jar packages at three time points. When service A is restarted next time, the Jar package resources of the last successful deployment (Jar package components deployed on 2020.05.11) will be automatically loaded in reverse order of time points.

[0062] On the basis of the above-mentioned embodiments, the embodiments of the present invention dynamically initialize the Jar package component that was successfully deployed last time after any server in the server cluster is restarted, thereby ensuring the reliability of the system.

[0063] Furthermore, based on the above embodiment, each server in the server cluster is encapsulated with a Jar package loading and deployment tool class, which provides the functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports the deployment of different Jar package resources for multiple businesses.

[0064] Encapsulates the general Jar package loading and deployment tool class (which can be implemented by inheriting the URLClassLoader class) and provides the following methods:

[0065] (1) Load and deploy Jar (loadJar), ​​(2) Get the built-in class of the Jar package (loadClass), (3) Unload Jar package resources (unloadJar).

[0066] The Jar package loading and deployment tool class supports the deployment of different Jar package resources for multiple businesses. The names can be customized and maintained in memory, for example: deploying Axxx.Jar for business A, deploying Bxxx.Jar for business B, and deploying Cxxx.Jar for business C.

[0067] The in-memory mapping is maintained as follows:

[0068] AxxxName-------------Axxx.Jar resource

[0069] BxxxName-------------Bxxx.Jar resource

[0070] CxxxName-------------Cxxx.Jar resource

[0071] The name can be customized and can be obtained based on the name when using the specified business Jar resource.

[0072] On the basis of the above embodiments, the embodiments of the present invention improve practicality by setting a Jar package loading and deployment tool class to load and deploy Jar package components, obtain Jar package component built-in classes and uninstall Jar package components, and support the deployment of different Jar package resources for multiple businesses.

[0073] Figure 2 FIG. 1 is a flow chart of a Jar package component hot deployment method provided by an embodiment of the present invention. Figure 2 As shown:

[0074] Note 1:

[0075] [Through the three elements of the jar package]

[0076] According to the three elements, assemble the private server warehouse directory address (this address is the address of a directory in the private server warehouse), request this address, obtain the html tag content, parse out the specific address of the jar package in the private server warehouse (jar url), and then download the jar package file.

[0077] (eg: groupId=com.xxx.contract, artifactId=contract-controls, version=1.1.28-SNAPSHOT)

[0078] Request "Maven Private Server Warehouse Service" to obtain the Html tag content, parse the Html tag through jsoup, and obtain the specific jar access address

[0079] (eg:http: / / maven.xxxxxx.com / content / groups / xx-Search-Group / com / xxx / contract / contract-controls / 1.1.28-SNAPSHOT / contract-controls-1.1.28-20200507.071329-4.jar)

[0080]

Through jar url

[0081] The jar url method is simple and does not require a series of parsing to obtain the jar url. However, in the development process, programmers are faced with the three elements of jar. It would be more convenient to use if the three elements of jar are provided. The jar url method is just to manually go to the private server warehouse to find the url address of the file, and only manually do the parsing step. In terms of ease of use, the three elements of jar are more convenient and faster, and do not require manual participation.

[0082] Figure 3 This is an example diagram of Html tag content in a text tool in a Jar package component hot deployment method provided in an embodiment of the present invention. Figure 4 This is an example diagram of Html tag content in a browser in a Jar package component hot deployment method provided in an embodiment of the present invention.

[0083] Figure 5 FIG. 1 is a schematic diagram of hot deployment interaction of Jar package components provided by an embodiment of the present invention. Figure 5As shown, FeClient (user terminal) sends a publishing request to the publishing request receiving server, and the publishing request receiving server publishes the permission verification information to the user center (permission control center), and the permission control center returns the permission confirmation information. The publishing request receiving server obtains the publishing lock, obtains concurrent permissions, and returns the result asynchronously to the user terminal. The publishing request receiving server distributes the request to each server in the cluster to execute the deployment. Each server in the deployment server cluster requests the Maven private server warehouse to obtain the Jar resources, and obtains the Jar resources to load and deploy the operation. The publishing request receiving server releases the publishing lock. FeClient sends the query publishing result information to any server in the deployment server cluster, and receives the hot deployment status result returned by the server.

[0084] "Publish receive request server" receiving parameter example:

[0085] Jar package three elements: groupId, artifactId, version

[0086] To publish the hot deployment server list serverIps: [10.26.14.41,10.33.150.163,10.33.158.73]

[0087] Distribute to each server according to serverIps to perform hot deployment operations.

[0088] The Jar package component hot deployment method provided by the embodiment of the present invention has the following characteristics:

[0089] 1. Loading and deployment based on Jar packages (multiple files), which can be used in development, testing, and production environments. It is highly flexible and can independently load and unload classes.

[0090] 2. Jar package file download does not require the local installation of Maven environment. You can locate the Jar package file directory of the "private server warehouse" through the "three elements", parse the Html tag, and obtain the latest Jar resource specific location. The advantage of this method is that it is simple and convenient, and does not require additional environment or Maven configuration.

[0091] 3. You can flexibly load external and internal Jar resource files of the system by providing only three elements or the specific address of Jar.

[0092] 4. Simple and easy to use, with less external dependence.

[0093] The Jar package component hot deployment method provided by the embodiment of the present invention supports hot deployment in Jar url address mode and Jar three-element mode, and can dynamically parse the latest Jar information in real time; users can selectively perform grayscale hot deployment on online servers, that is, users can select the server to be deployed for operation; provide retrieval of the hot deployment operation results of this time, and retrieval of the detailed status results of the hot deployment of each cluster server deployed this time (it can be checked whether the deployment of each server in this operation is successful); in response to the service restart situation, the Jar package resources of the most recent successful deployment can be dynamically initialized.

[0094] Figure 6 FIG. 1 is a schematic diagram of the structure of a Jar package component hot deployment system provided by an embodiment of the present invention. Figure 6 As shown, the system includes: a user terminal 10, a server cluster 20 and a private server warehouse 30, wherein: the user terminal 10 is used to send a publishing request to any server in the server cluster 20, and the server receiving the publishing request is a publishing request receiving server, and the publishing request includes the Jar package three elements of the Jar package component to be deployed and the information of the server cluster for executing the deployment, or, the publishing request includes the Jar url address of the Jar package component to be deployed and the information of the server cluster for executing the deployment, and the Jar The url address is the storage address of the Jar package component in the private server warehouse 30, the execution deployment server cluster is a subset of the server cluster 20, and the execution deployment server cluster includes at least one server to deploy the Jar package component; the publishing request receiving server is used to send the publishing request to the execution deployment server cluster; each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private server warehouse 30 according to the three elements of the Jar package and the private server warehouse address, download the Jar package component according to the storage address and complete the hot deployment operation, or, each server of the execution deployment server cluster is used to download the Jar package component according to the Jarurl address and complete the hot deployment operation. .

[0095] The embodiment of the present invention includes the three elements of the Jar package or the Jar url address in the publishing request sent by the user terminal, obtains the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, and then downloads the Jar package component and completes the hot deployment operation, or downloads the Jar package component according to the Jar url address and completes the hot deployment operation, thereby realizing the deployment of the Jar package to the formal environment without restarting the server, thereby reducing the communication, docking, and joint debugging costs between the docking business parties.

[0096] Furthermore, when each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private server warehouse 30 according to the three elements of the Jar package and the private server warehouse address, it is specifically used to: obtain the private server warehouse directory address according to the three elements of the Jar package and the private server warehouse address, request the private server warehouse directory address to obtain the corresponding Html tag, and parse the Html tag to obtain the storage address of the Jar package component in the private server warehouse 30.

[0097] On the basis of the above embodiments, the embodiments of the present invention obtain the private server warehouse directory address by splicing the three elements of the Jar package and the private server warehouse address, request the private server warehouse directory address to obtain the corresponding Html tag, parse the Html tag to obtain the storage address of the Jar package component in the private server warehouse, and realize the rapid acquisition of the storage address of the Jar package component in the private server warehouse.

[0098] Furthermore, the publishing request also includes a user terminal identification. Before the publishing request receiving server is used to send the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: send the user terminal identification to the authority control center so that the authority control center can verify the publishing authority of the user terminal 10 corresponding to the user terminal identification; after the authority control center verifies the publishing authority of the user terminal 10 corresponding to the user terminal identification, the authority confirmation information sent by the authority control center is received.

[0099] On the basis of the above-mentioned embodiment, the embodiment of the present invention improves the system security by sending the publishing request to the execution deployment server cluster after verifying the publishing authority of the user terminal.

[0100] Furthermore, after the publishing request receiving server is used to receive the permission confirmation information sent by the permission control center and before sending the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: obtain a publishing lock, thereby obtaining the permission to send the publishing request to the execution deployment server cluster in parallel; and release the publishing lock after each server in the execution deployment server cluster completes the hot deployment operation.

[0101] The embodiment of the present invention acquires a publishing lock before sending a publishing request to a deployment execution server cluster, and releases the publishing lock after each server in the deployment execution server cluster completes a hot deployment operation, thereby saving system resources.

[0102] Furthermore, after each server of the deployment execution server cluster is used to download the Jar package component according to the storage address and complete the hot deployment operation or after each server of the deployment execution server cluster is used to download the Jar package component according to the Jar url address and complete the hot deployment operation, each server of the deployment execution server cluster is also used to store the operation record data.

[0103] On the basis of the above-mentioned embodiments, the embodiments of the present invention store the operation records for data after downloading the Jar package components and completing the hot deployment operation, which is beneficial to query and manage the deployment status of the Jar package components.

[0104] Furthermore, the user terminal 10 is further configured to: send a hot deployment operation result query request to any server in the deployment execution server cluster, and receive a hot deployment status result sent by any server after receiving the hot deployment operation result query request.

[0105] On the basis of the above embodiments, the embodiment of the present invention sends a hot deployment operation result query request to any server in the deployment server cluster through a user terminal to query the hot deployment status result, thereby realizing effective management of the hot deployment status.

[0106] Furthermore, any one of the servers in the server cluster 20 is further used to: dynamically initialize the Jar package component that was successfully deployed last time after restarting.

[0107] On the basis of the above-mentioned embodiments, the embodiments of the present invention dynamically initialize the Jar package component that was successfully deployed last time after any server in the server cluster is restarted, thereby ensuring the reliability of the system.

[0108] Furthermore, each server in the server cluster 20 is encapsulated with a Jar package loading and deployment tool class, which provides functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports deployment of different Jar package resources for multiple services.

[0109] On the basis of the above embodiments, the embodiments of the present invention improve practicality by setting a Jar package loading and deployment tool class to load and deploy Jar package components, obtain Jar package component built-in classes and uninstall Jar package components, and support the deployment of different Jar package resources for multiple businesses.

[0110] The system provided in the embodiment of the present invention is used for the above method. The specific functions can refer to the above method flow and will not be repeated here.

[0111] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A Jar package component hot deployment method, characterized in that: include: The user terminal sends a publishing request to any server in the server cluster. The server that receives the publishing request is the publishing request receiving server. The publishing request includes the three elements of the Jar package component to be deployed and the information of the execution deployment server cluster. The execution deployment server cluster is a subset of the server cluster. The execution deployment server cluster includes at least one server on which the Jar package component is to be deployed. The three elements of the Jar package and the project program files are stored separately. The publishing request receiving server sends the publishing request to the execution deployment server cluster, and each server of the execution deployment server cluster obtains the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, downloads the Jar package component according to the storage address and completes the hot deployment operation. The three elements of the Jar package are not configured inside the project and do not need to rely on additional environment or Maven configuration; The step of obtaining the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address specifically includes: The private server warehouse directory address is obtained by splicing the three elements of the Jar package and the private server warehouse address, the private server warehouse directory address is requested to obtain the corresponding Html tag, and the Html tag is parsed by jsoup to obtain the storage address of the Jar package component in the private server warehouse.

2. The Jar package component hot deployment method according to claim 1, characterized in that: The publishing request also includes a user terminal identifier. Before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method also includes: The publishing request receiving server sends the user terminal identifier to the authority control center so that the authority control center can verify the publishing authority of the user terminal corresponding to the user terminal identifier; after the authority control center verifies the publishing authority of the user terminal corresponding to the user terminal identifier, the publishing request receiving server receives the authority confirmation information sent by the authority control center.

3. The Jar package component hot deployment method according to claim 2 is characterized in that: After the publishing request receiving server receives the permission confirmation information sent by the permission control center and before the publishing request receiving server sends the publishing request to the execution deployment server cluster, the method further includes: The publishing request receiving server obtains a publishing lock, thereby obtaining the authority to send the publishing requests to the execution deployment server cluster in parallel; and, after each server in the execution deployment server cluster completes the hot deployment operation, the publishing lock is released.

4. The Jar package component hot deployment method according to claim 1, characterized in that: After downloading the Jar package component according to the storage address and completing the hot deployment operation, the method further includes: each server in the deployment execution server cluster stores the operation record as data.

5. The Jar package component hot deployment method according to claim 4 is characterized in that: The method further includes: the user terminal sends a hot deployment operation result query request to any server in the deployment execution server cluster, and after receiving the hot deployment operation result query request, the any server sends a hot deployment status result to the user terminal.

6. The Jar package component hot deployment method according to claim 1, characterized in that: The method further comprises: After any server in the server cluster is restarted, the Jar package component that was successfully deployed last time is dynamically initialized.

7. The method according to claim 1, characterized in that Each server in the server cluster is encapsulated with a Jar package loading and deployment tool class, which provides functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports deployment of different Jar package resources for multiple services.

8. A Jar package component hot deployment system, characterized in that: It includes user terminals, server clusters and private server warehouses, including: The user terminal is used to send a publishing request to any server in the server cluster, and the server receiving the publishing request is a publishing request receiving server, wherein the publishing request includes three elements of the Jar package component to be deployed and information of the execution deployment server cluster, and the execution deployment server cluster is a subset of the server cluster, and the execution deployment server cluster includes at least one server on which the Jar package component is to be deployed; wherein the three elements of the Jar package and the project program files are stored separately; The publishing request receiving server is used to send the publishing request to the execution deployment server cluster; each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, download the Jar package component according to the storage address and complete the hot deployment operation. The three elements of the Jar package are not configured inside the project and do not need to rely on additional environment or Maven configuration; When each server of the execution deployment server cluster is used to obtain the storage address of the Jar package component in the private server warehouse according to the three elements of the Jar package and the private server warehouse address, it is specifically used to: obtain the private server warehouse directory address according to the three elements of the Jar package and the private server warehouse address, request the private server warehouse directory address to obtain the corresponding Html tag, and obtain the storage address of the Jar package component in the private server warehouse by parsing the Html tag through jsoup.

9. The Jar package component hot deployment system according to claim 8, characterized in that: The publishing request also includes a user terminal identification. Before the publishing request receiving server is used to send the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: send the user terminal identification to the authority control center so that the authority control center can verify the publishing authority of the user terminal corresponding to the user terminal identification; after the authority control center has successfully verified the publishing authority of the user terminal corresponding to the user terminal identification, receive the authority confirmation information sent by the authority control center.

10. The Jar package component hot deployment system according to claim 9, characterized in that: After the publishing request receiving server is used to receive the permission confirmation information sent by the permission control center and before sending the publishing request to the execution deployment server cluster, the publishing request receiving server is also used to: obtain a publishing lock to obtain the permission to send the publishing request to the execution deployment server cluster in parallel; and release the publishing lock after each server in the execution deployment server cluster completes the hot deployment operation.

11. The Jar package component hot deployment system according to claim 8, characterized in that: After each server in the deployment server cluster is used to download the Jar package component according to the storage address and complete the hot deployment operation, each server in the deployment server cluster is also used to store the operation record.

12. The Jar package component hot deployment system according to claim 11, characterized in that: The user terminal is further used to: send a hot deployment operation result query request to any server in the deployment execution server cluster, and receive a hot deployment status result sent by the any server after receiving the hot deployment operation result query request.

13. The Jar package component hot deployment system according to claim 8, characterized in that: Any server in the server cluster is further used to: dynamically initialize the Jar package component that was successfully deployed last time after restarting.

14. The Jar package component hot deployment system according to claim 8, characterized in that: Each server in the server cluster is encapsulated with a Jar package loading and deployment tool class, which provides functions of loading and deploying Jar package components, obtaining Jar package component built-in classes, and uninstalling Jar package components, and supports deployment of different Jar package resources for multiple services.