Application deployment method and device, equipment and storage medium

By integrating local resources, private cloud resources and public cloud resources, determining the deployment resources of the target service, and distributing service packages to the corresponding deployment resources for deployment, the existing technology cannot meet the rapid application under multi-type computing resources. The issues of iteration and continuous delivery have realized the hybrid deployment of applications and unified planning of resources.

CN119396419AActive Publication Date: 2025-02-07INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411341864.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2025-02-07
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

The existing deployment methods cannot meet the deployment needs of rapid iteration and continuous delivery of applications under multi-type computing resources.

Method used

By obtaining the service package and deployment parameters of the application to be deployed, integrating local resources, private cloud resources and public cloud resources, determining the deployment resources of the target service, and distributing the service package to the corresponding deployment resources for deployment.

Benefits of technology

It realizes hybrid deployment of applications under multiple types of computing resources, meets the needs of rapid iteration and continuous delivery, and improves the flexibility of application deployment and the optimization of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396419A_ABST
    Figure CN119396419A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and provides an application deployment method, device and equipment and a storage medium, and the method comprises the steps: obtaining a service package of each target service of a to-be-deployed application, and deployment parameters configured by each target service; obtaining available resources in the computing power resource pool, and determining deployment resources corresponding to the target services according to the deployment parameters and the available resources; the deployment resources comprise at least one of local resources, private cloud resources and public cloud resources, and the computing power resource pool is obtained by carrying out computing power fusion on the local resources, the private cloud resources and the public cloud resources; and distributing the service package of the target service to the corresponding deployment resource for deployment. By integrating the resources, hybrid deployment of the applications is achieved, unified planning and deployment of the computing power resources are achieved, the deployment requirements of rapid iteration and continuous delivery of the applications under multiple types of computing power resources are met, the flexibility of application deployment is improved, and resource configuration is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application deployment method, device, equipment and storage medium. Background Art

[0002] With the widespread application of cloud computing and microservice architecture, computing resources are showing a trend of core diversification and ubiquitous distribution. Computing resources are gradually extending to the edge and terminal sides, and the types of computing resources are gradually enriched, making the software deployment process more complex and diversified. While the computing network realizes the support of computing power for applications by coordinating the scheduling of multi-level computing power such as cloud computing, edge computing, and smart terminals, the traditional manual deployment method and the existing automatic deployment method in a single computing deployment environment can no longer meet the deployment requirements of rapid iteration and continuous delivery of applications under multiple types of computing resources. Summary of the invention

[0003] The present invention provides an application deployment method, apparatus, device and storage medium to address the defect that the existing deployment method cannot meet the deployment requirements of rapid iteration and continuous delivery of applications under multiple types of computing resources, and realize hybrid deployment of applications under multiple types of computing resources.

[0004] The present invention provides an application deployment method, comprising: Obtaining a service package of each target service of the application to be deployed, and deployment parameters configured for each target service; the deployment parameters include a deployment environment; Obtain available resources in a computing power resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; Distribute the service package of the target service to the deployment resources for deployment.

[0005] According to the application deployment method provided by the present invention, the step of distributing the service package of the target service to the deployment resource for deployment includes: Get the code scanning script file; Execute the code scanning script file, perform code scanning on the service package of the target service, and generate a scanning report; If it is determined according to the scan report that the service package of the target service has passed the scan, the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

[0006] According to the application deployment method provided by the present invention, sending the service package of the target service to the deployment directory of the deployment resource for deployment includes: If the deployment resources include local resources, sending the service package of the first target service to the deployment directory of the local resources; the first target service is the target service of the deployment resources being local resources; Running the service package of the first target service when the local resource environment is deployed to deploy the first target service; If the deployment resources include hybrid cloud resources, construct an image file of a service package of a second target service; the second target service is a target service whose deployment resources are hybrid cloud resources, and the hybrid cloud resources include at least one of private cloud resources and public cloud resources; Sending the service package of the second target service and the image file to the deployment directory of the hybrid cloud resources; When deployed in the hybrid cloud resource environment, running the image file to obtain a service container of the second target service; According to the configuration parameters in the deployment parameters of the second target service, service configuration is performed in the service container to deploy the second target service.

[0007] According to the application deployment method provided by the present invention, sending the service package of the target service to the deployment directory of the deployment resource for deployment includes: The service package of the target service is divided into multiple small files of preset sizes by adopting the segmented upload method; Concurrently uploading the multiple small files through multiple threads, sending the multiple small files to the deployment directory of the deployment resource, and monitoring the upload status of the multiple small files; The target small file that failed to be uploaded is determined according to the upload status, and the target small file is retried to be uploaded by adopting the breakpoint resume method, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

[0008] According to the application deployment method provided by the present invention, the step of obtaining the service packages of each target service of the application to be deployed includes: Pull the program code of each target service of the application to be deployed from the code repository; After the Nginx configuration is integrated into the program code, the program code is packaged and constructed to generate an executable file to obtain a service package of the target service; the Nginx configuration is used to start the Nginx service when the target service is deployed.

[0009] According to the application deployment method provided by the present invention, after distributing the service package of the target service to the deployment resource for deployment, the method further includes: Get the service name of the target service; According to the service name and the deployment resource where the target service is located, a test request is sent to the target service to detect whether communication with the target service is available.

[0010] According to the application deployment method provided by the present invention, after distributing the service package of the target service to the deployment resource for deployment, the method further includes: Obtain monitoring data of the target service; Determining whether the target service is deployed according to the monitoring data; When the target service is deployed, the running status of the target service is monitored according to the monitoring data.

[0011] The present invention also provides an application deployment device, comprising the following modules: An acquisition module, used to acquire the service packages of each target service of the application to be deployed, and the deployment parameters configured for each target service; the deployment parameters include the deployment environment; A partitioning module is used to obtain available resources in a computing resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; The deployment module is used to distribute the service package of the target service to the deployment resources for deployment.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-described application deployment methods when executing the computer program.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the application deployment method as described in any one of the above are implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned application deployment methods are implemented.

[0015] The application deployment method, device, equipment and storage medium provided by the present invention obtain computing resources by integrating local resources, private cloud resources and public cloud resources, and determine the deployment resources corresponding to the service of the application to be deployed according to the deployment parameters corresponding to the service of the application to be deployed and the available resources in the computing resource pool, so as to distribute the service to the corresponding deployment resource for deployment, and realize the hybrid deployment of the service under different computing resources. By integrating resources to realize the hybrid deployment of applications, unified planning and deployment of computing resources are realized, which is conducive to meeting the deployment requirements of rapid iteration and continuous delivery of applications under multiple types of computing resources, improving the flexibility of application deployment, and optimizing resource allocation. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 It is a flowchart of the application deployment method provided by the present invention.

[0018] Figure 2 It is a schematic diagram of the architecture of the deployment model provided by the present invention.

[0019] Figure 3 It is a schematic diagram of the application deployment process provided by the present invention.

[0020] Figure 4 It is a structural schematic diagram of the application deployment device provided by the present invention.

[0021] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0023] The embodiment of the present invention provides an application deployment method, which is based on DevOps automated deployment, integrates different types of computing resources, selects different combinations of hybrid deployment solutions according to different application scenarios and deployment requirements, and implements hybrid deployment of applications under multiple types of computing resources. It provides higher flexibility and scalability for the deployment and operation of applications, enables applications to easily adapt to different environments and business requirements, and implements continuous integration and deployment of applications, thereby meeting the deployment requirements of rapid iteration and continuous delivery of applications. The process-based deployment solution can also improve the overall quality and stability of applications.

[0024] Specifically, Figure 1 is a flow chart of the application deployment method provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 100, obtaining service packages of each target service of the application to be deployed, and deployment parameters configured for each target service; the deployment parameters include a deployment environment; Step 200, obtaining available resources in a computing resource pool, and determining deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing resource pool is obtained by integrating computing power of the local resources, the private cloud resources, and the public cloud resources; Step 300: Distribute the service package of the target service to the deployment resources for deployment.

[0025] Obtain the service packages of each target service of the application to be deployed, as well as the deployment parameters of each target service. An application to be deployed may include one or more target services to be deployed. The deployment parameters of the target service include the deployment environment and may further include the configuration parameters of the target service. The configuration parameters include but are not limited to the service concurrency, the number of access users, and QPS (Queries-per-second).

[0026] Optionally, the deployment parameters may be configured by the user or automatically generated based on the configuration parameters of the target service configured by the user.

[0027] Obtain the remaining available resources in the computing resource pool, and determine the deployment resources corresponding to the target service according to the deployment parameters of the target service and the remaining available resources, where the deployment resources include at least one of local resources, private cloud resources, and public cloud resources. The computing resource pool is obtained by integrating the computing power of local resources, private cloud resources, and public cloud resources.

[0028] Among them, local resources refer to local server resources that host software applications and data within the user organization, private cloud resources refer to cloud computing resources that users build through K8s or OpenStack to provide security, controllability, and customization, and public cloud resources refer to cloud computing resources provided by cloud service providers. Furthermore, local resources include but are not limited to physical servers, virtual machines, and storage devices, private cloud resources include but are not limited to cloud computing platforms and virtualization environments built by users themselves, and public cloud resources include but are not limited to cloud computing and cloud storage services provided by third parties.

[0029] Optionally, deployment resources come from a computing resource pool, which is obtained by integrating different types of deployment resources such as local resources, private cloud resources, and public cloud resources, thus realizing the integration and coordinated use of different deployment resources. When integrating different types of deployment resources, it is necessary to clearly identify the computing power, storage capacity, and network bandwidth of the resources, so as to provide a deployment configuration reference for the hybrid deployment of applications and ensure that the server provides the maximum computing power support while running stably.

[0030] Furthermore, when determining the deployment resources corresponding to each target service, it is also necessary to obtain the remaining available resources in the computing resource pool, and determine the deployment resources corresponding to the target service based on the deployment parameters and available resources of each target service.

[0031] Optionally, the deployment parameters also include a deployment mode. The deployment module includes single deployment and hybrid deployment. In the hybrid deployment mode, specifically, under the microservice architecture, multiple services are deployed under different types of resources, different services communicate with each other, and a service is deployed under multiple types of resources to ensure the rapid response of the service in computing environments such as the cloud and the edge.

[0032] Based on the integration of different types of deployment resources, users can select one or more different types of resources for deployment according to the functional characteristics of the service when deploying applications. The deployment parameters also include the service name, deployment resource name, deployment directory, number of nodes for service deployment, port number when the service is started, etc., which the user needs to specify when deploying the application. The configuration parameters of the service also include the resource parameters allocated to the service, which specifically include the service's processor CPU and memory size, so as to improve the resource utilization of the service.

[0033] According to the deployment resources corresponding to each target service, the service packages of each target service are respectively distributed to the corresponding deployment resources for service deployment, thereby completing the deployment of the application to be deployed. Distributing the service packages of the target services to the corresponding deployment resources for deployment includes sending the service packages of one target service to different deployment resources for deployment, and sending the service packages of multiple different target services to different deployment resources for deployment, and may also include sending the service packages of multiple different target services to the same deployment resource for deployment.

[0034] In one embodiment, corresponding deployment models are set for different deployment modes, and different deployment models correspond to different deployment processes. When distributing the service package of the target service to the corresponding deployment resources for deployment, the corresponding deployment model is selected according to the deployment mode corresponding to the application to be deployed, and the corresponding deployment process is executed according to the deployment model to distribute the service package of the target service to the corresponding deployment resources for deployment.

[0035] Furthermore, diverse applications correspond to diverse deployment environments. In the hybrid deployment mode, different deployment environments correspond to different deployment strategies. That is, in the deployment model corresponding to the hybrid deployment mode, different target services of the same application to be deployed correspond to different deployment strategies. According to the deployment strategy corresponding to each target service, the deployment of each target service is completed under the corresponding deployment resources.

[0036] In this embodiment, computing resources are obtained by integrating local resources, private cloud resources, and public cloud resources, and the deployment resources corresponding to the services of the applications to be deployed are determined according to the deployment parameters corresponding to the services of the applications to be deployed and the available resources in the computing resource pool, so that the services are distributed to the corresponding deployment resources for deployment, and the hybrid deployment of services under different computing resources is realized. The hybrid deployment of applications is realized by integrating resources, and the unified planning and deployment of computing resources is realized, which is conducive to meeting the deployment requirements of rapid iteration and continuous delivery of applications under multiple types of computing resources, improving the flexibility of application deployment, and optimizing resource allocation.

[0037] In one embodiment, a user can build a private code repository for application development, and in the application deployment phase, pull the application program code from the code repository to build a service package for deployment. Specifically, in step 100, the service package of each target service of the application to be deployed is obtained, including: Step 101, pull the program code of each target service of the application to be deployed from the code repository; Step 102, after integrating the Nginx configuration into the program code, the program code is packaged and constructed to generate an executable file to obtain a service package of the target service; the Nginx configuration is used to start the Nginx service when the target service is deployed.

[0038] Pull the program code of each target service of the application to be deployed from the code repository, integrate the Nginx configuration into the program code of the target service, package and build the program code, generate an executable file, and obtain the service package of the target service. Among them, the Nginx configuration is used to directly start the Nginx service for access when the target service is deployed.

[0039] Optionally, when determining the deployment resources corresponding to the target service, the resources and number of nodes deployed by each target service are divided by resource partitioning. Specifically, a preset dictionary format is used, with key representing the service name of the target service, value representing the resources to be deployed by the target service, and count representing the number of nodes to be deployed. The service that automatically divides resources is used to match the corresponding deployment resources from the available mixed deployment resources through configuration parameters such as the occupied resources, running status, and concurrent number of the target service.

[0040] Furthermore, in step 300, the service package of the target service is distributed to the corresponding deployment resources for deployment, which specifically includes: Step 301, obtaining a code scanning script file; Step 302, executing the code scanning script file, performing code scanning on the service package of the target service, and generating a scanning report; Step 303: If it is determined according to the scan report that the service package of the target service has passed the scan, the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

[0041] Before deploying the target service, you need to execute the scanning script file to perform code scanning on the service package. Specifically, obtain the code scanning script file, which is stored in a specific service, and obtain the scanning script file by initiating a scanning service request. Execute the obtained code scanning script file to perform code scanning on the service package of the target service and generate a scanning report. If it is determined that the service package of the target service has passed the scan based on the generated scanning report, send the service package of the target service to the deployment directory of the corresponding deployment resource for deployment.

[0042] Optionally, when performing code scanning on the service package of the target service, a code scanning script file is obtained through a curl command, and the code scanning script file is executed using a shell command to complete the code scanning of the service package of the target service. In one embodiment, before performing code scanning on the service package of the target service, a code test may also be performed on the target service to authenticate the service function of the target service, and code scanning may be performed after the function authentication of the target service passes.

[0043] Furthermore, different types of deployment resources need to execute different deployment strategies when performing service deployment. Based on this, in step 303, sending the service package of the target service to the deployment directory of the deployment resource for deployment may also include: Step 313: If the deployment resources include local resources, send the service package of the first target service to the deployment directory of the local resources; the first target service is the target service of the deployment resources being local resources; Step 323, running the service package of the first target service when the local resource environment is deployed to deploy the first target service; Step 333: if the deployment resources include hybrid cloud resources, construct an image file of a service package of a second target service; the second target service is a target service whose deployment resources are hybrid cloud resources, and the hybrid cloud resources include at least one of private cloud resources and public cloud resources; Step 343: Send the service package of the second target service and the image file to the deployment directory of the hybrid cloud resources; Step 353, when deployed in the hybrid cloud resource environment, running the image file to obtain a service container of the second target service; Step 363: Perform service configuration in the service container according to the configuration parameters in the deployment parameters of the second target service to deploy the second target service.

[0044] For target services whose deployment resources are local resources, you need to send the service package to the deployment directory of the local resources for deployment. For target services whose deployment resources are private cloud resources or public cloud resources, you need to pull the image file of the service package from the image repository, and then send the service package and image file to the deployment directory of the hybrid cloud resources of private cloud resources or public cloud resources for deployment.

[0045] Specifically, if the deployment resources of each target service include local resources, the service package of the first target service is sent to the deployment plank road of the local resources, wherein the first target service is a target service whose deployment resources are local resources. When deployed in the local resource environment, the service package of the first target service is run to deploy the first target service.

[0046] If the deployment resources of each target service include hybrid cloud resources, construct an image file of the service package of the second target service. The second target is a target service whose deployment resources are hybrid cloud resources, and the hybrid cloud resources include at least one of private cloud resources and public cloud resources. Send the service package and image file of the second target service to the deployment directory of the hybrid cloud resources. When deployed in the hybrid cloud resource environment, run the image file of the second target service to obtain the service container of the second target service. Further, according to the configuration parameters in the deployment parameters of the second target service, perform service configuration in the service container, thereby completing the deployment of the second target service. Among them, the configuration parameters in the deployment parameters include but are not limited to service configuration files, port numbers, processors and memory sizes, etc.

[0047] Optionally, when deploying services, it involves authenticated access to deployment resources, where local resources are accessed through server IP, port number, user name (non-root user) and password. After successful authentication, server resources can be accessed, and operations such as uploading, downloading, and running executable files can be performed. Server resources can also be obtained by executing server commands to monitor resources.

[0048] For private cloud resources, based on the account information applied for from the administrator, the administrator adds the access user to the user center, assigns permissions to the user, initializes the access password, and the access user accesses the private cloud resources using the applied account and password, obtains the access token, and performs operation authentication using the access token.

[0049] For public cloud resources, access to public cloud resources is authenticated through the access key AccessKey, using the AccessKey ID (user ID) and AccessKey Secret (password) for authentication.

[0050] In one embodiment, when distributing the service package of the target service to the corresponding deployment resource, the file distribution is performed by using the method of segmented uploading and breakpoint resume. In step 303, the service package of the target service is sent to the deployment directory of the deployment resource for deployment, which may also include: Step 3031, using a piecewise uploading method to divide the service package of the target service into a plurality of small files of a preset size; Step 3032, uploading the multiple small files concurrently through multiple threads, sending the multiple small files to the deployment directory of the deployment resource, and monitoring the upload status of the multiple small files; Step 3033, determining the target small file that failed to be uploaded according to the upload status, and retrying to upload the target small file by using the breakpoint resume method, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

[0051] When distributing the service package of the target service to the deployment directory of the corresponding deployment resource, the service package of the target service is divided into multiple small files of preset size by using the fragment upload method, and the multiple small files are marked with file numbers. Multiple small files are uploaded concurrently through multiple threads, and the multiple small files are sent to the deployment directory of the deployment resource, and the upload status of the multiple small files is monitored.

[0052] According to the upload status of the monitored small files, the small files that have been successfully uploaded and the small files that have failed to be uploaded are determined. During the file upload process, if there are uncertain factors such as network problems, the file upload will fail or be interrupted. The file sequence number of the successfully uploaded small file is recorded. For the target small file that failed to be uploaded, the breakpoint resume method is adopted to retry uploading the target small file. Each small file is sent to the deployment directory of the corresponding deployment resource to ensure the integrity of the uploaded file, so as to send the service package of the target service to the deployment directory of the corresponding deployment resource for deployment.

[0053] In one embodiment, during the target service deployment process, the deployment process is monitored to determine whether the target service is deployed successfully. After the target service deployment is completed, a communication test is performed on the target service, and the running status of the target service is monitored. Specifically, for the communication test of the target service, after step 300, the following may also be included: Step 401, obtaining the service name of the target service; Step 402: Send a test request to the target service according to the service name and the deployment resource where the target service is located, so as to detect whether communication with the target service is available.

[0054] Get the service name of the target service, which is a configuration parameter item specified in the deployment parameters of the target service. Send a test request to the target service based on the service name of the target service and the deployment resources of the target service. The test request is an HTTP request, and detects whether the communication of the target service is available based on the test request.

[0055] Regarding monitoring the running status of the target service, after step 300, the following may also be included: Step 403, obtaining monitoring data of the target service; Step 404, determining whether the target service is deployed according to the monitoring data; Step 405: When the target service is deployed, monitor the running status of the target service according to the monitoring data.

[0056] After the target service is deployed, the monitoring data of the target service is obtained, and the deployment process of the target service is monitored and managed according to the monitoring data to ensure the accuracy and consistency of the deployment, and to determine whether the deployment of the target service is complete, and the deployment completion specifically means that the target service can run normally. In the case that the target service is deployed, the running status of the target service is monitored according to the monitoring data of the target service to determine whether the service is abnormal, so as to provide real-time feedback and adjustment mechanism.

[0057] In one embodiment, the application deployment method provided by the embodiment of the present invention mainly includes stages such as resource integration, deployment model construction and application deployment. Among them, in the resource integration stage, different types of resources such as local resources, private cloud resources and public cloud resources are mainly integrated to facilitate unified management and efficient use of resources. Resource fusion is implemented based on resource parameters, which include hardware resource parameters and network resource parameters. The hardware resource parameters include the number of CPU cores, CPU frequency, memory size, memory type, storage capacity and storage speed, etc. The network resource parameters include network bandwidth, network delay and load critical threshold, etc. It is necessary to continuously monitor the resources that have been consumed by the server so as to determine the remaining available resources of each type of resources when integrating resources.

[0058] Furthermore, in the deployment model construction phase, according to business needs and technical architecture, the application components, dependencies, deployment environment and resource allocation are clarified, and based on the DevOps automated hybrid deployment process, an automated approach is adopted to achieve seamless connection and rapid deployment of the application from development to production environment. In order to meet the deployment requirements of applications in different business scenarios, the deployment models constructed include but are not limited to microservice architecture, containerized deployment and serverless architecture.

[0059] In the application deployment phase, based on the built deployment model, the automated deployment process is executed. Specifically, the version control system is used to manage the code repository to ensure the tracking and backtracking of code changes. According to the deployment environment corresponding to the target service of the application to be deployed, the service and deployment resources are divided, and the configuration parameters such as the deployment resources, number of nodes, deployment directory, and port number of the service are clarified. The continuous integration tool is used to automatically compile the code, run the test, and review the code quality, as well as test and run the service unit to ensure the correctness of the service function, so as to detect whether the function of the modified version is complete. The service image is built and sent to the image warehouse for unified management. During the service distribution process, the service package and service image are sent to the executed deployment resource. The integrity of the sent service package file is ensured by file segmentation and breakpoint continuation. After the file is uploaded, the file upload status is monitored, the uploaded execution script is obtained, and the startup script of the service is run, so as to achieve automatic deployment of mixed resources. The running status of the application is detected in real time by obtaining monitoring data, and feedback and adjustment suggestions are provided.

[0060] Optional, Figure 2 An architecture of a deployment model is given as an example, which realizes resource integration based on the integration of local resources, private cloud resources and public cloud resources. The deployment model is configured to have the resource management capability of the integrated hybrid resources, as well as the service resource division, service distribution, code scanning, package management and log management capabilities.

[0061] like Figure 2 As shown, the code repository maintains the project code through the warehouse management system GitLab, and configures the GitLabci / cd Runner agent to check the Runner status to obtain the execution status of the ci / cd pipeline, the final result of the deployment, and the last running time, etc. The entire deployment process is controlled through the gitlab-ci.yml file, and global variables are defined through variables, stages are defined through stages and execution order, and specific execution jobs are defined. Special processing can also be performed for different branches. In the hybrid deployment model, deployment needs to be carried out in multiple resources, so service resource division ServiceResource Allocation and service distribution Service Dispatch are required.

[0062] Furthermore, when dividing service resources, the division is performed through the resource automatic division service using the dictionary format provided by yml. In the resource automatic division service, the corresponding hybrid deployment resources are matched based on the resources occupied by the deployed services in the configured deployment parameters, the running status of the services, the number of concurrent connections, etc.

[0063] Optionally, the deployment model searches for dependencies based on the Maven NPM component, performs code scanning based on the SonarScanner scanner, and uses the SonarQube analyzer to generate a scan report based on the code scanning results. The package management capability is implemented based on the Helm Chart component. The package management capability of the deployment model includes creating, packaging, publishing, and managing service packages. Specifically, after pulling the application code from the code repository, the code is built and packaged, an executable file is generated, and a service package is built.

[0064] The shell script in the deployment model is used by users to configure deployment parameters, etc. It can also be used as a service deployment script and is sent to the deployment directory together with the service package when the service is distributed.

[0065] The image repository in the deployment model is used to manage image files. For services whose deployment resources are hybrid cloud resources, Docker is used to build images of service packages. The image repository is used to centrally manage the scripts for building images. In the script, you need to configure the address of the image repository Harbor: HARBOR_SERVER, the username and password of the image repository: HARBOR_USER, the image name: IMAGE_NAME, the image tag: IMAGE_TAG and other parameters.

[0066] Furthermore, based on the resource management capability of the deployment model, service resource division and service distribution are performed during the application deployment phase to achieve hybrid deployment of each service of the application under different types of resources. For example, if the application to be deployed includes 10 services, two of which are deployed in local resources, five services are deployed in private cloud resources, and three services are deployed in public cloud resources, the services of the application to be deployed communicate with each other through HTTP requests. Through service resource division, the deployment resources of each of the 10 services are clarified, and through service distribution, each service is distributed to the deployment directory of the corresponding deployment resource.

[0067] The log management capability of the deployment model is used to monitor the service deployment process. Specifically, the Prometheus service monitoring system is used to monitor the server and service status, and the ELK (Elasticsearch, Logstash and Kibana, log analysis system) stack is used for log management and analysis. Prometheus Server regularly obtains monitoring data from the configured monitoring targets and Exporters through HTTP pull. Each monitored host or application as a monitoring target provides an interface for outputting monitoring data through Exporters, and PrometheusServer periodically collects data from the interface. During operation, the service sends logs to KafKa, and Elasticsearch consumes the log data for log analysis and saves the analysis results for viewing.

[0068] In some embodiments, reference Figure 3 In the deployment process shown, the distribution object of service distribution is the built service package. In the application deployment process, the pulled program code is first built and packaged to generate an executable file, and then the executable file is scanned and unit tested. For services whose deployment resources are hybrid cloud resources, an image is built. If the deployment resource is a local resource, the service package is sent to the deployment directory of the local resource. If the deployment resource is a hybrid cloud resource, the image file of the service package is pulled from the image warehouse, and then the pulled image file and the service package are sent together to the deployment directory of the hybrid cloud resource, so as to perform hybrid deployment of the service. For service packages and image files, they are sent by means of multi-segment upload and breakpoint resume to ensure file integrity.

[0069] In the hybrid deployment process, the built service package is directly run when deploying in the local resource environment, and the memory resources required by the service are configured to complete the service deployment of local resources. In the hybrid cloud resource deployment environment, the service container is obtained by running the image file, and then the service configuration file, port number, CPU, memory and other configuration parameters are configured to complete the service deployment of hybrid cloud resources.

[0070] Before the service is deployed, the calling relationship between services is maintained in the form of a (from, to) list. After the service is deployed, an HTTP request is sent to the service through the service name and the resource where the service is located to detect whether the service communication is available, monitor the service deployment process, and monitor the service running status.

[0071] In this embodiment, by integrating different types of computing resources such as local resources, private cloud resources and public cloud resources, unified planning and scheduling of resources is achieved, which facilitates users to select appropriate deployment resources according to the services to be deployed when deploying applications, thereby improving the flexibility of application deployment. In addition, based on the unified planning of resources, the data security of local resources can be guaranteed, and resources can be quickly involved in the service. At the same time, it can also facilitate the expansion and contraction of private cloud resources, reduce the operation and maintenance costs of public cloud resources, and improve resource utilization and service access speed and reliability.

[0072] Furthermore, based on the automated hybrid deployment of application services, the cycle from code writing to online use is shortened, and rapid integration, verification and deployment of applications are achieved, which is conducive to rapid iteration and continuous deployment of applications.

[0073] The application deployment device provided by the present invention is described below. The application deployment device described below and the application deployment method described above can be referenced to each other.

[0074] Reference Figure 4 , the application deployment device provided by the embodiment of the present invention includes: The acquisition module 10 is used to acquire the service packages of each target service of the application to be deployed, and the deployment parameters configured for each target service; the deployment parameters include the deployment environment; The partitioning module 20 is used to obtain available resources in the computing power resource pool, and determine the deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources and the public cloud resources; The deployment module 30 is used to distribute the service package of the target service to the deployment resources for deployment.

[0075] In one embodiment, the deployment module 30 is further used to: Get the code scanning script file; Execute the code scanning script file, perform code scanning on the service package of the target service, and generate a scanning report; If it is determined according to the scan report that the service package of the target service has passed the scan, the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

[0076] In one embodiment, the deployment module 30 is further used to: If the deployment resources include local resources, sending the service package of the first target service to the deployment directory of the local resources; the first target service is the target service of the deployment resources being local resources; Running the service package of the first target service when the local resource environment is deployed to deploy the first target service; If the deployment resources include hybrid cloud resources, construct an image file of a service package of a second target service; the second target service is a target service whose deployment resources are hybrid cloud resources, and the hybrid cloud resources include at least one of private cloud resources and public cloud resources; Sending the service package of the second target service and the image file to the deployment directory of the hybrid cloud resources; When deployed in the hybrid cloud resource environment, running the image file to obtain a service container of the second target service; According to the configuration parameters in the deployment parameters of the second target service, service configuration is performed in the service container to deploy the second target service.

[0077] In one embodiment, the deployment module 30 is further used to: The service package of the target service is divided into multiple small files of preset sizes by adopting the segmented upload method; Concurrently uploading the multiple small files through multiple threads, sending the multiple small files to the deployment directory of the deployment resource, and monitoring the upload status of the multiple small files; The target small file that failed to be uploaded is determined according to the upload status, and the target small file is retried to be uploaded by adopting the breakpoint resume method, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

[0078] In one embodiment, the acquisition module 10 is further used for: Pull the program code of each target service of the application to be deployed from the code repository; After the Nginx configuration is integrated into the program code, the program code is packaged and constructed to generate an executable file to obtain a service package of the target service; the Nginx configuration is used to start the Nginx service when the target service is deployed.

[0079] In one embodiment, the application deployment device further includes a testing module, which is used to: Get the service name of the target service; According to the service name and the deployment resource where the target service is located, a test request is sent to the target service to detect whether communication with the target service is available.

[0080] In one embodiment, the application deployment device further includes a monitoring module, which is used to: Obtain monitoring data of the target service; Determining whether the target service is deployed according to the monitoring data; When the target service is deployed, the running status of the target service is monitored according to the monitoring data.

[0081] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communications interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the steps of the application deployment method, for example including: Obtaining a service package of each target service of the application to be deployed, and deployment parameters configured for each target service; the deployment parameters include a deployment environment; Obtain available resources in a computing power resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; Distribute the service package of the target service to the deployment resources for deployment.

[0082] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0083] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the application deployment method provided by the above methods, for example, including: Obtaining a service package of each target service of the application to be deployed, and deployment parameters configured for each target service; the deployment parameters include a deployment environment; Obtain available resources in a computing power resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; Distribute the service package of the target service to the deployment resources for deployment.

[0084] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the application deployment method provided by the above methods, for example, including: Obtaining a service package of each target service of the application to be deployed, and deployment parameters configured for each target service; the deployment parameters include a deployment environment; Obtain available resources in a computing power resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; Distribute the service package of the target service to the deployment resources for deployment.

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

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

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

Claims

1. An application deployment method, characterized in that: include: Obtaining the service packages of each target service of the application to be deployed, and the deployment parameters of each target service configuration; The deployment parameters include a deployment environment; Obtain available resources in a computing power resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing power resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; Distribute the service package of the target service to the deployment resources for deployment.

2. The application deployment method according to claim 1, characterized in that: The distributing the service package of the target service to the deployment resource for deployment includes: Get the code scanning script file; Execute the code scanning script file, perform code scanning on the service package of the target service, and generate a scanning report; If it is determined according to the scan report that the service package of the target service has passed the scan, the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

3. The application deployment method according to claim 2, characterized in that: The sending the service package of the target service to the deployment directory of the deployment resource for deployment includes: If the deployment resources include local resources, sending the service package of the first target service to the deployment directory of the local resources; the first target service is the target service of the deployment resources being local resources; Running the service package of the first target service when the local resource environment is deployed to deploy the first target service; If the deployment resources include hybrid cloud resources, construct an image file of a service package of a second target service; the second target service is a target service whose deployment resources are hybrid cloud resources, and the hybrid cloud resources include at least one of private cloud resources and public cloud resources; Sending the service package of the second target service and the image file to the deployment directory of the hybrid cloud resources; When deployed in the hybrid cloud resource environment, running the image file to obtain a service container of the second target service; According to the configuration parameters in the deployment parameters of the second target service, service configuration is performed in the service container to deploy the second target service.

4. The application deployment method according to claim 2, characterized in that: The sending the service package of the target service to the deployment directory of the deployment resource for deployment includes: The service package of the target service is divided into multiple small files of preset sizes by adopting the segmented upload method; Concurrently uploading the multiple small files through multiple threads, sending the multiple small files to the deployment directory of the deployment resource, and monitoring the upload status of the multiple small files; The target small file that failed to be uploaded is determined according to the upload status, and the target small file is retried to be uploaded by adopting the breakpoint resume method, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

5. The application deployment method according to claim 1, characterized in that: The step of obtaining the service packages of each target service of the application to be deployed includes: Pull the program code of each target service of the application to be deployed from the code repository; After the Nginx configuration is integrated into the program code, the program code is packaged and constructed to generate an executable file to obtain a service package of the target service; the Nginx configuration is used to start the Nginx service when the target service is deployed.

6. The application deployment method according to claim 1, characterized in that: After distributing the service package of the target service to the deployment resource for deployment, the method further includes: Get the service name of the target service; According to the service name and the deployment resource where the target service is located, a test request is sent to the target service to detect whether communication with the target service is available.

7. The application deployment method according to claim 1, characterized in that: After distributing the service package of the target service to the deployment resource for deployment, the method further includes: Obtain monitoring data of the target service; Determining whether the target service is deployed according to the monitoring data; When the target service is deployed, the running status of the target service is monitored according to the monitoring data.

8. An application deployment device, characterized in that: include: An acquisition module, used to acquire a service package of each target service of the application to be deployed, and deployment parameters of each target service configuration; The deployment parameters include a deployment environment; A partitioning module is used to obtain available resources in a computing resource pool, and determine deployment resources corresponding to each of the target services according to the deployment parameters and the available resources; the deployment resources include at least one of local resources, private cloud resources, and public cloud resources, and the computing resource pool is obtained by integrating the computing power of the local resources, the private cloud resources, and the public cloud resources; The deployment module is used to distribute the service package of the target service to the deployment resources for deployment.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the application deployment method according to any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the application deployment method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Hybrid cloud disaster tolerance method, hybrid cloud disaster tolerance server and storage medium

    CN108234212A

  • E-sports data processing method and device, equipment and storage medium

    CN113573378A

  • Service deployment method of hybrid cloud platform, management platform, equipment and medium

    CN116684421A

  • Intelligent calculation center system applied to AI large model

    CN117851027A

  • Computing power resource scheduling method and device, computer equipment and storage medium

    CN117873707A