Application deployment methods, devices, equipment and storage media

By integrating local and cloud resources to form a computing power resource pool, and combining code scanning and sharding upload technologies, the application deployment challenges under multiple types of computing power resources are solved, enabling rapid iteration and continuous delivery.

CN119396419BActive Publication Date: 2026-01-30INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411341864.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2026-01-30
Estimated Expiration
2044-09-25

AI Technical Summary

Technical Problem

Existing deployment methods cannot meet the needs of rapid iteration and continuous delivery under various types of computing resources. Traditional manual deployment methods and single computing power deployment environments cannot adapt to complex and diverse software deployment needs.

Method used

By integrating local resources, private cloud resources, and public cloud resources to form a computing power resource pool, the deployment resources of the target service are determined according to the service package and deployment parameters of the application to be deployed. Technologies such as code scanning, fragmented uploading, and breakpoint resume are used to achieve hybrid deployment of service packages under different computing power resources.

Benefits of technology

It enables unified planning and deployment of computing resources, improves the flexibility of application deployment and the efficiency of resource allocation, and meets the needs of rapid iteration and continuous delivery under multiple types of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396419B_ABST
    Figure CN119396419B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer technology, providing an application deployment method, apparatus, device, and storage medium. The method includes: acquiring service packages of each target service of the application to be deployed, and deployment parameters configured for each target service; acquiring available resources in a computing resource pool, and determining the deployment resources corresponding to each target service based on the deployment parameters and 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 local resources, private cloud resources, and public cloud resources; and distributing the service packages of the target services to the corresponding deployment resources for deployment. By integrating resources, hybrid deployment of applications is achieved, enabling unified planning and deployment of computing resources. This facilitates meeting the deployment needs of applications for rapid iteration and continuous delivery under multiple types of computing resources, improving the flexibility of application deployment, and optimizing resource allocation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

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

[0002] With the wide application of cloud computing and micro-service architecture, computing power resources show the trend of kernel diversification and distribution ubiquity. Computing power resources gradually extend to the edge side and the end side, and the types of computing power resources gradually become rich, which makes the software deployment process tend to be complex and diversified. When the computing power network realizes the application of computing power by coordinating the scheduling of cloud computing, edge computing, intelligent terminal and other multi-level computing power, the traditional manual deployment method and the existing automatic deployment method in a single computing power deployment environment cannot meet the deployment needs of rapid iteration and continuous delivery of applications in multi-type computing power resources. SUMMARY

[0003] The present application provides an application deployment method, device, equipment and storage medium to solve the defect that the existing deployment method cannot meet the deployment needs of rapid iteration and continuous delivery of applications in multi-type computing power resources, and realizes the mixed deployment of applications in multi-type computing power resources.

[0004] The present application provides an application deployment method, comprising:

[0005] Obtain the service package of each target service of the application to be deployed, and the deployment parameters of each target service configuration; the deployment parameters include the deployment environment;

[0006] Obtain the available resources in the computing power resource pool, and determine the deployment resources corresponding to each target service 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 computing power fusion of the local resources, the private cloud resources and the public cloud resources;

[0007] Distribute the service package of the target service to the deployment resources for deployment.

[0008] According to the application deployment method provided by the present application, the service package of the target service is distributed to the deployment resources for deployment, comprising:

[0009] Obtain the code scanning script file;

[0010] Execute the code scanning script file, perform code scanning on the service package of the target service, and generate a scanning report;

[0011] If it is determined according to the scanning report that the service package scanning of the target service is passed, the service package of the target service is sent to a deployment directory of the deployment resource for deployment.

[0012] According to the application deployment method provided by the application, the sending of the service package of the target service to the deployment directory of the deployment resource for deployment comprises:

[0013] If the deployment resource comprises a local resource, the service package of a first target service is sent to a deployment directory of the local resource; the first target service is a target service of the deployment resource being a local resource.

[0014] The service package of the first target service is run in the local resource environment to deploy the first target service.

[0015] If the deployment resource comprises a hybrid cloud resource, an image file of a second target service is constructed; the second target service is a target service of the deployment resource being a hybrid cloud resource, and the hybrid cloud resource comprises at least one of a private cloud resource and a public cloud resource.

[0016] The service package of the second target service and the image file are sent to a deployment directory of the hybrid cloud resource.

[0017] The image file is run in the hybrid cloud resource environment to obtain a service container of the second target service.

[0018] According to a configuration parameter in a deployment parameter of the second target service, service configuration is performed in the service container to deploy the second target service.

[0019] According to the application deployment method provided by the application, the sending of the service package of the target service to the deployment directory of the deployment resource for deployment comprises:

[0020] The service package of the target service is cut into a plurality of small files of a preset size in a split uploading manner.

[0021] The plurality of small files are uploaded in a concurrent manner by a plurality of threads, the plurality of small files are sent to the deployment directory of the deployment resource, and an uploading state of the plurality of small files is monitored.

[0022] According to the uploading state, a target small file of which uploading fails is determined, the target small file is uploaded in a resuming manner, and the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

[0023] According to the application deployment method provided by the application, the obtaining of the service package of each target service of the application to be deployed comprises:

[0024] pulling program codes of each target service of an application to be deployed from a code repository;

[0025] integrating an Nginx configuration into the program codes, packaging and building the program codes to generate an executable file, and obtaining a service package of the target service; the Nginx configuration is used to start an Nginx service when the target service is deployed.

[0026] According to the application deployment method provided by the application, after the service package of the target service is distributed to the deployment resource for deployment, the method further comprises:

[0027] obtaining a service name of the target service;

[0028] sending a test request to the target service according to the service name and the deployment resource where the target service is located, to detect whether communication of the target service is available.

[0029] According to the application deployment method provided by the application, after the service package of the target service is distributed to the deployment resource for deployment, the method further comprises:

[0030] obtaining monitoring data of the target service;

[0031] determining whether the target service is deployed according to the monitoring data;

[0032] monitoring a running state of the target service according to the monitoring data when the target service is deployed.

[0033] The application also provides an application deployment device comprising the following modules:

[0034] an obtaining module, configured to obtain a service package of each target service of an application to be deployed, and deployment parameters configured for each target service; the deployment parameters comprise a deployment environment;

[0035] a dividing module, configured to obtain available resources in a computing resource pool, and determine deployment resources corresponding to each target service according to the deployment parameters and the available resources; the deployment resources comprise at least one of a local resource, a private cloud resource and a public cloud resource, and the computing resource pool is obtained by performing computing power fusion on the local resource, the private cloud resource and the public cloud resource;

[0036] a deployment module, configured to distribute the service package of the target service to the deployment resources for deployment.

[0037] The application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the application deployment method according to any one of the above when executing the computer program.

[0038] The application further provides a non-transitory computer readable storage medium, which stores a computer program, wherein the computer program is executable by a processor to implement the steps of the application deployment method according to any one of the above.

[0039] The application further provides a computer program product, which includes a computer program, wherein the computer program is executable by a processor to implement the steps of the application deployment method according to any one of the above.

[0040] The application provides an application deployment method, device, equipment and storage medium, which integrates local resources, private cloud resources and public cloud resources to obtain computing power resources, and determines deployment resources corresponding to services of an application to be deployed according to deployment parameters corresponding to the services of the application to be deployed and available resources in a computing power resource pool, so as to distribute the services to the corresponding deployment resources for deployment, and realize mixed deployment of the services under different computing power resources. The mixed deployment of the application is realized by integrating resources, unified planning and deployment of computing power resources are realized, the deployment demand of rapid iteration and continuous delivery of the application under multiple types of computing power resources is facilitated, the flexibility of application deployment is improved, and resource configuration is optimized. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of these drawings.

[0042] Figure 1 is a flowchart of the application deployment method provided by the application.

[0043] Figure 2 is an architecture diagram of the deployment model provided by the application.

[0044] Figure 3 is an application deployment flowchart provided by the application.

[0045] Figure 4 is a structure diagram of the application deployment device provided by the application.

[0046] Figure 5 is a structure diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0047] In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be described clearly and completely below in conjunction with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the protection scope of the present application.

[0048] The embodiment of the present application provides an application deployment method, and the automatic deployment based on DevOps realizes the mixed deployment of the application under the multi-type computing power resource by fusing different types of computing power resources, selecting different combinations of mixed deployment schemes according to different application scenarios and deployment requirements, and providing higher flexibility and scalability for the deployment and running of the application, so that the application can easily adapt to different environments and business requirements, realize the continuous integration and deployment of the application, and meet the deployment requirements of the rapid iteration and continuous delivery of the application. The process-oriented deployment solution can also improve the overall quality and stability of the application.

[0049] Specifically, Figure 1 is a flowchart of the application deployment method provided by the present application, as Figure 1 shown, the method comprises the following steps:

[0050] In step 100, the service package of each target service of the application to be deployed is obtained, and the deployment parameters of each target service are configured; the deployment parameters comprise a deployment environment;

[0051] In step 200, the available resources in the computing power resource pool are obtained, and the deployment resources corresponding to each target service are determined according to the deployment parameters and the available resources; the deployment resources comprise at least one of a local resource, a private cloud resource and a public cloud resource, and the computing power resource pool is obtained by fusing the local resource, the private cloud resource and the public cloud resource;

[0052] In step 300, the service package of the target service is distributed to the deployment resource for deployment.

[0053] The service package of each target service of the application to be deployed is obtained, and the deployment parameters of each target service are obtained, wherein one application to be deployed can comprise one or more target services to be deployed, the deployment parameters of the target service comprise a deployment environment, and can further comprise configuration parameters of the target service, which comprise but are not limited to service concurrency, number of access users and QPS (Queries-per-second, query rate per second).

[0054] Optionally, the deployment parameter can be configured by the user or automatically generated according to the configuration parameter of the target service configured by the user.

[0055] The remaining available resources in the computing resource pool are acquired, and the deployment resource corresponding to the target service is determined according to the deployment parameter of the target service and the remaining available resources. The deployment resource includes at least one of the local resource, the private cloud resource and the public cloud resource. The computing resource pool is obtained by fusing the local resource, the private cloud resource and the public cloud resource.

[0056] The local resource refers to the local server resource for hosting software applications and data within the user organization, the private cloud resource refers to the cloud computing resource provided by the user through K8s or OpenStack, etc., and the public cloud resource refers to the cloud computing resource provided by the cloud service provider. Further, the local resource includes but is not limited to physical servers, virtual machines and storage devices, the private cloud resource includes but is not limited to user-built cloud computing platforms and virtualization environments, and the public cloud resource includes but is not limited to third-party provided cloud computing and cloud storage services.

[0057] Optionally, the deployment resource is derived from the computing resource pool, which is obtained by integrating different types of deployment resources such as local resources, private cloud resources and public cloud resources, realizing the fusion and collaborative use of different deployment resources. When integrating different types of deployment resources, the computing power, storage capacity and network bandwidth of the resources need to be identified, providing deployment configuration reference for mixed deployment of applications, and ensuring stable operation of the server while providing maximum computing power support.

[0058] Further, when determining the deployment resource corresponding to each target service, the remaining available resources in the computing resource pool are also acquired, and the deployment resource corresponding to the target service is determined according to the deployment parameter of each target service and the available resources.

[0059] Optionally, the deployment parameter further includes a deployment mode, and the deployment mode includes single deployment and mixed deployment. In the mixed deployment mode, a plurality of services are respectively deployed on different types of resources under the micro-service architecture, different services communicate with each other, and one service is deployed on multiple types of resources, thereby ensuring fast response of the service in the cloud edge and other computing environments.

[0060] Based on the integration of different types of deployment resources, the user can select one or more different types of resources for deployment according to the functional characteristics of the service when deploying the application. 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, and other parameters that 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 processor CPU and memory size of the service, to facilitate improving the resource utilization of the service.

[0061] According to the deployment resources corresponding to each target service, the service package of each target service is distributed to the corresponding deployment resource for service deployment, thereby completing the deployment of the application to be deployed. Distributing the service package of the target service to the corresponding deployment resource for deployment includes sending the service package 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. It can also include sending the service packages of multiple different target services to the same deployment resource for deployment.

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

[0063] Further, diversified applications correspond to diversified 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, and the deployment of each target service is completed in the corresponding deployment resource according to the deployment strategy corresponding to each target service.

[0064] In this embodiment, the computing power resources are obtained by integrating local resources, private cloud resources and public cloud resources, and the deployment resources corresponding to the services of the application to be deployed are determined according to the deployment parameters corresponding to the services of the application to be deployed and the available resources in the computing power resource pool, so as to distribute the services to the corresponding deployment resources for deployment, thereby realizing the hybrid deployment of the services in different computing power resources. By integrating resources to realize the hybrid deployment of the application, the unified planning and deployment of computing power resources are realized, which is conducive to meeting the deployment needs of rapid iteration and continuous delivery of the application in multiple types of computing power resources, improving the flexibility of application deployment, and optimizing resource allocation.

[0065] In one embodiment, a user can build a private code repository for the development of an application, and in the application deployment stage, a program code of the application is pulled from the code repository to build a service package for deployment. Specifically, in step 100, a service package of each target service of the application to be deployed is obtained, including:

[0066] In step 101, the program code of each target service of the application to be deployed is pulled from the code repository.

[0067] In step 102, after the Nginx configuration is integrated into the program code, the program code is packaged and built to generate an executable file, thereby obtaining the service package of the target service; the Nginx configuration is used to start the Nginx service when the target service is deployed.

[0068] The program code of each target service of the application to be deployed is pulled from the code repository, and after the Nginx configuration is integrated into the program code of the target service, the program code is packaged and built to generate an executable file, thereby obtaining the service package of the target service; the Nginx configuration is used to directly start the Nginx service for access when the target service is deployed.

[0069] Optionally, when determining the deployment resource corresponding to the target service, the number of resources and nodes for each target service deployment is divided by resource division. Specifically, a preset dictionary format is used, with key representing the service name of the target service, value representing the resource to be deployed for the target service, and count representing the number of nodes for deployment. For services that use automatic resource division, the corresponding deployment resource is matched from the available hybrid deployment resource by using configuration parameters such as occupied resource, running state, and concurrency number of the target service.

[0070] Further, in step 300, the service package of the target service is distributed to the corresponding deployment resource for deployment, specifically including:

[0071] In step 301, a code scanning script file is obtained.

[0072] In step 302, the code scanning script file is executed to perform code scanning on the service package of the target service, thereby generating a scanning report.

[0073] In step 303, if it is determined according to the scanning report that the service package of the target service passes the scanning, the service package of the target service is sent to the deployment directory of the deployment resource for deployment.

[0074] Before the target service is deployed, a scanning script file needs to be executed to perform code scanning on the service package. Specifically, the code scanning script file is obtained, the code scanning script file is stored in a specific service, and the scanning script file is obtained by initiating a scanning service request. The obtained code scanning script file is executed to perform code scanning on the service package of the target service, and a scanning report is generated. If it is determined according to the generated scanning report that the service package of the target service passes the scanning, the service package of the target service is sent to the deployment directory of the corresponding deployment resource for deployment.

[0075] Optionally, when the service package of the target service is code scanned, the 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 an embodiment, before the service package of the target service is code scanned, the target service can also be code tested to authenticate the service function of the target service, and after the function of the target service is authenticated, code scanning is performed.

[0076] Further, different types of deployment resources need to perform different deployment strategies when deploying services. Based on this, in step 303, the service package of the target service is sent to the deployment directory of the deployment resource for deployment, which can also include:

[0077] In step 313, if the deployment resource includes a local resource, the service package of the first target service is sent to the deployment directory of the local resource; the first target service is a target service whose deployment resource is a local resource.

[0078] In step 323, the service package of the first target service is run in the local resource environment to deploy the first target service.

[0079] In step 333, if the deployment resource includes a hybrid cloud resource, an image file of the service package of the second target service is constructed; the second target service is a target service whose deployment resource is a hybrid cloud resource, and the hybrid cloud resource includes at least one of a private cloud resource and a public cloud resource.

[0080] In step 343, the service package of the second target service and the image file are sent to the deployment directory of the hybrid cloud resource.

[0081] In step 353, the image file is run in the hybrid cloud resource environment to obtain a service container of the second target service.

[0082] In step 363, according to the configuration parameter in the deployment parameter of the second target service, service configuration is performed in the service container to deploy the second target service.

[0083] For the target service whose deployment resource is a local resource, the service package needs to be sent to the deployment directory of the local resource for deployment. For the target service whose deployment resource is a private cloud resource or a public cloud resource, the image file of the service package needs to be pulled in the image warehouse, and then the service package and the image file are sent to the deployment directory of the hybrid cloud resource of the private cloud resource or the public cloud resource for deployment.

[0084] Specifically, if the deployment resource of each target service includes a local resource, the service package of the first target service is sent to the deployment directory of the local resource, where the first target service is the target service whose deployment resource is a local resource. When deployed in the local resource environment, the service package of the first target service is run, so that the first target service is deployed.

[0085] If the deployment resource of each target service includes a hybrid cloud resource, the image file of the service package of the second target service is constructed, the second target service is the target service whose deployment resource is a hybrid cloud resource, and the hybrid cloud resource includes at least one of a private cloud resource and a public cloud resource. The service package and the image file of the second target service are sent to the deployment directory of the hybrid cloud resource. When deployed in the hybrid cloud resource environment, the image file of the second target service is run to obtain a service container of the second target service. Further, according to the configuration parameters in the deployment parameters of the second target service, service configuration is performed in the service container, so that the deployment of the second target service is completed. The configuration parameters in the deployment parameters include but are not limited to service configuration files, port numbers, processor and memory sizes, etc.

[0086] Optionally, when the service is deployed, authentication access to the deployment resource is involved. The local resource is accessed by server ip, port number, username (non-root user) and password. After successful authentication, the server resource can be accessed to perform operations such as uploading, downloading and running executable files. The server resource can also be obtained by executing server commands to monitor the resource.

[0087] For a private cloud resource, based on the account information applied to the administrator, the administrator adds the access user to the user center, assigns the user with the right, initializes the access password, and the access user accesses the private cloud resource through the applied account password to obtain an access token for operation authentication.

[0088] For a public cloud resource, the AccessKey is used for authentication access to the public cloud resource. The AccessKey ID (user identifier) and the AccessKey Secret (password) are used for authentication.

[0089] In one embodiment, when distributing the service package of the target service to the corresponding deployment resource, the file distribution is performed in a manner of fragmented uploading and breakpoint resuming, and in step 303, the service package of the target service is sent to the deployment directory of the deployment resource for deployment, which can further include:

[0090] In step 3031, the service package of the target service is cut into a plurality of small files of a preset size in a manner of fragmented uploading.

[0091] In step 3032, the plurality of small files are uploaded concurrently by a plurality of threads, sent to the deployment directory of the deployment resource, and the uploading status of the plurality of small files is monitored.

[0092] In step 3033, a target small file that fails to be uploaded is determined according to the uploading status, and the target small file is uploaded again in a manner of breakpoint resuming, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

[0093] 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 cut into a plurality of small files of a preset size in a manner of fragmented uploading, and the plurality of small files are marked with file serial numbers. The plurality of small files are uploaded concurrently by a plurality of threads, sent to the deployment directory of the deployment resource, and the uploading status of the plurality of small files is monitored.

[0094] According to the uploading status of the small files monitored, a small file that succeeds to be uploaded and a target small file that fails to be uploaded are determined. When uncertain factors such as network problems occur in the file uploading process, the file uploading fails or is interrupted. The file serial number of the small file that succeeds to be uploaded is recorded, and the target small file that fails to be uploaded is uploaded again in a manner of breakpoint resuming, so as to send each small file to the deployment directory of the corresponding deployment resource, ensure the integrity of the uploaded file, and thus send the service package of the target service to the deployment directory of the corresponding deployment resource for deployment.

[0095] In one embodiment, during the deployment of the target service, the deployment process is monitored to determine whether the target service is successfully deployed, and after the deployment of the target service is completed, the target service is tested for communication and the running state of the target service is monitored. Specifically, for the communication test of the target service, after step 300, the method can further include:

[0096] In step 401, the service name of the target service is obtained.

[0097] In step 402, a test request is sent to the target service according to the service name and the deployment resource where the target service is located, so as to detect whether the communication of the target service is available.

[0098] obtaining a service name of the target service, the service name being a configuration parameter item indicated in a deployment parameter of the target service, and sending a test request to the target service according to the service name of the target service and a deployment resource of the target service, the test request being an HTTP request, and detecting whether communication of the target service is available based on the test request.

[0099] For monitoring the running state of the target service, after step 300, the method can further comprise:

[0100] obtaining monitoring data of the target service in step 403;

[0101] determining whether the target service is deployed completely according to the monitoring data in step 404;

[0102] monitoring the running state of the target service according to the monitoring data in step 405, when the target service is deployed completely.

[0103] After the target service is deployed, the monitoring data of the target service is obtained, the deployment process of the target service is monitored and managed according to the monitoring data, the accuracy and consistency of the deployment are ensured, and whether the target service is deployed completely is determined, the deployment completion specifically means that the target service can normally run. When the target service is deployed completely, the running state of the target service is monitored according to the monitoring data of the target service, whether the service is abnormal is determined, so as to provide real-time feedback and adjustment mechanism.

[0104] In an embodiment, the application deployment method provided by the embodiment mainly includes resource integration, deployment model construction and application deployment stages. In the resource integration stage, different types of resources such as local resources, private cloud resources and public cloud resources are integrated for unified management and efficient use of resources. Resource integration is based on resource parameters, which include hardware resource parameters and network resource parameters. The hardware resource parameters include CPU core number, CPU frequency, memory size, memory type, storage capacity and storage speed. The network resource parameters include network bandwidth, network delay and load critical threshold. The consumed resources of the server need to be continuously monitored, so as to determine the remaining available resources of each type of resource during resource integration.

[0105] Further, in the deployment model construction stage, according to the business requirements and technical architecture, the components, dependency relationships, deployment environments and resource allocation of the application program are determined, and based on the DevOps automatic hybrid deployment process, an automatic mode is adopted to realize seamless connection and rapid deployment of the application program from development to production environment. In order to meet the deployment requirements of applications in different business scenarios, the deployment model constructed includes but is not limited to microservice architecture, containerized deployment and serverless architecture.

[0106] In the application deployment phase, based on the built deployment model, an automated deployment process is performed. Specifically, a version control system is used to manage the code repository, ensuring tracking and backtracking of code changes. According to the target service corresponding to the deployment environment of the application to be deployed, the service and deployment resources are divided, and the configuration parameters such as the deployment resource where the service is located, the number of nodes, the deployment directory, and the port number of the service running are determined. 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 new version is perfect. The service image is built and sent to the image repository for unified management. In the service distribution process, the service package and service image are sent to the deployment resource for execution. Through file fragmentation and breakpoint resume transmission, the integrity of the sent service package file is ensured. After the file is uploaded, the execution script is obtained by monitoring the file upload state, and the service startup script is run, thereby achieving automatic deployment of hybrid resources. The running state of the application program is detected in real time by obtaining the monitoring data, and feedback and adjustment suggestions are provided.

[0107] Optionally, Figure 2 An architecture of the deployment model is exemplarily given. Based on the integration of local resources, private cloud resources, and public cloud resources, resource integration is realized. The deployment model is configured to have resource management capability for the integrated hybrid resources, as well as service resource division, service distribution, code scanning, package management, and log management capabilities.

[0108] As Figure 2 shown, the code repository maintains project code through the repository management system GitLab, and checks the Runner state through the configuration of the GitLab ci / cd Runner proxy program to obtain the execution 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, global variables are defined through variables, stages are defined through stages, and the execution order is defined. Specific execution jobs can also be defined, and special processing can be done for different branches. Under the hybrid deployment model, deployment needs to be performed in multiple resources, therefore, service resource division ServiceResource Allocation and service distribution Service Dispatch are needed.

[0109] Further, in the service resource division, the dictionary format of yml is used to divide the services through automatic resource division. In the automatic resource division service, the corresponding hybrid deployment resources are matched based on the deployment parameters configured in the deployment service, such as the resources occupied by the deployment service, the running state of the service, and the number of concurrent services.

[0110] Optionally, the deployment model finds dependencies based on Maven NPM components, performs code scanning based on a SonarScanner scanner, generates a scanning report based on a SonarQube analyzer according to the code scanning result, and implements package management capability based on a Helm Chart component. The package management capability of the deployment model includes creating, packaging, publishing, and managing service packages. Specifically, after pulling the code of an application from a code repository, the code is built and packaged to generate an executable file, and a service package is built.

[0111] The shell script in the deployment model is used for users to configure deployment parameters and the like, and can also be used as a deployment script of a service, which is sent to a deployment directory together with a service package when the service is distributed.

[0112] The image repository in the deployment model is used for managing image files. For a service whose deployment resource is a hybrid cloud resource, a service package is built using Docker, and the image repository is used for unified management of scripts for building images. In the scripts, parameters such as 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 the like need to be configured.

[0113] Further, based on the resource management capability of the deployment model, service resource division and service distribution are performed in the application deployment stage, and hybrid deployment of each service of an application on different types of resources is implemented. For example, if an application to be deployed includes 10 services, two services are deployed on local resources, five services are deployed on private cloud resources, and three services are deployed on public cloud resources, the services of the application to be deployed communicate with each other through HTTP requests. Through service resource division, the deployment resource of each service of the 10 services is determined, and through service distribution, each service is distributed to the deployment directory of the corresponding deployment resource.

[0114] The deployment model's log management capabilities are 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, a log analysis system) stack is used for log management and analysis. The Prometheus Server periodically retrieves monitoring data from configured monitoring targets and Exporters via HTTP pulls. Each monitored host or application provides an interface to output monitoring data through Exporters, and the Prometheus Server periodically collects data from these interfaces. During service operation, logs are sent to Kafka, where Elasticsearch consumes the log data for analysis and saves the analysis results for later viewing.

[0115] In some embodiments, refer to Figure 3 The deployment process shown depicts a service distribution process where the service package is the distributed object. In the application deployment process, the pulled program code is first built and packaged to generate an executable file. Then, code scanning and unit testing are performed on this executable file. For services deployed on hybrid cloud resources, an image is built. If the deployment resource is a local resource, the service package is sent to the local resource's deployment directory. If the deployment resource is a hybrid cloud resource, the image file of the service package is pulled from the image repository, and then the pulled image file and the service package are sent together to the hybrid cloud resource's deployment directory, thus performing a hybrid deployment of the service. For the service package and image file, chunked uploads and breakpoint resume uploads are used to ensure file integrity.

[0116] In a hybrid deployment process, when deploying on a local resource environment, the built service package is run directly, the required memory resources are configured, and the service deployment on the local resource is completed. In a 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 on the hybrid cloud resource.

[0117] Before service deployment, the call relationships between services are maintained in the form of a (from, to) list. After service deployment, HTTP requests are sent to the service by service name and the resource where the service resides to check the availability of service communication, and the service deployment process and service running status are monitored.

[0118] In the embodiment, by integrating different types of computing resource such as local resource, private cloud resource and public cloud resource, unified planning and scheduling of the resources are realized, which facilitates the user to select appropriate deployment resource according to the to-be-deployed service when deploying the application, and improves the flexibility of application deployment. Moreover, based on the unified planning of the resources, the data security of the local resource can be ensured, and the resource can be quickly involved in the service, and meanwhile, the expansion and contraction of the private cloud resource can be facilitated, the operation and maintenance cost of the public cloud resource can be reduced, and the resource utilization rate and the access speed and reliability of the service can be improved.

[0119] Further, based on the automatic hybrid deployment of the application service, the period from code writing to online use is shortened, the rapid integration, verification and deployment of the application are realized, and the rapid iteration and continuous deployment of the application are facilitated.

[0120] The application deployment apparatus provided by the present application is described below, and the application deployment apparatus described below can be referred to the application deployment method described above.

[0121] Reference Figure 4 The application deployment apparatus provided by the embodiment of the present application comprises:

[0122] The obtaining module 10 is configured to obtain service packages of each target service of a to-be-deployed application and deployment parameters configured for each target service, wherein the deployment parameters comprise a deployment environment.

[0123] The dividing module 20 is configured to obtain available resources in a computing resource pool, and determine deployment resources corresponding to each target service according to the deployment parameters and the available resources, wherein the deployment resources comprise at least one of a local resource, a private cloud resource and a public cloud resource, and the computing resource pool is obtained by performing computing fusion on the local resource, the private cloud resource and the public cloud resource.

[0124] The deployment module 30 is configured to distribute the service packages of the target services to the deployment resources for deployment.

[0125] In one embodiment, the deployment module 30 is further configured to:

[0126] obtain a code scanning script file;

[0127] execute the code scanning script file, perform code scanning on the service packages of the target services, and generate a scanning report;

[0128] if it is determined according to the scanning report that the service packages of the target services pass the scanning, send the service packages of the target services to a deployment directory of the deployment resources for deployment.

[0129] In one embodiment, the deployment module 30 is further configured to:

[0130] If the deployment resource comprises a local resource, sending a service package of a first target service to a deployment directory of the local resource; the first target service is a target service of the deployment resource being the local resource;

[0131] Running the service package of the first target service in a local resource environment to deploy the first target service;

[0132] If the deployment resource comprises a hybrid cloud resource, constructing an image file of a service package of a second target service; the second target service is a target service of the deployment resource being the hybrid cloud resource, and the hybrid cloud resource comprises at least one of a private cloud resource and a public cloud resource;

[0133] Sending the service package of the second target service and the image file to a deployment directory of the hybrid cloud resource;

[0134] Running the image file in a hybrid cloud resource environment to obtain a service container of the second target service;

[0135] According to a configuration parameter in a deployment parameter of the second target service, performing service configuration in the service container to deploy the second target service.

[0136] In one embodiment, the deployment module 30 is further configured to:

[0137] Using a split upload manner, cutting the service package of the target service into a plurality of small files of a preset size;

[0138] Concurrently uploading the plurality of small files through a plurality of threads, sending the plurality of small files to a deployment directory of the deployment resource, and monitoring an upload state of the plurality of small files;

[0139] According to the upload state, determining a target small file of which the upload fails, and using a breakpoint resume manner to perform upload retry on the target small file, so as to send the service package of the target service to the deployment directory of the deployment resource for deployment.

[0140] In one embodiment, the obtaining module 10 is further configured to:

[0141] Pulling program codes of each target service of an application to be deployed from a code repository;

[0142] After incorporating an Nginx configuration in the program codes, packaging and building the program codes to generate an executable file, and obtaining a service package of the target service; the Nginx configuration is used to start an Nginx service when the target service is deployed.

[0143] In one embodiment, the application deployment apparatus further includes a testing module for:

[0144] Obtain the service name of the target service;

[0145] Based on the service name and the deployment resources where the target service is located, a test request is sent to the target service to detect whether the communication of the target service is available.

[0146] In one embodiment, the application deployment apparatus further includes a monitoring module, used for:

[0147] Obtain monitoring data for the target service;

[0148] Determine whether the target service has been deployed successfully based on the monitoring data;

[0149] Once the target service is deployed, monitor the operational status of the target service based on the monitoring data.

[0150] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... 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 via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute steps of the application deployment method, such as:

[0151] Obtain the service packages of each target service of the application to be deployed, as well as the deployment parameters configured for each target service; the deployment parameters include the deployment environment.

[0152] Obtain available resources from the computing power resource pool, and determine the deployment resources corresponding to each target service based on 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 merging the computing power of the local resources, the private cloud resources and the public cloud resources;

[0153] The service package of the target service is distributed to the deployment resources for deployment.

[0154] In addition, the logic instructions in the memory 530 described above can be implemented in the form of a software function unit and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0155] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the steps of the application deployment method provided by the above-mentioned methods, for example, including:

[0156] Obtaining the service package of each target service of the application to be deployed, and the deployment parameter of each target service configuration; the deployment parameter comprises a deployment environment;

[0157] Obtaining the available resources in the computing resource pool, and determining the deployment resource corresponding to each target service according to the deployment parameter and the available resources; the deployment resource comprises at least one of a local resource, a private cloud resource and a public cloud resource, and the computing resource pool is obtained by performing computing power fusion on the local resource, the private cloud resource and the public cloud resource;

[0158] Distributing the service package of the target service to the deployment resource for deployment.

[0159] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the application deployment method provided by the above-mentioned methods, for example, including:

[0160] Obtaining the service package of each target service of the application to be deployed, and the deployment parameter of each target service configuration; the deployment parameter comprises a deployment environment;

[0161] Obtain available resources in the computing resource pool, and determine deployment resources corresponding to each target service 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 computing resource fusion of the local resources, the private cloud resources and the public cloud resources.

[0162] Distribute service packages of the target services to the deployment resources for deployment.

[0163] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the present embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0164] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and the necessary general hardware platform, and of course, it can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0165] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An application deployment method characterized by comprising: The application comprises: obtaining service packages of target services of an application to be deployed, and deployment parameters of the target services; the deployment parameters comprise a deployment environment; obtaining available resources in a computing 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; distributing the service packages of the target services to the deployment resources for deployment; wherein the deployment parameters further comprise at least one of a deployment mode, a number of nodes for service deployment and resource parameters allocated to services, and the deployment mode comprises single deployment and hybrid deployment; the construction of the computing resource pool comprises: when integrating the local resources, the private cloud resources and the public cloud resources, explicitly identifying the computing capacity, the storage capacity and the network bandwidth thereof, and performing computing fusion based on the identification results; the determination of the deployment resources corresponding to the target services according to the deployment parameters and the available resources comprises: based on a preset dictionary format, matching the deployment resources corresponding to the target services through automatic division of resources, wherein the key of the dictionary format represents the service name of the target service, the value represents the matched deployment resource, and the count represents the number of nodes for deployment; the distribution of the service packages of the target services to the deployment resources for deployment comprises: obtaining a code scanning script file; executing the code scanning script file to perform code scanning on the service packages of the target services, and generating a scanning report; if it is determined according to the scanning report that the service packages of the target services pass the scanning, sending the service packages of the target services to a deployment directory of the deployment resources for deployment; the distribution of the service packages of the target services to the deployment directory of the deployment resources for deployment comprises: if the deployment resources comprise local resources, sending the service packages of a first target service to a deployment directory of the local resources; the first target service is a target service whose deployment resources are local resources; running the service packages of the first target service in the local resource environment to deploy the first target service; if the deployment resources comprise hybrid cloud resources, constructing an image file of service packages 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 comprise at least one of private cloud resources and public cloud resources; sending the service packages of the second target service and the image file to a deployment directory of the hybrid cloud resources; running the image file in the hybrid cloud resource environment to obtain a service container of the second target service; performing service configuration in the service container according to configuration parameters in the deployment parameters of the second target service to deploy the second target service.

2. The application deployment method of claim 1, wherein, the distribution of the service packages of the target services to the deployment directory of the deployment resources for deployment comprises: adopting a sharding upload mode to cut the service packages of the target services into a plurality of small files of a preset size; Concurrently uploading a plurality of small files by a plurality of threads, sending the plurality of small files to a deployment directory of the deployment resource, and monitoring an upload state of the plurality of small files; According to the upload state, determining a target small file that fails to be uploaded, and performing upload retry on the target small file in a manner of breakpoint continuation, to send a service package of the target service to the deployment directory of the deployment resource for deployment.

3. The application deployment method of claim 1, wherein, The service package of each target service of the application to be deployed includes: Pulling program code of each target service of the application to be deployed from a code repository; After incorporating an Nginx configuration in the program code, packaging and building the program code to generate an executable file, and obtaining the service package of the target service; the Nginx configuration is used to start an Nginx service when the target service is deployed.

4. The application deployment method of claim 1, wherein, After the service package of the target service is distributed to the deployment resource for deployment, the method further includes: Obtaining a service name of the target service; According to the service name and the deployment resource where the target service is located, sending a test request to the target service to detect whether communication of the target service is available.

5. The application deployment method of claim 1, wherein, After the service package of the target service is distributed to the deployment resource for deployment, the method further includes: Obtaining monitoring data of the target service; According to the monitoring data, determining whether the target service is deployed; In the case where the target service is deployed, monitoring a running state of the target service according to the monitoring data.

6. An application deployment apparatus characterized by comprising: The method includes: A obtaining module is configured to obtain a service package of each target service of an application to be deployed, and a deployment parameter configured for each target service; The deployment parameter includes a deployment environment; A division module is configured to obtain available resources in a computing resource pool, and determine a deployment resource corresponding to each target service according to the deployment parameter and the available resources; the deployment resource includes at least one of a local resource, a private cloud resource, and a public cloud resource; A deployment module is configured to distribute the service package of the target service to the deployment resource for deployment; The deployment parameter further includes at least one of a deployment mode, a node number of service deployment, and a resource parameter allocated to the service; the deployment mode includes single deployment and mixed deployment; The construction of the computing resource pool includes: when the local resource, the private cloud resource, and the public cloud resource are integrated, explicitly identifying computing capability, storage capacity, and network bandwidth thereof, and performing computing fusion based on an identification result; The division module is further configured to match a corresponding deployment resource for each target service based on a preset dictionary format by automatically dividing resources of the service, wherein a key of the dictionary format represents a service name of a target service, a value represents a matched deployment resource, and count represents a node number of deployment; The deployment module is further configured to acquire a code scanning script file, execute the code scanning script file to perform code scanning on the service package of the target service, and generate a scanning report; and if it is determined according to the scanning report that the service package of the target service passes the scanning, send the service package of the target service to a deployment directory of the deployment resource for deployment. The deployment module is further configured to, if the deployment resource comprises a local resource, send a service package of a first target service to a deployment directory of the local resource; the first target service is a target service whose deployment resource is a local resource; run the service package of the first target service when the local resource environment is deployed, to deploy the first target service; if the deployment resource comprises a hybrid cloud resource, construct an image file of a service package of a second target service; the second target service is a target service whose deployment resource is a hybrid cloud resource, and the hybrid cloud resource comprises at least one of a private cloud resource and a public cloud resource; send the service package of the second target service and the image file to a deployment directory of the hybrid cloud resource; run the image file when the hybrid cloud resource environment is deployed, to obtain a service container of the second target service; and perform service configuration in the service container according to a configuration parameter in a deployment parameter of the second target service, to deploy the second target service.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the application deployment method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the application deployment method according to any one of claims 1 to 5.

Citation Information

Patent Citations

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

    CN116684421A

  • Intelligent calculation center system applied to AI large model

    CN117851027A