Distributed-based application service deployment method, device and electronic equipment
By retrieving information from application service and server data tables, and selecting target application services and servers, distributed deployment is achieved, solving the flexibility problem of application service deployment methods, allowing independent selection and deployment, and improving deployment flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 中国邮政储蓄银行股份有限公司
- Filing Date
- 2023-02-27
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies have poor flexibility in application service deployment methods, making it impossible to deploy independently on a single server, and the environment-bound nature of these methods results in insufficient deployment flexibility.
By retrieving relevant information from the application data table and the server data table, the target application service and the target server are selected. Based on the distributed deployment method, the target application service is deployed to the target server, allowing independent selection and deployment without being restricted by the test environment dimension.
It enables independent deployment of each application service and server, improving deployment flexibility and allowing new servers and application services to be deployed in the current test environment, avoiding the limitations of template binding.
Smart Images

Figure CN116149686B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of test environment deployment technology, and more specifically, to a method, apparatus, and electronic device for deploying distributed application services. Background Technology
[0002] Currently, when deploying a core bank component (application system, also known as a business system) in an automated environment, application services (which are deployed to servers to run) are typically deployed at the environment level. For example, six A application services are deployed on test environment 1. The servers corresponding to these six application services are bound to test environment 1. When test environment 1 is selected for deployment, the application services on these six servers can only be deployed with the same version. If you want to deploy a new version of the application service on one of the servers, independent deployment is not supported.
[0003] Therefore, when automatically deploying an application service in the current test environment, it is necessary to first establish an environment. Deploying the application service involves simultaneously deploying it on all servers within that environment. Deployment is not possible on servers outside this environment, making it impossible to select a single server for individual application service deployment. Thus, the current solution only allows deployment of independent application services within a single environment, and cannot deploy multiple independent application services within a single environment, resulting in poor flexibility in application service deployment. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, and electronic device for deploying application services based on distributed systems, so as to at least solve the problem of poor flexibility in the deployment methods of application services in the prior art.
[0005] To achieve the above objectives, according to one aspect of this application, a method for deploying distributed application services is provided, comprising: obtaining application-related information of an application service from an application data table, and selecting one of a plurality of application services as a target application service based on the application-related information, wherein the application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service; obtaining server-related information of a server from a server data table, and selecting at least one of a plurality of servers as a target server based on the server-related information, wherein the server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server; deploying the target application service to the target server, and determining the current test environment as the target test environment, wherein the current test environment is an environment in which the target application service is running on the target server, and / or, the target application service is redeployed to a non-target server, and / or, the target server has an environment in which a non-target application service is running.
[0006] Optionally, selecting one of the multiple application services as the target application service based on the application-related information includes: obtaining a first preset condition, the first preset condition including at least one of the following: the name of the application service is the target name, the type of the application service is the target type, and the version of the application service is the target version; selecting the application service that meets the first preset condition from the multiple application services as the target application service based on the application-related information; selecting at least one of the multiple servers as the target server based on the server-related information includes: obtaining a second preset condition, the second preset condition including at least one of the following: the server's memory is greater than a memory threshold, the server's running speed is greater than a running speed threshold, the server's name is the target name, and the server's bandwidth is greater than a bandwidth threshold; selecting the server that meets the second preset condition from the multiple servers as the target server based on the server-related information.
[0007] Optionally, deploying the target application service to the target server includes: packaging the application-related information of the target application service and the target application service into an installation package, and sending the installation package to the target server, so that the target server deploys the target application service based on the installation package.
[0008] Optionally, after deploying the target application service to the target server, the method further includes: obtaining configuration-related information of the configuration center system from a configuration data table, and selecting a target configuration center system that meets a third preset condition from a plurality of configuration center systems based on the configuration-related information, wherein the configuration-related information includes at least one of the following: the name of the configuration center system, the type of the configuration center system, and the third preset condition includes at least one of the following: the name of the configuration center system is a target name, and the type of the configuration center system is a target type; obtaining registration-related information of the registration center system from a registration data table, and selecting a target registration center system that meets a fourth preset condition from a plurality of registration center systems based on the registration-related information. The registration-related information includes at least one of the following: the name of the registration center system, the type of the registration center system, and the fourth preset condition includes at least one of the following: the name of the registration center system is the target name, the type of the registration center system is the target type; database-related information of the database is obtained from the database data table, and a target database that meets the fifth preset condition is selected from multiple databases based on the database-related information, wherein the database-related information includes at least one of the following: the name of the database, the type of the database, the number of connections to the database, and the fifth preset condition includes at least one of the following: the name of the database is the target name, the type of the database is the target type, and the number of connections to the database does not exceed the maximum number of connections.
[0009] Optionally, after selecting a target configuration center system that meets the third preset condition from multiple configuration center systems, the method further includes: establishing a communication connection between multiple target servers and the target configuration center system, or establishing a communication connection between one target server and the target configuration center system; after selecting a target registry system that meets the fourth preset condition from multiple registry systems, the method further includes: establishing a communication connection between multiple target servers and the target registry system, or establishing a communication connection between one target server and the target registry system; after selecting a target database that meets the fifth preset condition from multiple databases, the method further includes: establishing a communication connection between multiple target servers and the target database, or establishing a communication connection between one target server and the target database.
[0010] Optionally, the method further includes: obtaining the number of application services deployed on the target server; if the number of application services is greater than or equal to a service quantity threshold, updating the deployment status of the target server to an undeployable state, wherein if the deployment status of the target server is the undeployable state, the undeployed application services are not deployed to the target server; obtaining the number of servers connected to the target configuration center system; if the number of servers is greater than or equal to a configuration quantity threshold, updating the connection status of the target configuration center system to an unconnectable state, wherein if the connection status of the target configuration center system is the unconnectable state, the unconnected servers do not connect to the target configuration center. The system establishes a connection; it obtains the number of servers already connected to the target registry system, and if the number of servers is greater than or equal to a registration number threshold, it updates the connection status of the target registry system to an unconnectable state. When the connection status of the target registry system is in the unconnectable state, the unconnected servers do not establish a connection with the target registry system. The system also obtains the number of servers already connected to the target database, and if the number of servers is greater than or equal to a server number threshold, it updates the connection status of the target database to an unconnectable state. When the connection status of the target database is in the unconnectable state, the unconnected servers do not establish a connection with the target database.
[0011] Optionally, after deploying the target application service to the target server, the method further includes: generating a deployment template based on the deployment method of the target application service and the target server, wherein the deployment template includes at least the application-related information of the target application service and the server-related information of the target server; and storing the deployment template in a REDIS database.
[0012] Optionally, the method further includes: executing verification logic before selecting at least one of the multiple servers as the target server based on the server-related information, wherein the verification logic includes at least one of the following: whether the server name is empty, whether the server's memory is full, and whether the server's running speed is 0; executing the verification logic before deploying the target application service to the target server; and executing the verification logic after deploying the target application service to the target server.
[0013] According to another aspect of this application, a deployment apparatus for a distributed application service is provided, comprising: a first processing unit, configured to obtain application-related information of an application service from an application data table, and select one of a plurality of application services as a target application service based on the application-related information, wherein the application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service; a second processing unit, configured to obtain server-related information of a server from a server data table, and select at least one of a plurality of servers as a target server based on the server-related information, wherein the server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server; and a third processing unit, configured to deploy the target application service to the target server, and determine the current test environment as the target test environment, wherein the current test environment is an environment in which the target application service is running on the target server, and / or, the target application service is redeployed to a non-target server, and / or, the target server has an environment in which a non-target application service is running.
[0014] According to another aspect of this application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including methods for performing any one of the methods described.
[0015] The technical solution of this application first obtains application-related information from the application data table, and selects one of multiple application services as the target application service based on the application-related information. Then, it obtains server-related information from the server data table, and selects at least one of multiple servers as the target server based on the server-related information. Finally, it deploys the target application service to the target server, and defines the current test environment as the target test environment. This solution allows for deployment of each application service individually, or application services on a single server, without binding application services, servers, and test environments. It eliminates the limitations of test environment-level deployment, enabling deployment of application services and servers outside the test environment, as well as deployment of new servers and application services within the current test environment. It is no longer limited to bound templates, making the deployment method more flexible and thus solving the problem of poor flexibility in application service deployment. Attached Figure Description
[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a distributed application service deployment method according to an embodiment of this application is shown.
[0018] Figure 2 A flowchart illustrating a method for deploying a distributed application service according to an embodiment of this application is shown.
[0019] Figure 3 A flowchart illustrating another method for deploying application services based on distributed systems is shown.
[0020] Figure 4 A structural block diagram of a distributed application service deployment apparatus provided according to an embodiment of this application is shown.
[0021] The above figures include the following reference numerals:
[0022] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] 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 clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] For ease of description, the following explains some of the nouns or terms used in the embodiments of this application:
[0026] Application service: A service that specifically implements a certain application function, such as deposit service or remittance service. Multiple application services can be deployed on a server, but generally, only one application service can be deployed on a server.
[0027] The current deployment method for applications is to deploy them in advance according to templates. For example, if there are 6 application services, they are all bound to the test environment. This direct binding method results in poor flexibility in the deployment of application services. If a low-version application service is deployed, all application services in this environment must be the same low version, and other application services in the environment cannot be configured. For example, 3 application services are low versions and 3 application services are high versions.
[0028] Therefore, in some solutions, the application service is deployed in the current test environment, following the selected template and push process step by step, which does not allow for flexible deployment.
[0029] In some solutions, the deployment process is relatively simplified because the test environment and application services are bound together. First, a specific deployment template is defined, and then the application services are deployed according to the test environment. This is convenient to operate, but it cannot realize complex deployment mechanisms in some special scenarios, nor can it enable the application services and test environment to be combined independently.
[0030] As described in the background section, the existing application service deployment methods are not very flexible. To address this issue, embodiments of this application provide a method, apparatus, and electronic device for deploying distributed application services.
[0031] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0032] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a distributed application service deployment method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0033] The memory 104 can be used to store computer programs, such as application service software programs and modules, like the computer program corresponding to the device information display method in this embodiment of the invention. The processor 102 executes various functional application services and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0034] This embodiment provides a method for deploying distributed application services running on a mobile terminal, computer terminal, or similar computing device. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] Figure 2 This is a flowchart illustrating a method for deploying a distributed application service according to an embodiment of this application. Figure 2 As shown, the method includes the following steps:
[0036] Step S201: Obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0037] Specifically, application data tables can be used to store application-related information associated with application services. This information can also be displayed on the interface, for example, as a dropdown menu, a radio button, or a table. This allows users to select the individual application service to be deployed and its corresponding version from multiple application services, instead of using the default version.
[0038] Step S202: Obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0039] Specifically, server data tables can be used to store server-related information, and this information can also be displayed on the interface, for example, as a drop-down list, a radio button, or a table. This allows you to select the individual server to be deployed from multiple services instead of using the default version.
[0040] Step S203: Deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment on which a non-target application service is running.
[0041] Specifically, this solution does not require environmental restrictions and allows for flexible deployment of application services to target servers. For example, a hybrid deployment mode combining environment and server names can be used. This allows for the deployment of independent application services on new servers outside the environment, as well as server expansion for a specific test, adding one or more new servers, and deploying multiple versions of application services on multiple servers.
[0042] For example, the test environment has 6 servers, each with an application service deployed. Different versions of the application service can be deployed on the 6 servers. For the deposit service, a corresponding interface can be developed. Version 1.0 of the application service (deposit service) can be deployed on 3 servers, and version 2.0 of the application service (deposit service) can be deployed on the other 3 servers. Generally, higher versions are compatible with lower versions of the application service. If a higher version of the application service cannot run, a lower version of the application service can still be used.
[0043] This embodiment first retrieves application-related information from the application data table, and then selects one of multiple application services as the target application service based on this information. Next, it retrieves server-related information from the server data table, and selects at least one of multiple servers as the target server based on this information. Finally, it deploys the target application service onto the target server, and designates the current test environment as the target test environment. This solution allows for deployment of each application service individually, or application services on individual servers, without binding application services, servers, and test environments. It eliminates the limitations of test environment-level deployment, enabling deployment of application services and servers outside the test environment, as well as deployment of new servers and application services within the current test environment. It is no longer limited to bound templates, making the deployment method more flexible and thus solving the problem of poor flexibility in application service deployment.
[0044] When selecting a specific target application service, one can filter from multiple application services to select the target application service to be deployed. Similarly, when selecting a specific target server, one can filter from multiple servers to select the target server to be deployed. Specifically, the process of selecting one of the multiple application services as the target application service based on the aforementioned application-related information can be achieved through the following steps: Obtaining a first preset condition, which includes at least one of the following: the name of the application service is the target name; the type of the application service is the target type; and the version of the application service is the target version; selecting the application service that meets the first preset condition from the multiple application services as the target application service based on the aforementioned application-related information; and selecting at least one of the multiple servers as the target server based on the aforementioned server-related information can be achieved through the following steps: Obtaining a second preset condition, which includes at least one of the following: the server's memory is greater than a memory threshold; the server's running speed is greater than a running speed threshold; the server's name is the target name; and the server's bandwidth is greater than a bandwidth threshold; and selecting the server that meets the second preset condition from the multiple servers as the target server based on the aforementioned server-related information.
[0045] In this scheme, a first preset condition can be used to filter out the target application service from multiple application services, so that the target application service can be deployed separately to achieve independent deployment of the application service. Alternatively, a second preset condition can be used to filter out the target server from multiple servers, so that the target server can be deployed separately to achieve independent deployment of the server.
[0046] Specifically, you can select servers by their IP address, choosing one or more servers, or even filtering servers in batches. You can also choose whether a server is used independently or in a hybrid configuration; in a hybrid configuration, multiple servers can be deployed.
[0047] Specifically, the target name in the first preset condition refers to the service name of the application service, the target type in the first preset condition refers to the service type of the application service, and the target version in the first preset condition refers to the service version of the application service. The target name in the second preset condition refers to the server name of the application server.
[0048] In order to deploy the application services and servers after the servers and application services are selected, so as to deploy the test environment, the deployment of the target application service to the target server in this application can be achieved by the following steps: packaging the application-related information of the target application service and the target application service into an installation package, and sending the installation package to the target server, so that the target server can deploy the target application service based on the installation package.
[0049] In this solution, the actual deployment process involves simply passing parameters. The application information and the target application service can be packaged together and the packaged installation package sent to the server. The server can then deploy the application service based on the installation package. The server is not actually moved; deployment is done directly by passing parameters.
[0050] In one embodiment of this application, after deploying the target application service to the target server, the method further includes the following steps: obtaining configuration-related information of the configuration center system from the configuration data table, and selecting a target configuration center system that meets a third preset condition from multiple configuration center systems based on the configuration-related information, wherein the configuration-related information includes at least one of the following: the name of the configuration center system, the type of the configuration center system, and the third preset condition includes at least one of the following: the name of the configuration center system is a target name, and the type of the configuration center system is a target type; obtaining registration-related information of the registration center system from the registration data table, and selecting a target registration center system that meets a fourth preset condition from multiple registration center systems based on the registration-related information. The central system, wherein the aforementioned registration-related information includes at least one of the following: the name of the aforementioned registration center system, the type of the aforementioned registration center system, and the aforementioned fourth preset condition includes at least one of the following: the name of the aforementioned registration center system is the target name, and the type of the aforementioned registration center system is the target type; database-related information of the database is obtained from the database data table, and based on the aforementioned database-related information, a target database that meets the fifth preset condition is selected from multiple of the aforementioned databases, wherein the aforementioned database-related information includes at least one of the following: the name of the aforementioned database, the type of the aforementioned database, and the number of connections to the aforementioned database, and the aforementioned fifth preset condition includes at least one of the following: the name of the aforementioned database is the target name, the type of the aforementioned database is the target type, and the number of connections to the aforementioned database does not exceed the maximum number of connections.
[0051] This solution also allows for flexible deployment of the configuration center system, registration center system, and data. When selecting a specific target configuration center system, it can be filtered from multiple configuration center systems to select the target configuration center system to be deployed. A third preset condition can be used to filter the target configuration center system from multiple configuration center systems, allowing for independent deployment of the target configuration center system. Similarly, when selecting a specific target registration center system, it can be filtered from multiple registration center systems to select the target registration center system to be deployed. A fourth preset condition can be used to filter the target registration center system from multiple registration center systems, allowing for independent deployment of the target registration center system. Finally, when selecting a specific target database, it can be filtered from multiple databases to select the target database to be deployed. A fifth preset condition can be used to filter the target database from multiple databases, allowing for independent deployment of the target database.
[0052] Specifically, selection can be based on the IP address of the configuration center system. Single or multiple configuration center systems can be selected, or batch filtering can be performed. Within each configuration center system, it can be chosen whether to use them independently or in a hybrid manner; when using them in a hybrid manner, multiple configuration center systems can be deployed.
[0053] Specifically, you can select by the IP address of the registry center system, and you can select one or more registry center systems. Of course, you can also filter registry center systems in batches. You can also choose whether to use the registry center system independently or in a hybrid manner. When using it in a hybrid manner, you can deploy multiple registry center systems.
[0054] Specifically, databases can be selected by IP address, and single or multiple databases can be selected, or databases can be filtered in batches. Databases can also be selected for independent or mixed use; when used in a mixed manner, multiple databases can be deployed.
[0055] Additionally, the target name in the third preset condition refers to the configuration center name of the configuration center system, and the target type in the third preset condition refers to the registry center name of the registry center system. The target name in the fourth preset condition refers to the registry center name of the registry center system, and the target type in the fourth preset condition refers to the registry center name of the registry center system. The target name in the fifth preset condition refers to the database name of the database, and the target type in the fifth preset condition refers to the database name of the database.
[0056] In some embodiments, after selecting a target configuration center system that meets the third preset condition from multiple configuration center systems, the method further includes the following steps: establishing a communication connection between multiple target servers and the target configuration center system, or establishing a communication connection between one target server and the target configuration center system; after selecting a target registry system that meets the fourth preset condition from multiple registry systems, the method further includes the following steps: establishing a communication connection between multiple target servers and the target registry system, or establishing a communication connection between one target server and the target registry system; after selecting a target database that meets the fifth preset condition from multiple databases, the method further includes the following steps: establishing a communication connection between multiple target servers and the target database, or establishing a communication connection between one target server and the target database.
[0057] In this scheme, multiple target servers can share a target configuration center system, or each target server can be configured with a separate target configuration center system. Multiple target servers can share a target registration center system, or each target server can be configured with a separate target registration center system. Multiple target servers can share a target database, or each target server can be configured with a separate target database.
[0058] If the number of application services deployed on the server is too large, it will cause server overload. If the number of servers deployed in the target configuration center system is too large, it will cause target configuration center system overload. If the number of servers deployed in the target registry system is too large, it will cause target registry system overload. If the number of servers communicating with the target database is too large, it will cause target database overload. In the specific implementation process, the above method also includes the following steps: obtaining the number of application services deployed on the target server; if the number of application services is greater than or equal to the service quantity threshold, updating the deployment status of the target server to an undeployable state; wherein, if the deployment status of the target server is in the undeployable state, the undeployed application services are not deployed to the target server; obtaining the number of servers connected to the target configuration center system; if the number of servers is greater than or equal to the configuration quantity threshold, updating the deployment status of the target configuration center system to an undeployable state. The connection status of the system is updated to an unconnectable state. When the connection status of the target configuration center system is in the unconnectable state, the unconnected servers do not establish a connection with the target configuration center system. The number of servers connected to the target registration center system is obtained. If the number of servers is greater than or equal to a registration number threshold, the connection status of the target registration center system is updated to an unconnectable state. When the connection status of the target registration center system is in the unconnectable state, the unconnected servers do not establish a connection with the target registration center system. The number of servers connected to the target database is obtained. If the number of servers is greater than or equal to a server number threshold, the connection status of the target database is updated to an unconnectable state. When the connection status of the target database is in the unconnectable state, the unconnected servers do not establish a connection with the target database.
[0059] This solution allows for limitations on the number of application services deployed on a server. If the number exceeds a certain threshold, no more application services will be deployed on that server, preventing server lag or overload caused by an excessive number of deployed services. Similarly, the number of servers deployed in the configuration center system can be limited; if the number exceeds a certain threshold, no more servers will be deployed for that configuration center system, preventing lag or overload caused by an excessive number of deployed servers. The same applies to the registry center system; if the number exceeds a certain threshold, no more servers will be deployed for that registry center system, preventing lag or overload caused by an excessive number of deployed servers. Furthermore, the number of servers used for database communication can be limited; if the number exceeds a certain threshold, no more servers will be deployed for that database, preventing database lag caused by an excessive number of servers connecting to the database. This ensures a more efficient deployment method.
[0060] After the application service, server, configuration center system, registration center system, and database have been deployed, you can check the boxes in the display interface to indicate that the information is correct. This will automatically install the corresponding data packages or data files according to the deployment method. Of course, this solution also supports deployment at the environment level. If you are deploying directly at the environment level, you don't need to confirm each deployment process; you can confirm only at the last step.
[0061] In another embodiment of this application, after the target application service is deployed to the target server, the method further includes the following steps: generating a deployment template according to the deployment method of the target application service and the target server, wherein the deployment template includes at least the application-related information of the target application service and the server-related information of the target server; and storing the deployment template in a REDIS database.
[0062] This solution not only allows for flexible deployment of application services and servers, but also allows the deployed test environment to be used as a deployment template and stored in the Redis database. This enables the existing environment to be deployed directly using the previously deployed test environment. Furthermore, the deployed template can be updated, further ensuring the flexibility of this solution.
[0063] To ensure higher efficiency in deploying application services, in another embodiment of this application, the method further includes the following steps: before selecting at least one of the multiple servers as the target server based on the server-related information, performing verification logic, wherein the verification logic includes at least one of the following: whether the name of the server is empty, whether the memory of the server is full, and whether the running speed of the server is 0; performing the verification logic before deploying the target application service to the target server; and performing the verification logic after deploying the target application service to the target server.
[0064] This solution can execute verification logic three times: before selecting the server, before deploying the application service to the server, and after deploying the application service to the server. This allows for pre- and post-checks of the server, as well as general and data-based verifications, to ensure that the server's operational status can be detected. This prevents deployment failures caused by server anomalies, thereby improving the deployment efficiency of this solution.
[0065] Specifically, if an error is detected after executing the verification logic, the application server can be temporarily suspended from deployment to the server. Instead, a corresponding prompt message can be displayed on the interface to promptly notify staff.
[0066] To enable those skilled in the art to better understand the technical solution of this application, the implementation process of the deployment method of distributed application services of this application will be described in detail below with reference to specific embodiments.
[0067] This embodiment relates to a specific method for deploying distributed application services, such as... Figure 3 As shown, it includes the following steps:
[0068] Step S1: Obtain application-related information of the application service from the application data table, and select the application service that meets the first preset condition from multiple application services based on the application-related information as the target application service.
[0069] Step S2: Obtain server-related information from the server data table, and select the server that meets the second preset condition from multiple servers based on the server-related information as the target server.
[0070] Step S3: Obtain configuration-related information of the configuration center system from the configuration data table, and select the target configuration center system that meets the third preset condition from multiple configuration center systems based on the configuration-related information;
[0071] Step S4: Obtain registration-related information of the registration center system from the registration data table, and select the target registration center system that meets the fourth preset condition from multiple registration center systems based on the registration-related information;
[0072] Step S5: Obtain database-related information from the database data table, and select the target database that meets the fifth preset condition from multiple databases based on the database-related information;
[0073] Step S6: Deploy the current test environment based on the target application service, target server, target configuration center system, target registry system, and target database.
[0074] This application also provides a deployment apparatus for distributed application services. It should be noted that this distributed application service deployment apparatus can be used to execute the deployment method for distributed application services provided in this application. This apparatus is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0075] The following describes the deployment apparatus for distributed application services provided in the embodiments of this application.
[0076] Figure 4 This is a structural block diagram of a distributed application service deployment device according to an embodiment of this application. Figure 4 As shown,
[0077] The first processing unit 10 is configured to obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0078] Specifically, application data tables can be used to store application-related information associated with application services. This information can also be displayed on the interface, for example, as a dropdown menu, a radio button, or a table. This allows users to select the individual application service to be deployed and its corresponding version from multiple application services, instead of using the default version.
[0079] The second processing unit 20 is used to obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0080] Specifically, server data tables can be used to store server-related information, and this information can also be displayed on the interface, for example, as a drop-down list, a radio button, or a table. This allows you to select the individual server to be deployed from multiple services instead of using the default version.
[0081] The third processing unit 30 is configured to deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is an environment in which the target application service is running on the target server, and / or, the target application service is redeployed to a non-target server, and / or, the target server is an environment in which a non-target application service is running.
[0082] Specifically, this solution does not require environmental restrictions and allows for flexible deployment of application services to target servers. For example, a hybrid deployment mode combining environment and server names can be used. This allows for the deployment of independent application services on new servers outside the environment, as well as server expansion for a specific test, adding one or more new servers, and deploying multiple versions of application services on multiple servers.
[0083] For example, the test environment has 6 servers, each with an application service deployed. Different versions of the application service can be deployed on the 6 servers. For the deposit service, a corresponding interface can be developed. Version 1.0 of the application service (deposit service) can be deployed on 3 servers, and version 2.0 of the application service (deposit service) can be deployed on the other 3 servers. Generally, higher versions are compatible with lower versions of the application service. If a higher version of the application service cannot run, a lower version of the application service can still be used.
[0084] In this embodiment, the first processing unit obtains application-related information of the application service from the application data table, and selects one of multiple application services as the target application service based on the application-related information. The second processing unit obtains server-related information of the server from the server data table, and selects at least one of multiple servers as the target server based on the server-related information. The third processing unit deploys the target application service to the target server and determines the current test environment as the target test environment. In this scheme, each application service can be deployed independently, or the application service can be deployed to the server independently. It does not bind application services, servers, and test environments, and there are no restrictions on deployment at the test environment level. This allows for the deployment of application services and servers outside the test environment, and also allows for the deployment of new servers and application services within the current test environment. It is no longer limited to bound templates, making the deployment method more flexible and thus solving the problem of poor flexibility in application service deployment methods.
[0085] When selecting a specific target application service, multiple application services can be filtered to select the target application service to be deployed. Similarly, when selecting a specific target server, multiple servers can be filtered to select the target server to be deployed. In the specific implementation process, the first processing unit includes a first acquisition module and a first selection module. The first acquisition module is used to acquire first preset conditions, which include at least one of the following: the name of the application service is the target name, the type of the application service is the target type, and the version of the application service is the target version. The first selection module is used to select the application service that meets the first preset conditions from multiple application services based on the application-related information, as the target application service. The second processing unit includes a second acquisition module and a second selection module. The second acquisition module is used to acquire second preset conditions, which include at least one of the following: the memory of the server is greater than a memory threshold, the running speed of the server is greater than a running speed threshold, the name of the server is the target name, and the bandwidth of the server is greater than a bandwidth threshold. The second selection module is used to select the server that meets the second preset conditions from multiple servers based on the server-related information, as the target server.
[0086] In this scheme, a first preset condition can be used to filter out the target application service from multiple application services, so that the target application service can be deployed separately to achieve independent deployment of the application service. Alternatively, a second preset condition can be used to filter out the target server from multiple servers, so that the target server can be deployed separately to achieve independent deployment of the server.
[0087] Specifically, you can select servers by their IP address, choosing one or more servers, or even filtering servers in batches. You can also choose whether a server is used independently or in a hybrid configuration; in a hybrid configuration, multiple servers can be deployed.
[0088] Specifically, the target name in the first preset condition refers to the service name of the application service, the target type in the first preset condition refers to the service type of the application service, and the target version in the first preset condition refers to the service version of the application service. The target name in the second preset condition refers to the server name of the application server.
[0089] In order to deploy the application services and servers after screening them to achieve the deployment of the test environment, the third processing unit of this application includes a processing module. The processing module is used to package the application-related information of the target application service and the target application service into an installation package, and send the installation package to the target server so that the target server can deploy the target application service based on the installation package.
[0090] In this solution, the actual deployment process involves simply passing parameters. The application information and the target application service can be packaged together and the packaged installation package sent to the server. The server can then deploy the application service based on the installation package. The server is not actually moved; deployment is done directly by passing parameters.
[0091] In one embodiment of this application, the apparatus further includes a fourth processing unit, a fifth processing unit, and a sixth processing unit. The fourth processing unit is configured to, after deploying the target application service to the target server, obtain configuration-related information of the configuration center system from a configuration data table, and select a target configuration center system that meets a third preset condition from among the multiple configuration center systems based on the configuration-related information. The configuration-related information includes at least one of the following: the name of the configuration center system, the type of the configuration center system, and the third preset condition includes at least one of the following: the name of the configuration center system is a target name, and the type of the configuration center system is a target type. The fifth processing unit is configured to obtain registration-related information of the registration center system from a registration data table, and select a target configuration center system that meets a third preset condition from among the multiple registration center systems based on the registration-related information. The target registration center system that meets the fourth preset condition, wherein the registration-related information includes at least one of the following: the name of the registration center system, the type of the registration center system, and the fourth preset condition includes at least one of the following: the name of the registration center system is the target name, and the type of the registration center system is the target type; the sixth processing unit is used to obtain database-related information of the database from the database data table, and select the target database that meets the fifth preset condition from multiple databases based on the database-related information, wherein the database-related information includes at least one of the following: the name of the database, the type of the database, and the number of connections to the database, and the fifth preset condition includes at least one of the following: the name of the database is the target name, the type of the database is the target type, and the number of connections to the database does not exceed the maximum number of connections.
[0092] This solution also allows for flexible deployment of the configuration center system, registration center system, and data. When selecting a specific target configuration center system, it can be filtered from multiple configuration center systems to select the target configuration center system to be deployed. A third preset condition can be used to filter the target configuration center system from multiple configuration center systems, allowing for independent deployment of the target configuration center system. Similarly, when selecting a specific target registration center system, it can be filtered from multiple registration center systems to select the target registration center system to be deployed. A fourth preset condition can be used to filter the target registration center system from multiple registration center systems, allowing for independent deployment of the target registration center system. Finally, when selecting a specific target database, it can be filtered from multiple databases to select the target database to be deployed. A fifth preset condition can be used to filter the target database from multiple databases, allowing for independent deployment of the target database.
[0093] Specifically, selection can be based on the IP address of the configuration center system. Single or multiple configuration center systems can be selected, or batch filtering can be performed. Within each configuration center system, it can be chosen whether to use them independently or in a hybrid manner; when using them in a hybrid manner, multiple configuration center systems can be deployed.
[0094] Specifically, you can select by the IP address of the registry center system, and you can select one or more registry center systems. Of course, you can also filter registry center systems in batches. You can also choose whether to use the registry center system independently or in a hybrid manner. When using it in a hybrid manner, you can deploy multiple registry center systems.
[0095] Specifically, databases can be selected by IP address, and single or multiple databases can be selected, or databases can be filtered in batches. Databases can also be selected for independent or mixed use; when used in a mixed manner, multiple databases can be deployed.
[0096] Additionally, the target name in the third preset condition refers to the configuration center name of the configuration center system, and the target type in the third preset condition refers to the registry center name of the registry center system. The target name in the fourth preset condition refers to the registry center name of the registry center system, and the target type in the fourth preset condition refers to the registry center name of the registry center system. The target name in the fifth preset condition refers to the database name of the database, and the target type in the fifth preset condition refers to the database name of the database.
[0097] In some embodiments, the above-described apparatus further includes a seventh processing unit, an eighth processing unit, and a ninth processing unit. The seventh processing unit is configured to establish a communication connection between multiple target servers and the target configuration center system, or to establish a communication connection between one target server and the target configuration center system, after selecting a target configuration center system that meets the third preset condition from multiple configuration center systems. The eighth processing unit is configured to establish a communication connection between multiple target servers and the target registration center system, or to establish a communication connection between one target server and the target registration center system, after selecting a target registration center system that meets the fourth preset condition from multiple registration center systems. The ninth processing unit is configured to establish a communication connection between multiple target servers and the target database, or to establish a communication connection between one target server and the target database, after selecting a target database that meets the fifth preset condition from multiple databases.
[0098] In this scheme, multiple target servers can share a target configuration center system, or each target server can be configured with a separate target configuration center system. Multiple target servers can share a target registration center system, or each target server can be configured with a separate target registration center system. Multiple target servers can share a target database, or each target server can be configured with a separate target database.
[0099] If the number of application services deployed on the server is too large, it will cause server overload. If the number of servers deployed in the target configuration center system is too large, it will cause target configuration center system overload. If the number of servers deployed in the target registry center system is too large, it will cause target registry center system overload. If the number of servers communicating with the target database is too large, it will cause target database overload. In specific implementation, the above device also includes a tenth processing unit, an eleventh processing unit, a twelfth processing unit, and a thirteenth processing unit. The tenth processing unit is used to obtain the number of application services deployed on the target server. If the number of application services is greater than or equal to a service quantity threshold, the deployment status of the target server is updated to an undeployable state. When the deployment status of the target server is undeployable, the undeployed application services are not deployed to the target server. The eleventh processing unit is used to obtain the number of servers connected to the target configuration center system. If the number of servers is greater than or equal to a configuration quantity threshold, the eleventh processing unit updates the deployment status of the target server to an undeployable state. In the following situations, the connection status of the target configuration center system is updated to an unconnectable state, wherein, when the connection status of the target configuration center system is in the unconnectable state, the unconnected servers do not establish a connection with the target configuration center system; the twelfth processing unit is used to obtain the number of servers connected to the target registration center system, and when the number of servers is greater than or equal to the registration number threshold, the connection status of the target registration center system is updated to an unconnectable state, wherein, when the connection status of the target registration center system is in the unconnectable state, the unconnected servers do not establish a connection with the target registration center system; the thirteenth processing unit is used to obtain the number of servers connected to the target database, and when the number of servers is greater than or equal to the server number threshold, the connection status of the target database is updated to an unconnectable state, wherein, when the connection status of the target database is in the unconnectable state, the unconnected servers do not establish a connection with the target database.
[0100] This solution allows for limitations on the number of application services deployed on a server. If the number exceeds a certain threshold, no more application services will be deployed on that server, preventing server lag or overload caused by an excessive number of deployed services. Similarly, the number of servers deployed in the configuration center system can be limited; if the number exceeds a certain threshold, no more servers will be deployed for that configuration center system, preventing lag or overload caused by an excessive number of deployed servers. The same applies to the registry center system; if the number exceeds a certain threshold, no more servers will be deployed for that registry center system, preventing lag or overload caused by an excessive number of deployed servers. Furthermore, the number of servers used for database communication can be limited; if the number exceeds a certain threshold, no more servers will be deployed for that database, preventing database lag caused by an excessive number of servers connecting to the database. This ensures a more efficient deployment method.
[0101] After the application service, server, configuration center system, registration center system, and database have been deployed, you can check the boxes in the display interface to indicate that the information is correct. This will automatically install the corresponding data packages or data files according to the deployment method. Of course, this solution also supports deployment at the environment level. If you are deploying directly at the environment level, you don't need to confirm each deployment process; you can confirm only at the last step.
[0102] In another embodiment of this application, the above-mentioned apparatus further includes a generation unit and a storage unit. The generation unit is used to generate a deployment template according to the deployment method of the target application service and the target server after the target application service is deployed to the target server. The deployment template includes at least the application-related information of the target application service and the server-related information of the target server. The storage unit is used to store the deployment template in the REDIS database.
[0103] This solution not only allows for flexible deployment of application services and servers, but also allows the deployed test environment to be used as a deployment template and stored in the Redis database. This enables the existing environment to be deployed directly using the previously deployed test environment. Furthermore, the deployed template can be updated, further ensuring the flexibility of this solution.
[0104] To ensure higher efficiency in deploying application services, in another embodiment of this application, the apparatus further includes a first execution unit, a second execution unit, and a third execution unit. The first execution unit is configured to execute verification logic before selecting at least one of the multiple servers as a target server based on the server-related information. The verification logic includes at least one of the following: whether the name of the server is empty, whether the memory of the server is full, and whether the running speed of the server is 0. The second execution unit is configured to execute the verification logic before deploying the target application service to the target server. The third execution unit is configured to execute the verification logic after deploying the target application service to the target server.
[0105] This solution can execute verification logic three times: before selecting the server, before deploying the application service to the server, and after deploying the application service to the server. This allows for pre- and post-checks of the server, as well as general and data-based verifications, to ensure that the server's operational status can be detected. This prevents deployment failures caused by server anomalies, thereby improving the deployment efficiency of this solution.
[0106] Specifically, if an error is detected after executing the verification logic, the application server can be temporarily suspended from deployment to the server. Instead, a corresponding prompt message can be displayed on the interface to promptly notify staff.
[0107] The aforementioned deployment device for distributed application services includes a processor and a memory. The first processing unit, the second processing unit, and the third processing unit are all stored as program units in the memory, and the processor executes the program units stored in the memory to implement the corresponding functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.
[0108] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the flexibility of application service deployment.
[0109] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0110] This invention provides a computer-readable storage medium that includes a stored program, wherein the program, when running, controls the device containing the computer-readable storage medium to execute the distributed application service deployment method.
[0111] Specifically, the deployment methods for distributed application services include:
[0112] Step S201: Obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0113] Step S202: Obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0114] Step S203: Deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment on which a non-target application service is running.
[0115] This invention provides a processor for running a program, wherein the program executes the deployment method for distributed application services.
[0116] Specifically, the deployment methods for distributed application services include:
[0117] Step S201: Obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0118] Step S202: Obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0119] Step S203: Deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment on which a non-target application service is running.
[0120] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs at least the following steps:
[0121] Step S201: Obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0122] Step S202: Obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0123] Step S203: Deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment on which a non-target application service is running.
[0124] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.
[0125] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having at least the following method steps:
[0126] Step S201: Obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service.
[0127] Step S202: Obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server.
[0128] Step S203: Deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment on which a non-target application service is running.
[0129] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0130] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0131] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this 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, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0132] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0133] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0134] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0135] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0136] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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 technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0137] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0138] As can be seen from the above description, the embodiments of this application achieve the following technical effects:
[0139] 1) The distributed application service deployment method of this application first obtains application-related information of the application service from the application data table, and selects one of multiple application services as the target application service based on the application-related information. Then, it obtains server-related information of the server from the server data table, and selects at least one of multiple servers as the target server based on the server-related information. Finally, it deploys the target application service to the target server and determines the current test environment as the target test environment. In this scheme, each application service can be deployed independently, or the application service can be deployed to a server independently, without binding application services, servers, and test environments. There are no restrictions on deployment at the test environment level. This allows for the deployment of application services and servers outside the test environment, and also allows for the deployment of new servers and application services within the current test environment, no longer limited to bound templates. This deployment method is more flexible and thus solves the problem of poor flexibility in application service deployment methods.
[0140] 2) The distributed application service deployment apparatus of this application comprises a first processing unit that retrieves application-related information from an application data table and selects one of multiple application services as the target application service based on the application-related information; a second processing unit that retrieves server-related information from a server data table and selects at least one of multiple servers as the target server based on the server-related information; and a third processing unit that deploys the target application service to the target server and determines the current test environment as the target test environment. In this scheme, each application service can be deployed independently, or the application service can be deployed to a server independently, without binding application services, servers, and test environments. There are no restrictions on deployment at the test environment level. This allows for the deployment of application services and servers outside the test environment, and also allows for the deployment of new servers and application services within the current test environment, no longer limited to bound templates. This deployment method is more flexible, thus solving the problem of poor flexibility in application service deployment methods.
[0141] 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 deploying distributed application services, characterized in that, include: The application-related information of the application service is obtained from the application data table, and one of the multiple application services is selected as the target application service based on the application-related information. The application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service. The server-related information of the server is obtained from the server data table, and at least one of the multiple servers is selected as the target server based on the server-related information. The server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server. The target application service is deployed to the target server, and the current test environment is determined as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment in which a non-target application service is running; After deploying the target application service to the target server, the method further includes: obtaining configuration-related information of the configuration center system from a configuration data table, and selecting a target configuration center system that meets a third preset condition from a plurality of configuration center systems based on the configuration-related information, wherein the configuration-related information includes at least one of the following: the name of the configuration center system, the type of the configuration center system, and the third preset condition includes at least one of the following: the name of the configuration center system is a target name, and the type of the configuration center system is a target type; obtaining registration-related information of the registration center system from a registration data table, and selecting a target registration center system that meets a fourth preset condition from a plurality of registration center systems based on the registration-related information, wherein... The registration-related information includes at least one of the following: the name of the registration center system, the type of the registration center system, and the fourth preset condition includes at least one of the following: the name of the registration center system is the target name, the type of the registration center system is the target type; the database-related information of the database is obtained from the database data table, and based on the database-related information, a target database that meets the fifth preset condition is selected from multiple databases, wherein the database-related information includes at least one of the following: the name of the database, the type of the database, the number of connections to the database, and the fifth preset condition includes at least one of the following: the name of the database is the target name, the type of the database is the target type, and the number of connections to the database does not exceed the maximum number of connections.
2. The method according to claim 1, characterized in that, Selecting one application service from multiple application services as the target application service based on the application-related information includes: Obtain a first preset condition, which includes at least one of the following: the name of the application service is a target name, the type of the application service is a target type, and the version of the application service is a target version; Based on the application-related information, select the application service that meets the first preset condition from among the multiple application services as the target application service; Selecting at least one target server from a plurality of servers based on the server-related information includes: Obtain a second preset condition, which includes at least one of the following: the server's memory is greater than a memory threshold, the server's running speed is greater than a running speed threshold, the server's name is the target name, and the server's bandwidth is greater than a bandwidth threshold. Based on the server-related information, the server that meets the second preset condition is selected from a plurality of servers as the target server.
3. The method according to claim 1, characterized in that, Deploying the target application service to the target server includes: The application-related information of the target application service and the target application service are packaged into an installation package, and the installation package is sent to the target server so that the target server can deploy the target application service based on the installation package.
4. The method according to claim 1, characterized in that, After selecting a target configuration center system that meets the third preset condition from among multiple configuration center systems, the method further includes: Establish communication connections between multiple target servers and the target configuration center system, or establish a communication connection between one target server and the target configuration center system; After selecting a target registry system that meets the fourth preset condition from among multiple registry systems, the method further includes: Establish communication connections between multiple target servers and the target registry system, or establish a communication connection between one target server and the target registry system; After selecting a target database that meets the fifth preset condition from multiple databases, the method further includes: Establish communication connections between multiple target servers and the target database, or establish a communication connection between one target server and the target database.
5. The method according to claim 1, characterized in that, The method further includes: The number of application services deployed on the target server is obtained. If the number of application services is greater than or equal to the service quantity threshold, the deployment status of the target server is updated to an undeployable state. If the deployment status of the target server is the undeployable state, the undeployed application services are not deployed to the target server. The number of servers connected to the target configuration center system is obtained. If the number of servers is greater than or equal to the configuration number threshold, the connection status of the target configuration center system is updated to an unconnectable state. In the case that the connection status of the target configuration center system is the unconnectable state, the unconnected servers do not establish a connection with the target configuration center system. The number of servers that the target registry system has connected to is obtained. If the number of servers is greater than or equal to the registration number threshold, the connection status of the target registry system is updated to an unconnectable state. In the case that the connection status of the target registry system is the unconnectable state, the unconnected servers do not establish a connection with the target registry system. The number of servers that the target database has connected to is obtained. If the number of servers is greater than or equal to a server number threshold, the connection status of the target database is updated to an unconnectable state. When the connection status of the target database is the unconnectable state, the unconnected servers do not establish a connection with the target database.
6. The method according to claim 1, characterized in that, After deploying the target application service to the target server, the method further includes: A deployment template is generated based on the deployment method of the target application service and the target server, wherein the deployment template includes at least the application-related information of the target application service and the server-related information of the target server; The deployment template is stored in the REDIS database.
7. The method according to claim 1, characterized in that, The method further includes: Before selecting at least one of the multiple servers as the target server based on the server-related information, a verification logic is executed, wherein the verification logic includes at least one of the following: whether the server name is empty, whether the server's memory is full, and whether the server's running speed is 0. The verification logic is executed before the target application service is deployed to the target server; After the target application service is deployed to the target server, the verification logic is executed.
8. A deployment device for distributed application services, characterized in that, include: The first processing unit is configured to obtain application-related information of the application service from the application data table, and select one of the multiple application services as the target application service based on the application-related information, wherein the application-related information includes at least one of the following: the name of the application service, the type of the application service, and the version of the application service; The second processing unit is used to obtain server-related information from the server data table, and select at least one of the multiple servers as the target server based on the server-related information, wherein the server-related information includes at least one of the following: the memory size of the server, the running speed of the server, the name of the server, and the bandwidth of the server; The third processing unit is configured to deploy the target application service to the target server and determine the current test environment as the target test environment, wherein the current test environment is the target server on which the target application service is running, and / or the target application service is redeployed to a non-target server, and / or the target server is an environment in which a non-target application service is running; The device further includes a fourth processing unit, a fifth processing unit, and a sixth processing unit. The fourth processing unit is configured to, after deploying the target application service to the target server, obtain configuration-related information of the configuration center system from a configuration data table, and select a target configuration center system that meets a third preset condition from among the multiple configuration center systems based on the configuration-related information. The configuration-related information includes at least one of the following: the name of the configuration center system, the type of the configuration center system, and the third preset condition includes at least one of the following: the name of the configuration center system is a target name, and the type of the configuration center system is a target type. The fifth processing unit is configured to obtain registration-related information of the registration center system from a registration data table, and select a target configuration center system that meets the fourth preset condition from among the multiple registration center systems based on the registration-related information. The target registry system is defined by the following conditions: the registration-related information includes at least one of the following: the name of the registry system, the type of the registry system; the fourth preset condition includes at least one of the following: the name of the registry system is the target name, the type of the registry system is the target type; the sixth processing unit is used to obtain database-related information from the database data table, and select a target database that meets the fifth preset condition from multiple databases based on the database-related information, wherein the database-related information includes at least one of the following: the name of the database, the type of the database, the number of connections to the database; the fifth preset condition includes at least one of the following: the name of the database is the target name, the type of the database is the target type, the number of connections to the database does not exceed the maximum number of connections.
9. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising methods for performing any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for deploying application services on server
CN108279906A
Project deployment method and device, electronic equipment and storage medium
CN112764753A