Service deployment method and device, equipment, storage medium and program product

Through the service deployment template automated deployment service, the problem of low reusability of service deployment solutions in the existing technology is solved, efficient automated deployment in different environments is achieved, and development efficiency is improved.

CN119225751APending Publication Date: 2024-12-31CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411522785.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The low reusability of service deployment solutions in the prior art leads to the need to rebuild the deployment process when facing different environments, resulting in inefficient development.

Method used

By introducing a service deployment template, we can judge and associate the target service environment information based on the service deployment request, and automatically deploy services to the target environment. It is suitable for multiple service deployments and avoid rebuilding the deployment process.

Benefits of technology

Improve the reusability of service deployment solutions, reduce manual operations, and improve development efficiency and automated deployment capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119225751A_ABST
    Figure CN119225751A_ABST
Patent Text Reader

Abstract

The invention provides a service deployment method and device, equipment, a storage medium and a program product, and relates to the technical field of software development. The method comprises the steps of obtaining a service deployment request; according to the target deployment type of the to-be-deployed service, determining whether a target service deployment template corresponding to the target deployment type exists; if the target service deployment template corresponding to the to-be-deployed service exists, judging whether target service environment information exists in the target service deployment template or not; if the target service deployment template does not contain the target service environment information, associating the target service environment information in the target service deployment template with the service deployment request; and executing the service deployment request, calling the target service deployment template, and deploying the to-be-deployed service to a service environment corresponding to the target service environment information. According to the method provided by the invention, the reusability of the service deployment scheme is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a service deployment method, apparatus, device, storage medium and program product. Background Art

[0002] In modern software development, with the increasing frequency of software version iterations, the corresponding service deployment of software development also faces the challenge of rapid iteration. In order to solve the challenges of service deployment in existing software development technologies, cloud computing technology and software development technology are combined, virtualization technology and container technology are introduced, and automated service construction and deployment are achieved through continuous integration and continuous deployment.

[0003] In the prior art, after the service-related programs are written and uploaded to the corresponding code repository, the deployment of the service can be roughly divided into two stages. The first stage is the construction of the service, which is to build the service in combination with the code repository corresponding to the service and generate the corresponding container image; the second stage is the deployment of the service, which is to configure the specific deployment information of the service through the deployment platform and deploy the service in the cloud platform.

[0004] However, when services in the prior art are deployed in different environments, it is necessary to re-execute the deployment process or modify the deployment configuration information, which leads to the problem of low reusability of the service deployment solution in the prior art. Summary of the invention

[0005] The present application provides a service deployment method, apparatus, device, storage medium and program product to solve the technical problem of low system development efficiency in the prior art.

[0006] In a first aspect, the present application provides a service deployment method, comprising:

[0007] Obtain a service deployment request, which includes target service environment information where the service to be deployed needs to be deployed;

[0008] According to the target deployment type of the service to be deployed, determining whether there is a target service deployment template corresponding to the target deployment type; wherein the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template;

[0009] If there is a target service deployment template corresponding to the service to be deployed, determine whether the target service deployment template contains target service environment information;

[0010] If the target service deployment template does not include the target service environment information, then the target service environment information included in the service deployment request is added to the target service deployment template;

[0011] Associating the target service environment information in the target service deployment template with the service deployment request;

[0012] Execute the service deployment request, call the target service deployment template, and deploy the service to be deployed to the service environment corresponding to the target service environment information.

[0013] In a possible design, before associating the target service environment information in the target service deployment template with the service deployment request, the following is further included:

[0014] Create a service version and code branch corresponding to the service to be deployed; the service version is used to maintain the version information of the service to be deployed after creation or update, and the code branch is used to provide code support for the construction of the service to be deployed.

[0015] In a possible design, the target service deployment template further includes container orchestration information, where the container orchestration information includes container information of the service to be deployed and the service to be deployed of the subsidiary service of the service to be deployed;

[0016] Accordingly, before executing the service deployment request, calling the target service deployment template, and deploying the service to be deployed into the service environment corresponding to the target service environment information, the method further includes:

[0017] If the first container orchestration information in the target service deployment template is inconsistent with the second container orchestration information carried in the service deployment request, the target service deployment template is updated according to the second container orchestration information.

[0018] In a possible design, the target service deployment template also includes a pipeline sub-template, interface information for calling the pipeline sub-template, and a code repository address.

[0019] In one possible design, the method includes:

[0020] If there is no target service deployment template corresponding to the service to be deployed, the target service deployment template is written according to the preset template writing strategy based on the pipeline sub-template, interface information, code warehouse address, target service environment information and second container orchestration information.

[0021] In one possible design, the target deployment type includes front-end deployment or back-end deployment.

[0022] In a second aspect, the present application provides a service deployment device, including:

[0023] An acquisition module is used to acquire a service deployment request, where the service deployment request includes target service environment information where the service to be deployed needs to be deployed;

[0024] A first processing module is used to determine whether there is a target service deployment template corresponding to the target deployment type according to the target deployment type of the service to be deployed; wherein the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template;

[0025] The second processing module is used to determine whether the target service deployment template contains target service environment information when there is a target service deployment template corresponding to the service to be deployed;

[0026] A third processing module is used to add the target service environment information included in the service deployment request to the target service deployment template when the target service deployment template does not include the target service environment information;

[0027] A fourth processing module, configured to associate the target service environment information in the target service deployment template with the service deployment request;

[0028] The execution module is used to execute the service deployment request, call the target service deployment template, and deploy the service to be deployed to the service environment corresponding to the target service environment information.

[0029] In a possible design, the fourth processing module is further used for:

[0030] Create a service version and code branch corresponding to the service to be deployed; the service version is used to maintain the version information of the service to be deployed after creation or update, and the code branch is used to provide code support for the construction of the service to be deployed.

[0031] In a possible design, the target service deployment template further includes container orchestration information, where the container orchestration information includes container information of the service to be deployed and the service to be deployed of the subsidiary service of the service to be deployed;

[0032] Accordingly, before executing the service deployment request, calling the target service deployment template, and deploying the service to be deployed into the service environment corresponding to the target service environment information, the execution module is further used to:

[0033] When the first container orchestration information in the target service deployment template is inconsistent with the second container orchestration information carried in the service deployment request, the target service deployment template is updated according to the second container orchestration information.

[0034] In a possible design, the target service deployment template also includes a pipeline sub-template, interface information for calling the pipeline sub-template, and a code repository address.

[0035] In a possible design, the second processing module is further used for:

[0036] When there is no target service deployment template corresponding to the service to be deployed, the target service deployment template is written according to the preset template writing strategy based on the pipeline sub-template, interface information, code warehouse address, target service environment information and second container orchestration information.

[0037] In one possible design, the target deployment type includes front-end deployment or back-end deployment.

[0038] In the third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the service deployment method as described in the first aspect above and various possible designs of the first aspect.

[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the service deployment method as described in the first aspect and various possible designs of the first aspect are implemented.

[0040] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the service deployment method as described in the first aspect and various possible designs of the first aspect.

[0041] The service deployment method, apparatus, device, storage medium and program product provided by the present application obtain the deployment request corresponding to the service to be deployed, and determine whether there is a corresponding target service deployment template for the service deployment request; when the target service deployment template exists, determine whether the target service template contains the corresponding target service environment information, and if so, associate the target service environment information in the target service template with the service deployment request; and call the target service template to execute the service deployment request, and deploy the service to be deployed to the service environment corresponding to the target service environment information. The present application realizes the automatic deployment of services through service deployment templates, and is applicable to a variety of services; when there is a service that is compatible with the service deployment template and needs to be deployed, it is only necessary to associate the environment information in the service deployment template with the corresponding service deployment request, and there is no need to rebuild the service deployment process, thereby improving the reusability of the service deployment solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] Figure 1 The process of the service deployment method provided in the embodiment of the present application Figure 1 ;

[0044] Figure 2 The process of the service deployment method provided in the embodiment of the present application Figure 2 ;

[0045] Figure 3 A schematic diagram of a process flow of a method for deploying an application provided in an embodiment of the present application;

[0046] Figure 4 A flow chart of a service deployment request execution method provided in an embodiment of the present application;

[0047] Figure 5 A flowchart of a service deployment task execution method provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of an application deployment device provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of the structure of a service deployment device provided in an embodiment of the present application;

[0050] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0051] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0052] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0053] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.

[0054] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0055] Terminology explanation:

[0056] Containers: are a lightweight form of virtualization that allow developers to package an application and all its dependencies together to run consistently in any environment.

[0057] Cluster: A system composed of multiple computers or nodes. It is a powerful computing architecture that combines multiple computing nodes together to not only improve the performance and availability of the system, but also provide fault tolerance in the face of failures.

[0058] Cloud platform: refers to an environment for sharing computing resources and delivering services provided through the Internet.

[0059] Kubernetes: is an open source container orchestration platform for automating the deployment, scaling, and management of containerized applications.

[0060] Pod: In Kubernetes, Pod is the basic deployment unit, which represents a collection of one or more containers. These containers share storage, network, and run together on the same host.

[0061] In the prior art, when deploying a service, it is necessary to manually create a pipeline and deploy the container image corresponding to the service to the container platform. This requires cross-platform operations, and each deployment to a new environment requires re-operation. In order to solve the complexity of cross-platform operations, the prior art combines pipelines and container deployment to jointly process the two important stages of service deployment, and uses the deployment operation as a step in the pipeline, thereby solving the problem of cross-platform operations.

[0062] However, in actual service deployment, when the environment of service deployment changes, it is necessary to re-adapt the changed environment in the pipeline and deployment, and the corresponding environment information needs to be modified; and if there are multiple services in an application, it is still necessary to manually deploy multiple services one by one. When the environment of each service deployment is different, it is still necessary to modify the existing service deployment process or solution. For example, there are three services in an application, two microservices and one middleware service. There is an inconsistency between the deployment environment of the two microservices and the deployment environment of the middleware service, and the middleware service can only be deployed after the two microservices are deployed. Then, when deploying the service in the application, first create a deployment process for the service based on the basic information or deployment information of the service, and execute the deployment process; when the next service to be deployed is a middleware service, due to the inconsistent deployment environment, it is necessary to re-create the deployment process. Therefore, it can be known that the deployment tools and deployment solutions provided by the prior art cannot fully meet the deployment of multiple different types of services, resulting in the technical problem of low reusability of the existing deployment solutions.

[0063] In response to the above technical problems, the present application proposes the following technical concept: the cross-platform solution for solving the complex deployment of multiple platforms in the prior art does not take into account the environmental requirements of the service in the actual deployment, resulting in low reusability of the service deployment solution. In actual applications, the deployment environment of the service involves multiple links in the service deployment process. If modification is required, the entire deployment process needs to be rebuilt. Therefore, the service deployment process can be templated and the service environment information can be associated. Developers can perform association processing based on the service deployment request and the environmental information in the service deployment template, so that when the service deployment is required, the adapted template can be directly called and the corresponding environmental information can be associated to achieve effective deployment of the service, thereby achieving the effect of improving the reusability of the service deployment solution.

[0064] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0065] Figure 1 The process of the service deployment method provided in the embodiment of the present application Figure 1 .like Figure 1 As shown, the service deployment method includes:

[0066] S101. Obtain a service deployment request.

[0067] In this step, the service deployment request includes target service environment information where the service to be deployed needs to be deployed.

[0068] Optionally, the target service environment information includes: a service environment identifier and cluster information; the service environment identifier is a unique identifier of the cloud environment in which the target service is deployed, and the cluster information is information of the cloud platform in which the target service is deployed. The cluster information includes at least one of the following: infrastructure information in the cluster, load balancing information, storage configuration information, network configuration information, cluster management information, security configuration information, service deployment strategy, environment variables, and container image information. The container image information refers to the container image repository used by the service to be deployed and the container image version to be built. The environment variable refers to the configuration that the service to be deployed needs to be injected into the container or instance. The deployment strategy refers to the resource allocation strategy or service deployment strategy adopted when the container corresponding to the service to be deployed is deployed in the cluster. The security configuration refers to the data encryption method or permission control method of the cluster. The cluster management information refers to the allocation management tool and the monitoring tool in the cluster. The network configuration information refers to the virtual private cloud configuration and the subnet configuration in the cluster. The storage configuration information refers to the storage type and data backup strategy in the cluster. The load balancing information refers to the load balancing strategy in the cluster. The infrastructure information refers to the node information and node connection information in the cluster.

[0069] In this step, the method of obtaining the service deployment request can be any of the following: receiving the service deployment request sent by the client based on the API; using the message queue system to receive and process the service deployment request; providing a command line tool to obtain the service deployment request based on the input service deployment instruction.

[0070] S102: Determine, according to the target deployment type of the service to be deployed, whether there is a target service deployment template corresponding to the target deployment type.

[0071] In this step, the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template; the target deployment type includes front-end deployment or back-end deployment.

[0072] It should be noted that the classification criteria for the target deployment type in this embodiment are the underlying technologies used by the services to be deployed, which can be mainly divided into two categories: front-end services and back-end services. In actual applications, there may be multiple categories of specific deployment types, but they can generally be divided into these two categories.

[0073] S103: If there is a target service deployment template corresponding to the service to be deployed, determine whether the target service deployment template contains target service environment information.

[0074] Optionally, the target service deployment template also includes a pipeline sub-template, interface information for calling the pipeline sub-template, and a code repository address. The service deployment request also carries the second container orchestration information corresponding to the service to be deployed.

[0075] Optionally, in another possible implementation, if there is no target service deployment template corresponding to the service to be deployed, the target service deployment template is written according to the preset template writing strategy based on the pipeline sub-template, interface information, code repository address, target service environment information and second container orchestration information.

[0076] Among them, the pipeline sub-template specifies the construction process of the service to be deployed, from the submission of the service code to the generation of the corresponding container image, and pushing the container image to the image repository. The specific construction process can also include continuous integration, code review, and integration testing of the service to be deployed. This application does not limit the specific construction process in the pipeline sub-template. In actual applications, users can customize the construction process based on the pipeline sub-template.

[0077] It should be noted that the interface information is the calling interface information provided by the management tool corresponding to the pipeline sub-template. The corresponding management tool can be called through the interface information to implement the construction process specified in the pipeline sub-template based on the management tool.

[0078] The code repository address is the repository address used to store code files for services to be deployed. The code repository is used to host engineering codes for enterprises or individual users, and can update code branches in the code repository based on the addition or update of services.

[0079] The preset template writing strategy refers to how to create the association between the pipeline sub-template, interface information, code warehouse address, target service environment information and second container orchestration information, and determine the writing order of each information in the service deployment template.

[0080] Exemplarily, the pipeline sub-template has a unique corresponding identifier, and the target service environment information includes a unique service environment identifier; then the association relationship can be created by creating a mapping relationship between the pipeline sub-template identifier, interface information, code warehouse address, and service environment identifier and the identifier of the second container orchestration information. The second container orchestration information is the container orchestration information of the service to be deployed, including the container information of the service to be deployed and the to-be-deployed service of the subsidiary service of the service to be deployed.

[0081] S104: If the target service deployment template does not include the target service environment information, then the target service environment information included in the service deployment request is added to the target service deployment template.

[0082] This step involves updating the target service deployment template, which is used to add the target service environment information of the service to be deployed in the target service deployment template to ensure that the service to be deployed can be deployed to the corresponding environment when the service is deployed.

[0083] S105: Associating the target service environment information in the target service deployment template with the service deployment request.

[0084] Optionally, before associating the target service environment information with the service deployment request, it is also necessary to create a service version and a code branch corresponding to the service to be deployed.

[0085] Among them, the service version is used to maintain the version information of the service to be deployed after it is created or updated, and the code branch is used to provide code support for the construction of the service to be deployed.

[0086] In this step, the service deployment template includes multiple service environment information.

[0087] In this step, the association can be achieved by mapping the identification information of the service to be deployed in the service deployment request to the target service environment information, or mapping the service version and container image version of the service to be deployed to the target service environment information.

[0088] Exemplarily, a possible implementation method of associating the target service environment information in the target service deployment template with the service deployment request may be:

[0089] A1. Create a mapping rule for each environment information field in the target service deployment template.

[0090] In this step, the mapping rules can be stored using key-value pairs, databases, or configuration files.

[0091] A2. Parse the service deployment request, extract the environment information in the service deployment request, and match the environment information in the service deployment request with the fields in the template according to a preset mapping rule.

[0092] A3. Determine that the environment information extracted from the service deployment request is consistent with the environment information required by the mapping rule in the target service deployment template.

[0093] A4. Generate a specific deployment plan or deployment strategy based on the matching environment information.

[0094] In this step, the deployment plan or deployment strategy contains all the steps and configurations required in the deployment process to facilitate successful deployment in the target service environment.

[0095] S106: Execute the service deployment request, call the target service deployment template, and deploy the service to be deployed to the service environment corresponding to the target service environment information.

[0096] In this step, the target service deployment template also includes container orchestration information, and the container orchestration information includes container information of the service to be deployed and the service to be deployed of the subsidiary service of the service to be deployed.

[0097] The container information of the service to be deployed includes the number of container copies of the service to be deployed, processor information, memory information, environment variables, configuration file information, and mount storage configuration information. The services to be deployed of the dependent services include the type of the dependent services, the number of dependent services, the association between the dependent services and the service to be deployed, and the container image information of the dependent services.

[0098] For example, if the container management platform used by the service to be deployed is Kubernetes, the service to be deployed can be regarded as the main service corresponding to a Pod, and the subsidiary service of the service to be deployed belongs to the subsidiary service in the Pod. The types of subsidiary services can be: log collection and data monitoring. The service to be deployed corresponds to the main container in the Pod, and the subsidiary service corresponds to the subsidiary container in the Pod.

[0099] Accordingly, before executing the service deployment request, it is also necessary to determine whether the container orchestration information needs to be updated, specifically:

[0100] If the first container orchestration information in the target service deployment template is inconsistent with the second container orchestration information carried in the service deployment request, the target service deployment template is updated according to the second container orchestration information.

[0101] The inconsistency of the orchestration information may include: inconsistency in the number of subsidiary services, inconsistency in the types of subsidiary services, and inconsistency in the container information of the service to be deployed.

[0102] In this embodiment, the deployment order of the ancillary services is not restricted. In actual applications, the deployment order of the ancillary services is related to the business types processed by the services to be deployed. Generally, the ancillary services will be deployed after the deployment of the services to be deployed is completed.

[0103] The service deployment method provided in the embodiment of the present application obtains the deployment request corresponding to the service to be deployed, and determines whether there is a corresponding target service deployment template for the service deployment request; when there is a target service deployment template, determines whether the target service deployment template contains the target service environment information corresponding to the service to be deployed; if so, associates the target service environment information in the target service template with the service deployment request; and calls the target service template to execute the service deployment request, and deploys the service to be deployed to the service environment corresponding to the target service environment information. The present application realizes the automatic deployment of services through service deployment templates, and is applicable to a variety of services; when there is a service that is compatible with the service deployment template and needs to be deployed, it is only necessary to associate the environment information in the service deployment template with the corresponding service deployment request, and there is no need to rebuild the service deployment process, thereby improving the reusability of the service deployment solution.

[0104] Figure 2 The process of the service deployment method provided in the embodiment of the present application Figure 2 .exist Figure 1 Based on the embodiment shown, how to implement the deployment of multiple services in an application is introduced at the application deployment level, such as Figure 2 As shown, the method comprises the following steps:

[0105] S201. In response to a deployment request of a target application, basic deployment information of the target application is obtained.

[0106] In this step, the basic deployment information of the target application includes: multiple services to be deployed of the target application and the deployment order of the multiple services to be deployed.

[0107] Exemplarily, this step is based on Figure 3 Further explanation of the deployment order of multiple services to be deployed. Figure 3 A schematic diagram of a process flow of a deployment method of an application provided in an embodiment of the present application. Figure 3 As shown, the target application contains four services to be deployed, and the application framework used by the target application is a microservice architecture, where service 1, service 2, and service 4 are microservices without dependencies, and service 2 is a middleware service that depends on the running result of service 1 to run. In the service deployment sequence of the target application, service 2 must be deployed after service 1, and the specific deployment sequence can be: step 1: deploy service 1, service 2, and service 4 in parallel; step 2: deploy service 2 after service 1.

[0108] S202: Obtain a service deployment request for each service to be deployed based on the basic deployment information.

[0109] In this step, based on the services to be deployed in the deployment basic information, the service environment information and container orchestration information of each service to be deployed are determined, and the service deployment request is determined based on the services to be deployed, the service environment information and the container orchestration information.

[0110] S203: Respond to and execute the service deployment request of each service to be deployed based on the deployment order.

[0111] In this step, the request response and execution of the services to be deployed can be multi-threaded or single-threaded. As long as the deployment order of the services to be deployed with dependencies remains unchanged, other services to be deployed can execute corresponding service deployment requests in parallel, thereby improving the efficiency of service deployment.

[0112] In this embodiment, multiple services to be deployed are deployed in sequence according to a predetermined deployment order of services in a target application, and service deployment can be implemented in a multi-threaded manner, thereby improving the efficiency of service deployment.

[0113] Based on the above embodiments, Figure 4 As shown, this application proposes a method for executing a service deployment request. Figure 4 A flow chart of a service deployment request execution method provided in an embodiment of the present application. The method includes:

[0114] B1. Based on the target deployment type carried in the service deployment request corresponding to the current service to be deployed, determine whether there is a corresponding target service deployment template.

[0115] B2. If there is a corresponding target service deployment template, a deployment task for the service to be deployed is created based on the target service deployment template.

[0116] B3. Determine whether the first container orchestration information in the target service deployment template is consistent with the second container orchestration information in the service deployment request.

[0117] B4. If the container orchestration information is inconsistent, the target service deployment template is updated according to the second container orchestration information.

[0118] B5. Create the version and code branch corresponding to the service to be deployed.

[0119] B6. Associating the target service environment information in the target service deployment template with the service deployment request.

[0120] In this step, the target service environment information is associated with the service deployment request. It is necessary to determine whether the target service deployment template contains the target service environment information. If not, it is added to the target service deployment template. If it is included, it is directly associated.

[0121] B7. If there is no corresponding target service deployment template, write the target service deployment template according to the pipeline sub-template, interface information, code warehouse address, target service environment information and second container orchestration information, according to the preset template writing strategy, and associate the target service environment information in the target service deployment template with the service deployment request.

[0122] B8. Call the target service deployment template to execute the deployment task of the service to be deployed.

[0123] In this embodiment, the container orchestration information in the service deployment template is compared with the container orchestration information in the service deployment request to update the container orchestration information; and the target service environment information and the service deployment request are associated to achieve the mapping of the service deployment request to the target service environment information; thereby, without rebuilding the template and deployment process, rapid deployment of services can be achieved based on the existing template.

[0124] Based on the above embodiments, the present application embodiment provides a method for executing a service deployment task. Figure 5 A flow chart of a method for executing a service deployment task provided in an embodiment of the present application. Figure 5 As shown, the method includes six stages, specifically: pending stage, building stage, building check stage, deployment stage, deployment check stage and completion stage. The execution of tasks is implemented based on multiple task processors, specifically: C1, obtaining pending deployment tasks; C2, constructing a container image based on the building processor to implement the deployment task; C3, checking the build status of the deployment task based on the building status check processor; C4, deploying tasks based on the deployment processor; C5, checking the deployment status of the deployment task based on the deployment status check processor; C6, determining that the deployment task is completed when the deployment status shows that the deployment is successful. Each stage may include multiple deployment tasks. By periodically scanning the deployment task list, the corresponding tasks are obtained for processing. When a task completes the processing of this stage, it will enter the next stage to guide the task to complete, and the number of threads of each task processor can be configured, and multiple tasks can be executed simultaneously to ensure the performance of the system. For example, Figure 5 As shown, deployment task 4 is in the pending stage, deployment task 1 and deployment task 6 are in the building stage, deployment task 5 is in the building check stage, deployment task 2 and deployment task 7 are in the deployment stage, deployment task 3 is in the deployment check stage, and deployment task 0 is in the completed stage.

[0125] The present application provides an application deployment device for implementing the above-mentioned embodiments. Figure 6 A schematic diagram of the structure of an application deployment device provided in an embodiment of the present application. Figure 6 As shown, the application deployment device includes: a basic information management module 601, a service deployment template module 602, a service management module 603 and an application management module 604.

[0126] Among them, the basic information management module 601 is used to implement pipeline sub-template management, specifically to define the construction process of the service to be deployed;

[0127] It is also used to implement pipeline source management, specifically to maintain the interface information of the management tool corresponding to the pipeline sub-template template;

[0128] It is also used for code repository source management, specifically maintaining the address information of the code repository;

[0129] It is also used for cluster management, specifically maintaining multiple service environment information.

[0130] The service deployment template module 602 is used to maintain container orchestration information, and associate the container orchestration information, the pipeline sub-template, the interface information corresponding to the pipeline source, the service environment information corresponding to the cluster management, and the code repository address, and determine it as a service deployment template.

[0131] The service management module 603 is used to maintain the basic information, environment information, version information, container orchestration information and service deployment records of the service. The basic information of the service includes the unique identifier of the service and the code repository address corresponding to the service; the environment information of the service includes the environment identifier and cluster information of the service; the container orchestration information comes from the container orchestration information of the service deployment template, and can be updated based on the container orchestration information of the service to be deployed; the service deployment record includes the build status, deployment status and associated pipeline sub-templates during deployment.

[0132] The application management module 604 is used to maintain the basic information of the application, service arrangement information and record the application deployment. The basic information of the application includes the unique identification of the application and the description information of the application; the service arrangement information includes the type, quantity and deployment order of the deployed services in the application.

[0133] In this embodiment, the deployment template creation and service deployment of each service in the application can be realized through the application deployment device, and the deployment status of the application in the process of realizing service deployment can be displayed by saving the deployment record.

[0134] Figure 7 This is a schematic diagram of the structure of the service deployment device provided in the embodiment of the present application. Figure 7 As shown, the service deployment device 70 includes: an acquisition module 701, a first processing module 702 and a second processing module 703;

[0135] An acquisition module 701 is used to acquire a service deployment request, where the service deployment request includes target service environment information where the service to be deployed needs to be deployed;

[0136] The first processing module 702 is used to determine whether there is a target service deployment template corresponding to the target deployment type according to the target deployment type of the service to be deployed; wherein the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template;

[0137] The second processing module 703 is used to determine whether the target service deployment template includes target service environment information when there is a target service deployment template corresponding to the service to be deployed;

[0138] The third processing module 704 is used to add the target service environment information included in the service deployment request to the target service deployment template when the target service deployment template does not include the target service environment information;

[0139] The fourth processing module 705 is used to associate the target service environment information in the target service deployment template with the service deployment request;

[0140] The execution module 706 is used to execute the service deployment request, call the target service deployment template, and deploy the service to be deployed to the service environment corresponding to the target service environment information.

[0141] In some embodiments, the fourth processing module 705 is further configured to:

[0142] Create a service version and code branch corresponding to the service to be deployed; the service version is used to maintain the version information of the service to be deployed after creation or update, and the code branch is used to provide code support for the construction of the service to be deployed.

[0143] In some embodiments, the target service deployment template further includes container orchestration information, the container orchestration information including container information of the service to be deployed and the service to be deployed of the subsidiary service of the service to be deployed;

[0144] Accordingly, before executing the service deployment request, calling the target service deployment template, and deploying the service to be deployed into the service environment corresponding to the target service environment information, the execution module 706 is further used to:

[0145] When the first container orchestration information in the target service deployment template is inconsistent with the second container orchestration information carried in the service deployment request, the target service deployment template is updated according to the second container orchestration information.

[0146] In some embodiments, the target service deployment template also includes a pipeline sub-template, interface information for calling the pipeline sub-template, and a code warehouse address.

[0147] In some embodiments, the second processing module 703 is further configured to:

[0148] When there is no target service deployment template corresponding to the service to be deployed, the target service deployment template is written according to the preset template writing strategy based on the pipeline sub-template, interface information, code warehouse address, target service environment information and second container orchestration information.

[0149] In some embodiments, the target deployment type includes a front-end deployment or a back-end deployment.

[0150] The service deployment device provided in the embodiment of the present application can be used to execute the technical solution of the service deployment method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0151] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the first processing module 702 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the first processing module 702. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0152] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the electronic device 80 may include: a transceiver 801 , a processor 802 , and a memory 803 .

[0153] The processor 802 executes the computer-executable instructions stored in the memory, so that the processor 802 executes the solution in the above embodiment. The processor 802 can be a general-purpose processor, including a central processing unit CPU, a network processor (network processor, NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0154] The memory 803 is connected to the processor 802 via a system bus and implements communication therebetween. The memory 803 is used to store computer program instructions.

[0155] The transceiver 801 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0156] The system bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.

[0157] The service deployment device provided in the embodiment of the present application may be the processing terminal of the above-mentioned embodiment.

[0158] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the service deployment method in the above embodiment.

[0159] An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the service deployment method of the above embodiment.

[0160] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the service deployment method in the above embodiment.

[0161] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.

[0162] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0163] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0164] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.

[0165] It should be understood that the above processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.

[0166] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0167] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0168] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0169] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.

[0170] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

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

Claims

1. A service deployment method, characterized in that: include: Obtaining a service deployment request, wherein the service deployment request includes target service environment information on which the service to be deployed needs to be deployed; According to the target deployment type of the service to be deployed, determining whether there is a target service deployment template corresponding to the target deployment type; wherein the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template; If the target service deployment template corresponding to the service to be deployed exists, determining whether the target service deployment template contains the target service environment information; If the target service deployment template does not include the target service environment information, then adding the target service environment information included in the service deployment request to the target service deployment template; Associating the target service environment information in the target service deployment template with the service deployment request; The service deployment request is executed, the target service deployment template is called, and the service to be deployed is deployed to the service environment corresponding to the target service environment information.

2. The method according to claim 1, characterized in that Before associating the target service environment information in the target service deployment template with the service deployment request, the method further includes: Create a service version and a code branch corresponding to the service to be deployed; wherein the service version is used to maintain the version information of the service to be deployed after creation or update, and the code branch is used to provide code support for the construction of the service to be deployed.

3. The method according to claim 1, characterized in that: The target service deployment template further includes container orchestration information, where the container orchestration information includes container information of the service to be deployed and the service to be deployed of the subsidiary service of the service to be deployed; Accordingly, before executing the service deployment request, calling the target service deployment template, and deploying the service to be deployed into the service environment corresponding to the target service environment information, the method further includes: If the first container orchestration information in the target service deployment template is inconsistent with the second container orchestration information carried in the service deployment request, the target service deployment template is updated according to the second container orchestration information.

4. The method according to claim 3, characterized in that The target service deployment template also includes a pipeline sub-template, interface information for calling the pipeline sub-template, and a code warehouse address.

5. The method according to claim 4, characterized in that The method comprises: If the target service deployment template corresponding to the service to be deployed does not exist, the target service deployment template is written according to the pipeline sub-template, the interface information, the code repository address, the target service environment information and the second container orchestration information in accordance with a preset template writing strategy.

6. The method according to claim 1, characterized in that The target deployment type includes front-end deployment or back-end deployment.

7. A service deployment device, characterized in that: include: An acquisition module, used to acquire a service deployment request, wherein the service deployment request includes target service environment information on which the service to be deployed needs to be deployed; A first processing module is used to determine whether there is a target service deployment template corresponding to the target deployment type according to the target deployment type of the service to be deployed; wherein the service deployment template is used to deploy the service to the service environment corresponding to the service deployment template; A second processing module is used to determine whether the target service deployment template includes the target service environment information when there is the target service deployment template corresponding to the service to be deployed; A third processing module, configured to add the target service environment information included in the service deployment request to the target service deployment template when the target service deployment template does not include the target service environment information; A fourth processing module, configured to associate the target service environment information in the target service deployment template with the service deployment request; The execution module is used to execute the service deployment request, call the target service deployment template, and deploy the service to be deployed to the service environment corresponding to the target service environment information.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.